拍照装置

master
13703816893 2 years ago
parent ff8e190e53
commit 560ed6f40f

@ -14,9 +14,9 @@
:rules="rules" :rules="rules"
:model="formInfo" :model="formInfo"
> >
<el-form-item label="线路名称:" prop="lineid"> <el-form-item label="线路名称:" prop="lineId">
<el-select <el-select
v-model="formInfo.lineid" v-model="formInfo.lineId"
placeholder="请选择" placeholder="请选择"
@change="getTowerchange" @change="getTowerchange"
> >
@ -29,8 +29,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="杆塔名称:" prop="towerid"> <el-form-item label="杆塔名称:" prop="towerId">
<el-select v-model="formInfo.towerid" 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"
@ -40,8 +40,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="装置ID" prop="cmdid"> <el-form-item label="装置ID" prop="cmdId">
<el-input v-model="formInfo.cmdid" autocomplete="on"></el-input> <el-input v-model="formInfo.cmdId" autocomplete="on"></el-input>
</el-form-item> </el-form-item>
<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>
@ -54,12 +54,12 @@
<div class="addchannel" ref="channelBoxref"> <div class="addchannel" ref="channelBoxref">
<div <div
class="channelBoxadd" class="channelBoxadd"
v-for="(channellist, index) in formInfo.list" v-for="(val, index) in formInfo.channelId"
:key="index" :key="index"
> >
<el-form-item label="通道号:"> <el-form-item label="通道号:">
<el-select <el-select
v-model="channellist.channelVal" v-model="val.id"
placeholder="请选择通道号" placeholder="请选择通道号"
@change="changeHandle" @change="changeHandle"
> >
@ -73,7 +73,7 @@
</el-form-item> </el-form-item>
<el-form-item label="通道名称:"> <el-form-item label="通道名称:">
<el-input <el-input
v-model="channellist.nickname" v-model="val.alias"
placeholder="请输入通道名称" placeholder="请输入通道名称"
></el-input> ></el-input>
</el-form-item> </el-form-item>
@ -82,20 +82,20 @@
v-if="index !== 0" v-if="index !== 0"
type="danger" type="danger"
icon="el-icon-minus" icon="el-icon-minus"
@click="deleteModule(channellist, index)" @click="deleteModule(val, index)"
></el-button> ></el-button>
<el-button <el-button
icon="el-icon-plus" icon="el-icon-plus"
type="primary" type="primary"
@click="addModule()" @click="addModule()"
v-if="index + 1 == formInfo.list.length" v-if="index + 1 == formInfo.channelId.length"
></el-button> ></el-button>
</div> </div>
</div> </div>
<!-- <el-form-item label="通道(可多选)" prop="channelVal"> <!-- <el-form-item label="通道(可多选)" prop="id">
<el-checkbox-group <el-checkbox-group
class="channelBox" class="channelBox"
v-model="formInfo.channelVal" v-model="formInfo.id"
v-if="channelOptions.length > 0" v-if="channelOptions.length > 0"
> >
<el-checkbox <el-checkbox
@ -151,7 +151,7 @@ export default {
lineOptions: [], //线 lineOptions: [], //线
toweridOptions: [], // toweridOptions: [], //
rules: { rules: {
cmdid: [ cmdId: [
{ required: true, message: "请输入装置ID", trigger: "blur" }, { required: true, message: "请输入装置ID", trigger: "blur" },
{ validator: validCmid, trigger: "blur" }, { validator: validCmid, trigger: "blur" },
], ],
@ -170,38 +170,33 @@ export default {
this.getChannel(); this.getChannel();
if (val == null) { if (val == null) {
return (this.formInfo = { return (this.formInfo = {
lineid: [], lineId: '',
towerid: [], towerId: '',
cmdid: "", cmdId: '',
equipName: "", equipName: '',
sim: "", sim: '',
list: [ channelId: [
{ {
channelVal: '', id: '',
nickname: "", alias: '',
}, },
], ],
}); });
} }
this.formInfo = val; this.formInfo = val;
// let channelnr = [];
// val.list.forEach((item) => {
// channelnr.push(item.id);
// });
// this.$set(this.formInfo, "channelVal", channelnr);
}, },
// //
changeHandle(){ changeHandle(){
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id)) this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
}, },
// //
addModule() { addModule() {
// //
this.formInfo.list.push({ this.formInfo.channelId.push({
channelVal: '', id: '',
nickname: "", alias: "",
}); });
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id)) this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
this.$nextTick(() => { this.$nextTick(() => {
console.log(this.$refs.channelBoxref); console.log(this.$refs.channelBoxref);
if (this.$refs.channelBoxref) { if (this.$refs.channelBoxref) {
@ -213,26 +208,27 @@ export default {
// //
deleteModule(item, index) { deleteModule(item, index) {
console.log(item, index); console.log(item, index);
const itemList = this.formInfo.list.indexOf(item); const itemList = this.formInfo.channelId.indexOf(item);
if (itemList !== -1) { if (itemList !== -1) {
this.formInfo.list.splice(index, 1); this.formInfo.channelId.splice(index, 1);
} }
this.filterOption = this.channelOptions.filter(val => !this.formInfo.list.some(item => item.channelVal === val.id)) this.filterOption = this.channelOptions.filter(val => !this.formInfo.channelId.some(item => item.id === val.id))
}, },
// //
submitForm() { submitForm() {
this.$refs.formgrapInfo.validate((valid) => { this.$refs.formgrapInfo.validate((valid) => {
if (valid) { if (valid) {
if (this.photoDialogTitle == "新增") { if (this.photoDialogTitle == "新增") {
this.formInfo = { // this.formInfo = {
channelid: this.formInfo.channelVal, // lineId: this.formInfo.lineId,
cmdid: this.formInfo.cmdid, // towerId: this.formInfo.towerId,
lineid: this.formInfo.lineid, // cmdId: this.formInfo.cmdId,
equipName: this.formInfo.equipName, // equipName: this.formInfo.equipName,
sim: this.formInfo.sim, // sim: this.formInfo.sim,
displayName: this.formInfo.cmdid, // channelId: this.formInfo.channelId,
towerid: this.formInfo.towerid, // displayName: this.formInfo.cmdId,
}; // };
this.$set(this.formInfo,'displayName',this.formInfo.cmdId)
addTerminalJoggle(this.formInfo) addTerminalJoggle(this.formInfo)
.then((res) => { .then((res) => {
this.isShow = false; this.isShow = false;
@ -251,16 +247,6 @@ export default {
}); });
}); });
} else { } else {
this.formInfo = {
channelid: this.formInfo.channelVal,
cmdid: this.formInfo.cmdid,
lineid: this.formInfo.lineid,
equipName: this.formInfo.equipName,
sim: this.formInfo.sim,
displayName: this.formInfo.cmdid,
towerid: this.formInfo.towerid,
id: this.formInfo.id,
};
updateTerminalJoggle(this.formInfo) updateTerminalJoggle(this.formInfo)
.then((res) => { .then((res) => {
this.isShow = false; this.isShow = false;
@ -283,12 +269,12 @@ 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.lineid = ""; this.formInfo.lineId = "";
} else { } else {
this.lineOptions = res.data.list; this.lineOptions = res.data.list;
if (this.photoDialogTitle == "新增") { if (this.photoDialogTitle == "新增") {
// this.formInfo.lineid = res.data.list[0].id; // this.formInfo.lineId = res.data.list[0].id;
this.$set(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;
@ -298,16 +284,16 @@ export default {
}, },
// //
getTower() { getTower() {
getLineAndGtInfo({ type: 2, id: this.formInfo.lineid }) getLineAndGtInfo({ type: 2, 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.towerid = ""; this.formInfo.towerId = "";
} else { } else {
this.toweridOptions = res.data.list; this.toweridOptions = res.data.list;
if (this.photoDialogTitle == "新增" || this.photoDialogtype == 1) { if (this.photoDialogTitle == "新增" || this.photoDialogtype == 1) {
// this.formInfo.towerid = res.data.list[0].id; // this.formInfo.towerId = res.data.list[0].id;
this.$set(this.formInfo, "towerid", res.data.list[0].id); this.$set(this.formInfo, "towerId", res.data.list[0].id);
this.photoDialogtype = 0; this.photoDialogtype = 0;
} }
} }
@ -326,7 +312,7 @@ export default {
.then((res) => { .then((res) => {
this.channelOptions = res.data.list; this.channelOptions = res.data.list;
this.filterOption = res.data.list; this.filterOption = res.data.list;
this.formInfo.list[0].channelVal = this.filterOption[0].id; this.formInfo.channelId[0].id = this.filterOption[0].id;
}) })
.catch((err) => {}); .catch((err) => {});
}, },

@ -27,28 +27,28 @@
> >
</el-table-column> --> </el-table-column> -->
<el-table-column <el-table-column
prop="linename" prop="lineName"
label="线路名称" label="线路名称"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="towername" prop="towerName"
label="杆塔名称" label="杆塔名称"
show-overflow-tooltip show-overflow-tooltip
min-width="120" min-width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="displayName" prop="equipName"
label="设备名称" label="设备名称"
show-overflow-tooltip show-overflow-tooltip
min-width="150" min-width="150"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="cmdid" prop="cmdId"
label="设备编号" label="设备编号"
show-overflow-tooltip show-overflow-tooltip
min-width="150" min-width="150"
@ -377,7 +377,7 @@ export default {
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
resetTerminalApi({ cmId: data.cmdid }) resetTerminalApi({ cmId: data.cmdId })
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.$message({ this.$message({
@ -413,7 +413,7 @@ export default {
//gps //gps
changeGPS(val, row) { changeGPS(val, row) {
console.log(val, row); console.log(val, row);
setTermGPSJoggle({ gpsstatus: val, cmdId: row.cmdid }) setTermGPSJoggle({ gpsstatus: val, cmdId: row.cmdId })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (val == 0) { if (val == 0) {

Loading…
Cancel
Save