diff --git a/src/components/unitGrouping/unitGroupCategory.vue b/src/components/unitGrouping/unitGroupCategory.vue index 18946a7..3955db1 100644 --- a/src/components/unitGrouping/unitGroupCategory.vue +++ b/src/components/unitGrouping/unitGroupCategory.vue @@ -167,9 +167,9 @@ export default { methods: { //保存按钮 Onsubmit() { - console.log(this.personnelUnit.form.id); - if (this.personnelUnit.form.id === "") { - this.$message.success("请选择单位分组"); + console.log(this.personnelUnit.id); + if (this.personnelUnit.id === "") { + this.$message.warning("请先选择单位分组"); } else { postapi("/api/app/customer-org-group-detail/many", this.addrulst).then( (res) => { @@ -181,15 +181,22 @@ export default { //移除按钮 addselecteditems() { //personnelUnit.nogroupselected - if (this.rightselctedata.length == 0) { this.$message.warning("已选数据为空无法移动"); } else { let count = this.rightselctedata.length - 1; for (var i = count; i >= 0; i--) { - this.personnelUnit.nogroupselected.splice(i, 1); - this.tabledata.push(this.rightselctedata[i]); + // this.personnelUnit.nogroupselected.splice(i, 1); + if ( + !this.rightselctedata.includes(this.rightselctedata[i].displayName) + ) { + this.tabledata.push(this.rightselctedata[i]); + this.personnelUnit.nogroupselected.splice(i, 1); + console.log(this.rightselctedata[i]); + } + // this.tabledata.push(this.rightselctedata[i]); } + // this. } }, //右侧勾选按钮 @@ -206,8 +213,14 @@ export default { this.saveornot = false; let count = this.unselecteddata.length - 1; for (var i = count; i >= 0; i--) { - this.tabledata.splice(i, 1); - this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); + // this.tabledata.splice(i, 1); + // this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); + if ( + [...new Set(this.unselecteddata)] + ) { + this.tabledata.splice(i, 1); + this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); + } } this.unselecteddata.forEach((item) => { this.addrulst.push({ diff --git a/src/components/unitGrouping/unitGroupingTable.vue b/src/components/unitGrouping/unitGroupingTable.vue index 0597d18..4c5fb9a 100644 --- a/src/components/unitGrouping/unitGroupingTable.vue +++ b/src/components/unitGrouping/unitGroupingTable.vue @@ -276,9 +276,9 @@ export default { }); // getapi( - `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.id}` + `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}` ).then((res) => { - console.log(res.data,'当前列'); + console.log(res.data, "当前列"); this.personnelUnit.nogroupselected = res.data; console.log(this.personnelUnit.nogroupselected, "我是分组"); });