From 82fe0718311ec6a29af1d1702b62d17d9970e2de Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 22 一月 2025 15:20:10 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb --- src/views/system/tijian/index.vue | 53 +++++++++++++++++++++++++---------------------------- 1 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 9966fbe..7e99913 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -1075,6 +1075,9 @@ }, watch: { + filterText(val) { + this.$refs.tree.filter(val); + }, filterage(val) { this.$refs.treas.filter(val); }, @@ -2511,7 +2514,6 @@ this.loading = true; getProParentIdDxList().then((response) => { this.Treedata = response.data.list; - if (this.tableData[0]) { this.tableData[0].tjProjectList.forEach((selectionitem) => { this.Treedata.forEach((item) => { @@ -2626,30 +2628,36 @@ }); } }, - // 鐐瑰嚮鑾峰彇姣忎釜鏍戣妭鐐� handleCurrentChecked(data, checked, checkedNodes) { this.dataObj = data; - if (checked.checkedNodes.length != 0) { - let proId = data.proId; - getProSonDxList(proId).then((res) => { - this.TreedataList = res.data.list; + if (checked.checkedNodes.length > 0) { + const promises = checked.checkedNodes.map(node => getProSonDxList(node.proId)); + Promise.all(promises).then(results => { + this.TreedataList = results.flatMap(res => res.data.list); + this.checkedListkey = []; + this.DataList = []; + this.TreedataList.forEach((item) => { this.checkedListkey.push(item.proId); - this.DataList.push(item); - this.spliceData(); - this.DataList.forEach((item1) => { - if (item1.proParentId == data.proId) { - item1.propinName = data.proName; - } - }); }); + + this.spliceData(); // 鍋囪杩欎釜鏂规硶鏄綘瀹氫箟鐨勫叾浠栧湴鏂瑰鐞嗘暟鎹殑 + + // 鏇存柊鍚嶇О鍜岃绠楁�讳环 + this.DataList.forEach((item1) => { + const parent = checked.checkedNodes.find(node => node.proId === item1.proParentId); + if (parent) { + item1.propinName = parent.proName; + } + }); + this.TotalPrice1 = 0; this.marryall = 0; if (this.DataList.length != 0) { this.list1 = false; this.DataList.forEach((item) => { - this.marryall = item.proPrice * item.sl; + this.marryall += Number(item.proPrice) * Number(item.sl); }); } }); @@ -2830,13 +2838,11 @@ this.DataLists = []; }, + // 澶勭悊璁㈠崟椤圭洰 processOrderItems(cusId) { getTransitionList1(cusId).then((response) => { this.tableData1 = response.data; if (this.tableData1) { - let totalOrdPrice = new Big(0); - let totalNowPrice = new Big(0); - this.tableData1.forEach((item) => { if (item.tjCategory != null) { this.tjCategory = item.tjCategory; @@ -2846,18 +2852,9 @@ this.treeList.push(item9.proId); }); } - // 浣跨敤Big.js杩涜鍔犳硶浠ラ伩鍏嶇簿搴︿涪澶� - totalOrdPrice = totalOrdPrice.plus(new Big(item.ordPrice || 0)); - totalNowPrice = totalNowPrice.plus(new Big(item.nowPrice || 0)); + this.TotalPrice1 += item.ordPrice || 0; // 绱姞搴旀敹閲戦 + this.TotalPrice += item.nowPrice || 0; // 绱姞瀹炴敹閲戦 }); - - // 灏咮ig鏁拌浆鎹㈠洖鏁板�煎苟淇濈暀涓や綅灏忔暟 - this.TotalPrice1 = totalOrdPrice.toNumber().toFixed(2); - this.TotalPrice = totalNowPrice.toNumber().toFixed(2); - - // 纭繚TotalPrice鏄竴涓瓧绗︿覆锛岄槻姝㈠悗缁搷浣滃鑷寸簿搴︿涪澶� - this.TotalPrice = this.TotalPrice.toString(); - // 璁$畻鎶樻墸 this.discount = this.TotalPrice1 > 0 ? (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10 : 0; -- Gitblit v1.8.0