From c8a687cdea16f6adc2fd330158ce1a3f7d0818f5 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 28 Nov 2024 09:57:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unplannedreceiptRequestMain/index.vue | 30 +++++++++++++++++++ .../unplannedreceiptRequestMain.data.ts | 10 ++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue index c79258b9a..d16b26a6e 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/index.vue @@ -135,6 +135,7 @@ import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' import * as SubjectAccountApi from '@/api/wms/subjectAccount' const { loadStart, loadDone } = usePageLoading() +import * as ruleApi from '@/api/wms/rule/index' // 计划外入库申请 defineOptions({ name: 'UnplannedreceiptRequestMain' }) @@ -194,6 +195,7 @@ const isItemType = async (itemCode, labelTypeParams) => { } // 查询页面返回 +const fromManagementPrecision = ref('') const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(async () => { console.log('searchTableSuccess',formField, searchField, val, formRef, type, row ) @@ -201,6 +203,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => // 明细查询页赋值 if(formField == 'toLocationCode'){ row['toLocationCode'] = val[0]['code'] + + await ruleApi.getManagementPrecision({ + itemCodes: [row['itemCode']], + locationCode:val[0]['code'] + }).then((res) => { + fromManagementPrecision.value = res[0].ManagementPrecision + if (fromManagementPrecision.value == 'BY_QUANTITY') { + // row['disabled_batch'] = false + UnplannedreceiptRequestDetailRules.batch[0].required = false + + } else { + // row['disabled_batch'] = true + UnplannedreceiptRequestDetailRules.batch[0].required = true + } + }) } else if(formField == 'itemCode'){ let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['code'])) if(itemCodes.length>0){ @@ -525,7 +542,20 @@ const buttonTableClick = async (val, row) => { return } }) + ruleApi.getManagementPrecision({ + itemCodes: [item['itemCode']], + locationCode:item['toLocationCode'] + }).then((res) => { + fromManagementPrecision.value = res[0].ManagementPrecision + if (fromManagementPrecision.value == 'BY_QUANTITY') { + item.batch = formatDate(new Date(),'YYYYMMDD') + item['disabled_batch'] = false + } else { + item['disabled_batch'] = true + } + }) }) + } } diff --git a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts index fe8b22b0b..c553107f7 100644 --- a/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/unplannedreceipt/unplannedreceiptRequestMain/unplannedreceiptRequestMain.data.ts @@ -1427,6 +1427,9 @@ function validateQty(rule, value, callback) { } //表单校验 export const UnplannedreceiptRequestDetailRules = reactive({ + batch: [ + { required: true, message: '请选择批次', trigger: ['blur', 'change'] } + ], arriveDate: [ { required: true, message: '请选择到货日期', trigger: 'change' } ], @@ -1521,7 +1524,9 @@ export const UnplannedreceiptRequestDetailLabel = useCrudSchemas(reactive