Commit 0da53ab9 authored by 耿迪迪's avatar 耿迪迪

危化设备管理企业选择 gengdidi

parent 1319ac29
......@@ -37,6 +37,7 @@
<el-table :data="tableData.pageData" stripe border style="width:100%;" :loading="loading">
<el-table-column width="50" type="index" label="序号"></el-table-column>
<el-table-column prop="enterpriseName" label="企业名称"></el-table-column>
<el-input type="hidden" pro="enterpriseId"></el-input>
<el-table-column prop="deviceName" label="设备名称"></el-table-column>
<el-table-column prop="deviceName" label="设备类型">
<template slot-scope="scope">
......@@ -141,8 +142,10 @@ export default class SafetyDeviceMg extends Vue {
addFun() {
this.zjKey++;
this.dialogVisible = true;
this.formData.dataType = this.searchData.dataType;
this.formData.enterpriseId = this.enterpriseId;
//this.formData.dataType = this.searchData.dataType;
if(METHOD.enterpriseId){
this.formData.enterpriseId = METHOD.enterpriseId;
}
}
editFun(row: any) {
this.dialogTit = "编辑";
......
......@@ -7,6 +7,16 @@
:close-on-click-modal="false"
>
<el-form ref="editForm" :model="editForm" :rules="rules" label-width="100px">
<el-form-item label="选择企业" prop="enterpriseId" v-if="play">
<el-select v-model="editForm.enterpriseId" placeholder="请选择" @change="seletChange">
<el-option
v-for="item in enterpriseList"
:key="item.enterpriseId"
:label="item.unitName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="dataType">
<el-select v-model="editForm.dataType">
<el-option label="监控设备" value="5"></el-option>
......@@ -59,7 +69,7 @@
<el-form-item label="物品类型" prop="category">
<el-input v-model="editForm.category"></el-input>
</el-form-item>
<el-form-item label="否是重大危险源" prop="isBigDanger">
<!--<el-form-item label="否是重大危险源" prop="isBigDanger">
<el-radio-group v-model="editForm.isBigDanger">
<el-radio :label="'0'"></el-radio>
<el-radio :label="'1'"></el-radio>
......@@ -72,7 +82,7 @@
<el-option value="三级"></el-option>
<el-option value="四级"></el-option>
</el-select>
</el-form-item>
</el-form-item>-->
<el-form-item label="联系人" prop="contacts">
<el-input v-model="editForm.contacts"></el-input>
</el-form-item>
......@@ -114,21 +124,23 @@ export default class SafetyDeviceMgEdit extends Vue {
enterpriseId: String;
};
@Prop(String) title!: String;
// @Provide() editForm: any = {};
@Provide() enterpriseList: any = [];
@Provide() qvvalue: any = []; //区域值
@Provide() signsArr: any = []; //图例list
@Provide() dialogTableVisible: Boolean = false;
@Provide() rules: any = {
//enterpriseId: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
deviceName: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
dataType: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
isBigDanger: [
/*isBigDanger: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
dangerGrade: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
],*/
factoryLocation: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
......@@ -136,6 +148,7 @@ export default class SafetyDeviceMgEdit extends Vue {
latitude: [{ required: true, trigger: "blur", message: "该项为必填项!" }]
};
@Provide() loadmap: Boolean = false;
@Provide() play: Boolean = false;
@Provide() enterpriseId: string = "dbe0c3268a3c4911913f35a2fdcd0e3e";
qrFun(v: any) {
......@@ -157,11 +170,12 @@ export default class SafetyDeviceMgEdit extends Vue {
confirmFun(formName: string) {
let that = this,
params = that.editForm;
params.enterpriseId = that.editForm.enterpriseListId;
(that as any).$refs[formName].validate((valid: boolean) => {
if (valid) {
METHOD.axiosPost(
that,
`/safetyDeviceInfo/addOrEditSafetyDeviceInfo/${that.enterpriseId}`,
`/safetyDeviceInfo/addOrEditSafetyDeviceInfo`,
params,
function(res: any) {
if (res.code == 0) {
......@@ -179,9 +193,52 @@ export default class SafetyDeviceMgEdit extends Vue {
}
});
}
getnterpriseListInfo() {
let that = this,
param ={accountStatus:'0'};
that.loading = true;
METHOD.axiosPost(
that,
`/enterpriseInfo/queryEnterpriseListInfo`,
param,
function(res: any) {
that.loading = false;
if (res.code == 0) {
that.enterpriseList = res.data;
}
}
);
}
getnterpriseListInfo() {
let that = this,
param ={accountStatus:'0'};
that.loading = true;
METHOD.axiosPost(
that,
`/enterpriseInfo/queryEnterpriseListInfo`,
param,
function(res: any) {
that.loading = false;
if (res.code == 0) {
that.enterpriseList = res.data;
}
}
);
}
seletChange(enterpriseId: any) {
let that = this,
arr;
arr = that.enterpriseList.filter((ele: any) => enterpriseId == ele.enterpriseId);
that.editForm.enterpriseListId = arr[0].enterpriseId;
}
created() {
//this.editForm = this.editFormData;
if(METHOD.enterpriseId){
this.enterpriseId = METHOD.enterpriseId;
}else{
//政府用户
this.play = true;
this.getnterpriseListInfo();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment