From bc57f8457cf804a29519a1643cfb34b8fb045c09 Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Fri, 6 Dec 2024 13:30:56 +0800 Subject: [PATCH] 2024-12-06 --- .../quote/detail/primary/quoteDetailBom.vue | 73 ++++++++++-------- .../detail/primary/quoteDetailRouting.vue | 34 ++++---- .../quote/detail/primary/quoteDetailTool.vue | 77 +++++++++++-------- .../modules/quote/detail/quoteDetail.vue | 13 +++- 4 files changed, 108 insertions(+), 89 deletions(-) diff --git a/src/views/modules/quote/detail/primary/quoteDetailBom.vue b/src/views/modules/quote/detail/primary/quoteDetailBom.vue index 3063a73..1b0bec7 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailBom.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailBom.vue @@ -350,40 +350,47 @@ export default { }) }, handleChangeVersion(row) { - let node = this.$refs.tree.getCurrentNode(); - let params = { - partNo: row.partNo, - bomType: row.bomType, - buNo: row.buNo, - site: row.site, - engChgLevel: row.engChgLevel, - alternativeNo: row.alternativeNo, - createBy: this.$store.state.user.name, - quoteId: this.quoteDetail.quoteId, - quoteDetailId: this.quoteDetail.id, - quoteNo: this.quoteDetail.quoteNo, - quoteDetailItemNo: this.quoteDetail.itemNo, - versionNo:this.quoteDetail.versionNo, - - } - if (node) { - params.id = node.id - params.partNo = node.partNo - params.bomType = node.bomType - params.buNo = node.buNo - params.site = node.site - } - changeQuoteDetailBomTree(params).then(({data}) => { - if (data && data.code === 0) { - this.$message.success(data.msg); - this.versionVisible = false; - this.handleQueryQuoteDetailBomTree(); - } else { - this.$message.warning(data.msg); - } - }).catch((error) => { - this.$message.error(error); + this.$confirm('确认切换BOM版本吗,切换后将重新覆盖工具信息,请确认!','提示',{ + type: 'warning', + confirmButtonText: '确定', + cancelButtonText: '取消', }) + .then(()=>{ + let node = this.$refs.tree.getCurrentNode(); + let params = { + partNo: row.partNo, + bomType: row.bomType, + buNo: row.buNo, + site: row.site, + engChgLevel: row.engChgLevel, + alternativeNo: row.alternativeNo, + createBy: this.$store.state.user.name, + quoteId: this.quoteDetail.quoteId, + quoteDetailId: this.quoteDetail.id, + quoteNo: this.quoteDetail.quoteNo, + quoteDetailItemNo: this.quoteDetail.itemNo, + versionNo:this.quoteDetail.versionNo, + + } + if (node) { + params.id = node.id + params.partNo = node.partNo + params.bomType = node.bomType + params.buNo = node.buNo + params.site = node.site + } + changeQuoteDetailBomTree(params).then(({data}) => { + if (data && data.code === 0) { + this.$message.success(data.msg); + this.versionVisible = false; + this.handleQueryQuoteDetailBomTree(); + } else { + this.$message.warning(data.msg); + } + }).catch((error) => { + this.$message.error(error); + }) + }).catch((error) => {}) }, handleJumpToBom(row){ if (this.$router.resolve('part-bomManagement').resolved.name === '404') { diff --git a/src/views/modules/quote/detail/primary/quoteDetailRouting.vue b/src/views/modules/quote/detail/primary/quoteDetailRouting.vue index fede86c..6605d00 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailRouting.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailRouting.vue @@ -361,24 +361,6 @@ export default { fixed: '', columnWidth: 100, }, - { - userId: this.$store.state.user.name, - functionId: 5011, - serialNumber: '5011Table5ResourceNum', - tableId: "5011Table5", - tableName: "报价工艺信息", - columnProp: 'resourceNum', - headerAlign: "center", - align: "right", - columnLabel: '机台数量', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 100, - }, { userId: this.$store.state.user.name, functionId: 5011, @@ -634,6 +616,19 @@ export default { } }, changeRouting(row){ + if (this.$refs.tree.getCurrentNode().parentId === 0 || this.$refs.tree.getCurrentNode().parentId === null || this.$refs.tree.getCurrentNode().parentId === undefined){ + this.$confirm('确认切换Routing版本吗,切换后将重新覆盖工具信息,请确认!','提示',{ + type: 'warning', + confirmButtonText: '确定', + cancelButtonText: '取消', + }).then(()=>{ + this.handleChangeRouting(row); + }) + }else { + this.handleChangeRouting(row); + } + }, + handleChangeRouting(row){ let params = { quoteId: this.quoteDetail.quoteId, quoteDetailId: this.quoteDetail.id, @@ -660,7 +655,6 @@ export default { }).catch((error)=>{ this.$message.error(error) }) - }, handleJumpToRouting(row){ if (this.$router.resolve('part-routingManagement').resolved.name === '404') { @@ -751,7 +745,7 @@ export default { - + diff --git a/src/views/modules/quote/detail/primary/quoteDetailTool.vue b/src/views/modules/quote/detail/primary/quoteDetailTool.vue index 6ba7ddb..bacc447 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailTool.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailTool.vue @@ -69,6 +69,7 @@ export default { let params = { quoteDetailId: this.quoteDetail.id } + this.dataList = []; this.queryLoading = true queryQuoteDetailTool(params).then(({data})=>{ if (data && data.code === 0){ @@ -84,7 +85,9 @@ export default { }, handleSave(row){ if (row){ - this.saveTool = {...row}; + this.saveTool = { + ...row + }; }else { this.saveTool = {...this.tool}; } @@ -112,12 +115,15 @@ export default { }).catch(() => {}); }, computedQuoteUnitCost(){ - let quoteUnitCost = this.saveTool.unitCost * this.saveTool.toolQty; - if (isNaN(quoteUnitCost)){ + if (this.saveTool.toolNo === '*'){ + return; + } + // 分摊成本 = 单片模具费 / (1-Mark up%)/分摊数量 + if ((1-this.saveTool.expectedServiceLife/100) === 0){ this.saveTool.quoteUnitCost = 0; - return + return; } - this.saveTool.quoteUnitCost = quoteUnitCost/this.saveTool.expectedServiceLife; + this.saveTool.quoteUnitCost = this.saveTool.unitCost / (1-this.saveTool.expectedServiceLife/100) / this.saveTool.toolQty; }, handleQueryToolList(flag){ let params = { @@ -141,7 +147,7 @@ export default { }) }, handleToolDblClick(row){ - this.saveTool.toolNo = row.toolNo; + // this.saveTool.toolNo = row.toolNo; this.saveTool.toolDesc = row.toolDesc; this.saveTool.unitCost = row.unitCost; this.toolVisible = false @@ -241,9 +247,13 @@ export default { }, 'toolVisible'(newVal,oldVal){ if (newVal){ + let toolDesc = this.saveTool.toolDesc; + if (this.saveTool.toolNo === '*' && this.saveTool.toolNo === '#'){ + toolDesc = ''; + } this.queryTool={ - toolNo: this.saveTool.toolNo, - toolDesc: "", + toolNo: '', + toolDesc: toolDesc, } this.handleQueryToolList(); } @@ -256,57 +266,56 @@ export default {
新增 - - - - - + + + + - -