|
|
|
|
@ -0,0 +1,279 @@
|
|
|
|
|
<template>
|
|
|
|
|
<!-- 日常雨水设施新增编辑 -->
|
|
|
|
|
<dialogShow :title="title" :is-show.sync="isShow" :width="width">
|
|
|
|
|
<template v-slot:content>
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-position="right"
|
|
|
|
|
:label-width="formLabelWidth">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="所属道路" prop="road_id">
|
|
|
|
|
<el-select class="width100" v-model="roadName" filterable remote @change="chooseRoad"
|
|
|
|
|
:disabled="roaddisabled" reserve-keyword placeholder="请输入关键词查找道路信息" clearable @focus="remoteRoad"
|
|
|
|
|
:remote-method="remoteMethod" :loading="roadloading">
|
|
|
|
|
<el-option v-for="item in roadsList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="巡查内容" prop="ask_content_id">
|
|
|
|
|
<el-select multiple class="width100" v-model="askContentArr" placeholder="请选择巡查内容">
|
|
|
|
|
<el-option v-for="item in equiementList" :key="item.id" :label="item.value" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="所在位置" prop="address">
|
|
|
|
|
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="mapform"></avue-input-map>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="经度" prop="longitude">
|
|
|
|
|
<el-input disabled="" v-model="form.longitude" placeholder="经度" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="纬度" prop="latitude">
|
|
|
|
|
<el-input disabled="" v-model="form.latitude" placeholder="纬度" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="现场照片" prop="files_list">
|
|
|
|
|
<el-upload multiple action="/api/admin/upload-file" list-type="picture-card" :file-list="filesList"
|
|
|
|
|
ref="pictureUpload" :auto-upload="true" :data="uploadOther" :on-error="handleError"
|
|
|
|
|
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,1)}">
|
|
|
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
|
|
|
<div slot="file" slot-scope="{file}">
|
|
|
|
|
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
|
|
|
|
<span class="el-upload-list__item-actions">
|
|
|
|
|
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
|
|
|
|
<i class="el-icon-zoom-in"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="是否异常" prop="is_unusual">
|
|
|
|
|
<el-radio-group v-model="form.is_unusual">
|
|
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
|
|
<!-- <el-radio :label="2">破损</el-radio> -->
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12" v-if="form.is_unusual==0">
|
|
|
|
|
<el-form-item label="巡查开始点位" prop="start_mapform">
|
|
|
|
|
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="start_mapform"></avue-input-map>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12" v-if="form.is_unusual==0">
|
|
|
|
|
<el-form-item label="巡查结束点位" prop="end_mapform">
|
|
|
|
|
<avue-input-map :params="mapparams" placeholder="请选择地图" v-model="end_mapform"></avue-input-map>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="form.is_unusual!=0">
|
|
|
|
|
<el-form-item label="异常类型" prop="unusual_type_id">
|
|
|
|
|
<el-select class="width100" v-model="form.unusual_type_id" placeholder="请选择异常类型">
|
|
|
|
|
<el-option v-for="item in unusualList" :key="item.id" :label="item.value" :value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="24" v-if="form.is_unusual!=0">
|
|
|
|
|
<el-form-item label="异常处置建议" prop="tip">
|
|
|
|
|
<el-input type="textarea" v-model="form.tip" placeholder="请填写异常处置建议" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="是否现场处理" prop="is_scene">
|
|
|
|
|
<el-radio-group v-model="form.is_scene">
|
|
|
|
|
<el-radio :label="0">否</el-radio>
|
|
|
|
|
<el-radio :label="1">是</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="form.is_scene==1">
|
|
|
|
|
<el-form-item label="现场处理结果" prop="result">
|
|
|
|
|
<el-input type="textarea" v-model="form.result" placeholder="请填写现场处理结果" autocomplete="off">
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24" v-if="form.is_scene==1">
|
|
|
|
|
<el-form-item label="处理后照片" prop="files_end_list">
|
|
|
|
|
<el-upload multiple action="/api/admin/upload-file" list-type="picture-card" :file-list="dealFilesList"
|
|
|
|
|
ref="pictureUploads" :limit="3" :auto-upload="true" :data="uploadOther" :on-error="handleError"
|
|
|
|
|
:on-success="function(responsose,file,fileList) {return handlesuccess(responsose,file,fileList,2)}">
|
|
|
|
|
<i slot="default" class="el-icon-plus"></i>
|
|
|
|
|
<div slot="file" slot-scope="{file}">
|
|
|
|
|
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="">
|
|
|
|
|
<span class="el-upload-list__item-actions">
|
|
|
|
|
<span class="el-upload-list__item-preview" @click="handlePictureCardPreview(file)">
|
|
|
|
|
<i class="el-icon-zoom-in"></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-if="!disabled" class="el-upload-list__item-delete" @click="handleRemove(file)">
|
|
|
|
|
<i class="el-icon-delete"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template v-slot:footerbtn>
|
|
|
|
|
<el-button v-if="formType=='auditform'" type="primary" v-preventReClick @click="auditForm('formdetail','1')">保 存
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</dialogShow>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
get,
|
|
|
|
|
storeequipment,
|
|
|
|
|
saveequipment
|
|
|
|
|
} from '../../../../api/rain/inspection.js'
|
|
|
|
|
import {
|
|
|
|
|
getToken
|
|
|
|
|
} from '@/utils/auth'
|
|
|
|
|
import {
|
|
|
|
|
listroad
|
|
|
|
|
} from '../../../../api/basic/road.js'
|
|
|
|
|
import dialogShow from '@/components/dialogShow'
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
dialogShow
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
formType: "showform", // 审核:auditform 办结 endform 查看 showform
|
|
|
|
|
title: "日常雨水设施",
|
|
|
|
|
width: "60%",
|
|
|
|
|
labelwidth: "120px",
|
|
|
|
|
isShow: false,
|
|
|
|
|
infoId: "",
|
|
|
|
|
|
|
|
|
|
disabled:false,
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
mapparams: {
|
|
|
|
|
zoom: 11,
|
|
|
|
|
},
|
|
|
|
|
mapform: [],
|
|
|
|
|
start_mapform: [],
|
|
|
|
|
end_mapform: [],
|
|
|
|
|
roadsList: [],
|
|
|
|
|
roadName: "",
|
|
|
|
|
roaddisabled: false,
|
|
|
|
|
roadloading: false,
|
|
|
|
|
|
|
|
|
|
filesList: [],
|
|
|
|
|
dealFilesList: [],
|
|
|
|
|
form: {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
rules: {}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
infoId(val) {
|
|
|
|
|
this.infoId = val
|
|
|
|
|
},
|
|
|
|
|
formType(val) {
|
|
|
|
|
this.formType = val
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
initLoad(){
|
|
|
|
|
this.uploadOther.token = getToken();
|
|
|
|
|
},
|
|
|
|
|
getEquipmentInfo(id) {
|
|
|
|
|
if (id) {
|
|
|
|
|
var that = this;
|
|
|
|
|
that.form = {}
|
|
|
|
|
get(id).then(res => {
|
|
|
|
|
let result = Object.assign(that.form, res);
|
|
|
|
|
that.form = result.rain_equipment_info
|
|
|
|
|
if (result.rain_inspection_logs) {
|
|
|
|
|
for (var k of result.rain_inspection_logs) {
|
|
|
|
|
k.adminName = k.admin ? k.admin.name : ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
that.form.rainInspectionLogs = result.rain_inspection_logs
|
|
|
|
|
that.form.roadName = result.rain_equipment_info.road ? result.rain_equipment_info.road.name : ""
|
|
|
|
|
that.form.end_time = result.end_time
|
|
|
|
|
that.form.remark = result.remark
|
|
|
|
|
that.form.end_type = result.end_type
|
|
|
|
|
that.form.maintain_type = result.maintain_type
|
|
|
|
|
let _files = [];
|
|
|
|
|
for (var mod of result.rain_equipment_info.rain_equipment_files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.photoType = "before";
|
|
|
|
|
_files.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.filesList = _files;
|
|
|
|
|
|
|
|
|
|
let _filesafter = [];
|
|
|
|
|
for (var mod of result.rain_equipment_info.rain_equipment_end_files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.files.url;
|
|
|
|
|
m.id = mod.files.id;
|
|
|
|
|
m.photoType = "after";
|
|
|
|
|
_filesafter.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.dealFilesList = _filesafter;
|
|
|
|
|
console.log(that.form)
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
chooseRoad(val) {
|
|
|
|
|
this.form.road_id = val
|
|
|
|
|
},
|
|
|
|
|
remoteRoad() {
|
|
|
|
|
this.roadsList = []
|
|
|
|
|
},
|
|
|
|
|
remoteMethod(query) {
|
|
|
|
|
|
|
|
|
|
if (query != '') {
|
|
|
|
|
this.roadloading = true
|
|
|
|
|
listroad({
|
|
|
|
|
name: query
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.roadloading = false
|
|
|
|
|
this.roadsList = res.data
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.roadsList = []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|