|
|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px"
|
|
|
- @submit.native.prevent>
|
|
|
+ @submit.native.prevent
|
|
|
+ >
|
|
|
<el-form-item label="标题" prop="title">
|
|
|
<el-input
|
|
|
v-model="queryParams.title"
|
|
|
@@ -40,7 +41,8 @@
|
|
|
<template #default="scope">
|
|
|
<span v-if="scope.row.rectified === '0'" class="el-tag el-tag--info el-tag--medium el-tag--light">否</span>
|
|
|
<span v-if="scope.row.rectified === '1'" class="el-tag el-tag--primary el-tag--medium el-tag--light"
|
|
|
- type="warning">是</span>
|
|
|
+ type="warning"
|
|
|
+ >是</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" label="事件状态" prop="status">
|
|
|
@@ -110,7 +112,8 @@
|
|
|
readonly
|
|
|
size="small"
|
|
|
type="date"
|
|
|
- value-format="yyyy-MM-dd">
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ >
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -183,14 +186,16 @@
|
|
|
<el-form-item label="整改前图片" prop="attachPaths">
|
|
|
<ImageUpload v-if="form.attachPaths!=='' && form.attachPaths!==null" ref="ImageUpload"
|
|
|
:fileType="['png', 'jpg', 'jpeg']"
|
|
|
- :isShowTip="false" :value="form.attachPaths"></ImageUpload>
|
|
|
+ :isShowTip="false" :value="form.attachPaths"
|
|
|
+ ></ImageUpload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="整改后图片" prop="rectificationUrl">
|
|
|
<ImageUpload v-if="form.rectificationUrl!=='' && form.rectificationUrl!==null" ref="ImageUpload"
|
|
|
:fileType="['png', 'jpg', 'jpeg']"
|
|
|
- :isShowTip="false" :value="form.rectificationUrl"></ImageUpload>
|
|
|
+ :isShowTip="false" :value="form.rectificationUrl"
|
|
|
+ ></ImageUpload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-form-item label="整改信息" prop="rectificationData">
|
|
|
@@ -234,7 +239,8 @@
|
|
|
:visible.sync="innerVisible"
|
|
|
append-to-body
|
|
|
title="处置"
|
|
|
- width="30%">
|
|
|
+ width="30%"
|
|
|
+ >
|
|
|
<el-form ref="sendForm" :model="sendForm" label-width="130px">
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
@@ -269,7 +275,8 @@
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="现场照片" prop="scenePicture">
|
|
|
<ImageUpload ref="ImageUploads" :fileType="['png', 'jpg', 'jpeg']"
|
|
|
- :isShowTip="false" :limit="1" :value="sendForm.scenePicture" @input="getUrl"></ImageUpload>
|
|
|
+ :isShowTip="false" :limit="1" :value="sendForm.scenePicture" @input="getUrl"
|
|
|
+ ></ImageUpload>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -279,7 +286,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<div v-if="form.rectified==='0' && form.status ==='0'" slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handleConfirm">确认事件</el-button>
|
|
|
+ <el-button type="primary" @click="handleConfirm">上报事件</el-button>
|
|
|
<el-button type="danger" @click="submitForm(2)">无异常</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -292,7 +299,8 @@
|
|
|
<el-timeline-item
|
|
|
v-for="(activity, index) in eventLog"
|
|
|
:key="index"
|
|
|
- :timestamp="activity.createTime" placement="top">
|
|
|
+ :timestamp="activity.createTime" placement="top"
|
|
|
+ >
|
|
|
<div>
|
|
|
<span>{{ activity.createName }}</span>
|
|
|
<br>
|
|
|
@@ -318,13 +326,13 @@ import {
|
|
|
listEvent,
|
|
|
updateEvent,
|
|
|
userDeptSelectIncludeChildren
|
|
|
-} from "@/api/construction/heating/event";
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
+} from '@/api/construction/heating/event'
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
export default {
|
|
|
- name: "Event",
|
|
|
- components: {Treeselect},
|
|
|
+ name: 'Event',
|
|
|
+ components: { Treeselect },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
|
@@ -343,8 +351,8 @@ export default {
|
|
|
eventList: [],
|
|
|
deptOptions: undefined,
|
|
|
// 弹出层标题
|
|
|
- title: "",
|
|
|
- title1: "",
|
|
|
+ title: '',
|
|
|
+ title1: '',
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
innerVisible: false,
|
|
|
@@ -379,73 +387,76 @@ export default {
|
|
|
label: 'label' // 节点显示文本字段名(例如接口返回的是name,则改为name)
|
|
|
},
|
|
|
eventStatusOptions: [
|
|
|
- {value: '0', label: '上报'},
|
|
|
- {value: '1', label: '确认'},
|
|
|
- {value: '2', label: '无异常'},
|
|
|
- {value: '3', label: '办结'},
|
|
|
+ { value: '0', label: '待处置' },
|
|
|
+ { value: '1', label: '确认' },
|
|
|
+ { value: '2', label: '无异常' },
|
|
|
+ { value: '3', label: '办结' },
|
|
|
+ { value: 'event_report', label: '上报' },
|
|
|
+ { value: 'event_completion', label: '办结' },
|
|
|
+ { value: 'event_archiving', label: '归档' }
|
|
|
],
|
|
|
// 表单校验
|
|
|
- rules: {},
|
|
|
- };
|
|
|
+ rules: {}
|
|
|
+ }
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList();
|
|
|
+ this.getList()
|
|
|
this.findParentId()
|
|
|
},
|
|
|
watch: {
|
|
|
filterText(val) {
|
|
|
- this.$refs.deptTree.filter(val);
|
|
|
+ this.$refs.deptTree.filter(val)
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
eventStatusText() {
|
|
|
- const targetOption = this.eventStatusOptions.find(option => option.value === this.form.status);
|
|
|
- return targetOption ? targetOption.label : this.form.status;
|
|
|
+ const targetOption = this.eventStatusOptions.find(option => option.value === this.form.status)
|
|
|
+ return targetOption ? targetOption.label : this.form.status
|
|
|
},
|
|
|
formattedRectified() {
|
|
|
return this.form.rectified === '0' ? '否' :
|
|
|
this.form.rectified === '1' ? '是' :
|
|
|
- '未知状态'; // 处理异常值
|
|
|
+ '未知状态' // 处理异常值
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
handleConfirm() {
|
|
|
if (this.form.deptLists == null || this.form.deptLists.length === 0) {
|
|
|
- this.$modal.msgError("请选择指派部门");
|
|
|
+ this.$modal.msgError('请选择指派部门')
|
|
|
return
|
|
|
}
|
|
|
- this.innerVisible = true;
|
|
|
+ this.innerVisible = true
|
|
|
this.resetFrom()
|
|
|
},
|
|
|
/** 查询巡检任务事件列表 */
|
|
|
getList() {
|
|
|
- this.loading = true;
|
|
|
+ this.loading = true
|
|
|
findParentId(this.$store.state.user.dept.deptId).then(response => {
|
|
|
- this.queryParams.deptId = response.data[0];
|
|
|
+ this.queryParams.deptId = response.data[0]
|
|
|
listEvent(this.queryParams).then(response => {
|
|
|
- this.eventList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- });
|
|
|
+ this.eventList = response.rows
|
|
|
+ this.total = response.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.open = false;
|
|
|
- this.open1 = false;
|
|
|
- this.reset();
|
|
|
+ this.open = false
|
|
|
+ this.open1 = false
|
|
|
+ this.reset()
|
|
|
},
|
|
|
findParentId() {
|
|
|
findParentId(this.$store.state.user.dept.deptId).then(response => {
|
|
|
- const parentId = response.data[0];
|
|
|
- userDeptSelectIncludeChildren({deptId: parentId}).then(response => {
|
|
|
+ const parentId = response.data[0]
|
|
|
+ userDeptSelectIncludeChildren({ deptId: parentId }).then(response => {
|
|
|
this.deptOptions = response.data
|
|
|
})
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
getStatusLabel(status) {
|
|
|
- const option = this.eventStatusOptions.find(option => option.value === status);
|
|
|
- return option ? option.label : status;
|
|
|
+ const option = this.eventStatusOptions.find(option => option.value === status)
|
|
|
+ return option ? option.label : status
|
|
|
},
|
|
|
getStatusType(status) {
|
|
|
const typeMap = {
|
|
|
@@ -453,44 +464,44 @@ export default {
|
|
|
'1': 'primary',
|
|
|
'2': 'success',
|
|
|
'3': 'warning'
|
|
|
- };
|
|
|
- return typeMap[status] || 'info';
|
|
|
+ }
|
|
|
+ return typeMap[status] || 'info'
|
|
|
},
|
|
|
handleDeptSelect(selectedNode, id) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.updateDeptLists();
|
|
|
- });
|
|
|
+ this.updateDeptLists()
|
|
|
+ })
|
|
|
},
|
|
|
handleDeptDeselect(deselectedNode, id) {
|
|
|
this.$nextTick(() => {
|
|
|
- this.updateDeptLists();
|
|
|
- });
|
|
|
+ this.updateDeptLists()
|
|
|
+ })
|
|
|
},
|
|
|
updateDeptLists() {
|
|
|
if (!this.form.deptId || this.form.deptId.length === 0) {
|
|
|
- this.form.deptLists = [];
|
|
|
+ this.form.deptLists = []
|
|
|
}
|
|
|
|
|
|
// 根据选中的部门ID构建部门列表
|
|
|
this.form.deptLists = this.form.deptId.map(deptId => {
|
|
|
- const dept = this.findDeptById(deptId, this.deptOptions);
|
|
|
+ const dept = this.findDeptById(deptId, this.deptOptions)
|
|
|
return {
|
|
|
mapDeptId: deptId,
|
|
|
mapDeptName: dept ? dept.label : '未知部门'
|
|
|
- };
|
|
|
- });
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
findDeptById(id, nodes) {
|
|
|
for (const node of nodes) {
|
|
|
if (node.id === id) {
|
|
|
- return node;
|
|
|
+ return node
|
|
|
}
|
|
|
if (node.children && node.children.length > 0) {
|
|
|
- const found = this.findDeptById(id, node.children);
|
|
|
- if (found) return found;
|
|
|
+ const found = this.findDeptById(id, node.children)
|
|
|
+ if (found) return found
|
|
|
}
|
|
|
}
|
|
|
- return null;
|
|
|
+ return null
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
@@ -509,9 +520,9 @@ export default {
|
|
|
rectified: null,
|
|
|
deptId: [],
|
|
|
deptLists: []
|
|
|
- };
|
|
|
+ }
|
|
|
if (this.$refs.deptTree) {
|
|
|
- this.$refs.deptTree.setCheckedKeys([]);
|
|
|
+ this.$refs.deptTree.setCheckedKeys([])
|
|
|
}
|
|
|
this.sendForm = {
|
|
|
casualty: null,
|
|
|
@@ -519,10 +530,10 @@ export default {
|
|
|
solvingTime: null,
|
|
|
handlingPerson: null,
|
|
|
handlingPersonPhone: null,
|
|
|
- scenePicture: null,
|
|
|
+ scenePicture: null
|
|
|
}
|
|
|
- this.resetForm("form");
|
|
|
- this.resetForm("sendForm");
|
|
|
+ this.resetForm('form')
|
|
|
+ this.resetForm('sendForm')
|
|
|
},
|
|
|
resetFrom() {
|
|
|
this.sendForm = {
|
|
|
@@ -531,19 +542,19 @@ export default {
|
|
|
solvingTime: null,
|
|
|
handlingPerson: null,
|
|
|
handlingPersonPhone: null,
|
|
|
- scenePicture: null,
|
|
|
+ scenePicture: null
|
|
|
}
|
|
|
- this.resetForm("sendForm");
|
|
|
+ this.resetForm('sendForm')
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
+ this.getList()
|
|
|
},
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
+ this.resetForm('queryForm')
|
|
|
+ this.handleQuery()
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
@@ -553,44 +564,45 @@ export default {
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加巡检任务事件";
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = '添加巡检任务事件'
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
+ this.reset()
|
|
|
const id = row.id || this.ids
|
|
|
getEvent(id).then(response => {
|
|
|
this.form = response.data
|
|
|
- this.open = true;
|
|
|
+ this.form.deptId = undefined
|
|
|
+ this.open = true
|
|
|
if (row.rectified === '0' && row.status === '0') {
|
|
|
- this.title = "事件处置";
|
|
|
+ this.title = '事件处置'
|
|
|
} else {
|
|
|
- this.title = "事件详情";
|
|
|
+ this.title = '事件详情'
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
getUrl(url) {
|
|
|
- console.log("getUrl", url)
|
|
|
+ console.log('getUrl', url)
|
|
|
this.sendForm.scenePicture = url
|
|
|
},
|
|
|
//处置记录
|
|
|
getEventLog(row) {
|
|
|
getEventLogByEventId(row.eventId).then(response => {
|
|
|
- this.open1 = true;
|
|
|
- this.title1 = "处置记录";
|
|
|
+ this.open1 = true
|
|
|
+ this.title1 = '处置记录'
|
|
|
this.eventLog = response.data
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm(status) {
|
|
|
this.form.deptList = this.form.deptLists
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (status === 1) {
|
|
|
if (this.form.deptLists == null || this.form.deptLists.length === 0) {
|
|
|
- this.$modal.msgError("请选择指派部门");
|
|
|
+ this.$modal.msgError('请选择指派部门')
|
|
|
return
|
|
|
}
|
|
|
this.form.deptId = null
|
|
|
@@ -602,33 +614,33 @@ export default {
|
|
|
this.form.handlingPersonPhone = this.sendForm.handlingPersonPhone
|
|
|
this.form.scenePicture = this.sendForm.scenePicture
|
|
|
updateEvent(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("事件确认");
|
|
|
- this.open = false;
|
|
|
- this.innerVisible = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.$modal.msgSuccess('事件确认')
|
|
|
+ this.open = false
|
|
|
+ this.innerVisible = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
} else {
|
|
|
this.form.deptId = null
|
|
|
this.form.status = 2
|
|
|
updateEvent(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("事件无异常");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
+ this.$modal.msgSuccess('事件无异常')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除巡检任务事件编号为"' + ids + '"的数据项?').then(function () {
|
|
|
- return delEvent(ids);
|
|
|
+ const ids = row.id || this.ids
|
|
|
+ this.$modal.confirm('是否确认删除巡检任务事件编号为"' + ids + '"的数据项?').then(function() {
|
|
|
+ return delEvent(ids)
|
|
|
}).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
+ this.getList()
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
|
}).catch(() => {
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
@@ -637,5 +649,5 @@ export default {
|
|
|
}, `event_${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
|
}
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|