From 5ceaf4aef1b5fe1e79d10f025528f944ab4b991b Mon Sep 17 00:00:00 2001 From: A0010407 Date: Tue, 28 Nov 2023 17:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E5=A4=87=E7=B3=BB=E7=BB=9F-=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E7=8F=AD=E7=BB=84+=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/equTeam/index.vue | 79 ++++++++++++------------------ src/views/wms/equipment/index.vue | 4 +- 2 files changed, 34 insertions(+), 49 deletions(-) diff --git a/src/views/device/equTeam/index.vue b/src/views/device/equTeam/index.vue index 4162c24..d4c1717 100644 --- a/src/views/device/equTeam/index.vue +++ b/src/views/device/equTeam/index.vue @@ -164,6 +164,7 @@ :visible.sync="open" width="1000px" append-to-body + v-if="open" > @@ -207,20 +208,10 @@ - - - @@ -269,7 +260,8 @@ export default { data() { return { //人员表 - // peopleList: [], + peopleList: [], + teamPerson: [], // 可选(左边) leftList: [], // 已选(右边,只需要key) @@ -344,16 +336,15 @@ export default { key: response.rows[i].userId, label: response.rows[i].teamUserName, }); - - // this.peopleList.push({ - // key: response.rows[i].userId, - // label: response.rows[i].nickName - // }) - } - for (let i in response.selected) { - this.rightList.push(response.selected[i].key); - this.form.rightData = this.rightList; + this.peopleList.push({ + key: response.rows[i].userId, + nickName: response.rows[i].nickName, + }); } + //for (let i in response.selected) { + //this.rightList.push(response.selected[i].key); + //this.form.rightData = this.rightList; + //} this.loading = false; }); }, @@ -415,6 +406,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.rightList = []; this.open = true; this.title = "添加设备班组维护"; }, @@ -433,37 +425,37 @@ export default { this.title = "修改设备班组维护"; }); }, - /** 提交按钮 */ submitForm() { this.$refs["form"].validate((valid) => { - var people = ""; if (valid) { if (this.form.id != null) { this.form.rightData = this.rightList; - - // if(this.form.rightData != null){ - // this.form.rightData.forEach((item) => { - // this.peopleList.forEach((item1) => { - // if(item1.key == item){ - // this.form.teamPerson = []; - // this.form.teamPerson.push(item1.label); - // } - // }); - // }); - // } - - // if (Array.isArray(this.form.teamPerson)) { - // this.form.teamPerson = this.listToString(this.form.teamPerson); - // } - + this.teamPerson = []; + this.form.rightData.forEach((item) => { + this.peopleList.forEach((item1) => { + if (item == item1.key) { + this.teamPerson.push(item1.nickName); + } + }); + }); + this.form.teamPerson = this.teamPerson.toString(); updateEquTeam(this.form).then((response) => { this.$modal.msgSuccess("修改成功"); this.open = false; this.getList(); }); } else { + this.teamPerson = []; this.form.rightData = this.rightList; + this.form.rightData.forEach((item) => { + this.peopleList.forEach((item1) => { + if (item == item1.key) { + this.teamPerson.push(item1.nickName); + } + }); + }); + this.form.teamPerson = this.teamPerson.toString(); addEquTeam(this.form).then((response) => { this.$modal.msgSuccess("新增成功"); this.open = false; @@ -506,15 +498,6 @@ export default { }) .catch(() => {}); }, - // 对象转成指定字符串分隔 - // listToString(list, separator) { - // let strs = ""; - // separator = separator || ","; - // for (let i in list) { - // strs += list[i].url + separator; - // } - // return strs != "" ? strs.substr(0, strs.length - 1) : ""; - // }, /** 导出按钮操作 */ handleExport() { this.download( diff --git a/src/views/wms/equipment/index.vue b/src/views/wms/equipment/index.vue index c9b678e..4e7774e 100644 --- a/src/views/wms/equipment/index.vue +++ b/src/views/wms/equipment/index.vue @@ -315,6 +315,7 @@ :visible.sync="open" width="1000px" append-to-body + v-if="open" >
@@ -654,6 +655,7 @@ :visible.sync="queryOpen" width="1000px" append-to-body + v-if="queryOpen" > @@ -1027,7 +1029,7 @@ export default { options: [ { status: "1", - label: "正常", + label: "启用", }, { status: "0",