From 4cd570c40951d27e5cd745f8678913f221cdb22e Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期六, 11 一月 2025 18:02:18 +0800
Subject: [PATCH] 111

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

diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue
index 1fcdfd2..666f2ff 100644
--- a/src/views/system/package/index.vue
+++ b/src/views/system/package/index.vue
@@ -550,16 +550,20 @@
         </el-table-column>
       </el-table> -->
 
-      <el-row style="display: flex; width: 1300px;">
+      <el-row style="display: flex; width: 1300px">
         <el-col>
           <div
             style="text-align: center; margin-bottom: 10px; margin-top: 10px"
           >
             椤圭洰鍒楄〃
           </div>
-          <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="filterText">
-          </el-input>
-          <div class="tab3" style="height: 365px;">
+          <el-input
+            placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�"
+            @input="handleFilterInput"
+            v-model="queryParams.nr"
+            clearable
+          />
+          <div class="tab3" style="height: 365px">
             <el-tree
               class="filter-tree"
               v-loading="loading"
@@ -580,7 +584,7 @@
               :total="total"
               :page.sync="queryParams.page"
               :limit.sync="queryParams.pageSize"
-              @pagination="getDataList"
+              @pagination="handlePageChange"
             />
           </div>
         </el-col>
@@ -728,7 +732,11 @@
 import { listCategory } from "@/api/mall/category";
 import { listKeyword } from "@/api/mall/keyword";
 // import { getProParentIdDxList, getProSonDxList } from "@/api/system/tijian";
-import { getProParentIdDxList, getProSonDxList } from "@/api/system/package";
+import {
+  getProParentIdDxList,
+  search,
+  getProSonDxList,
+} from "@/api/system/package";
 import {
   getPacList,
   getPacInFo,
@@ -825,6 +833,7 @@
         pageSize: 10,
         pacName: null,
         pacRemark: null,
+        nr: "",
       },
       // 琛ㄥ崟鍙傛暟
       form: {
@@ -864,11 +873,11 @@
       },
     };
   },
-  watch: {
-    filterText(val) {
-      this.$refs.tree.filter(val);
-    },
-  },
+  // watch: {
+  //   filterText(val) {
+  //     this.$refs.tree.filter(val);
+  //   },
+  // },
 
   created() {
     this.getList();
@@ -912,6 +921,7 @@
         this.loading = false;
       });
     },
