diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 88e4bc2..725b0ed 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -5002,22 +5002,30 @@ this.$message.warning('属性值不能为空值!') return } - if (this.modalData.flag === '2' && this.modalData.oldPartType === 'Manufactured' && this.modalData.partType === 'Manufactured Recipe') { - this.$confirm("该操作会删除物料BOM,请确认!", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }).then(() => { - this.saveData2() - }) - } else if (this.modalData.flag === '2' && this.modalData.oldPartType === 'Manufactured Recipe' && this.modalData.partType === 'Manufactured') { - this.$confirm("该操作会删除物料配方,请确认!", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }).then(() => { + if (this.modalData.flag === '2' && this.modalData.oldPartType !== this.modalData.partType) { + const oldType = this.modalData.oldPartType + const newType = this.modalData.partType + let confirmMsg = null + if (oldType === 'Purchased (raw)') { + confirmMsg = '该操作将会创建初始BOM 和 Routing!' + } else if ((oldType === 'Manufactured' || oldType === 'Purchased') && newType === 'Manufactured Recipe') { + confirmMsg = '该操作将会删除产品BOM,创建配方BOM!' + } else if (oldType === 'Manufactured Recipe' && (newType === 'Manufactured' || newType === 'Purchased')) { + confirmMsg = '该操作将会删除配方BOM,创建产品BOM!' + } else if (oldType === 'Purchased' && newType === 'Manufactured') { + confirmMsg = '该操作将会创建Routing和BOM!' + } + if (confirmMsg) { + this.$confirm(confirmMsg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.saveData2() + }) + } else { this.saveData2() - }) + } } else { this.saveData2() } diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue index 94d5538..c58a4b1 100644 --- a/src/views/modules/project/projectInfo/com_project_info_part.vue +++ b/src/views/modules/project/projectInfo/com_project_info_part.vue @@ -2623,22 +2623,30 @@ import {downLoadFile, queryFileId, readPartFromFile} from "../../../../api/part/ this.$message.warning('属性值不能为空值!') return } - if (this.modalData.flag === '2' && this.modalData.oldPartType === 'Manufactured' && this.modalData.partType === 'Manufactured Recipe') { - this.$confirm("该操作会删除物料BOM,请确认!", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }).then(() => { - this.saveData2() - }) - } else if (this.modalData.flag === '2' && this.modalData.oldPartType === 'Manufactured Recipe' && this.modalData.partType === 'Manufactured') { - this.$confirm("该操作会删除物料配方,请确认!", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }).then(() => { + if (this.modalData.flag === '2' && this.modalData.oldPartType !== this.modalData.partType) { + const oldType = this.modalData.oldPartType + const newType = this.modalData.partType + let confirmMsg = null + if (oldType === 'Purchased (raw)') { + confirmMsg = '该操作将会创建初始BOM 和 Routing!' + } else if ((oldType === 'Manufactured' || oldType === 'Purchased') && newType === 'Manufactured Recipe') { + confirmMsg = '该操作将会删除产品BOM,创建配方BOM!' + } else if (oldType === 'Manufactured Recipe' && (newType === 'Manufactured' || newType === 'Purchased')) { + confirmMsg = '该操作将会删除配方BOM,创建产品BOM!' + } else if (oldType === 'Purchased' && newType === 'Manufactured') { + confirmMsg = '该操作将会创建Routing和BOM!' + } + if (confirmMsg) { + this.$confirm(confirmMsg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.saveData2() + }) + } else { this.saveData2() - }) + } } else { this.saveData2() }