Files
admin-sjzx/src/views/pqs/supervise/technology/components/alarm.vue

428 lines
16 KiB
Vue
Raw Normal View History

2024-05-15 21:33:54 +08:00
<template>
2024-07-02 19:40:25 +08:00
<TableHeader area datePicker nextFlag theCurrentTime ref="TableHeaderRef">
2024-06-05 16:08:09 +08:00
<template #select>
2024-06-13 13:32:50 +08:00
<el-form-item label="流程状态">
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择流程状态">
2024-06-05 16:08:09 +08:00
<el-option
v-for="item in statusSelect"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</template>
2024-05-15 21:33:54 +08:00
<template #operation>
2024-05-22 16:05:51 +08:00
<!-- <el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>-->
<!-- <el-button icon="el-icon-Delete" type="primary">删除</el-button>-->
<!-- <el-button icon="el-icon-Download" type="primary">导出</el-button>-->
2024-05-15 21:33:54 +08:00
</template>
2024-05-22 16:05:51 +08:00
</TableHeader>
<!--表格-->
2024-06-04 16:54:33 +08:00
<Table ref="tableRef" />
2024-05-22 16:05:51 +08:00
<!--弹框-->
2024-06-04 16:54:33 +08:00
<feedback-popup ref="feedbackPopup" />
2024-07-23 15:03:48 +08:00
<!-- 详情 -->
<el-dialog draggable v-model="dialogVisible" v-if="dialogVisible" title="详情" width="1000">
<detail :id="detailId" />
</el-dialog>
2024-05-15 21:33:54 +08:00
</template>
2024-06-04 16:54:33 +08:00
<script setup lang="ts">
2024-05-15 21:33:54 +08:00
import { ref, onMounted, provide, nextTick } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { ElMessage, ElMessageBox } from 'element-plus'
2024-05-22 16:05:51 +08:00
import FeedbackPopup from '@/views/pqs/supervise/technology/feedbackPopup.vue'
import { useRouter } from 'vue-router'
2024-06-04 16:54:33 +08:00
import { cancelFeedback } from '@/api/supervision-boot/leaflet'
import { useAdminInfo } from '@/stores/adminInfo'
2024-06-05 15:08:24 +08:00
import { useDictData } from '@/stores/dictData'
2024-06-26 16:05:22 +08:00
import { getFileNameAndFilePath } from '@/api/system-boot/file'
2024-07-23 15:03:48 +08:00
import detail from '@/views/pqs/supervise/harmonicSurvey/test/detail.vue'
2024-06-05 15:08:24 +08:00
const dictData = useDictData()
2024-06-05 16:08:09 +08:00
const statusSelect = dictData.statusSelect()
2024-06-04 16:54:33 +08:00
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
2024-05-22 16:05:51 +08:00
const { push } = useRouter()
const feedbackPopup = ref()
2024-05-15 21:33:54 +08:00
const tableRef = ref()
2024-07-23 15:03:48 +08:00
const dialogVisible = ref(false)
const detailId = ref('')
2024-05-15 21:33:54 +08:00
const TableHeaderRef = ref()
const tableStore = new TableStore({
2024-05-21 16:27:27 +08:00
url: '/supervision-boot/warningLeaflet/alarmPageData',
2024-05-15 21:33:54 +08:00
publicHeight: 65,
method: 'POST',
column: [
2024-05-21 16:27:27 +08:00
{
2024-05-15 21:33:54 +08:00
title: '序号',
type: 'seq',
align: 'center',
width: 60,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
2024-05-22 16:05:51 +08:00
{
2024-06-04 16:54:33 +08:00
field: 'problemType',
title: '告警单问题来源',
minWidth: '150',
2024-05-21 16:27:27 +08:00
render: 'tag',
custom: {
1: 'warning',
2: 'warning',
3: 'warning',
4: 'warning'
},
replaceValue: {
1: '技术监督计划',
2: '在线监测超标问题',
3: '用户投诉问题',
4: '试运行监测点问题'
2024-05-21 16:27:27 +08:00
}
},
2024-06-14 16:59:21 +08:00
{ field: 'dutyOrgName', title: '负责单位', minWidth: '150' },
2024-05-21 16:27:27 +08:00
{ field: 'leafletName', title: '单据名称', minWidth: '150' },
{ field: 'issueDetail', title: '告警内容', minWidth: '150' },
{ field: 'reformAdvice', title: '整改意见', minWidth: '150' },
2024-05-22 16:05:51 +08:00
{
2024-06-04 16:54:33 +08:00
field: 'status',
2024-06-13 13:32:50 +08:00
title: '流程状态',
2024-06-04 16:54:33 +08:00
minWidth: '150',
2024-05-21 16:27:27 +08:00
render: 'tag',
custom: {
2024-06-19 19:37:39 +08:00
0: 'warning',
2024-05-21 16:27:27 +08:00
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
2024-05-22 16:05:51 +08:00
5: 'primary'
2024-05-21 16:27:27 +08:00
},
replaceValue: {
2024-06-19 19:37:39 +08:00
0: '待提交审批',
2024-05-21 16:27:27 +08:00
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
2024-06-13 13:32:50 +08:00
5: '新增'
2024-05-21 16:27:27 +08:00
}
},
2024-06-19 11:28:18 +08:00
2024-05-21 16:27:27 +08:00
{ field: 'createTime', title: '创建时间', minWidth: '150' },
2024-06-05 15:08:24 +08:00
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
// {
// title: '报告',
// minWidth: '150',
// align: 'center',
// render: 'buttons',
// fixed: 'right',
// buttons: [
// {
// name: 'productSetting',
// title: '查看报告',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// disabled: row => {
// return !(row.problemType == 2 || row.problemType == 4)
// },
// click: row => {
// if (row.problemType == 2) {
// const match = row.filePath.match(/excelreport(\/[^?#]*)/)
// window.open(window.location.origin + '/#/previewFile?' + match[1])
// } else {
// if (row.problemPath == null) {
// ElMessage({
// message: '暂无报告!',
// type: 'warning'
// })
// } else {
// getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
// // window.open(res.data.url)
// })
// }
// }
// }
// },
// {
// name: 'productSetting',
// title: '报告下载',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// disabled: row => {
// return !(row.problemType == 2 || row.problemType == 4)
// },
// click: row => {
// if (row.problemType == 2) {
// window.open(row.filePath)
// } else {
// if (row.problemPath == null) {
// ElMessage({
// message: '暂无报告!',
// type: 'warning'
// })
// } else {
// getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
// window.open(res.data.url)
// })
// }
// }
// }
// }
// ]
// },
2024-08-07 11:13:46 +08:00
{
title: '操作',
minWidth: '220',
2024-08-07 11:13:46 +08:00
align: 'center',
render: 'buttons',
fixed: 'right',
buttons: [
{
2024-08-07 11:13:46 +08:00
name: 'productSetting',
title: '查看报告',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !(row.problemType == 2 || row.problemType == 4)
},
click: row => {
if (row.problemType == 2) {
const match = row.filePath.match(/excelreport(\/[^?#]*)/)
window.open(window.location.origin + '/#/previewFile?' + match[1])
} else {
if (row.problemPath == null) {
ElMessage({
message: '暂无报告!',
type: 'warning'
})
} else {
window.open(window.location.origin + '/#/previewFile?/' + row.problemPath)
// getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
// // window.open(res.data.url)
// })
2024-08-07 11:13:46 +08:00
}
}
}
},
{
name: 'productSetting',
title: '报告下载',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !(row.problemType == 2 || row.problemType == 4)
},
click: row => {
if (row.problemType == 2) {
window.open(row.filePath)
} else {
if (row.problemPath == null) {
ElMessage({
message: '暂无报告!',
type: 'warning'
})
} else {
getFileNameAndFilePath({ filePath: '/' + row.problemPath }).then(res => {
window.open(res.data.url)
})
}
}
}
},
2024-07-23 15:03:48 +08:00
{
name: 'edit',
title: '查看信息',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
2024-07-25 14:12:34 +08:00
return !row.problemId || row.problemType != 1
2024-07-23 15:03:48 +08:00
},
click: async row => {
dialogVisible.value = true
detailId.value = row.problemId
}
},
2024-05-24 09:49:40 +08:00
{
name: 'productSetting',
title: '发送督办单',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
// handleAudit(row.processInstanceId)
2024-05-29 19:01:34 +08:00
ElMessage.warning('待打通生成管理系统接口!')
2024-05-24 09:49:40 +08:00
}
},
2024-05-15 21:33:54 +08:00
{
name: 'productSetting',
2024-05-22 16:05:51 +08:00
title: '问题反馈',
2024-05-15 21:33:54 +08:00
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
2024-05-21 16:27:27 +08:00
disabled: row => {
2024-07-15 20:34:21 +08:00
return row.dutyOrgId != adminInfo.$state.deptId || row.status !== 5
2024-05-21 16:27:27 +08:00
},
2024-05-15 21:33:54 +08:00
click: row => {
2024-06-20 16:54:19 +08:00
feedbackPopup.value.open(
'填报反馈单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
2024-06-20 16:54:19 +08:00
row.reformAdvice
)
2024-05-15 21:33:54 +08:00
}
},
2024-05-24 09:49:40 +08:00
2024-05-21 16:27:27 +08:00
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
2024-06-20 16:54:19 +08:00
return !row.processInstanceId
2024-05-21 16:27:27 +08:00
},
click: row => {
2024-06-04 16:54:33 +08:00
handleAudit(row.processInstanceId, row.historyInstanceId)
2024-05-21 16:27:27 +08:00
}
},
2024-06-19 19:37:39 +08:00
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
2024-07-15 20:34:21 +08:00
return row.dutyOrgId != adminInfo.$state.deptId || !(row.status == 0)
2024-06-19 19:37:39 +08:00
},
disabled: row => {
return !(row.status == 0)
},
2024-06-19 19:37:39 +08:00
click: row => {
feedbackPopup.value.open(
'编辑',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
2024-06-26 16:05:22 +08:00
row.reformAdvice,
2024-06-19 19:37:39 +08:00
row.takeStep,
row.reportPath
)
}
},
2024-05-15 21:33:54 +08:00
{
name: 'edit',
2024-05-21 16:27:27 +08:00
title: '重新发起',
2024-05-15 21:33:54 +08:00
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
2024-05-21 16:27:27 +08:00
disabled: row => {
2024-06-18 16:38:33 +08:00
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
2024-05-21 16:27:27 +08:00
},
2024-05-15 21:33:54 +08:00
click: row => {
2024-05-22 16:05:51 +08:00
// deviceQuitPopup.value.open('重新发起', row)
2024-06-04 16:54:33 +08:00
feedbackPopup.value.open(
'重新发起告警单',
row.id,
row.status,
row.issueDetail,
row.problemPath,
row.supervisionReport,
2024-06-26 16:05:22 +08:00
row.reformAdvice,
2024-06-04 16:54:33 +08:00
row.takeStep,
2024-06-20 16:54:19 +08:00
row.reportPath,
row.reformAdvice
2024-06-04 16:54:33 +08:00
)
2024-05-15 21:33:54 +08:00
}
},
2024-08-07 11:13:46 +08:00
2024-05-21 16:27:27 +08:00
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
2024-06-04 16:54:33 +08:00
return row.createBy != adminInfo.$state.id || row.status != 1
2024-05-21 16:27:27 +08:00
},
click: row => {
2024-06-04 16:54:33 +08:00
cancelLeave(row)
2024-05-21 16:27:27 +08:00
}
}
2024-05-15 21:33:54 +08:00
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.currentPage = tableStore.table.params.pageNum
}
})
2024-06-04 16:54:33 +08:00
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
2024-06-19 11:28:18 +08:00
inputType: 'textarea',
2024-06-04 16:54:33 +08:00
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFeedback(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
2024-05-15 21:33:54 +08:00
tableStore.table.params.status = ''
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
2024-05-22 16:05:51 +08:00
/** 流程实例详情 */
2024-06-04 16:54:33 +08:00
const handleAudit = (instanceId: any, historyInstanceId: any) => {
2024-05-29 19:01:34 +08:00
push({
name: 'BpmProcessInstanceDetail',
2024-06-04 16:54:33 +08:00
state: {
id: instanceId,
historyInstanceId
2024-05-29 19:01:34 +08:00
}
})
2024-05-22 16:05:51 +08:00
}
2024-05-15 21:33:54 +08:00
</script>
2024-06-04 16:54:33 +08:00
<style scoped lang="scss"></style>