You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
109 lines
2.3 KiB
Vue
109 lines
2.3 KiB
Vue
2 years ago
|
<template>
|
||
|
<el-dialog
|
||
|
class="addtowerDialogline"
|
||
|
title="新增杆塔"
|
||
|
:visible.sync="isShow"
|
||
|
:close-on-click-modal="false"
|
||
|
width="420px"
|
||
|
>
|
||
|
<el-form
|
||
|
label-position="left"
|
||
|
label-width="92px"
|
||
|
ref="formLineInfo"
|
||
|
:rules="rules"
|
||
|
:model="formdata"
|
||
|
>
|
||
|
<el-form-item label="线路编号:" prop="lineId">
|
||
|
<el-input
|
||
|
v-model="formdata.lineId"
|
||
|
autocomplete="off"
|
||
|
:disabled="true"
|
||
|
></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="杆塔名称:" prop="towerName">
|
||
|
<el-input v-model="formdata.towerName" autocomplete="off"></el-input>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
|
||
|
<div slot="footer" class="dialog-footer">
|
||
|
<el-button @click="isShow = false">取 消</el-button>
|
||
|
<el-button type="primary" @click="submitForm()">确 定</el-button>
|
||
|
</div>
|
||
|
</el-dialog>
|
||
|
</template>
|
||
|
<script>
|
||
|
import { addTowerApi } from "@/utils/api/index";
|
||
|
|
||
|
export default {
|
||
|
props: {
|
||
|
lineDialogTitle: String,
|
||
|
},
|
||
|
|
||
|
data() {
|
||
|
return {
|
||
|
isShow: false,
|
||
|
formdata: {},
|
||
|
dyOptions: "",
|
||
|
rules: {
|
||
|
towerName: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: "请输入杆塔名称",
|
||
|
trigger: "blur",
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
//判断
|
||
|
getdataform(val) {
|
||
|
this.formdata = val;
|
||
|
this.formdata.lineId = val.name;
|
||
|
},
|
||
|
// 保存确定操作
|
||
|
submitForm() {
|
||
|
this.$refs.formLineInfo.validate((valid) => {
|
||
|
if (valid) {
|
||
|
// 走保存请求
|
||
|
|
||
|
addTowerApi({
|
||
|
list: [
|
||
|
{
|
||
|
lineId: this.formdata.id,
|
||
|
name: this.formdata.towerName,
|
||
|
},
|
||
|
],
|
||
|
})
|
||
|
.then((res) => {
|
||
|
this.isShow = false;
|
||
|
this.$message.success("添加成功");
|
||
|
})
|
||
|
.catch((err) => {
|
||
|
this.$message.error("添加失败");
|
||
|
});
|
||
|
} else {
|
||
|
console.log("error submit!!");
|
||
|
return false;
|
||
|
}
|
||
|
});
|
||
|
},
|
||
|
display() {
|
||
|
this.isShow = true;
|
||
|
},
|
||
|
hide() {
|
||
|
this.isShow = false;
|
||
|
},
|
||
|
},
|
||
|
|
||
|
created() {},
|
||
|
};
|
||
|
</script>
|
||
|
<style lang="less">
|
||
|
.addtowerDialogline {
|
||
|
.el-select {
|
||
|
width: 100%;
|
||
|
}
|
||
|
}
|
||
|
</style>
|