From fed46cbc7b8f3d503e31968e54c11183bf93f828 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 8 Aug 2024 15:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=BA=93=E5=AD=98=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventorymoveRequestMain/index.vue | 133 ++++---- .../inventorymoveRequestMain.data.ts | 321 ++++++------------ 2 files changed, 153 insertions(+), 301 deletions(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue index ff388d3bd..d7c1d4a8c 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue @@ -182,7 +182,7 @@ else if( routeName.value == 'InventorymoveRequestMain'){ } console.log(99 , businessType.value) InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ - if(item.field == 'fromLocationCode') { + if(item.field == 'fromWarehouseCode') { if (fromInventoryStatus.value) { item.tableForm.searchCondition = [ { @@ -249,16 +249,30 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ } else { delete item.tableForm.searchCondition } - }else if(item.field == "toLocationCode"){ - if (toInventoryStatus.value) { + } +}) +// 修改 tableform 属性 +InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { + if(item.field == 'fromPackingNumber') { + if (fromInventoryStatus.value) { item.tableForm.searchCondition = [ + { + key: 'businessType', + value: businessType.value , + isMainValue: false + }] + item.form.componentProps.searchCondition = [ { key: 'businessType', value: businessType.value, isMainValue: false - },{ - key: 'isIn', - value: 'in', + } + ] + } else if (fromInventoryStatus.value == null) { + item.tableForm.searchCondition = [ + { + key: 'businessType', + value: businessType.value , isMainValue: false }] item.form.componentProps.searchCondition = [ @@ -266,21 +280,21 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ key: 'businessType', value: businessType.value, isMainValue: false - },{ - key: 'isIn', - value: 'in', - isMainValue: false }] - }} -}) -// 修改 tableform 属性 -InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { - if(item.field == 'fromPackingNumber') { - if (fromInventoryStatus.value) { + } else { + delete item.tableForm.searchCondition + } + } + if(item.field == "toLocationCode"){ + if (toInventoryStatus.value) { item.tableForm.searchCondition = [ { key: 'businessType', - value: businessType.value , + value: businessType.value, + isMainValue: false + },{ + key: 'isIn', + value: 'in', isMainValue: false }] item.form.componentProps.searchCondition = [ @@ -288,70 +302,34 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { key: 'businessType', value: businessType.value, isMainValue: false - } - ] - } else if (fromInventoryStatus.value == null) { + },{ + key: 'isIn', + value: 'in', + isMainValue: false + }] + }else if (toInventoryStatus.value == null) { item.tableForm.searchCondition = [ { key: 'businessType', value: businessType.value , isMainValue: false + },{ + key: 'isIn', + value: 'in', + isMainValue: false }] item.form.componentProps.searchCondition = [ { key: 'businessType', value: businessType.value, isMainValue: false + },{ + key: 'isIn', + value: 'in', + isMainValue: false }] - } else { - delete item.tableForm.searchCondition } } - // if(item.field == "toLocationCode"){ - // if (toInventoryStatus.value) { - // item.tableForm.searchCondition = [ - // { - // key: 'businessType', - // value: businessType.value, - // isMainValue: false - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }] - // item.form.componentProps.searchCondition = [ - // { - // key: 'businessType', - // value: businessType.value, - // isMainValue: false - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }] - // }else if (toInventoryStatus.value == null) { - // item.tableForm.searchCondition = [ - // { - // key: 'businessType', - // value: businessType.value , - // isMainValue: false - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }] - // item.form.componentProps.searchCondition = [ - // { - // key: 'businessType', - // value: businessType.value, - // isMainValue: false - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }] - // } - // } }) // 字段设置 更新主列表字段 @@ -373,7 +351,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => newRow['itemCode'] = item['itemCode'] newRow['fromBatch'] = item['batch'] newRow['fromInventoryStatus'] = item['inventoryStatus'] - // newRow['fromLocationCode'] = item['locationCode'] + newRow['fromLocationCode'] = item['locationCode'] newRow['uom'] = item['uom'] newRow['qty'] = item['qty'] if(routeName.value == 'OktoholdRequestMain'){ @@ -398,17 +376,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } } else { const setV = {} - if (formField == 'fromLocationCode') { - setV['fromWarehouseCode'] = val[0]['warehouseCode']//从仓库 + if (formField == 'fromWarehouseCode') { if(InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.push({ - key: 'locationCode', + key: 'warehouseCode', value: val[0]["code"], isMainValue: false }) } else { InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => { - if (item.key == 'locationCode') { + if (item.key == 'warehouseCode') { item.value = val[0]["code"] } }) @@ -429,7 +406,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { setV['itemCode'] = val[0]['itemCode'] setV['fromBatch'] = val[0]['batch'] setV['fromInventoryStatus'] = val[0]['inventoryStatus'] - // setV['fromLocationCode'] = val[0]['locationCode'] + setV['fromLocationCode'] = val[0]['locationCode'] setV['uom'] = val[0]['uom'] if(routeName.value == 'OktoholdRequestMain'){ setV['toInventoryStatus'] = "HOLD" @@ -721,11 +698,16 @@ const submitForm = async (formType, submitData) => { if(data.masterId){ data.id = data.masterId } + let findLocation = tableData.value.find(item=>item.fromLocationCode&&item.toLocationCode&&item.fromLocationCode==item.toLocationCode) + if(findLocation){ + message.warning('从库位和到库位不能相同') + return + } data.subList = tableData.value // 拼接子表数据参数 let isExist = false tableData.value.forEach(item => { - let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber == item.fromPackingNumber) ) - console.log(rs,5666); + let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) ) + console.log(rs,5666); if(rs.length > 1) isExist = true }) if (isExist) { @@ -733,6 +715,7 @@ const submitForm = async (formType, submitData) => { isExist = false return message.warning('包装号重复') } + flag.value = false data.subList.forEach(item => { console.log(556565,item); if(fromInventoryStatus.value){ diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts index 006019fc6..5899a7623 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts @@ -72,74 +72,14 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive([ table: { width: 150 }, - form: { - componentProps: { - disabled: true - } - } - // tableForm: { - // enterSearch: true, - // isInpuFocusShow: true, // 开启查询弹窗 - // searchListPlaceholder: '请选择从仓库代码', - // searchField: 'code', - // searchTitle: '仓库基础信息', - // searchAllSchemas: Warehouse.allSchemas, - // searchPage: WarehouseApi.pageBusinessTypeToWarehouse, - // verificationParams: [{ - // key: 'code', - // action: '==', - // value: '', - // isMainValue: false, - // isSearch: true, - // isFormModel: true, - // }], // 失去焦点校验参数 - // }, - // form: { - // // labelMessage: '信息提示说明!!!', - // componentProps: { - // enterSearch: true, - // isSearchList: true, - // searchListPlaceholder: '请选择从仓库代码', - // searchField: 'code', - // searchTitle: '仓库基础信息', - // searchAllSchemas: Warehouse.allSchemas, - // searchPage: WarehouseApi.pageBusinessTypeToWarehouse, - // verificationParams: [{ - // key: 'code', - // action: '==', - // value: '', - // isMainValue: false, - // isSearch: true, - // isFormModel: true, - // }], // 失去焦点校验参数 - // } - // } - }, - { - label: '从库位代码', - field: 'fromLocationCode', - sort: 'custom', - table: { - width: 150 - }, tableForm: { enterSearch: true, isInpuFocusShow: true, // 开启查询弹窗 - searchListPlaceholder: '请选择从库位代码', + searchListPlaceholder: '请选择从仓库代码', searchField: 'code', - searchTitle: '库位信息', - searchAllSchemas: Location.allSchemas, - searchPage: LocationApi.selectBusinessTypeToLocation, - searchCondition: [ - { - key: 'type', - value: 'businessType', - isMainValue: true - },{ - key: 'isIn', - value: 'out', - isMainValue: false - }], + searchTitle: '仓库基础信息', + searchAllSchemas: Warehouse.allSchemas, + searchPage: WarehouseApi.pageBusinessTypeToWarehouse, verificationParams: [{ key: 'code', action: '==', @@ -153,87 +93,12 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive([ // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择到库位代码', + isSearchList: true, + searchListPlaceholder: '请选择从仓库代码', searchField: 'code', - searchTitle: '库位信息', - searchAllSchemas: Location.allSchemas, - searchPage: LocationApi.selectBusinessTypeToLocation, - searchCondition: [ - { - key: 'type', - value: 'businessType', - isMainValue: true - },{ - key: 'isIn', - value: 'out', - isMainValue: false - }], - verificationParams: [{ - key: 'code', - action: '==', - value: '', - isMainValue: false, - isSearch: true, - isFormModel: true, - }], // 失去焦点校验参数 - } - } - }, - { - label: '到库位代码', - field: 'toLocationCode', - sort: 'custom', - table: { - width: 150 - }, - tableForm: { - enterSearch: true, - isInpuFocusShow: true, // 开启查询弹窗 - searchListPlaceholder: '请选择到库位代码', - searchField: 'code', - searchTitle: '库位信息', - searchAllSchemas: Location.allSchemas, - searchPage: LocationApi.selectBusinessTypeToLocation, - searchCondition: [ - { - key: 'type', - value: 'businessType', - isMainValue: true - },{ - key: 'isIn', - value: 'in', - isMainValue: false - }], - verificationParams: [{ - key: 'code', - action: '==', - value: '', - isMainValue: false, - isSearch: true, - isFormModel: true, - }], // 失去焦点校验参数 - }, - form: { - // labelMessage: '信息提示说明!!!', - componentProps: { - enterSearch: true, - isSearchList: true, // 开启查询弹窗 - searchListPlaceholder: '请选择到库位代码', - searchField: 'code', - searchTitle: '库位信息', - searchAllSchemas: Location.allSchemas, - searchPage: LocationApi.selectBusinessTypeToLocation, - searchCondition: [ - { - key: 'type', - value: 'businessType', - isMainValue: true - },{ - key: 'isIn', - value: 'in', - isMainValue: false - }], + searchTitle: '仓库基础信息', + searchAllSchemas: Warehouse.allSchemas, + searchPage: WarehouseApi.pageBusinessTypeToWarehouse, verificationParams: [{ key: 'code', action: '==', @@ -268,7 +133,7 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive([ field: 'requestTime', formatter: dateFormatter, detail: { - dateFormat: 'YYYY-MM-DD HH:mm:ss' + dateFormat: 'YYYY-MM-DD HH:mm:ss' }, sort: 'custom', table: { @@ -803,87 +668,88 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive( } } }, - // { - // label: '从库位代码', - // field: 'fromLocationCode', - // sort: 'custom', - // table: { - // width: 150 - // }, - // tableForm: { - // disabled: true - // }, - // form: { - // componentProps: { - // disabled: true - // } - // } - // }, - // { - // label: '到库位代码', - // field: 'toLocationCode', - // sort: 'custom', - // table: { - // width: 150 - // }, - // tableForm: { - // enterSearch: true, - // isInpuFocusShow: true, // 开启查询弹窗 - // searchListPlaceholder: '请选择到库位代码', - // searchField: 'code', - // searchTitle: '库位信息', - // searchAllSchemas: Location.allSchemas, - // searchPage: LocationApi.selectBusinessTypeToLocation, - // searchCondition: [ - // { - // key: 'type', - // value: 'businessType', - // isMainValue: true - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }], - // verificationParams: [{ - // key: 'code', - // action: '==', - // value: '', - // isMainValue: false, - // isSearch: true, - // isFormModel: true, - // }], // 失去焦点校验参数 - // }, - // form: { - // // labelMessage: '信息提示说明!!!', - // componentProps: { - // enterSearch: true, - // isSearchList: true, // 开启查询弹窗 - // searchListPlaceholder: '请选择到库位代码', - // searchField: 'code', - // searchTitle: '库位信息', - // searchAllSchemas: Location.allSchemas, - // searchPage: LocationApi.selectBusinessTypeToLocation, - // searchCondition: [ - // { - // key: 'type', - // value: 'businessType', - // isMainValue: true - // },{ - // key: 'isIn', - // value: 'in', - // isMainValue: false - // }], - // verificationParams: [{ - // key: 'code', - // action: '==', - // value: '', - // isMainValue: false, - // isSearch: true, - // isFormModel: true, - // }], // 失去焦点校验参数 - // } - // } - // }, + { + label: '从库位代码', + field: 'fromLocationCode', + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '到库位代码', + field: 'toLocationCode', + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + enterSearch: true, + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择到库位代码', + searchField: 'code', + searchTitle: '库位信息', + searchAllSchemas: Location.allSchemas, + searchPage: LocationApi.selectBusinessTypeToLocation, + searchCondition: [ + { + key: 'type', + value: 'businessType', + isMainValue: true + },{ + key: 'isIn', + value: 'in', + isMainValue: false + }], + isRepeat:true, + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择到库位代码', + searchField: 'code', + searchTitle: '库位信息', + searchAllSchemas: Location.allSchemas, + searchPage: LocationApi.selectBusinessTypeToLocation, + searchCondition: [ + { + key: 'type', + value: 'businessType', + isMainValue: true + },{ + key: 'isIn', + value: 'in', + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, { label: '从库存状态', field: 'fromInventoryStatus', @@ -1055,6 +921,9 @@ export const InventorymoveRequestDetailRules = reactive({ fromLocationCode: [ { required: true, message: '请选择从库位代码', trigger: 'change' } ], + fromPackingNumber: [ + { required: true, message: '请选择从包装号', trigger: 'change' } + ], fromInventoryStatus: [ { required: true, message: '请选择从库存状态', trigger: 'change' } ],