@@ -0,0 +1,34 @@ | |||
import axios from '../api' | |||
/** | |||
* API接口 | |||
*/ | |||
export default { | |||
getAllList(params) { | |||
return axios({ | |||
method: "POST", | |||
url: '/api/front/wateralarm/index', | |||
data:params | |||
}) | |||
}, | |||
cancel(params) { | |||
return axios({ | |||
method: "POST", | |||
url: '/api/front/wateralarm/cancel', | |||
data: params | |||
}) | |||
}, | |||
getDetail(id) { | |||
return axios({ | |||
method: "GET", | |||
url: '/api/front/wateralarm/detail', | |||
params: { | |||
id | |||
} | |||
}) | |||
}, | |||
} |
@@ -0,0 +1,117 @@ | |||
<template> | |||
<el-dialog :close-on-press-escape="false" :close-on-click-modal="false" ref="assignDialog" | |||
top="5vh" center title="指派" | |||
class="assign-dialog" :visible.sync="visible"> | |||
<el-form ref="ruleForm" :model="ruleForm" size="small" label-width="100px" | |||
class="form"> | |||
<el-form-item label="责任人" prop="assignUser" | |||
:rules="{ | |||
required: true, message: '责任人不能为空', trigger: 'change' | |||
}"> | |||
<el-select @change="assignUserClick" clearable filterable v-model="ruleForm.assignUser"> | |||
<el-option :key="index" :value="item.id" :label="item.realname" | |||
v-for="(item,index) in userList"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="联系方式" prop="assignContact"> | |||
<el-input :disabled="true" v-model="ruleForm.assignContact"></el-input> | |||
</el-form-item> | |||
<el-form-item label="备注" prop="assignNote"> | |||
<el-input | |||
rows="4" | |||
type="textarea" | |||
placeholder="备注" | |||
v-model="ruleForm.assignNote" | |||
maxlength="99" | |||
show-word-limit | |||
> | |||
</el-input> | |||
</el-form-item> | |||
</el-form> | |||
<span slot="footer" class="dialog-footer no-print"> | |||
<el-button :loading="submitLoading" @click="assignSubmit('ruleForm')" type="primary" size="medium" | |||
icon="el-icon-printer">指派</el-button> | |||
<el-button size="medium" icon="el-icon-back" | |||
@click="$emit('goBack')">返回 | |||
</el-button> | |||
</span> | |||
</el-dialog> | |||
</template> | |||
<script> | |||
import api from "@/api/question/list"; | |||
import adminApi from '@/api/permission/admin' | |||
export default { | |||
name: "assignDialog", | |||
data() { | |||
return { | |||
submitLoading:false, | |||
userList:[] | |||
} | |||
}, | |||
mounted(){ | |||
this.getUserAdminList() | |||
}, | |||
props:{ | |||
visible:{ | |||
type:Boolean, | |||
default(){ | |||
return false | |||
} | |||
}, | |||
ruleForm:{ | |||
type:Object, | |||
default(){ | |||
return {} | |||
} | |||
} | |||
}, | |||
methods:{ | |||
assignUserClick() { | |||
let ruleForm = JSON.parse(JSON.stringify(this.ruleForm)) | |||
if (ruleForm.assignUser) { | |||
let child = this.userList.find(item => item.id == ruleForm.assignUser) | |||
if (child) { | |||
ruleForm.assignContact = child.mobile | |||
} | |||
} else { | |||
ruleForm.assignContact = '' | |||
} | |||
this.ruleForm = Object.assign({}, ruleForm) | |||
}, | |||
getUserAdminList() { | |||
adminApi.getUserAdminList().then(res => { | |||
this.userList = res.data ? res.data : [] | |||
}).catch(err => { | |||
this.userList = [] | |||
}); | |||
}, | |||
assignSubmit(formName) { | |||
this.$refs[formName].validate((valid) => { | |||
if (valid) { | |||
this.submitLoading = true | |||
api.assign(this.ruleForm).then(res => { | |||
this.$message({ | |||
type: 'success', | |||
message: '指派成功!' | |||
}) | |||
this.submitLoading = false | |||
this.$emit('submitSuccess') | |||
}).catch(err => { | |||
this.submitLoading = false | |||
}); | |||
} | |||
}) | |||
}, | |||
} | |||
} | |||
</script> | |||
<style lang="less"> | |||
.assign-dialog{ | |||
.el-dialog { | |||
width: 500px !important; | |||
} | |||
} | |||
</style> |
@@ -655,6 +655,7 @@ | |||
position: absolute; | |||
top: 0rem; | |||
width: 100%; | |||
height: 1rem; | |||
} | |||
.box-header-title { |
@@ -142,6 +142,7 @@ | |||
.img-title{ | |||
position: absolute; | |||
width: 2.54rem; | |||
height: 1.2rem; | |||
top: 1.13rem; | |||
left: 2.4rem; | |||
} |
@@ -166,43 +166,6 @@ | |||
<el-button size="medium" icon="el-icon-back" @click="visible=false">返回</el-button> | |||
</div> | |||
</el-drawer> | |||
<el-dialog v-if="assignVisible" :close-on-press-escape="false" :close-on-click-modal="false" ref="assignDialog" | |||
top="5vh" center title="指派" | |||
class="assign-dialog" :visible.sync="assignVisible"> | |||
<el-form ref="ruleForm" :model="ruleForm" size="small" label-width="100px" | |||
class="form"> | |||
<el-form-item label="责任人" prop="assignUser" | |||
:rules="{ | |||
required: true, message: '责任人不能为空', trigger: 'change' | |||
}"> | |||
<el-select @change="assignUserClick" clearable filterable v-model="ruleForm.assignUser"> | |||
<el-option :key="index" :value="item.id" :label="item.realname" | |||
v-for="(item,index) in userList"></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="联系方式" prop="assignContact"> | |||
<el-input :disabled="true" v-model="ruleForm.assignContact"></el-input> | |||
</el-form-item> | |||
<el-form-item label="备注" prop="assignNote"> | |||
<el-input | |||
rows="4" | |||
type="textarea" | |||
placeholder="备注" | |||
v-model="ruleForm.assignNote" | |||
maxlength="99" | |||
show-word-limit | |||
> | |||
</el-input> | |||
</el-form-item> | |||
</el-form> | |||
<span slot="footer" class="dialog-footer no-print"> | |||
<el-button :loading="submitLoading" @click="assignSubmit('ruleForm')" type="primary" size="medium" | |||
icon="el-icon-printer">指派</el-button> | |||
<el-button size="medium" icon="el-icon-back" | |||
@click="assignVisible = false">返回 | |||
</el-button> | |||
</span> | |||
</el-dialog> | |||
<el-dialog v-if="signVisible" :close-on-press-escape="false" :close-on-click-modal="false" ref="signDialog" | |||
top="5vh" center title="标记完成" | |||
class="sign-dialog" :visible.sync="signVisible"> | |||
@@ -259,23 +222,29 @@ | |||
</el-button> | |||
</span> | |||
</el-dialog> | |||
<assignDialog v-if="assignVisible" | |||
:visible="assignVisible" | |||
:ruleForm="ruleForm" | |||
@submitSuccess="assignVisible=false;getAllList()" | |||
@goBack="assignVisible=false" | |||
> | |||
</assignDialog> | |||
</div> | |||
</template> | |||
<script> | |||
import api from "@/api/question/list"; | |||
import adminApi from '@/api/permission/admin' | |||
import driverAreaSelect from "@/components/driverAreaSelect"; | |||
import detailDialog from "./detailDialog"; | |||
import {mapGetters} from "vuex"; | |||
import uploadImage from '@/components/uploadImage' | |||
import assignDialog from '@/components/assignDialog' | |||
export default { | |||
name: "problem-container", | |||
data() { | |||
return { | |||
handleVisible:false, | |||
handleVisible: false, | |||
signVisible: false, | |||
submitLoading: false, | |||
assignVisible: false, | |||
@@ -306,7 +275,7 @@ | |||
ids: '' | |||
}; | |||
}, | |||
components: {driverAreaSelect, detailDialog,uploadImage}, | |||
components: {driverAreaSelect, detailDialog, uploadImage, assignDialog}, | |||
computed: { | |||
...mapGetters(["btnRule", "info"]) | |||
}, | |||
@@ -324,20 +293,19 @@ | |||
mounted() { | |||
this.tableLoading = true; | |||
let me = this; | |||
this.getUserAdminList() | |||
me.getAllList(); | |||
}, | |||
watch: {}, | |||
methods: { | |||
handle(row){ | |||
handle(row) { | |||
this.ruleForm = { | |||
id: row.id + '', | |||
handlerImage: [], | |||
handlerResult:'' | |||
handlerResult: '' | |||
} | |||
this.handleVisible = true | |||
}, | |||
handleSubmit(formName){ | |||
handleSubmit(formName) { | |||
this.$refs[formName].validate((valid) => { | |||
if (valid) { | |||
this.submitLoading = true | |||
@@ -355,7 +323,7 @@ | |||
} | |||
}) | |||
}, | |||
signSubmit(formName){ | |||
signSubmit(formName) { | |||
this.$refs[formName].validate((valid) => { | |||
if (valid) { | |||
this.submitLoading = true | |||
@@ -378,7 +346,7 @@ | |||
let ids = [] | |||
this.multipleSelection.map(item => { | |||
ids.push(item.id) | |||
if (item.status != 1&&item.status != 2) { | |||
if (item.status != 1 && item.status != 2) { | |||
bl = false | |||
} | |||
}) | |||
@@ -419,36 +387,6 @@ | |||
this.assignVisible = true | |||
} | |||
}, | |||
assignSubmit(formName) { | |||
this.$refs[formName].validate((valid) => { | |||
if (valid) { | |||
this.submitLoading = true | |||
api.assign(this.ruleForm).then(res => { | |||
this.$message({ | |||
type: 'success', | |||
message: '指派成功!' | |||
}) | |||
this.submitLoading = false | |||
this.assignVisible = false | |||
this.getAllList() | |||
}).catch(err => { | |||
this.submitLoading = false | |||
}); | |||
} | |||
}) | |||
}, | |||
assignUserClick() { | |||
let ruleForm = JSON.parse(JSON.stringify(this.ruleForm)) | |||
if (ruleForm.assignUser) { | |||
let child = this.userList.find(item => item.id == ruleForm.assignUser) | |||
if (child) { | |||
ruleForm.assignContact = child.mobile | |||
} | |||
} else { | |||
ruleForm.assignContact = '' | |||
} | |||
this.ruleForm = Object.assign({}, ruleForm) | |||
}, | |||
sign(row) { | |||
this.ruleForm = { | |||
id: row.id + '', | |||
@@ -465,13 +403,6 @@ | |||
} | |||
this.assignVisible = true | |||
}, | |||
getUserAdminList() { | |||
adminApi.getUserAdminList().then(res => { | |||
this.userList = res.data ? res.data : [] | |||
}).catch(err => { | |||
this.userList = [] | |||
}); | |||
}, | |||
handleSelectionChange(val) { | |||
this.multipleSelection = val; | |||
}, | |||
@@ -542,12 +473,13 @@ | |||
color: #333 !important; | |||
} | |||
.assign-dialog, .sign-dialog{ | |||
.sign-dialog { | |||
.el-dialog { | |||
width: 500px !important; | |||
} | |||
} | |||
.handle-dialog{ | |||
.handle-dialog { | |||
.el-dialog { | |||
width: 60% !important; | |||
} |
@@ -0,0 +1,296 @@ | |||
<template> | |||
<div class="water-alarm"> | |||
<el-form :inline="true" :model="searchParam" class="demo-form-inline"> | |||
<el-form-item label="预警编号"> | |||
<el-input | |||
clearable | |||
v-model="searchParam.alarmSn" | |||
size="small" | |||
placeholder="请输入任务单号" | |||
style="width: 150px" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="区划"> | |||
<driverAreaSelect style="width: 150px" v-model="searchParam.driverArea"></driverAreaSelect> | |||
</el-form-item> | |||
<el-form-item label="河湖名称"> | |||
<el-input | |||
clearable | |||
v-model="searchParam.driverName" | |||
size="small" | |||
placeholder="请输入河道名称" | |||
style="width: 150px" | |||
/> | |||
</el-form-item> | |||
<el-form-item label="日期"> | |||
<el-date-picker | |||
style="width: 220px" | |||
placeholder="日期" | |||
clearable | |||
size="small" | |||
value-format="yyyy-MM-dd" | |||
v-model="searchParam.time" | |||
type="daterange" | |||
range-separator="至" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期" | |||
></el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="状态"> | |||
<el-select | |||
clearable | |||
v-model="searchParam.status" | |||
size="small" | |||
placeholder="-请选择-" | |||
> | |||
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.id"/> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item> | |||
<el-button | |||
:loading="tableLoading" | |||
icon="el-icon-search" | |||
@click="search" | |||
size="small" | |||
type="primary" | |||
>搜索 | |||
</el-button> | |||
<el-button | |||
icon="el-icon-refresh-right" | |||
@click="initSearchParam();search()" | |||
type="primary" | |||
size="small" | |||
style="background-color: #fff; border: 1px solid #ccc ; color: #666" | |||
>清空 | |||
</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<el-table | |||
stripe | |||
ref="table" | |||
:height="tableHeight" | |||
v-loading="tableLoading" | |||
:data="dataList" | |||
border | |||
size="medium" | |||
row-key="id" | |||
> | |||
<el-table-column :index="indexMethod" label="序号" type="index" width="80" align="center"/> | |||
<el-table-column | |||
min-width="100" | |||
show-overflow-tooltip | |||
prop="alarmSn" | |||
label="报警编号" | |||
align="center" | |||
></el-table-column> | |||
<el-table-column min-width="100" show-overflow-tooltip prop="driverAreaName" label="区划" align="center"/> | |||
<el-table-column min-width="100" show-overflow-tooltip prop="driverName" label="河湖名称" align="center"/> | |||
<el-table-column | |||
min-width="120" | |||
show-overflow-tooltip | |||
prop="inspectTime" | |||
label="巡检日期" | |||
align="center" | |||
/> | |||
<el-table-column show-overflow-tooltip prop="alarmStandard" label="水质标准" align="center" min-width="100"/> | |||
<el-table-column show-overflow-tooltip prop="alarmInfo" label="报警信息" align="center" min-width="100"> | |||
<template slot-scope="{row}"> | |||
<span style="color: red">{{row.alarmInfo}}</span> | |||
</template> | |||
</el-table-column> | |||
<el-table-column show-overflow-tooltip prop="statusName" label="状态" align="center" min-width="90"/> | |||
<el-table-column show-overflow-tooltip prop="alarmTime" label="报警时间" align="center" min-width="160"> | |||
</el-table-column> | |||
<el-table-column label="操作" align="left" width="230"> | |||
<template slot-scope="{row}"> | |||
<el-button | |||
v-if="btnRule.wateralarm_detail" | |||
@click="detail(row)" | |||
type="primary" | |||
size="mini" | |||
icon="el-icon-document" | |||
>详情 | |||
</el-button> | |||
<el-button v-if="btnRule.inspectquestion_assign&&row.status==2" type="primary" size="mini" | |||
icon="el-icon-s-operation" @click="assign(row)">指派 | |||
</el-button> | |||
<el-button | |||
v-if="btnRule.wateralarm_cancel&&row.status==2" | |||
@click="edit(row)" | |||
type="warning" | |||
size="mini" | |||
icon="el-icon-s-check" | |||
>取消报警 | |||
</el-button> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
<div class="page-current"> | |||
<el-pagination | |||
:current-page="currentPage" | |||
:page-size="pageSize" | |||
prev-text="上一页" | |||
next-text="下一页" | |||
background | |||
layout="total, prev, pager, next, jumper" | |||
style="display: inline-block;" | |||
:total="count" | |||
@current-change="handleCurrentChange" | |||
/> | |||
</div> | |||
<infoForm | |||
:data="dataChild" | |||
@handleClose="visible=false" | |||
v-if="visible" | |||
:visible="visible" | |||
> | |||
</infoForm> | |||
<assignDialog v-if="assignVisible" | |||
:visible="assignVisible" | |||
:ruleForm="ruleForm" | |||
@submitSuccess="assignVisible=false;getAllList()" | |||
@goBack="assignVisible=false" | |||
> | |||
</assignDialog> | |||
</div> | |||
</template> | |||
<script> | |||
import api from "@/api/water/waterAlarm"; | |||
import driverAreaSelect from "@/components/driverAreaSelect"; | |||
import infoForm from './infoForm' | |||
import {mapGetters} from "vuex"; | |||
import assignDialog from '@/components/assignDialog' | |||
export default { | |||
name: "water-alarm", | |||
data() { | |||
return { | |||
assignVisible:false, | |||
ruleForm:{}, | |||
statusList: [ | |||
{id: 1, name: '未报警'}, | |||
{id: 2, name: '已报警'}, | |||
{id: 3, name: '已取消'}, | |||
{id: 4, name: '处理中'}, | |||
{id: 5, name: '处理完成'}, | |||
], | |||
dataChild: {}, | |||
visible: false, | |||
dataList: [], | |||
currentPage: 1, | |||
count: 0, | |||
pageSize: parseInt((document.body.clientHeight - 300 - 43) / 47), | |||
tableHeight: document.body.clientHeight - 300, | |||
tableLoading: false, | |||
searchParam: { | |||
alarmSn: "", | |||
driverName: "", | |||
driverArea: "", | |||
time: "", | |||
status: '' | |||
} | |||
}; | |||
}, | |||
computed: { | |||
...mapGetters(["btnRule"]) | |||
}, | |||
components: {driverAreaSelect, infoForm,assignDialog}, | |||
created() { | |||
}, | |||
mounted() { | |||
this.tableLoading = true; | |||
this.getAllList(); | |||
}, | |||
methods: { | |||
assign(row) { | |||
this.ruleForm = { | |||
id: row.id + '', | |||
assignUser: '', | |||
assignContact: '', | |||
assignNote: '' | |||
} | |||
this.assignVisible = true | |||
}, | |||
detail(row){ | |||
this.tableLoading = true; | |||
api.getDetail(row.id).then(res => { | |||
this.dataChild=res.data | |||
this.visible=true | |||
this.tableLoading = false; | |||
}).catch(e => { | |||
this.tableLoading = false; | |||
}); | |||
}, | |||
edit(row) { | |||
this.$confirm("确定要信息报警吗", "提示", { | |||
confirmButtonText: "确定", | |||
cancelButtonText: "取消", | |||
type: "warning" | |||
}).then(() => { | |||
this.tableLoading = true; | |||
api.edit({id: row.id, status: 2}).then(res => { | |||
this.$message({ | |||
type: "success", | |||
message: "操作成功" | |||
}); | |||
this.getAllList(); | |||
}).catch(e => { | |||
this.tableLoading = false; | |||
}); | |||
}); | |||
}, | |||
indexMethod(index) { | |||
return index + 1 + (this.currentPage - 1) * this.pageSize; | |||
}, | |||
initSearchParam() { | |||
this.searchParam = { | |||
alarmSn: "", | |||
driverName: "", | |||
driverArea: "", | |||
time: "", | |||
status: '' | |||
}; | |||
}, | |||
search() { | |||
this.currentPage = 1; | |||
this.tableLoading = true; | |||
this.$refs.table.bodyWrapper.scrollTop = 0; | |||
this.getAllList(); | |||
}, | |||
handleCurrentChange(val) { | |||
this.currentPage = val; | |||
this.$refs.table.bodyWrapper.scrollTop = 0; | |||
this.getAllList(); | |||
}, | |||
getAllList() { | |||
this.tableLoading = true; | |||
let searchParam = JSON.parse(JSON.stringify(this.searchParam)); | |||
if (searchParam.alarmTime && searchParam.alarmTime.length > 0) { | |||
searchParam.alarmTime = searchParam.time[0]+'~'+searchParam.time[1]; | |||
}else{ | |||
searchParam.alarmTime='' | |||
} | |||
searchParam.page = this.currentPage; | |||
searchParam.pageSize = this.pageSize; | |||
api.getAllList(searchParam).then(res => { | |||
this.dataList = res.data.records ? res.data.records : []; | |||
this.count = res.data.total; | |||
this.tableLoading = false; | |||
}).catch(e => { | |||
this.dataList = []; | |||
this.tableLoading = false; | |||
}); | |||
} | |||
} | |||
}; | |||
</script> | |||
<style lang="less"> | |||
.water-alarm { | |||
height: fit-content; | |||
background-color: #fff; | |||
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), 0 0 6px 0 rgba(0, 0, 0, 0.04); | |||
padding: 15px; | |||
} | |||
</style> |
@@ -0,0 +1,92 @@ | |||
<template> | |||
<el-drawer | |||
title="详情" | |||
:visible.sync="visible" | |||
direction="rtl" | |||
:size="drawerWidth" | |||
:before-close="handleClose" | |||
> | |||
<div class="info-form"> | |||
<el-form ref="ruleForm" :model="ruleForm" size="small" label-width="80px"> | |||
<el-form-item label="河湖名称" prop="inspectNo"> | |||
<el-input :disabled="true" clearable v-model="ruleForm.driverName" size="small"/> | |||
</el-form-item> | |||
<el-form-item label="巡检时间" prop="driverName"> | |||
<el-input :disabled="true" clearable v-model="ruleForm.inspectTime" size="small"/> | |||
</el-form-item> | |||
<el-form-item label="水质标准" prop="alarmStandard"> | |||
<el-input :disabled="true" clearable v-model="ruleForm.alarmStandard" size="small"/> | |||
</el-form-item> | |||
</el-form> | |||
<el-table | |||
stripe | |||
ref="table" | |||
:data="ruleForm.waterAlarmInfoList" | |||
border | |||
size="small" | |||
row-key="id" | |||
> | |||
<el-table-column label="序号" type="index" width="80" align="center"/> | |||
<el-table-column | |||
min-width="100" | |||
show-overflow-tooltip | |||
prop="name" | |||
label="参数名称" | |||
align="center" | |||
></el-table-column> | |||
<el-table-column min-width="100" show-overflow-tooltip prop="standardValue" label="标准值" align="center"/> | |||
<el-table-column min-width="100" show-overflow-tooltip prop="measuredValue" label="实测值" align="center"/> | |||
<el-table-column show-overflow-tooltip prop="measuredStandard" label="实测标准" align="center" min-width="100"/> | |||
<el-table-column show-overflow-tooltip prop="exceedStandard" label="超标情况" align="center" min-width="160"> | |||
</el-table-column> | |||
</el-table> | |||
<div style="text-align: center;margin-top: 15px"> | |||
<el-button | |||
icon="el-icon-back" | |||
style="margin-left: 15px" | |||
size="medium" | |||
@click="handleClose" | |||
>返回 | |||
</el-button> | |||
</div> | |||
</div> | |||
</el-drawer> | |||
</template> | |||
<script> | |||
export default { | |||
name: "info-form", | |||
data() { | |||
return { | |||
drawerWidth: document.body.clientWidth - 190 + "px", | |||
ruleForm: {}, | |||
}; | |||
}, | |||
props: { | |||
visible: { | |||
type: Boolean, | |||
default() { | |||
return false; | |||
} | |||
}, | |||
data: { | |||
type: Object, | |||
default() { | |||
return {}; | |||
} | |||
} | |||
}, | |||
components: {}, | |||
created() { | |||
this.ruleForm = JSON.parse(JSON.stringify(this.data)); | |||
}, | |||
mounted() { | |||
}, | |||
methods: { | |||
handleClose() { | |||
this.$emit("handleClose"); | |||
} | |||
} | |||
}; | |||
</script> |