From e19defd15577e70c8e55593d7fe44bab1cbe1a66 Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期二, 11 六月 2024 11:00:27 +0800
Subject: [PATCH] qxtj

---
 src/views/system/package/index.vue |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue
index 5644531..2dd443d 100644
--- a/src/views/system/package/index.vue
+++ b/src/views/system/package/index.vue
@@ -640,7 +640,6 @@
   components: { Packages },
   data() {
     let checkPhoneNum = (rule, value, callback) => {
-      console.log(value);
       let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
       if (value == "" && value == undefined && !value) {
         return callback("");
@@ -696,6 +695,7 @@
       newproName: [],
       // 鎵�鏈変綋妫�椤圭洰路
       allList: [],
+      treeList: [],
       // 鎵�鏈夊椁愭暟鎹�
       // allpackage:[],
       // 寮瑰嚭灞傛爣棰�
@@ -794,7 +794,6 @@
       });
     },
     sel(val) {
-      console.log(val);
       let id = val;
       this.keys = "";
       id.forEach((item) => {
@@ -808,9 +807,7 @@
         this.categoryList = response.rows;
       });
     },
-    shangpin(vals) {
-      console.log(vals);
-    },
+    shangpin(vals) {},
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
@@ -928,7 +925,7 @@
       // });
       getPacInFo(this.forms.pacId).then((response) => {
         this.form = response.data;
-        this.form.keywords=this.form.keywords.slice(0, -1);
+        this.form.keywords = this.form.keywords.slice(0, -1);
         this.form.keywords = this.form.keywords.split(",");
         this.DataList = [];
         this.checkedkey = [];
@@ -942,7 +939,7 @@
       this.open = true;
       getPacInFo(row.pacId).then((response) => {
         this.form = response.data;
-        this.form.keywords=this.form.keywords.slice(0, -1);
+        this.form.keywords = this.form.keywords.slice(0, -1);
         this.form.keywords = this.form.keywords.split(",");
         this.DataList = [];
         this.checkedkey = [];
@@ -1031,7 +1028,6 @@
     },
     //  // 榛樿鎺ュ彈鍥涗釜鍊� { 褰撳墠琛岀殑鍊�, 褰撳墠鍒楃殑鍊�, 琛岀殑涓嬫爣, 鍒楃殑涓嬫爣 }
     objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-      // console.log(row, column, rowIndex, columnIndex);
       let fields = ["propinName"];
       let cellValue = row[column.property];
       if (cellValue && fields.includes(column.property)) {
@@ -1100,7 +1096,6 @@
       });
     },
     handleCurrentChecked(data, checked, checkedNodes) {
-      console.log(data, checked);
       this.dataObj = data;
       this.checkedObj = checked;
       if (checked == true) {
@@ -1136,7 +1131,6 @@
             item.disabled = true;
           });
           this.checkedListkey = [];
-          console.log(this.TreedataList.length);
           this.DataList.forEach((item, index) => {
             if (item.proParentId == this.dataObj.proId) {
               this.DataList.splice(index, this.TreedataList.length);
@@ -1207,7 +1201,16 @@
       if (this.form.pacName) {
         this.form.tjProjectList = [];
         if (this.DataList.length != 0) {
-          this.DataList.forEach((item) => {
+          this.treeList = JSON.parse(JSON.stringify(this.DataList));
+          for (var i = 0; i < this.treeList.length; i++) {
+            for (var j = i + 1; j < this.treeList.length; j++) {
+              if (this.treeList[i].proParentId == this.treeList[j].proParentId) {
+                this.treeList.splice(j, 1);
+                j--;
+              }
+            }
+          }
+           this.treeList.forEach((item) => {
             this.form.tjProjectList.push({
               // id: 0,
               proName: item.propinName,
@@ -1226,12 +1229,12 @@
               // } else {
               //   this.form.pacStatus = 1;
               // }
-              if(this.keys){
+              if (this.keys) {
                 this.form.keywords = this.keys;
-              }else{
+              } else {
                 this.form.keywords = this.form.keywords.toString();
               }
-            
+
               updatePackage(this.form).then((response) => {
                 this.$modal.msgSuccess("淇敼鎴愬姛");
                 this.open = false;
@@ -1244,7 +1247,6 @@
               // } else {
               //   this.form.pacStatus = 1;
               // }
-              // console.log(this.form.tjProjectList);
               // return;
               addPackage(this.form).then((response) => {
                 this.$modal.msgSuccess("鏂板鎴愬姛");

--
Gitblit v1.8.0