Browse Source

上架政策获取优先级

hella_online_20241114
王宇飞 3 months ago
parent
commit
7076612e28
  1. 5
      src/api/wms/rule/index.ts
  2. 8
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue
  3. 22
      src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/index.vue

5
src/api/wms/rule/index.ts

@ -56,3 +56,8 @@ export const exportRule = async (params) => {
export const importTemplate = () => {
return request.download({ url: '/wms/rule/get-import-template' })
}
// 查询规则详情
export const getMaxPriority = async (code: number) => {
return await request.get({ url: `/wms/rule/getMaxPriority?code=` + code })
}

8
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/AddForm.vue

@ -660,7 +660,6 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formRef = ref() // Ref
const formStrategyCode = ref('')
//
const warehouseType = ref('WarehouseCode')
@ -1112,7 +1111,7 @@ const changeWarehouse = (e) => {
}
/** 打开弹窗 */
const open = async (type: string, strategyCode: string, id?: number) => {
const open = async (type: string, strategyCode: string, id?: number, priority?: Number) => {
formStrategyCode.value = strategyCode
dialogVisible.value = true
@ -1121,6 +1120,7 @@ const open = async (type: string, strategyCode: string, id?: number) => {
warehouseType.value = 'WarehouseCode'
// getFormWarehouseList()
resetForm()
//
if (id) {
@ -1196,6 +1196,9 @@ const open = async (type: string, strategyCode: string, id?: number) => {
formLoading.value = false
}
} else {
if(priority){
formData.value.priority = priority
}
Butttondata.value = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
@ -1389,6 +1392,7 @@ const getOverflowLocationCodes = async ()=>{
getOverflowLocationCodes()
</script>
<style scoped lang="scss">
.item {

22
src/views/wms/basicDataManage/strategySetting/strategy/upShelfStrategy/index.vue

@ -110,8 +110,8 @@ const resetQuery = () => {
//
const formRef = ref()
const openForm = (type: string, strategyCode: string, id: number) => {
formRef.value.open(type, strategyCode, id)
const openForm = (type: string, strategyCode: string, id?: number, priority?:number) => {
formRef.value.open(type, strategyCode, id, priority)
}
/** 删除按钮操作 */
@ -130,9 +130,11 @@ const route = useRoute() // 路由信息
//
const buttonBaseClick = (val, item) => {
const buttonBaseClick = async (val, item) => {
if (val == 'add') { //
openForm('create', queryParams.strategyCode)
await getDefaultPriority()
openForm('create', queryParams.strategyCode,undefined,defaultPriority.value)
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
@ -207,13 +209,19 @@ const butttondata = (row) => {
// -
const buttonTableClick = (val, row) => {
if (val == 'edit') { //
openForm('update', queryParams.strategyCode, row.id)
openForm('update', queryParams.strategyCode, row.id,undefined)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
const defaultPriority = ref(0)//
const getDefaultPriority = async ()=>{
const res = await RuleApi.getMaxPriority(queryParams.strategyCode)
console.log('getMaxPriority',res)
if(res){
defaultPriority.value = Number(res)
}
}
/** 初始化 **/
onMounted( async() => {
getList()

Loading…
Cancel
Save