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

yangwl
A0010407 1 year ago
parent 36fc7906d2
commit 5ceaf4aef1

@ -164,6 +164,7 @@
:visible.sync="open" :visible.sync="open"
width="1000px" width="1000px"
append-to-body append-to-body
v-if="open"
> >
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
@ -207,20 +208,10 @@
<el-form-item label="班组人员" prop="teamPerson"> <el-form-item label="班组人员" prop="teamPerson">
<el-input <el-input
v-model="form.teamPerson" v-model="form.teamPerson"
placeholder="请选择班组人员名字"
style="width: 840px" style="width: 840px"
disabled
> >
<el-button
slot="append"
@click="handleSelectPerson"
icon="el-icon-search"
></el-button>
</el-input> </el-input>
<ItemSelectPerson
ref="itemSelectPerson"
@onSelected="onItemSelectedPerson"
>
</ItemSelectPerson>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -269,7 +260,8 @@ export default {
data() { data() {
return { return {
// //
// peopleList: [], peopleList: [],
teamPerson: [],
// //
leftList: [], leftList: [],
// key // key
@ -344,16 +336,15 @@ export default {
key: response.rows[i].userId, key: response.rows[i].userId,
label: response.rows[i].teamUserName, label: response.rows[i].teamUserName,
}); });
this.peopleList.push({
// this.peopleList.push({ key: response.rows[i].userId,
// key: response.rows[i].userId, nickName: response.rows[i].nickName,
// label: response.rows[i].nickName });
// })
}
for (let i in response.selected) {
this.rightList.push(response.selected[i].key);
this.form.rightData = this.rightList;
} }
//for (let i in response.selected) {
//this.rightList.push(response.selected[i].key);
//this.form.rightData = this.rightList;
//}
this.loading = false; this.loading = false;
}); });
}, },
@ -415,6 +406,7 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.rightList = [];
this.open = true; this.open = true;
this.title = "添加设备班组维护"; this.title = "添加设备班组维护";
}, },
@ -433,37 +425,37 @@ export default {
this.title = "修改设备班组维护"; this.title = "修改设备班组维护";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
var people = "";
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
this.form.rightData = this.rightList; this.form.rightData = this.rightList;
this.teamPerson = [];
// if(this.form.rightData != null){ this.form.rightData.forEach((item) => {
// this.form.rightData.forEach((item) => { this.peopleList.forEach((item1) => {
// this.peopleList.forEach((item1) => { if (item == item1.key) {
// if(item1.key == item){ this.teamPerson.push(item1.nickName);
// this.form.teamPerson = []; }
// this.form.teamPerson.push(item1.label); });
// } });
// }); this.form.teamPerson = this.teamPerson.toString();
// });
// }
// if (Array.isArray(this.form.teamPerson)) {
// this.form.teamPerson = this.listToString(this.form.teamPerson);
// }
updateEquTeam(this.form).then((response) => { updateEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} else { } else {
this.teamPerson = [];
this.form.rightData = this.rightList; 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) => { addEquTeam(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
@ -506,15 +498,6 @@ export default {
}) })
.catch(() => {}); .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() { handleExport() {
this.download( this.download(

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

Loading…
Cancel
Save