|
|
|
|
@ -20,14 +20,14 @@
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="column.type=='opt'">
|
|
|
|
|
<Button ghost size="small" @click="view(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">查看</Button>
|
|
|
|
|
style="margin-left: 10px;" v-if="scope.row['status']==3">查看</Button>
|
|
|
|
|
|
|
|
|
|
<Button v-if="scope.row['status']==1" ghost size="small" @click="show(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">编辑</Button>
|
|
|
|
|
<Button v-if="scope.row['status']==1" ghost size="small" @click="edit(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">审核</Button>
|
|
|
|
|
<Button v-if="scope.row['status']==2" ghost size="small" @click="edit(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">办结</Button>
|
|
|
|
|
<Button v-if="scope.row['status']==3" ghost size="small" @click="edit(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">修改反馈部门</Button>
|
|
|
|
|
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="column.type=='status'">
|
|
|
|
|
@ -54,9 +54,106 @@
|
|
|
|
|
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="通用巡查编辑" :visible.sync="showdialogFormVisible" width="60%">
|
|
|
|
|
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
|
|
|
|
|
<el-scrollbar style="flex: 1">
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="类型" prop="ask_type_id">
|
|
|
|
|
<el-select @change="showAskContentChange" class="width100" v-model="form.ask_type_id" placeholder="请选择类型">
|
|
|
|
|
<el-option v-for="item in selects.ask_types" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="内容" prop="ask_content_id">
|
|
|
|
|
<el-select class="width100" v-model="form.ask_content_id" placeholder="请选择内容">
|
|
|
|
|
<el-option v-for="item in selects.ask_content" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<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="address">
|
|
|
|
|
<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="content">
|
|
|
|
|
<el-input type="textarea" v-model="form.content" placeholder="请填写详情" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="附件" prop="common_inspection_files">
|
|
|
|
|
<el-upload action="/api/admin/upload-file" list-type="picture-card" :file-list="commonInspectionFiles"
|
|
|
|
|
ref="pictureUploads" :auto-upload="true" :data="uploadOther"
|
|
|
|
|
:on-success="handlesuccess">
|
|
|
|
|
<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="feedback_department_id">
|
|
|
|
|
<el-select class="width100" v-model="form.feedback_department_id" placeholder="请选择反馈科室">
|
|
|
|
|
<el-option v-for="item in selects.departments" :key="item.id" :label="item.name"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="resetEditForm('form')">取 消</el-button>
|
|
|
|
|
<el-button type="primary" v-preventReClick @click="submitEditForm('form')">保存</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog :visible.sync="dialogVisible">
|
|
|
|
|
<img width="100%" :src="dialogImageUrl" alt="">
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="通用巡查编辑" :visible.sync="dialogFormVisible" fullscreen width="90%">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="通用巡查编辑" :visible.sync="dialogFormVisible" width="60%">
|
|
|
|
|
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
|
|
|
|
|
<el-scrollbar style="flex: 1">
|
|
|
|
|
<el-form :model="formdetail" :rules="rules" ref="formdetail" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
@ -82,11 +179,38 @@
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="详情" prop="type_id">
|
|
|
|
|
<el-input type="textarea" v-model="form.author" placeholder="请填写详情" autocomplete="off"></el-input>
|
|
|
|
|
<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="formdetail.longitude" placeholder="经度" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
<el-form-item label="纬度" prop="address">
|
|
|
|
|
<el-input disabled="" v-model="formdetail.latitude" placeholder="纬度" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="详情" prop="content">
|
|
|
|
|
{{formdetail.content}}
|
|
|
|
|
<!-- <el-input type="textarea" v-model="formdetail.content" placeholder="请填写详情" autocomplete="off"></el-input> -->
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="附件" prop="common_inspection_files">
|
|
|
|
|
<img v-if="commonInspectionFiles.length>0" v-for="item in commonInspectionFiles" :src="item.files.url" alt="">
|
|
|
|
|
<!-- <el-input type="textarea" v-model="formdetail.content" placeholder="请填写详情" autocomplete="off"></el-input> -->
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="24" v-if="form.status==1">
|
|
|
|
|
<el-form-item label="备注" prop="type_id">
|
|
|
|
|
<el-input type="textarea" v-model="form.author" placeholder="请填写备注" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
@ -124,7 +248,7 @@
|
|
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="resetForm('form')">取 消</el-button>
|
|
|
|
|
<el-button type="primary" v-preventReClick @click="submitForm('form', '2')">上 报</el-button>
|
|
|
|
|
<el-button type="primary" v-preventReClick @click="submitForm('form', '2')">审核</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
@ -140,6 +264,9 @@
|
|
|
|
|
save,
|
|
|
|
|
del
|
|
|
|
|
} from '../../api/commonInspection/index.js'
|
|
|
|
|
import {
|
|
|
|
|
getToken
|
|
|
|
|
} from '@/utils/auth'
|
|
|
|
|
import {
|
|
|
|
|
listdept
|
|
|
|
|
} from "../../api/system/department.js"
|
|
|
|
|
@ -147,17 +274,20 @@
|
|
|
|
|
getparameteritem,
|
|
|
|
|
getparameter
|
|
|
|
|
} from "../../api/system/dictionary.js"
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import AvueMap from 'avue-plugin-map'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
LxHeader
|
|
|
|
|
LxHeader,
|
|
|
|
|
AvueMap
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
|
|
tableHeight: 0,
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
showdialogFormVisible:false,
|
|
|
|
|
formLabelWidth: "120px",
|
|
|
|
|
clientHeight: 0,
|
|
|
|
|
tableData: [],
|
|
|
|
|
@ -175,9 +305,19 @@
|
|
|
|
|
ask_content:[],
|
|
|
|
|
departments:[]
|
|
|
|
|
},
|
|
|
|
|
mapparams:{
|
|
|
|
|
zoom: 11,
|
|
|
|
|
},
|
|
|
|
|
mapform:[] ,
|
|
|
|
|
commonInspectionFiles:[],
|
|
|
|
|
dialogImageUrl:"",
|
|
|
|
|
dialogVisible: false,
|
|
|
|
|
disabled: false,
|
|
|
|
|
formdetail:{
|
|
|
|
|
ask_type_detail:"",
|
|
|
|
|
ask_content_detail:"",
|
|
|
|
|
content:"",
|
|
|
|
|
common_inspection_files:[],
|
|
|
|
|
},
|
|
|
|
|
form: {
|
|
|
|
|
feedback_department_id:"",
|
|
|
|
|
@ -191,7 +331,18 @@
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
|
|
|
|
|
|
ask_type_id: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择类型',
|
|
|
|
|
// 可以单个或者同时写两个触发验证方式
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
}],
|
|
|
|
|
ask_content_id: [{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请选择内容',
|
|
|
|
|
// 可以单个或者同时写两个触发验证方式
|
|
|
|
|
trigger: ['change', 'blur'],
|
|
|
|
|
}]
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
columns: [{
|
|
|
|
|
@ -245,7 +396,7 @@
|
|
|
|
|
{
|
|
|
|
|
field: "操作",
|
|
|
|
|
title: "操作",
|
|
|
|
|
width: 220,
|
|
|
|
|
width: 200,
|
|
|
|
|
type: "opt",
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
@ -272,6 +423,13 @@
|
|
|
|
|
this.initLoad();
|
|
|
|
|
this.load();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
watch:{
|
|
|
|
|
'mapform':function(val){
|
|
|
|
|
this.form.longitude = val[0];
|
|
|
|
|
this.form.latitude = val[1];
|
|
|
|
|
this.form.address = val[2];
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
initLoad() {
|
|
|
|
|
@ -283,6 +441,8 @@
|
|
|
|
|
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
|
|
|
|
that.tableHeight = tableHeight;
|
|
|
|
|
|
|
|
|
|
this.uploadOther.token = getToken();
|
|
|
|
|
|
|
|
|
|
getparameteritem("general_type").then(res => {
|
|
|
|
|
this.selects.ask_types = res.detail
|
|
|
|
|
})
|
|
|
|
|
@ -305,7 +465,9 @@
|
|
|
|
|
keyword: this.searchFields.KeyWord
|
|
|
|
|
}).then(response => {
|
|
|
|
|
for(var m of response.data){
|
|
|
|
|
m.username = m.user.name
|
|
|
|
|
if(m.user){
|
|
|
|
|
m.username = m.user.name
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.tableData = response.data;
|
|
|
|
|
this.paginations.total = response.total;
|
|
|
|
|
@ -318,7 +480,7 @@
|
|
|
|
|
show(obj) {
|
|
|
|
|
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
|
|
|
|
this.dialogViewVisible = false;
|
|
|
|
|
this.dialogShowViewVisible = true;
|
|
|
|
|
this.showdialogFormVisible = true;
|
|
|
|
|
this.info(obj);
|
|
|
|
|
},
|
|
|
|
|
info(obj) {
|
|
|
|
|
@ -326,18 +488,24 @@
|
|
|
|
|
get(obj.id).then(res => {
|
|
|
|
|
let result = Object.assign(that.form, res);
|
|
|
|
|
// this.$set(that.form,res);
|
|
|
|
|
// showAskContent(result.ask_type_id);
|
|
|
|
|
that.showAskContent(result.ask_type_id);
|
|
|
|
|
// that.form = result;
|
|
|
|
|
|
|
|
|
|
that.mapform = [result.longitude,result.latitude,result.address]
|
|
|
|
|
|
|
|
|
|
let _files = [];
|
|
|
|
|
for (var mod of result.common_inspection_files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.name = mod.original_name;
|
|
|
|
|
m.url = mod.files.url
|
|
|
|
|
_files.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.commonInspectionFiles = _files;
|
|
|
|
|
that.formdetail = result;
|
|
|
|
|
that.form = result
|
|
|
|
|
console.log(that.formdetail);
|
|
|
|
|
console.log(that.commonInspectionFiles);
|
|
|
|
|
|
|
|
|
|
// let _files = [];
|
|
|
|
|
// for (var mod of result.files) {
|
|
|
|
|
// let m = Object.assign({}, mod);
|
|
|
|
|
// m.name = mod.original_name;
|
|
|
|
|
// _files.push(m);
|
|
|
|
|
// }
|
|
|
|
|
// that.fileList = _files;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
@ -349,16 +517,7 @@
|
|
|
|
|
if(obj){
|
|
|
|
|
this.info(obj);
|
|
|
|
|
}
|
|
|
|
|
// if (isnew) {
|
|
|
|
|
// var that = this;
|
|
|
|
|
// that.form.content = "";
|
|
|
|
|
// that.info(obj);
|
|
|
|
|
// this.isReportSave = true;
|
|
|
|
|
// } else {
|
|
|
|
|
// this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
|
|
|
|
// this.form.safety_task_id = obj.id;
|
|
|
|
|
// this.isReportSave = false;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
this.dialogFormVisible = true;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -422,6 +581,36 @@
|
|
|
|
|
that.dialogFormVisible = false;
|
|
|
|
|
that.dialogShowViewVisible = false;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
submitEditForm(formName){
|
|
|
|
|
var that = this;
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
console.log(that.form);
|
|
|
|
|
return
|
|
|
|
|
save(that.form).then(response => {
|
|
|
|
|
//console.log(response)
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.load();
|
|
|
|
|
that.showdialogFormVisible = false;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error('数据校验失败');
|
|
|
|
|
console.log('error submit!!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
resetEditForm(formName) {
|
|
|
|
|
var that = this;
|
|
|
|
|
// that.fileList = [];
|
|
|
|
|
this.$refs[formName].resetFields();
|
|
|
|
|
that.mapform = [];
|
|
|
|
|
that.dialogFormVisible = false;
|
|
|
|
|
that.showdialogFormVisible = false;
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
showAskContent(val){
|
|
|
|
|
getparameter({
|
|
|
|
|
@ -429,33 +618,48 @@
|
|
|
|
|
}).then(res =>{
|
|
|
|
|
this.selects.ask_content = res.detail
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
showAskContentChange(val){
|
|
|
|
|
getparameter({
|
|
|
|
|
pid:val
|
|
|
|
|
}).then(res =>{
|
|
|
|
|
this.selects.ask_content = res.detail
|
|
|
|
|
this.form.ask_content_id = ""
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
handleRemove(file) {
|
|
|
|
|
console.log(file);
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
for (var m of file) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push(m.response.id);
|
|
|
|
|
listUrl.push({
|
|
|
|
|
upload_id:m.response.id
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
listUrl.push(m.id);
|
|
|
|
|
listUrl.push({
|
|
|
|
|
upload_id:m.id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.form.file_list = listUrl;
|
|
|
|
|
},
|
|
|
|
|
handleExceed(files, fileList) {},
|
|
|
|
|
beforeRemove(file, fileList) {
|
|
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
|
},
|
|
|
|
|
handlePictureCardPreview(file) {
|
|
|
|
|
this.dialogImageUrl = file.url;
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
handlesuccess(response, file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push(m.response.id);
|
|
|
|
|
else
|
|
|
|
|
listUrl.push(m.id);
|
|
|
|
|
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push({
|
|
|
|
|
upload_id:m.response.id
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
listUrl.push({
|
|
|
|
|
upload_id:m.upload_id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.form.file_list = listUrl;
|
|
|
|
|
this.commonInspectionFiles = listUrl;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|