From d332a772c0cabc58d47f0afc4ae92fc55115ce3d Mon Sep 17 00:00:00 2001
From: qx <1084500556@qq.com>
Date: 星期一, 28 七月 2025 10:39:50 +0800
Subject: [PATCH] qx

---
 src/views/hosp/order/index.vue        |   96 +++++++++++++++++++++++++++--------------------
 public/yuanqu.ini                     |    6 --
 src/views/sampling/sampling/index.vue |    2 -
 3 files changed, 56 insertions(+), 48 deletions(-)

diff --git a/public/yuanqu.ini b/public/yuanqu.ini
index 8516056..877b8aa 100644
--- a/public/yuanqu.ini
+++ b/public/yuanqu.ini
@@ -1,11 +1,7 @@
 [development]
 8094=pbkwyy
 81=jdczgzyy
-<<<<<<< HEAD
-82=bjxjyy
-=======
-82=jdczgzyy
->>>>>>> ce00a82248ed72b6b23d1ceddcf332779317cdbb
+82=ssyjyy
 8095=jdczgzyy
 8096=sqyy
 8097=wbzxyy
diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue
index 4f31111..305352e 100644
--- a/src/views/hosp/order/index.vue
+++ b/src/views/hosp/order/index.vue
@@ -596,7 +596,7 @@
               </el-table-column>
               <el-table-column prop="proPrice" label="鍘熶环" width="56px">
               </el-table-column>
-              <el-table-column label="鎶樻墸">
+              <el-table-column label="鎶樻墸" width="150px">
                 <template slot-scope="scope">
                   <!-- @input="validateDiscount(scope.row)" -->
                   <el-input-number v-model.number="scope.row.discount" @change="handleManualChange(scope.row)"
@@ -1058,7 +1058,7 @@
       },
       TreedataList: [],
       discount: 10,
-      lastXianPrice:0,
+      lastXianPrice: 0,
       DataList: [],
       shijianlist: [],
       // 濂楅鎻愪氦鎸夐挳
@@ -1483,21 +1483,6 @@
     },
 
 
-    updateProPrice(row) {
-      console.log(row)
-      const ordPrice = new Big(row.ordPrice);
-      const discount = new Big(row.discount);
-      const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10)
-      row.nowPrice = result.toNumber();
-      this.TotalPrice = this.tableData1.reduce((sum, item) => {
-        return sum.plus(new Big(item.nowPrice || "0"));
-      }, new Big(0));
-
-      this.discount =
-        (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
-    },
-
-
     debounceNumberChange(currentValue, oldValue) {
       clearTimeout(this.debounceTimer);
       this.debounceTimer = setTimeout(() => {
@@ -1523,7 +1508,7 @@
             // this.TotalPrice = this.DataList3.reduce((sum, item) => {
             //   return sum.plus(new Big(item.nowPrice || "0"));
             // }, new Big(0));
-            this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
+            this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)).toFixed(2)
           });
         })
         .catch(() => {
@@ -1541,6 +1526,7 @@
     numberChangeXianPrice(currentValue, oldValue) {
       // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥�
       if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) {
+        console.log(2222333)
         return;
       }
       this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", {
@@ -1554,8 +1540,8 @@
           //   this.discount = this.getInfodis;
           // }
           let totalYsprice = new Big(0);
-          console.log(this.tableData3, 11111)
-          this.tableData3.forEach((item) => {
+          console.log(this.DataList3, 11111)
+          this.DataList3.forEach((item) => {
             item.discount = this.discount;
             const ordPrice = new Big(item.proPrice);
             const discount = new Big(item.discount);
@@ -1636,16 +1622,20 @@
     // },
 
     updateProPrice(row) {
-      console.log(row, 55555)
-      const ordPrice = new Big(row.proPrice);
-      const discount = new Big(row.discount);
-      const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10)
-      row.nowPrice = result.toNumber();
-      this.TotalPrice = this.DataList3.reduce((sum, item) => {
-        return sum.plus(new Big(item.nowPrice || "0"));
-      }, new Big(0));
-      this.discount =
-        (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
+      if (row.proPrice == 0) {
+        row.discount = 10
+        return
+      } else {
+        const ordPrice = new Big(row.proPrice);
+        const discount = new Big(row.discount);
+        const result = ordPrice.times(discount.div(10)); // ordPrice * (discount / 10)
+        row.nowPrice = result.toNumber();
+        this.TotalPrice = this.DataList3.reduce((sum, item) => {
+          return sum.plus(new Big(item.nowPrice || "0"));
+        }, new Big(0));
+        this.discount =
+          (Math.floor((this.TotalPrice / this.TotalPrice1) * 100) / 100) * 10;
+      }
     },
 
     handleRevoke() {
@@ -2289,9 +2279,11 @@
       this.DataList = [];
       this.DataList3 = [];
       this.Datalists = [];
-      this.filterText = "",
-        this.filterage = "",
-        this.TotalPrice1 = 0;
+      this.TotalPrice = 0;
+      this.discount = 10;
+      this.filterText = "";
+      this.filterage = "";
+      this.TotalPrice1 = 0;
       this.orderId = this.ids;
       this.cusId = this.cusIds;
       this.userId = this.userIds;
@@ -2402,8 +2394,8 @@
           this.TotalPrice1 = 0;
           this.DataList3.forEach((item) => {
             this.TotalPrice1 += item.proPrice * item.sl;
-             this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
-          this.lastXianPrice = this.TotalPrice;
+            this.TotalPrice = this.TotalPrice1 * (this.discount / 10)
+            this.lastXianPrice = this.TotalPrice;
           });
         });
       } else if (checked === false) {
@@ -2432,8 +2424,8 @@
           this.TotalPrice1 = 0;
           this.DataList3.forEach((item) => {
             this.TotalPrice1 += item.proPrice * item.sl;
-             this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
-          this.lastXianPrice = this.TotalPrice;
+            this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
+            this.lastXianPrice = this.TotalPrice;
           });
         });
       }
@@ -2477,9 +2469,6 @@
         this.spliceData();
         this.TotalPrice1 = 0;
         this.DataList.forEach((item1) => {
-          console.log(item1.proPrice, 3322);
-          console.log(this.TotalPrice1, 1122);
-
           this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
         });
         if (this.marryalls != 0) {
@@ -2497,8 +2486,18 @@
           });
         }
       });
+
       this.DataList3.forEach((item, index) => {
         if (item.proId == row.proId) {
+          let proParentId = item.proParentId
+          // 鑾峰彇褰撳墠閫変腑鐨勮妭鐐筴ey
+          const currentCheckedKeys = this.$refs.tree.getCheckedKeys();
+
+          // 鍒涘缓涓�涓柊鏁扮粍锛岀Щ闄ゆ兂瑕佸彇娑堥�変腑鐨勮妭鐐筴ey锛堣繖閲屽亣璁炬槸1锛�
+          const newCheckedKeys = currentCheckedKeys.filter(key => key !== proParentId);
+
+          // 浣跨敤setCheckedKeys鏂规硶鏇存柊閫変腑鐘舵��
+          this.$refs.tree.setCheckedKeys(newCheckedKeys);
           this.DataList3.splice(index, 1);
           this.marryalls = 0;
           this.DataList3.forEach((item1) => {
@@ -2506,21 +2505,36 @@
           });
         }
       });
+      if (this.DataList3.length == 0) {
+        this.discount = 10
+        this.checkedkey = []
+        this.$refs.tree.setCheckedKeys([])
+        this.TotalPrice1 = this.marryalls;
+        this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
+      } else if (this.DataList3.length == 1) {
+        this.discount = this.DataList3[0].discount
+        this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10)).toFixed(2)
+      }
       this.DataList.forEach((item, index) => {
         if (item.proId == row.proId) {
           this.DataList.splice(index, 1);
           this.TotalPrice1 = 0;
+          this.TotalPrice = 0;
           this.DataList.forEach((item1) => {
             this.TotalPrice1 = item1.proPrice + this.TotalPrice1;
+            this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
           });
           if (this.marryalls != 0) {
             this.TotalPrice1 += this.marryalls;
+            this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
           }
         }
       });
       this.TotalPrice1 = 0;
+      this.TotalPrice = 0;
       this.DataList3.forEach((item) => {
         this.TotalPrice1 += item.proPrice;
+        this.TotalPrice = new Big(this.TotalPrice1 * (this.discount / 10))
       });
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -2877,7 +2891,7 @@
 }
 
 .box1 {
-  width: 50%;
+  width: 35%;
   display: flex;
   flex-direction: column;
 }
diff --git a/src/views/sampling/sampling/index.vue b/src/views/sampling/sampling/index.vue
index f8885c1..57d952b 100644
--- a/src/views/sampling/sampling/index.vue
+++ b/src/views/sampling/sampling/index.vue
@@ -347,7 +347,6 @@
     // this.getNowTime();
     getTxmmccd().then((res) => {
       this.msg = Number(res.msg);
-      console.log(res, 444);
     });
     getCompany(this.queryParams).then((response) => {
       this.CompanyList = response.data;
@@ -384,7 +383,6 @@
     searchSelect(val) {
       this.CheckBox = val;
       this.queryParams.dw = this.CheckBox.drugManufacturerId;
-      console.log(this.CheckBox, 9999);
     },
     getRemoteData(query) {
       if (query) {

--
Gitblit v1.8.0