From 52744700bd9df61ade8a132589d0bb7e005a405a Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 21 Aug 2026 14:39:54 +0800 Subject: [PATCH] =?UTF-8?q?2026-08-21=20=E6=96=B0=E5=A2=9E=E6=8A=80?= =?UTF-8?q?=E6=9C=AF=E5=8F=82=E6=95=B0=E5=8D=A1=E5=92=8CBOM=E5=AD=90?= =?UTF-8?q?=E7=89=A9=E6=96=99=E6=97=B6=E6=A0=A1=E9=AA=8C=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E2=80=9D=E7=BC=96=E7=A0=81=E2=80=9C;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/part/recipeManagement.vue | 58 +++++++++++++++++---- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/src/views/modules/part/recipeManagement.vue b/src/views/modules/part/recipeManagement.vue index 426eda8..3dda380 100644 --- a/src/views/modules/part/recipeManagement.vue +++ b/src/views/modules/part/recipeManagement.vue @@ -4144,6 +4144,46 @@ export default { this.$refs.byProductTable.toggleRowSelection(row) }, + isDrawingNoMaintained (drawingNo) { + if (drawingNo === null || drawingNo === undefined) { + return false + } + const normalizedDrawingNo = String(drawingNo).trim().toUpperCase() + return normalizedDrawingNo !== '' && normalizedDrawingNo !== 'NA' + }, + + validateComponentDrawingNoForCreate () { + return partInformationSearch({ + site: this.$store.state.user.site, + partNo: this.componentData.componentPart, + limit: 1, + page: 1 + }).then(({data}) => { + const firstPart = data && data.code === 0 && data.page && data.page.list && data.page.list.length > 0 + ? data.page.list[0] + : null + if (!firstPart) { + this.$message.warning('子物料【' + this.componentData.componentPart + '】未查询到物料信息,不能保存!') + return false + } + + const materialStatus = (firstPart.status || '').toString().trim().toUpperCase() + if (materialStatus !== 'Y') { + // 临时物料不做编码校验 + return true + } + + if (this.isDrawingNoMaintained(firstPart.drawingNo)) { + return true + } + this.$message.warning('子物料【' + this.componentData.componentPart + '】未维护编码,不能保存!') + return false + }).catch(() => { + this.$message.error('验证子物料编码信息失败,请重试!') + return false + }) + }, + // 重量分配改变 changeWeightShare () { this.componentData.partsByWeight = this.componentData.weightShare @@ -4222,19 +4262,15 @@ export default { } } - partInformationSearch({ - site: this.$store.state.user.site, - partNo: this.componentData.componentPart, - limit: 1, - page: 1 - }).then(({data}) => { - if (data && data.code === 0 && data.page.list.length > 0 && data.page.list[0].drawingNo) { + if (this.componentData.flag !== '1') { + doSaveRecipeComponent() + return + } + + this.validateComponentDrawingNoForCreate().then((isValid) => { + if (isValid) { doSaveRecipeComponent() - } else { - this.$message.warning('子物料【' + this.componentData.componentPart + '】未获取编码,不能保存!') } - }).catch(() => { - this.$message.error('验证子物料编码信息失败,请重试!') }) },