From f87307840f288848c846553ee67d236ee00d5633 Mon Sep 17 00:00:00 2001 From: chenfang Date: Thu, 8 Aug 2024 10:56:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E8=BD=AC?= =?UTF-8?q?=E7=A7=BB=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= 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, 301 insertions(+), 153 deletions(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue index d7c1d4a8c..ff388d3bd 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 == 'fromWarehouseCode') { + if(item.field == 'fromLocationCode') { if (fromInventoryStatus.value) { item.tableForm.searchCondition = [ { @@ -249,30 +249,16 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ } else { delete item.tableForm.searchCondition } - } -}) -// 修改 tableform 属性 -InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { - if(item.field == 'fromPackingNumber') { - if (fromInventoryStatus.value) { + }else if(item.field == "toLocationCode"){ + if (toInventoryStatus.value) { item.tableForm.searchCondition = [ - { - key: 'businessType', - value: businessType.value , - isMainValue: false - }] - item.form.componentProps.searchCondition = [ { key: 'businessType', value: businessType.value, isMainValue: false - } - ] - } else if (fromInventoryStatus.value == null) { - item.tableForm.searchCondition = [ - { - key: 'businessType', - value: businessType.value , + },{ + key: 'isIn', + value: 'in', isMainValue: false }] item.form.componentProps.searchCondition = [ @@ -280,21 +266,21 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { 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) { + }} +}) +// 修改 tableform 属性 +InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { + if(item.field == 'fromPackingNumber') { + if (fromInventoryStatus.value) { item.tableForm.searchCondition = [ { key: 'businessType', - value: businessType.value, - isMainValue: false - },{ - key: 'isIn', - value: 'in', + value: businessType.value , isMainValue: false }] item.form.componentProps.searchCondition = [ @@ -302,34 +288,70 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { key: 'businessType', value: businessType.value, isMainValue: false - },{ - key: 'isIn', - value: 'in', - isMainValue: false - }] - }else if (toInventoryStatus.value == null) { + } + ] + } else if (fromInventoryStatus.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 + // }] + // } + // } }) // 字段设置 更新主列表字段 @@ -351,7 +373,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'){ @@ -376,16 +398,17 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } } else { const setV = {} - if (formField == 'fromWarehouseCode') { + if (formField == 'fromLocationCode') { + setV['fromWarehouseCode'] = val[0]['warehouseCode']//从仓库 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: 'warehouseCode', + key: 'locationCode', value: val[0]["code"], isMainValue: false }) } else { InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => { - if (item.key == 'warehouseCode') { + if (item.key == 'locationCode') { item.value = val[0]["code"] } }) @@ -406,7 +429,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" @@ -698,16 +721,11 @@ 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&&filterItem.fromPackingNumber == item.fromPackingNumber) ) - console.log(rs,5666); + let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber == item.fromPackingNumber) ) + console.log(rs,5666); if(rs.length > 1) isExist = true }) if (isExist) { @@ -715,7 +733,6 @@ 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 5899a7623..006019fc6 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts @@ -72,14 +72,74 @@ 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: Warehouse.allSchemas, - searchPage: WarehouseApi.pageBusinessTypeToWarehouse, + searchTitle: '库位信息', + searchAllSchemas: Location.allSchemas, + searchPage: LocationApi.selectBusinessTypeToLocation, + searchCondition: [ + { + key: 'type', + value: 'businessType', + isMainValue: true + },{ + key: 'isIn', + value: 'out', + isMainValue: false + }], verificationParams: [{ key: 'code', action: '==', @@ -93,12 +153,87 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive([ // labelMessage: '信息提示说明!!!', componentProps: { enterSearch: true, - isSearchList: true, - searchListPlaceholder: '请选择从仓库代码', + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择到库位代码', searchField: 'code', - searchTitle: '仓库基础信息', - searchAllSchemas: Warehouse.allSchemas, - searchPage: WarehouseApi.pageBusinessTypeToWarehouse, + 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 + }], verificationParams: [{ key: 'code', action: '==', @@ -133,7 +268,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: { @@ -668,88 +803,87 @@ 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 - }], - 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: '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: 'fromInventoryStatus', @@ -921,9 +1055,6 @@ export const InventorymoveRequestDetailRules = reactive({ fromLocationCode: [ { required: true, message: '请选择从库位代码', trigger: 'change' } ], - fromPackingNumber: [ - { required: true, message: '请选择从包装号', trigger: 'change' } - ], fromInventoryStatus: [ { required: true, message: '请选择从库存状态', trigger: 'change' } ],