From ea8df2c98909f24e12c1807184238e893dc80f31 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期一, 17 三月 2025 11:31:46 +0800
Subject: [PATCH] 1

---
 src/views/system/package/index.vue |   65 ++++++++++++++++++--------------
 1 files changed, 37 insertions(+), 28 deletions(-)

diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue
index 58136e7..54df751 100644
--- a/src/views/system/package/index.vue
+++ b/src/views/system/package/index.vue
@@ -10,7 +10,7 @@
       <el-form-item label="浣撴绫诲埆" prop="tjCategory">
         <el-select v-model="queryParams.tjCategory" placeholder="璇烽�夋嫨鐘舵��" style="width: 200px" filterable clearable>
           <el-option v-for="dict in dict.type.dict_tjtype" :key="dict.id" :label="dict.label"
-            :value="dict.value"></el-option>
+            :value="dict.value"></el-option>  
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -162,7 +162,7 @@
             style="width: 150px"
             @change="shangpin"
             filterable
-            clearable
+            clearablez
           >
             <el-option
               v-for="item in categoryList"
@@ -364,7 +364,7 @@
                 </template> 
               </el-table-column>-->
             </el-table>
-            <!-- <h3 style="font-weight: 600">鍚堣锛歿{ pics }}鍏�</h3> -->
+            <h4 style="font-weight: 600;padding-left:20px">涓�鍏遍�変腑{{DataList.length}}椤癸紝鍚堣锛歿{ form.xianprice }}鍏�</h4>
           </div>
         </el-col>
       </el-row>
@@ -765,33 +765,42 @@
       });
     },
 
-    /** 淇敼鎸夐挳鎿嶄綔 */
-    handleUpdate(row) {
-      this.title = "浣撴濂楅淇℃伅缁存姢";
-      this.open = true;
-      getPacInFo(row.pacId).then((response) => {
-        // this.form = response.data;
-        console.log(this.form, 445);
-        Object.keys(response.data).forEach((key) => {
-          this.$set(this.form, key, response.data[key]);
-        });
-        this.lastXianPrice = this.form.xianprice
-        this.form.keywords = this.form.keywords.slice(0, -1);
-        this.form.keywords = this.form.keywords.split(",");
-        this.DataList = [];
-        this.checkedkey = [];
-        this.checkedListkey = [];
-        this.DataList = response.data.packageProjects;
-        this.DataList.forEach((item) => {
-          this.checkedkey.push(item.proId);
-          this.checkedListkey.push(item.proId);
-        });
+   /** 淇敼鎸夐挳鎿嶄綔 */
+handleUpdate(row) {
+  this.reset(); // 閲嶇疆琛ㄥ崟
+  this.title = "浣撴濂楅淇℃伅缁存姢";
+  this.open = true;
+  this.loading = true;
 
-        // 鑾峰彇鏂扮殑鏁版嵁鍒楄〃锛堝鏋滈渶瑕侊級
-        this.getDataList();
-      });
-    },
+  getPacInFo(row.pacId).then((response) => {
+    const data = response.data || {};
+    Object.keys(data).forEach((key) => {
+      this.$set(this.form, key, data[key]);
+    });
+    this.youhui = data.limits || 10;
+    this.pics = data.price || 0;
+    this.form.xianprice = data.newPrice || 0;
+    this.lastXianPrice = this.form.xianprice;
+    this.form.keywords = data.keywords && data.keywords.length > 0
+      ? data.keywords.slice(0, -1).split(",")
+      : [];
+    this.DataList = data.packageProjects || [];
+    this.checkedkey = this.DataList.map(item => item.proId || '');
+    this.checkedListkey = [...this.checkedkey];
+    this.checkedNodes = [...this.checkedkey]; // 鍚屾 checkedNodes
 
+    return this.getDataList();
+  }).then(() => {
+    this.loading = false;
+    this.$nextTick(() => {
+      this.$refs.form.validate(); // 瑙﹀彂鏍¢獙
+    });
+  }).catch((error) => {
+    this.loading = false;
+    this.$message.error("鍔犺浇鏁版嵁澶辫触");
+    console.error(error);
+  });
+},
     // 鏂板琛�
     addmembers() {
       if (this.form.pacName) {

--
Gitblit v1.8.0