diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue index f7c6a612f..8d3ebdc53 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue @@ -265,7 +265,7 @@ function addDay(date: Date | number, addDay: number) { } // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { - nextTick(() => { + nextTick(async() => { if (type == 'tableForm') { if (formField == 'secondPackUnit') { row['secondPackUnit'] = val[0]['packUnit'] @@ -282,6 +282,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) => } const index1 = 0 setTableFormsValues(val, index1) + } else if (formField == 'workStationCode') { + // 获取管理精度 + const res = await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:val[0]['fgLocationCode'] + }) + if (res[0].ManagementPrecision == 'BY_BATCH') { + row['batch'] = formatTime(new Date(), 'yyyyMMdd') + ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { + if(item.field == 'batch') + item.tableForm.disabled = false + }) + ProductreceiptRequestDetailRules.batch[0].required = true + // 按数量管理批次清空不可输入 + } else if (res[0].ManagementPrecision == 'BY_QUANTITY') { + ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { + if(item.field == 'batch') + item.tableForm.disabled = true + }) + row['batch'] = '' + ProductreceiptRequestDetailRules.batch[0].required = false + } + row[formField] = val[0][searchField] } else { row[formField] = val[0][searchField] } diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts index 944c9e269..b05c0f139 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/productreceiptRequestMain.data.ts @@ -1113,6 +1113,9 @@ export const ProductreceiptRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + tableForm: { + disabled: false + } }, { label: '品名', diff --git a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue index 7a6c7272c..aaca13711 100644 --- a/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptAssemble/productreceiptAssembleRequestMain/index.vue @@ -246,39 +246,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => const index1 = 0 setTableFormsValues(val, index1) } else if (formField == 'workStationCode') { - const params = { - available: 'TRUE', - pageSize: 20, - pageNo: 1, - code: val[0]['fgLocationCode'], - name: '', - areaCode: '', - sort: '', - by: 'ASC', - } - const res = await LocationApi.getLocationPage(params) - console.log(222,res) - const params1 = { - available: 'TRUE', - pageSize: 20, - pageNo: 1, - code: res.list[0].areaCode, - name: '', - type: '', - manageMode:'' , - sort: '', - by: 'ASC', - } - const res1 = await AreaApi.getAreaPage(params1) - if (res1.list[0].manageMode == 'BY_BATCH') { + // 获取管理精度 + const res = await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:val[0]['fgLocationCode'] + }) + if (res[0].ManagementPrecision == 'BY_BATCH') { row['batch'] = formatTime(new Date(), 'yyyyMMdd') ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { if(item.field == 'batch') item.tableForm.disabled = false }) ProductreceiptRequestDetailRules.batch[0].required = true - - } else if (res1.list[0].manageMode == 'BY_QUANTITY') { + // 按数量管理批次清空不可输入 + } else if (res[0].ManagementPrecision == 'BY_QUANTITY') { ProductreceiptRequestDetail.allSchemas.tableFormColumns.forEach(item => { if(item.field == 'batch') item.tableForm.disabled = true @@ -286,7 +267,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => row['batch'] = '' ProductreceiptRequestDetailRules.batch[0].required = false } - row[formField] = val[0][searchField] } else{ row[formField] = val[0][searchField]