From 8f9c16120e210e9f26b928025931151b0be2d2e0 Mon Sep 17 00:00:00 2001 From: zhang_li Date: Sat, 29 Mar 2025 11:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=81=E8=B4=A7=E8=AE=A1=E5=88=92=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E5=8F=91=E8=B4=A7=EF=BC=9A=E8=B6=85=E5=8F=91=E7=9A=84?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=B8=BA0=20=E8=AE=A9=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E6=89=8B=E5=8A=A8=E5=A1=AB=E5=86=99=20=E4=B8=8D?= =?UTF-8?q?=E8=B6=85=E5=8F=91=E7=9A=84=E9=BB=98=E8=AE=A4=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E6=95=B0=E9=87=8F,=E7=82=B9=E5=87=BB=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=98=8E=E7=BB=86=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E9=83=BD=E5=BA=94=E8=AF=A5=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.ts | 1 + src/locales/zh-CN.ts | 1 + .../supplierdeliverBasicForm.vue | 30 ++++++++++++++++--- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 90e330482..4c195e17d 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -1325,6 +1325,7 @@ export default { 退回:'Return', 作废成功: 'Invalid successfully', '索赔金额不能为0,请修改后提交。': 'The claim amount cannot be 0, please modify and submit.', + '发货数量必须大于0': 'The shipment quantity must be greater than 0', 新增班次: 'Create Shift', 更多:'More', 批量重试:'Batch retry', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 50ebd2930..4fa544df5 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1324,6 +1324,7 @@ export default { 作废成功:'作废成功', 退回: '退回', '索赔金额不能为0,请修改后提交。': '索赔金额不能为0,请修改后提交。', + '发货数量必须大于0': '发货数量必须大于0', 新增班次:'新增班次', 更多:'更多', 批量重试:'批量重试', diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue index fe656f047..ed0656863 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverBasicForm.vue @@ -312,8 +312,11 @@ const getSearchTableData = async (number,formField,searchField,isAll)=>{ let produceDateStr = formatDate(newRow['produceDate'],'YYYYMMDD'); newRow['batch'] = produceDateStr newRow['supplierBatch'] = produceDateStr - newRow.expireDate = row['expireTime']?addDay(newRow['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf() - + newRow.expireDate = row['expireTime'] ? addDay(newRow['produceDate'], row['expireTime']).valueOf() : dayjs('2099-12-31').valueOf() + // 可以允许超发 + if (newRow['allowOverShipment'] == 'TRUE') { + newRow['qty'] =0 + } tableData.value.push(newRow) itemCodes.push(row['itemCode']) }) @@ -356,9 +359,9 @@ const submitForm = async (formType, submitData) => { // data.subList = tableData.value // 拼接子表数据参数 data.subList = [] for (let item of tableData.value) { - if(item.qty>0){ + // if(item.qty>0){ data.subList.push(item) // 拼接子表数据参数 - } + // } } let isHave = data.subList.some((item) => { @@ -374,6 +377,9 @@ const submitForm = async (formType, submitData) => { // 2.2. 如果物料不允许超发,申请发货数量不能大于 计划数量 - 已发货数量 let itemCodes = [] let itemCodeSum = [] + // 2.3 如果物料发货是0,不可以提交 + let itemCodesQtyIsZ = [] + console.log(222, data.subList) data.subList.forEach(item=>{ if(item['allowOverShipment']!='TRUE'){ let qtyDefault = item['planQty'] - item['shippedQty'] @@ -395,7 +401,23 @@ const submitForm = async (formType, submitData) => { } } } + console.log(item['qty']) + if(!item['qty']||item['qty']==0){ + itemCodesQtyIsZ.push({ + itemCode:item['itemCode'], + poLine:item['poLine'] + }) + } }) + if(itemCodesQtyIsZ.length>0){ + let str = '' + itemCodesQtyIsZ.forEach(cur => { + str += `【物料号${cur.itemCode}-订单行${cur.poLine}】` + }) + message.error(`${str}${t('ts.发货数量必须大于0')}`) + return + } + return if(itemCodes.length>0){ let str = '' itemCodes.forEach(cur => {