|
|
|
@ -164,6 +164,7 @@
|
|
|
|
|
:visible.sync="open"
|
|
|
|
|
width="1000px"
|
|
|
|
|
append-to-body
|
|
|
|
|
v-if="open"
|
|
|
|
|
>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-row>
|
|
|
|
@ -207,20 +208,10 @@
|
|
|
|
|
<el-form-item label="班组人员" prop="teamPerson">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.teamPerson"
|
|
|
|
|
placeholder="请选择班组人员名字"
|
|
|
|
|
style="width: 840px"
|
|
|
|
|
disabled
|
|
|
|
|
>
|
|
|
|
|
<el-button
|
|
|
|
|
slot="append"
|
|
|
|
|
@click="handleSelectPerson"
|
|
|
|
|
icon="el-icon-search"
|
|
|
|
|
></el-button>
|
|
|
|
|
</el-input>
|
|
|
|
|
<ItemSelectPerson
|
|
|
|
|
ref="itemSelectPerson"
|
|
|
|
|
@onSelected="onItemSelectedPerson"
|
|
|
|
|
>
|
|
|
|
|
</ItemSelectPerson>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
@ -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(
|
|
|
|
|