From c70ffa07e49c0711b79156f00f80b1883d07450f Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期二, 15 四月 2025 10:44:35 +0800
Subject: [PATCH] 11

---
 src/views/system/package/index.vue |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue
index 65eea47..4eca4f1 100644
--- a/src/views/system/package/index.vue
+++ b/src/views/system/package/index.vue
@@ -57,7 +57,7 @@
         <el-table-column label="濂楅鍚嶇О" align="center" prop="pacName" width="150px" fixed />
         <el-table-column label="鍘熶环" width="80px" align="center" prop="price" fixed></el-table-column>
         <el-table-column label="鎶樻墸" width="80px" align="center" prop="limits" fixed></el-table-column>
-        <el-table-column label="浼樻儬浠�" width="80px" align="center" prop="newPrice" fixed>
+        <el-table-column label="鐜颁环" width="80px" align="center" prop="newPrice" fixed>
         </el-table-column>
         <el-table-column label="鍗曢」鍒楄〃" align="center" prop="allProName" width="1200px">
         </el-table-column>
@@ -206,7 +206,7 @@
 
         <el-form-item label="鐜颁环" prop="xianprice">
           <el-input v-model="form.xianprice" placeholder="鐜颁环" clearable style="width: 140px" @input="changeXianjia"
-            @blur="numberChangeXianPrice(youhui, youhui)" type="number" :debounce="3000"/>
+            @blur="numberChangeXianPrice(youhui, youhui)" type="number" :debounce="3000" min="0"/>
         </el-form-item>
         <el-form-item label="鍏抽敭瀛�" prop="keywords">
           <el-select multiple v-model="form.keywords" placeholder="璇烽�夋嫨鍏抽敭瀛�" style="width: 160px" @change="sel" filterable
@@ -335,7 +335,7 @@
                   </el-input>
                 </template>
               </el-table-column>
-              <el-table-column prop="priceNow" label="浼樻儬浠�" width="80px" align="center">
+              <el-table-column prop="priceNow" label="鐜颁环" width="80px" align="center">
               </el-table-column>
               <el-table-column label="鎿嶄綔" align="center" width="80px">
                 <template slot-scope="scope">
@@ -486,8 +486,11 @@
       },
       forms: {},
       youhui: 10,
+      initializing: true, // 鍒濆鍖栨爣蹇�
       debounceTimer: null,
-      rules: {},
+      rules: {
+       
+      },
     };
   },
   created() {
@@ -495,6 +498,7 @@
     this.getKeyword();
     this.getCategory();
   },
+ 
   methods: {
     debounceNumberChange(currentValue, oldValue) {
       clearTimeout(this.debounceTimer);
@@ -606,6 +610,7 @@
         counterPrice: null,
         limits: 10,
       };
+      this.initializing = true; 
       this.resetForm("form");
     },
     handleQuery() {
@@ -647,6 +652,7 @@
       this.checkedListkey = [];
       this.checkedNodes = [];
       this.getDataList();
+      this.youhui = 10
     },
     handleStatusChange(row) {
       let data = {
@@ -664,6 +670,7 @@
         });
     },
     handleUp() {
+      this.reset();
       this.title = "浣撴濂楅淇℃伅缁存姢";
       this.open = true;
       getPacInFo(this.forms.pacId).then((response) => {
@@ -692,7 +699,7 @@
       getPacInFo(row.pacId).then((response) => {
         const data = response.data || {};
         Object.keys(data).forEach((key) => {
-          this.$set(this.form, key, data[key]);
+          this.$set(this.form, key, response.data[key]);
         });
         this.youhui = data.limits || 10;
         this.pics = data.price || 0;
@@ -705,7 +712,9 @@
         this.checkedkey = this.DataList.map(item => item.proId || '');
         this.checkedListkey = [...this.checkedkey];
         this.checkedNodes = [...this.checkedkey];
+        
         return this.getDataList();
+       
       }).then(() => {
         this.loading = false;
         this.$nextTick(() => {
@@ -714,7 +723,6 @@
       }).catch((error) => {
         this.loading = false;
         this.$message.error("鍔犺浇鏁版嵁澶辫触");
-        console.error(error);
       });
     },
     addmembers() {
@@ -824,7 +832,9 @@
         this.pics = this.DataList.reduce((total, item) => total + item.priceOrd, 0);
         this.$nextTick(() => {
           this.$refs.tree.setCheckedKeys(this.checkedNodes);
+          this.initializing = false;
         });
+       
       });
       this.loading = false;
     },
@@ -836,6 +846,9 @@
       });
     },
     handleCurrentChecked(data, checked, indeterminate) {
+      if (this.initializing) {
+        return; // 鍒濆鍖栨椂涓嶅鐞�
+      }
       if (checked) {
         if (!this.DataList.some((item) => item.proId === data.proId)) {
           this.DataList.push({
@@ -849,14 +862,16 @@
         if (!this.checkedNodes.includes(data.proId)) {
           this.checkedNodes.push(data.proId);
         }
+        this.updateTotalPrice();
       } else {
         this.DataList = this.DataList.filter((item) => item.proId !== data.proId);
         const index = this.checkedNodes.indexOf(data.proId);
         if (index > -1) {
           this.checkedNodes.splice(index, 1);
         }
+        this.updateTotalPrice();
       }
-      this.updateTotalPrice();
+     
     },
     updateTotalPrice() {
       this.form.xianprice = this.DataList.reduce((sum, item) => {

--
Gitblit v1.8.0