+
     /** 鏌ヨ鍏抽敭瀛楀垪琛� */
     getKeyword() {
       this.loading = true;
@@ -1257,64 +1267,88 @@
     },
     getDataList() {
       this.loading = true;
-      getProParentIdDxList(this.queryParams).then((response) => {
-        this.Treedata = response.data.list;
-        /*  if (this.form.tjProjectList) {
-          this.form.tjProjectList.forEach((item) => {
-            this.Treedata.forEach((item1) => {    
-              if (item.proId == item1.proId) {
-                this.checkedkey.push(item1.proId);
- 
-                this.DataList.push(item1);
-                
-                this.DataList.forEach((item1) => {
-                  item1.limits = 10;
-                  if (item1.limits > 10) {
-                    item1.limits = 10; // 寮哄埗灏嗗�艰缃负鏈�澶у��
-                  } else if (item1.limits < 0) {
-                    item1.limits = 0; // 寮哄埗灏嗗�艰缃负鏈�灏忓��
-                  }
-                  this.updateProPrice(item1); // 鏇存柊浠锋牸鎴栧叾浠栭�昏緫
-                });
- 
-              }
-            });
-          });
-        }  */ /* else {
-          this.checkedkey.push(this.Treedata[0].proId);
-          let proId = this.Treedata[0].proId;
-          this.TreedataList = this.Treedata.filter(
-            (item) => item.proId == proId
-          ); */
-
-        // 灏嗙涓�涓」鐩坊鍔犲埌 DataList
-        // this.TreedataList.forEach((item) => {
-        //   this.checkedListkey.push(item.proId);
-        //   this.DataList.push(item);
-        // });
-        /*  getProSonDxList(proId).then((res) => {
-            this.TreedataList = res.data.list;
-            this.TreedataList.forEach((item) => {
-              item.disabled = true;
-              this.checkedListkey.push(item.proId);
-              this.DataList.push(item);
-              this.DataList.forEach((item) => {
-                item.propinName = this.Treedata[0].proName;
-                item.propinPrice = this.Treedata[0].proPrice;
-              });
-              this.pics = 0;
-              this.DataList.forEach((item) => {
-                this.pics += item.proPrice;
-              });
-            });
-          }); */
-        // }
+      search(this.queryParams).then((response) => {
+        this.Treedata = response.data.list; // 鏇存柊鏍戝舰鏁版嵁
+        this.total = response.data.total; // 鏇存柊鎬绘潯鏁�
         this.pics = this.DataList.reduce(
           (total, item) => total + item.priceOrd,
           0
         );
-        this.loading = false;
       });
+      this.loading = false;
+    },
+    // getDataList() {
+    //   this.loading = true;
+
+    //   getProParentIdDxList(this.queryParams).then((response) => {
+    //     this.Treedata = response.data.list;
+    //     /*  if (this.form.tjProjectList) {
+    //       this.form.tjProjectList.forEach((item) => {
+    //         this.Treedata.forEach((item1) => {    
+    //           if (item.proId == item1.proId) {
+    //             this.checkedkey.push(item1.proId);
+ 
+    //             this.DataList.push(item1);
+                
+    //             this.DataList.forEach((item1) => {
+    //               item1.limits = 10;
+    //               if (item1.limits > 10) {
+    //                 item1.limits = 10; // 寮哄埗灏嗗�艰缃负鏈�澶у��
+    //               } else if (item1.limits < 0) {
+    //                 item1.limits = 0; // 寮哄埗灏嗗�艰缃负鏈�灏忓��
+    //               }
+    //               this.updateProPrice(item1); // 鏇存柊浠锋牸鎴栧叾浠栭�昏緫
+    //             });
+ 
+    //           }
+    //         });
+    //       });
+    //     }  */ /* else {
+    //       this.checkedkey.push(this.Treedata[0].proId);
+    //       let proId = this.Treedata[0].proId;
+    //       this.TreedataList = this.Treedata.filter(
+    //         (item) => item.proId == proId
+    //       ); */
+
+    //     // 灏嗙涓�涓」鐩坊鍔犲埌 DataList
+    //     // this.TreedataList.forEach((item) => {
+    //     //   this.checkedListkey.push(item.proId);
+    //     //   this.DataList.push(item);
+    //     // });
+    //     /*  getProSonDxList(proId).then((res) => {
+    //         this.TreedataList = res.data.list;
+    //         this.TreedataList.forEach((item) => {
+    //           item.disabled = true;
+    //           this.checkedListkey.push(item.proId);
+    //           this.DataList.push(item);
+    //           this.DataList.forEach((item) => {
+    //             item.propinName = this.Treedata[0].proName;
+    //             item.propinPrice = this.Treedata[0].proPrice;
+    //           });
+    //           this.pics = 0;
+    //           this.DataList.forEach((item) => {
+    //             this.pics += item.proPrice;
+    //           });
+    //         });
+    //       }); */
+    //     // }
+    //     this.pics = this.DataList.reduce(
+    //       (total, item) => total + item.priceOrd,
+    //       0
+    //     );
+    //     this.loading = false;
+    //   });
+    // },
+    handleFilterInput() {
+      this.queryParams.page = 1; // 鎼滅储鏃堕噸缃负绗竴椤�
+      this.getDataList(); // 璋冪敤鎺ュ彛鑾峰彇鏁版嵁
+    },
+
+    // 鍒嗛〉浜嬩欢
+    handlePageChange({ page, pageSize }) {
+      this.queryParams.page = page; // 鏇存柊褰撳墠椤�
+      this.queryParams.pageSize = pageSize; // 鏇存柊姣忛〉鏉℃暟
+      this.getDataList(); // 璋冪敤鎺ュ彛鑾峰彇鏁版嵁
     },
 
     handleCurrentChecked(data, checked, checkedNodes) {
@@ -1330,7 +1364,6 @@
           limits: 10,
           priceNow: data.proPrice,
         });
-        
       } else {
         let index = this.DataList.findIndex(
           (item) => item.proId === data.proId

--
Gitblit v1.8.0