From 92f96b0be59d794388a4293f8d14415fc0c7e6c6 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Thu, 15 Aug 2024 14:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BD=E5=BC=BA-=E8=AE=A2=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=BC=96=E8=BE=91=20=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=95=B0=E5=A4=A7=E4=BA=8E=E9=9B=B6=E5=B0=8F?= =?UTF-8?q?=E4=BA=8E1=20=20=E6=94=B6=E8=B4=A7=E6=95=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=AD=89=E4=BA=8E=E8=AE=A2=E5=8D=95=E6=95=B0=20=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E8=AE=A2=E5=8D=95=E6=95=B0=E5=A4=A7=E4=BA=8E1=20=20?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=94=B6=E8=B4=A7=E6=95=B0=E4=B8=BA1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交收货数不能大于订单数,收货数量必须大于0 --- .../index.vue | 11 +++++++++++ .../purchasereceiptRequestMain.data.ts | 18 ++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue index 07b6f32be..ab11f0b25 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/index.vue @@ -509,6 +509,12 @@ const updateTableData = (tableList)=>{ //批次 newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); newRow['defaultToLocationCode'] =row['defaultLocation'] + if(Number(row['orderQty'])>1){ + newRow['qty'] = 1 + }else{ + newRow['qty'] = row['orderQty'] + } + if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){ tableData.value.push(newRow) } @@ -734,6 +740,11 @@ const submitForm = async (formType, submitData) => { tableData.value.forEach((row, index) => { row['expireDate'] = row['expireTime']?addDay(row['produceDate'],row['expireTime']).valueOf():dayjs('2099-12-31').valueOf() }) + if(tableData.value.find(item=>item['qty']>item['orderQty'])){ + message.error('收货数不能大于订单数') + return + } + data.subList = tableData.value // 拼接子表数据参数 try { if (formType === 'create') { diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts index 6931e94ff..269ea64da 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestOrderMTypeMain/purchasereceiptRequestMain.data.ts @@ -580,7 +580,13 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive( }, } ])) - +function validateQty(rule, value, callback) { + if (value>0) { + callback() + }else{ + callback(new Error('数量必须大于0')) + } +} //表单校验 export const PurchasereceiptRequestMainRules = reactive({ ppNumber: [ @@ -609,7 +615,7 @@ export const PurchasereceiptRequestMainRules = reactive({ ], businessType: [ { required: true, message: '请输入业务类型', trigger: 'blur' } - ], + ] }) /** @@ -844,6 +850,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive