From d6df4fd6344569bffcd575f48f04da4a54f51036 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期二, 21 一月 2025 18:02:58 +0800
Subject: [PATCH] 1

---
 src/views/system/tijian/index.vue |   48 ++++++++++++++++++++++++++++++------------------
 1 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue
index bbea675..9966fbe 100644
--- a/src/views/system/tijian/index.vue
+++ b/src/views/system/tijian/index.vue
@@ -477,7 +477,7 @@
               <el-form-item label="浣撴绫诲瀷">
                 <el-select v-model="form.tjType" placeholder="璇烽�夋嫨浣撴绫诲瀷">
                   <el-option v-for="dict in dict.type.dict_team" :key="dict.value" :label="dict.label"
-                    :value="dict.value" :disabled="!form.firmId && dict.value === '1'"></el-option>
+                    :value="dict.value"></el-option>
                 </el-select>
               </el-form-item>
               <el-form-item label="浣撴绫诲埆">
@@ -505,8 +505,8 @@
               <el-form-item style="margin-left: 149px">
                 <el-button type="primary" @click="Package" size="mini" style="margin-right: 20px">閫夋嫨濂楅</el-button>
                 <el-button type="primary" @click="resetpackage" size="mini" style="margin-right: 20px">閲嶇疆濂楅</el-button>
-                <el-button type="primary" @click="submitPrice" :loading="loadingSubmit"
-                  :disabled="confirm || loadingSubmit" v-if="showHidden.has_charge == 'N'" size="mini">绛惧埌鐧昏</el-button>
+                <el-button type="primary" @click="submitPrice" :loading="loadingSubmit" :disabled="loadingSubmit"
+                  v-if="showHidden.has_charge == 'N'" size="mini">绛惧埌鐧昏</el-button>
                 <el-button type="primary" @click="submitCheckinfee" :disabled="confirm"
                   v-if="showHidden.has_charge == 'Y'" size="mini">鐧昏鏀惰垂</el-button>
               </el-form-item>
@@ -1074,9 +1074,7 @@
     };
   },
   watch: {
-    filterText(val) {
-      this.$refs.tree.filter(val);
-    },
+
     filterage(val) {
       this.$refs.treas.filter(val);
     },
@@ -1647,6 +1645,10 @@
         });
     },
     numberChangeXianPrice(currentValue, oldValue) {
+      // 濡傛灉鐜颁环娌℃湁鍙樺寲锛岀洿鎺ヨ繑鍥�
+      if (this.TotalPrice === this.lastXianPrice || !this.TotalPrice) {
+        return;
+      }
       this.$confirm("纭畾淇敼鎵�鏈夊瓙椤圭殑鎶樻墸鍚楋紵", "鎻愮ず", {
         confirmButtonText: "纭畾",
         cancelButtonText: "鍙栨秷",
@@ -1685,6 +1687,7 @@
               );
             }
           }
+          this.lastXianPrice = this.TotalPrice;
         })
         .catch(() => {
           this.discount = oldValue;
@@ -1831,7 +1834,7 @@
         });
       } else {
         let configKey = "getInfoFromSqlData";
-        getconfigKey(configKey).then((res) => {  
+        getconfigKey(configKey).then((res) => {
           if (res.code == 200) {
             if (res.msg == "N") {
               var websocket = null;
@@ -1882,7 +1885,7 @@
               /* this.$refs.aaa.open = true;
               this.$refs.aaa.getAllList();
               this.$refs.aaa.title = "璇佷欢瀛楀吀"; */
-              
+
             } else if (res.msg == "S") {
               this.cardreader = true;
               _this.cardreaderradio = 3;
@@ -2282,8 +2285,7 @@
       this.DataList = []; // 娓呯┖宸查�夐」鐩垪琛�
       this.checkedkey = []; // 娓呯┖鏍戠殑閫変腑鐘舵��
       this.checkedListkey = [];
-      this.TreedataList = [];
-      this.$refs.tree.setCheckedKeys([]); // 閲嶇疆鏍戦�変腑鐘舵��
+      this.TreedataList = []
 
       let data = {
         cusId,
@@ -2628,8 +2630,6 @@
     handleCurrentChecked(data, checked, checkedNodes) {
       this.dataObj = data;
       if (checked.checkedNodes.length != 0) {
-        this.$refs.tree.setCheckedKeys([data.proId]);
-
         let proId = data.proId;
         getProSonDxList(proId).then((res) => {
           this.TreedataList = res.data.list;
@@ -2804,9 +2804,8 @@
         pacId: _this.pacId,
         proIds: this.proIds,
       };
-
       // 鏍规嵁浣撴绫诲瀷閫夋嫨涓嶅悓鐨勫鐞嗘柟娉�
-      if (this.form.tjType == 1) {
+      if (this.form.firmId) {
         tuantiqueren(data).then((response) => {
           if (response.code == 200) {
             this.processOrderItems(cusId);
@@ -2831,11 +2830,13 @@
       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;
@@ -2845,9 +2846,18 @@
                 this.treeList.push(item9.proId);
               });
             }
-            this.TotalPrice1 += item.ordPrice || 0; // 绱姞搴旀敹閲戦
-            this.TotalPrice += item.nowPrice || 0; // 绱姞瀹炴敹閲戦
+            // 浣跨敤Big.js杩涜鍔犳硶浠ラ伩鍏嶇簿搴︿涪澶�
+            totalOrdPrice = totalOrdPrice.plus(new Big(item.ordPrice || 0));
+            totalNowPrice = totalNowPrice.plus(new Big(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;
@@ -3168,8 +3178,9 @@
             cusIdCard: item.cusId,
           })); // 鍒涘缓鏂扮殑瀵硅薄锛屽寘鍚� discount 鍜� id
         gaibianzhekou(newArray).then((res) => {
+          this.loadingSubmit = false;
           if (res.code === 200) {
-            this.loadingSubmit = false;
+
             let data;
 
             if (pacId || this.tjOrderList.length > 0) {
@@ -3201,6 +3212,7 @@
               };
               this.listgetOrder(data);
             } else {
+              this.loadingSubmit = false;
               this.$message({
                 type: "warning ",
                 message: "璇烽�夋嫨濂楅!",

--
Gitblit v1.8.0