From e602b489575a24b4b22d2055ca56c9763e6dfbc1 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Tue, 23 Jan 2024 10:28:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=8F=AA=E5=81=9A=E7=A6=BB=E6=95=A3=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/purchaseDetail/index.ts | 5 ++++ .../purchasePlanMain/index.vue | 24 ++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/api/wms/purchaseDetail/index.ts b/src/api/wms/purchaseDetail/index.ts index a9d7e622c..23e754226 100644 --- a/src/api/wms/purchaseDetail/index.ts +++ b/src/api/wms/purchaseDetail/index.ts @@ -43,6 +43,11 @@ export const getPurchaseDetailPage = async (params) => { } } +// 校验子表数据 +export const getPurchaseDetailPageCheckData = async (params) => { + return await request.get({ url: `/wms/purchase-detail/pageCheckData`, params }) +} + // 查询采购订单子列表 export const getPurchaseDetailPagePoNumber = async (params) => { if (params.isSearch) { diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue index af1229dee..4f8e575a9 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue @@ -388,14 +388,16 @@ const submitForm = async (formType, data) => { data.subList = [] for (let item of tableData.value) { - await PurchaseDetailApi.getPurchaseDetailPage({ + await PurchaseDetailApi.getPurchaseDetailPageCheckData({ number: item.poNumber, lineNumber: item.poLine, }).then(res => { console.log("【要货计划】-每条数据结果",item) - if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { - message.error('要货计划数量不得大于订单数量-已计划数量') - return + if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 + if (item.planQty > res.list[0].orderQty - res.list[0].plannedQty) { + message.error('要货计划数量不得大于订单数量-已计划数量') + return + } } data.subList.push(item) // 拼接子表数据参数 }) @@ -422,14 +424,18 @@ // 子表新增/编辑校验 const detailValidate = async (data) => { let tag = false - await PurchaseDetailApi.getPurchaseDetailPage({ + await PurchaseDetailApi.getPurchaseDetailPageCheckData({ number: data.poNumber, lineNumber: data.poLine }).then(res => { - if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { - message.error('要货计划数量不得大于订单数量-已计划数量') - tag = false - } else { + if(res.list[0].type == 'DISCRETE'){//只有离散单需要这个校验 + if (data.planQty > res.list[0].orderQty - res.list[0].plannedQty) { + message.error('要货计划数量不得大于订单数量-已计划数量') + tag = false + } else { + tag = true + } + }else{ tag = true } }).catch(err =>{