设备系统-设备班组+基础信息设备

yangwl
A0010407 1 year ago
parent 36fc7906d2
commit 5ceaf4aef1

@ -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(

@ -315,6 +315,7 @@
:visible.sync="open"
width="1000px"
append-to-body
v-if="open"
>
<el-form ref="form" :model="form" :rules="rules" label-width="115px">
<div class="step-margin">
@ -654,6 +655,7 @@
:visible.sync="queryOpen"
width="1000px"
append-to-body
v-if="queryOpen"
>
<el-form ref="form" :model="form" :rules="rules" label-width="115px">
<el-tabs type="border-card">
@ -1027,7 +1029,7 @@ export default {
options: [
{
status: "1",
label: "正常",
label: "启用",
},
{
status: "0",

Loading…
Cancel
Save