From 13c3a5e8b60348e3d89c4e32e396ed24ecd7ffdc Mon Sep 17 00:00:00 2001 From: mch <1332099529@qq.com> Date: Fri, 30 Jun 2023 11:43:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=A2=E6=A3=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitGrouping/unitGroupCategory.vue | 20 +++++++++++++++++-- .../unitGrouping/unitGroupingTable.vue | 3 ++- src/store/index.js | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/components/unitGrouping/unitGroupCategory.vue b/src/components/unitGrouping/unitGroupCategory.vue index e919967..e14e291 100644 --- a/src/components/unitGrouping/unitGroupCategory.vue +++ b/src/components/unitGrouping/unitGroupCategory.vue @@ -7,6 +7,7 @@ placeholder="请选择" style="margin-left: 20px" @change="getprojectgroups" + clearable > 移去 +
+ 保存 + +
@@ -131,6 +137,7 @@ import { mapState } from "vuex"; export default { data() { return { + saveornot:true,//保存按钮 selecteddata: [], //已选数据 unselecteddata: [], //未选数据 unselecteddata: [], //右边勾选中 @@ -175,12 +182,19 @@ export default { if (this.unselecteddata.length == 0) { this.$message.warning("未选数据为空无法移动"); } else { + this.saveornot=false let count = this.unselecteddata.length - 1; for (var i = count; i >= 0; i--) { this.tabledata.splice(i, 1); - this.selecteddata.push(this.unselecteddata[i]); + this.personnelUnit.nogroupselected.push(this.unselecteddata[i]); } // this.selecteddata = this.unselecteddata; + // 复制 + // let count = this.unselecteddata.length - 1; + // for (var i = count; i >= 0; i--) { + // this.tabledata.splice(i, 1); + // this.selecteddata.push(this.unselecteddata[i]); + // } } }, // 左侧未选 @@ -197,6 +211,7 @@ export default { }, //项目类别选择 getprojectgroups(v) { + this.getportfolioitems(); getapi(`/api/app/asbitem/in-item-type/${v}`).then((res) => { this.tabledata = res.data; console.log(res); @@ -212,6 +227,7 @@ export default { `/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.form.id}` ).then((res) => { console.log(res); + this.personnelUnit.form = res.data; }); } }, diff --git a/src/components/unitGrouping/unitGroupingTable.vue b/src/components/unitGrouping/unitGroupingTable.vue index 362cf02..06c3427 100644 --- a/src/components/unitGrouping/unitGroupingTable.vue +++ b/src/components/unitGrouping/unitGroupingTable.vue @@ -277,7 +277,8 @@ export default { // getapi(`/api/app/customer-org-group-detail/customer-org-group-detail-in-asbitem?CustomerOrgGroupId=${this.personnelUnit.id}`).then(res=>{ - console.log(res,'我是分组'); + this.personnelUnit.nogroupselected=res.data + console.log(res,'我是分组'); }) }, //编辑弹框 diff --git a/src/store/index.js b/src/store/index.js index 060199e..aee8aec 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -24,6 +24,7 @@ export default new Vuex.Store({ personnelgrouping:[], //人员分组 id:'',//根据Id选择的数据 form:'',//列表每一项 + nogroupselected:[],//已选分组 }, patientRegister:{//人员登记 From 7610071b113f74c4940b565e385ac694b3184817 Mon Sep 17 00:00:00 2001 From: mch <1332099529@qq.com> Date: Fri, 30 Jun 2023 16:21:20 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../unitGrouping/unitGroupCategory.vue | 78 +++++++++++++------ .../unitGrouping/unitGroupingTable.vue | 14 ++-- 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/src/components/unitGrouping/unitGroupCategory.vue b/src/components/unitGrouping/unitGroupCategory.vue index e14e291..18946a7 100644 --- a/src/components/unitGrouping/unitGroupCategory.vue +++ b/src/components/unitGrouping/unitGroupCategory.vue @@ -38,16 +38,19 @@ type="primary" style="margin-top: 10px" @click="addselecteditems" - >添加 移除
移去 添加
-
- + 保存
@@ -59,6 +62,7 @@ :data="personnelUnit.nogroupselected" @selection-change="selecteditems" > +