From 615e82d87778e35ae1d53788951fe7b2e5ee6a10 Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Thu, 14 Mar 2024 17:49:23 +0800 Subject: [PATCH] =?UTF-8?q?2024-03-14=20=E6=8A=A5=E4=BB=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/quotation/quoteOfRouting.js | 1 + .../quotationDetail/quoteRouting.vue | 30 +++++++++++++++++++ .../sellForQuotation/quoteDetail.vue | 26 +++++++++++++++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/api/quotation/quoteOfRouting.js b/src/api/quotation/quoteOfRouting.js index 1d5b695..cf0f445 100644 --- a/src/api/quotation/quoteOfRouting.js +++ b/src/api/quotation/quoteOfRouting.js @@ -1,3 +1,4 @@ import {createAPI} from "../../utils/httpRequest"; export const getRoutingTreeStructure = (data)=>createAPI(`/quote/routing/tree/list`,'get',data); +export const searchQuoteRoutingHeader = (data)=>createAPI(`/quote/routing/header`,'get',data); diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue index b9c8162..2dada78 100644 --- a/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue +++ b/src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue @@ -46,6 +46,7 @@ export default { site:this.detail.site, testPartNo:this.detail.productNo } + this.treeLoading = true; getRoutingTreeStructure(params).then(({data})=>{ if (data && data.code === 0){ this.routingTreeStructure = data.rows; @@ -55,12 +56,41 @@ export default { }else { this.$message.warning(data.msg) } + this.treeLoading = false; }).catch((error)=>{ this.$message.error(error) + this.treeLoading = false; }) }, changeSelect(){ + if (this.selectRouting.length === 0){ + this.updateQuoteRoutingList(); + return + } + this.$confirm('此操作将更换材料信息, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.updateQuoteRoutingList(); + }).catch(() => { + this.selectRouting = JSON.parse(JSON.stringify(this.copyRouting)) + this.$nextTick(()=>{ + this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}`) + }) + }); + }, + updateQuoteRoutingList(){ + }, + setSelectRouting(val){ + if (val.length === 0){ + this.getRoutingTreeStructure(); + return + } + this.selectRouting = JSON.parse(JSON.stringify(val)) + this.getRoutingTreeStructure(); + // this.searchQuoteRoutingList(); } } } diff --git a/src/views/modules/quotation/sellForQuotation/quoteDetail.vue b/src/views/modules/quotation/sellForQuotation/quoteDetail.vue index 7835d16..e810de4 100644 --- a/src/views/modules/quotation/sellForQuotation/quoteDetail.vue +++ b/src/views/modules/quotation/sellForQuotation/quoteDetail.vue @@ -12,6 +12,7 @@ import BillOfMateriel from "./quotationDetail/billOfMateriel.vue"; import {Decimal} from "decimal.js"; import {searchQuoteBomHeader, searchQuoteBomList} from "../../../../api/quotation/quoteOfBom"; import QuoteRouting from "./quotationDetail/quoteRouting.vue"; +import {searchQuoteRoutingHeader} from "../../../../api/quotation/quoteOfRouting"; export default { name:'quoteDetail', @@ -273,7 +274,30 @@ export default { this.$refs.property.getPropertyTemplatesItem();// 属性 this.$refs.tool.initQuotationToolData();//刀具 this.searchQuoteBomList();//bom - this.$refs.routing.getRoutingTreeStructure(); + this.searchQuoteRoutingHeader();// routing + }) + }, + searchQuoteRoutingHeader(){ + let params = { + site:this.$store.state.user.site, + quoteDetailId:this.quotationDetail.quotationDetailId, + testPartNo:this.quotationDetail.productNo + } + searchQuoteRoutingHeader(params).then(({data})=>{ + if (data && data.code === 0){ + let row = data.row + let arr = []; + if (row){ + arr[0] = row.version; + arr[1] = row.routingType; + arr[2] = row.alternativeNo; + } + this.$refs.routing.setSelectRouting(arr); + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) }) }, searchQuoteBomList(){