From 772d8df8a3ee02a6fe2dbd6ba7216e3e3ee0ec63 Mon Sep 17 00:00:00 2001 From: qx <2540746708@qq.com> Date: 星期四, 20 六月 2024 22:18:38 +0800 Subject: [PATCH] qxtj --- src/views/system/package/index.vue | 64 +++++++++++++++++++++++++++---- 1 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue index 2dd443d..f7284cb 100644 --- a/src/views/system/package/index.vue +++ b/src/views/system/package/index.vue @@ -301,8 +301,9 @@ <el-dialog :title="title" :visible.sync="open" - width="1100px" + width="1500px" append-to-body + :close-on-click-modal="false" > <el-form ref="form" @@ -499,7 +500,7 @@ </el-table> --> <el-row :gutter="20"> - <el-col :span="6"> + <el-col :span="7"> <div style="text-align: center; margin-bottom: 10px; margin-top: 10px" > @@ -519,6 +520,7 @@ :default-checked-keys="checkedkey" :filter-node-method="filterNode" ref="tree" + :render-content="renderContent" > </el-tree> </div> @@ -541,6 +543,7 @@ @check-change="handleCurrentChecked1" :default-checked-keys="checkedListkey" ref="trees" + :render-content="renderContent" > </el-tree> </div> @@ -561,9 +564,9 @@ > <el-table-column prop="propinName" label="妫�鏌ラ」鐩�"> </el-table-column> - <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px"> - </el-table-column> <el-table-column prop="proPrice" label="鍘熶环" width="56px"> + </el-table-column> + <el-table-column prop="proName" label="鏄庣粏椤圭洰" width="260px"> </el-table-column> <!-- <el-table-column @@ -584,6 +587,7 @@ </template> </el-table-column>--> </el-table> + <div>鍚堣锛歿{ pics }}鍏�</div> </div> </el-col> </el-row> @@ -650,6 +654,7 @@ } }; return { + pics: 0, filterText: "", DataList: [], list1: true, @@ -873,6 +878,8 @@ this.open = true; this.title = "浣撴濂楅淇℃伅缁存姢"; this.DataList = []; + this.checkedkey = []; + this.checkedListkey = []; this.getDataList(); // getAllList().then((response) => { // this.allList = response.data; @@ -1046,7 +1053,14 @@ } } }, - + renderContent(h, { node, data, store }) { + return ( + <span class="custom-tree-node"> + <span>{node.label}</span> + <span>({data.proPrice}鍏�)</span> + </span> + ); + }, getDataList() { this.loading = true; getProParentIdDxList().then((response) => { @@ -1063,12 +1077,17 @@ item2.disabled = true; this.checkedListkey.push(item2.proId); this.DataList.push(item2); + this.pics = 0; if (this.DataList.length != 0) { this.DataList.forEach((item) => { + this.pics += item.proPrice; if (item.proParentId == item1.proId) { item.propinName = item1.proName; item.propinPrice = item1.proPrice; } + }); + this.DataList.forEach((item) => { + this.pics += item.proPrice; }); } }); @@ -1089,6 +1108,9 @@ item.propinName = this.Treedata[0].proName; item.propinPrice = this.Treedata[0].proPrice; }); + this.DataList.forEach((item) => { + this.pics += item.proPrice; + }); }); }); } @@ -1108,7 +1130,9 @@ this.checkedListkey.push(item.proId); this.DataList.push(item); this.spliceData(); + this.pics = 0; this.DataList.forEach((item1) => { + this.pics += item1.proPrice; if (item1.proParentId == data.proId) { item1.propinName = data.proName; item1.propinPrice = this.dataObj.proPrice; @@ -1116,10 +1140,12 @@ }); }); this.TotalPrice1 = 0; + this.pics = 0; if (this.DataList.length != 0) { this.list1 = false; this.DataList.forEach((item) => { this.TotalPrice1 = item.proPrice + this.TotalPrice1; + this.pics += item.proPrice; }); } }); @@ -1135,6 +1161,10 @@ if (item.proParentId == this.dataObj.proId) { this.DataList.splice(index, this.TreedataList.length); } + }); + this.pics = 0; + this.DataList.forEach((item, index) => { + this.pics += item.proPrice; }); }); } @@ -1160,14 +1190,18 @@ if (item.proId == data.proId) { this.DataList.splice(index, 1); this.TotalPrice1 = 0; + this.pics = 0; this.DataList.forEach((item1) => { - this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + this.pics += item1.proPrice; + // this.TotalPrice1 = item1.proPrice + this.TotalPrice1; }); } }); } else if (checked == true) { this.DataList.push(data); + this.pics = 0; this.DataList.forEach((item1) => { + this.pics += item1.proPrice; if (item1.proParentId == this.dataObj.proId) { item1.propinName = this.dataObj.proName; item1.propinPrice = this.dataObj.proPrice; @@ -1175,8 +1209,10 @@ }); this.spliceData(); this.TotalPrice1 = 0; + this.pics = 0; this.DataList.forEach((item1) => { - this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + // this.TotalPrice1 = item1.proPrice + this.TotalPrice1; + this.pics += item1.proPrice; }); } }, @@ -1204,13 +1240,15 @@ this.treeList = JSON.parse(JSON.stringify(this.DataList)); for (var i = 0; i < this.treeList.length; i++) { for (var j = i + 1; j < this.treeList.length; j++) { - if (this.treeList[i].proParentId == this.treeList[j].proParentId) { + if ( + this.treeList[i].proParentId == this.treeList[j].proParentId + ) { this.treeList.splice(j, 1); j--; } } } - this.treeList.forEach((item) => { + this.treeList.forEach((item) => { this.form.tjProjectList.push({ // id: 0, proName: item.propinName, @@ -1387,4 +1425,12 @@ overflow-y: auto; border: 1px solid #d9d9d9; } +/* .custom-tree-node { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + padding-right: 8px; + } */ </style> \ No newline at end of file -- Gitblit v1.8.0