From 5dff3baef47eca75e0ceb3cda069cf8f0b7b768a Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期五, 24 一月 2025 17:53:30 +0800 Subject: [PATCH] 1 --- src/views/hosp/order/index.vue | 41 ++++++++++++++++++++++++++++++----------- 1 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue index 31be2bf..5f122fb 100644 --- a/src/views/hosp/order/index.vue +++ b/src/views/hosp/order/index.vue @@ -612,7 +612,7 @@ :props="defaultProp" show-checkbox node-key="id" - @check="handlepackage" + @check-change="handlepackage" :default-checked-keys="checkedkeys" :filter-node-method="filterpackage" ref="treas" @@ -1180,7 +1180,7 @@ </el-table-column> </el-table> - <h3 style="font-weight: 600">鍚堣锛歿{ marryalls }}鍏�</h3> + <!-- <h3 style="font-weight: 600">鍚堣锛歿{ marryalls }}鍏�</h3> --> </div> </div> @@ -2497,6 +2497,8 @@ // this.marryalls = 0; // this.Datalists = []; this.checkedkeys = []; + + this.DataList3 = []; getZhList().then((response) => { if (response.data) { this.packageList = response.data; @@ -2505,8 +2507,10 @@ }); } else { // this.TotalPrice1 = 0; - this.checkedkey = []; + this.checkedkeys = []; // this.DataList = []; + this.Datalists = []; + this.DataList3 = []; this.getDataList(); // if (this.marryalls != 0) { // this.TotalPrice1 += this.marryalls; @@ -2515,7 +2519,7 @@ }, handlepackage(data, checked, checkedNodes) { if (checked == true) { - this.$refs.treas.setCheckedKeys([data.id]); + // this.$refs.treas.setCheckedKeys([data.id]); let datas = { zhId: data.id, }; @@ -2541,7 +2545,7 @@ this.DataList3.forEach((item) => { console.log(item.proPrice); this.TotalPrice1 += item.proPrice * item.sl; - this.marryalls += item.proPrice; + this.marryalls += item.proPrice * item.sl; }); // 涓烘瘡涓」鐩坊鍔� propinName @@ -2659,6 +2663,8 @@ this.orderId = row.orderId; this.cusId = row.tjCusIdCard; this.userId = row.userId; + console.log(row, 666); + this.customer = { cusIdcard: row.tjCusIdCard, cusName: row.tjCustomerName, @@ -2807,14 +2813,21 @@ this.checkedObj = checked; if (checked === true) { - this.$refs.tree.setCheckedKeys([data.proId]); + // this.$refs.tree.setCheckedKeys([data.proId]); let proId = data.proId; getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; + this.TreedataList.forEach((item) => { - item.disabled = true; - this.checkedListkey.push(item.proId); + // item.disabled = true; + // this.checkedListkey.push(item.proId); + if (!this.checkedListkey.includes(item.proId)) { + this.checkedListkey.push(item.proId); + } + this.Datalists.push(item); + this.DataList3.push(item); + this.spliceData(); this.DataList3.forEach((item1) => { this.TotalPrice1 += item1.proPrice * item1.sl; @@ -2837,9 +2850,15 @@ getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; - // 浠庡凡閫夊垪琛ㄤ腑绉婚櫎璇ラ」鐩殑 ID - this.checkedListkey = this.checkedListkey.filter( - (id) => id !== proId + // 閬嶅巻 TreedataList 骞剁Щ闄ょ浉鍏崇殑瀛愰」 ID + this.TreedataList.forEach((item) => { + this.checkedListkey = this.checkedListkey.filter( + (id) => id !== item.proId + ); + }); + + this.Datalists = this.Datalists.filter( + (item) => item.proParentId !== proId ); // 浠� DataList3 涓Щ闄ょ浉鍏崇殑瀛愰」 -- Gitblit v1.8.0