装置修改bug

master
liuyi 2 years ago
parent ed21fdcedd
commit c5fa2e84c7

@ -14,11 +14,11 @@
:rules="rules" :rules="rules"
:model="formInfo" :model="formInfo"
> >
<el-form-item label="线路" prop="lineVal"> <el-form-item label="线路" prop="lineid">
<el-select <el-select
v-model="formInfo.lineVal" v-model="formInfo.lineid"
placeholder="请选择" placeholder="请选择"
@change="getTower" @change="getTowerchange"
> >
<el-option <el-option
v-for="item in lineOptions" v-for="item in lineOptions"
@ -29,8 +29,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="杆塔:" prop="towerVal"> <el-form-item label="杆塔:" prop="towerid">
<el-select v-model="formInfo.towerVal" placeholder="请选择"> <el-select v-model="formInfo.towerid" placeholder="请选择">
<el-option <el-option
v-for="item in toweridOptions" v-for="item in toweridOptions"
:key="item.id" :key="item.id"
@ -50,8 +50,8 @@
<el-form-item label="装置名称:" prop="equipName"> <el-form-item label="装置名称:" prop="equipName">
<el-input v-model="formInfo.equipName" auto-complete="on"></el-input> <el-input v-model="formInfo.equipName" auto-complete="on"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="SIM卡" prop="simCard"> <el-form-item label="SIM卡" prop="sim">
<el-input v-model="formInfo.simCard" auto-complete="on"></el-input> <el-input v-model="formInfo.sim" auto-complete="on"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="通道(可多选)" prop="channelVal"> <el-form-item label="通道(可多选)" prop="channelVal">
<el-checkbox-group <el-checkbox-group
@ -105,11 +105,11 @@ export default {
return { return {
isShow: false, isShow: false,
formInfo: { formInfo: {
// lineVal: "", // lineid: "",
// towerVal: "", // towerid: "",
// equipName: "", // equipName: "",
// cmdid: "", // cmdid: "",
// simCard: "", // sim: "",
// displayName: "", // displayName: "",
channelVal: [], channelVal: [],
}, },
@ -122,6 +122,7 @@ export default {
{ validator: validCmid, trigger: "blur" }, { validator: validCmid, trigger: "blur" },
], ],
}, },
photoDialogtype:0,//1 线change
}; };
}, },
mounted() {}, mounted() {},
@ -153,11 +154,11 @@ export default {
this.formInfo = { this.formInfo = {
channelid: this.formInfo.channelVal, channelid: this.formInfo.channelVal,
cmdid: this.formInfo.cmdid, cmdid: this.formInfo.cmdid,
lineid: this.formInfo.lineVal, lineid: this.formInfo.lineid,
equipName: this.formInfo.equipName, equipName: this.formInfo.equipName,
sim: this.formInfo.simCard, sim: this.formInfo.sim,
displayName: this.formInfo.cmdid, displayName: this.formInfo.cmdid,
towerid: this.formInfo.towerVal, towerid: this.formInfo.towerid,
}; };
addTerminalJoggle(this.formInfo) addTerminalJoggle(this.formInfo)
.then((res) => { .then((res) => {
@ -172,11 +173,11 @@ export default {
this.formInfo = { this.formInfo = {
channelid: this.formInfo.channelVal, channelid: this.formInfo.channelVal,
cmdid: this.formInfo.cmdid, cmdid: this.formInfo.cmdid,
lineid: this.formInfo.lineVal, lineid: this.formInfo.lineid,
equipName: this.formInfo.equipName, equipName: this.formInfo.equipName,
sim: this.formInfo.simCard, sim: this.formInfo.sim,
displayName: this.formInfo.cmdid, displayName: this.formInfo.cmdid,
towerid: this.formInfo.towerVal, towerid: this.formInfo.towerid,
id: this.formInfo.id, id: this.formInfo.id,
}; };
updateTerminalJoggle(this.formInfo) updateTerminalJoggle(this.formInfo)
@ -201,11 +202,13 @@ export default {
this.lineOptions = res.data.list; this.lineOptions = res.data.list;
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.lineOptions = []; this.lineOptions = [];
this.formInfo.lineVal = ""; this.formInfo.lineid = "";
} else { } else {
this.lineOptions = res.data.list; this.lineOptions = res.data.list;
// this.formInfo.lineVal = res.data.list[0].id; if (this.photoDialogTitle == "新增") {
this.$set(this.formInfo, "lineVal", res.data.list[0].id); // this.formInfo.lineid = res.data.list[0].id;
this.$set(this.formInfo, "lineid", res.data.list[0].id);
}
} }
// this.dyOptions = res.data.list; // this.dyOptions = res.data.list;
// this.formdata.dyid = res.data.list == [] ? "" : res.data.list[0].id; // this.formdata.dyid = res.data.list == [] ? "" : res.data.list[0].id;
@ -214,19 +217,28 @@ export default {
}, },
// //
getTower() { getTower() {
getSearchInfo({ type: 3, id: this.formInfo.lineVal }) getSearchInfo({ type: 3, id: this.formInfo.lineid })
.then((res) => { .then((res) => {
if (res.data.list.length == 0) { if (res.data.list.length == 0) {
this.toweridOptions = []; this.toweridOptions = [];
this.formInfo.towerVal = ""; this.formInfo.towerid = "";
} else { } else {
this.toweridOptions = res.data.list; this.toweridOptions = res.data.list;
// this.formInfo.towerVal = res.data.list[0].id; if (this.photoDialogTitle == "新增" || this.photoDialogtype == 1 ) {
this.$set(this.formInfo, "towerVal", res.data.list[0].id); // this.formInfo.towerid = res.data.list[0].id;
this.$set(this.formInfo, "towerid", res.data.list[0].id);
this.photoDialogtype = 0
}
} }
}) })
.catch((err) => {}); .catch((err) => {});
}, },
getTowerchange(){
if (this.photoDialogTitle == "修改") {
this.photoDialogtype = 1
}
this.getTower()
},
// //
getChannel() { getChannel() {
getAllChannelListJoggle() getAllChannelListJoggle()

Loading…
Cancel
Save