diff --git a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue index e78a592ce..39d377fbe 100644 --- a/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceipt/productreceiptRequestMain/index.vue @@ -740,6 +740,14 @@ const submitForm = async (formType, submitData) => { formRef.value.formLoading = false return } + const itemCodeCodes = data.subList.map(item => item.itemCode); // 获取所有的 code数组 + const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//判断每个明细的itemCode是否重复 + if (hasDuplicates) { + message.warning('物料不能重复') + formRef.value.formLoading = false + return + } + formRef.value.formLoading = true try { if (formType === 'create') { diff --git a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue index 28777d6e8..37a8db7c5 100644 --- a/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue +++ b/src/views/wms/productionManage/productreceiptscrap/productreceiptscrapRequestMain/index.vue @@ -638,6 +638,12 @@ const submitForm = async (formType, submitData) => { message.warning('数量必须大于0') return } + const itemCodeCodes = data.subList.map(item => item.itemCode); // 获取所有的 code数组 + const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//判断每个明细的itemCode是否重复 + if (hasDuplicates) { + message.warning('物料不能重复') + return + } formRef.value.formLoading = true try { if (formType === 'create') { diff --git a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue index d79ad0225..f96480c2f 100644 --- a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue +++ b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue @@ -455,6 +455,12 @@ const submitForm = async (formType, submitData) => { formRef.value.formLoading = false return } + const itemCodeCodes = data.subList.map(item => item.itemCode); // 获取所有的 code数组 + const hasDuplicates = itemCodeCodes.some((code, index) => itemCodeCodes.indexOf(code) !== index);//判断每个明细的itemCode是否重复 + if (hasDuplicates) { + message.warning('物料不能重复') + return + } formRef.value.formLoading = true try { if (formType === 'create') {