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 => {