From 5f5425c1be29b82205f19b7779cda67cfcc3a6e5 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期三, 19 六月 2024 17:53:26 +0800 Subject: [PATCH] qxtj --- src/views/system/package/index.vue | 37 ++++++++++++++++++++++--------------- 1 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/views/system/package/index.vue b/src/views/system/package/index.vue index 5644531..62df0a7 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; @@ -876,6 +873,8 @@ this.open = true; this.title = "浣撴濂楅淇℃伅缁存姢"; this.DataList = []; + this.checkedkey=[]; + this.checkedListkey=[]; this.getDataList(); // getAllList().then((response) => { // this.allList = response.data; @@ -928,7 +927,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 +941,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 +1030,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)) { @@ -1081,8 +1079,10 @@ }); }); } else { + console.log(this.checkedkey) this.checkedkey.push(this.Treedata[0].proId); let proId = this.Treedata[0].proId; + console.log(proId) getProSonDxList(proId).then((res) => { this.TreedataList = res.data.list; this.TreedataList.forEach((item) => { @@ -1100,7 +1100,7 @@ }); }, handleCurrentChecked(data, checked, checkedNodes) { - console.log(data, checked); + console.log(data, checked) this.dataObj = data; this.checkedObj = checked; if (checked == true) { @@ -1136,7 +1136,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 +1206,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 +1234,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 +1252,6 @@ // } else { // this.form.pacStatus = 1; // } - // console.log(this.form.tjProjectList); // return; addPackage(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); -- Gitblit v1.8.0