diff --git a/src/views/device/equTeam/index.vue b/src/views/device/equTeam/index.vue index 4162c241..d4c1717d 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 c9b678ee..4e7774e3 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",