2024-05-16 14:00:49 +08:00
|
|
|
<template>
|
|
|
|
|
<!-- <div> 普测结果 发起预告警单</div> -->
|
2024-06-19 16:19:57 +08:00
|
|
|
<TableHeader area datePicker nextFlag ref="TableHeaderRef">
|
2024-06-05 15:08:24 +08:00
|
|
|
<template v-slot:select>
|
|
|
|
|
<el-form-item label="计划名称">
|
2024-06-20 16:54:19 +08:00
|
|
|
<el-input
|
|
|
|
|
style="width: 200px"
|
|
|
|
|
v-model="tableStore.table.params.searchValue"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="请输入计划名称"
|
|
|
|
|
></el-input>
|
2024-06-05 15:08:24 +08:00
|
|
|
</el-form-item>
|
|
|
|
|
</template>
|
2024-05-16 14:00:49 +08:00
|
|
|
</TableHeader>
|
2024-06-05 15:08:24 +08:00
|
|
|
<Table ref="tableRef" />
|
|
|
|
|
<testQuestionsForm ref="testQuestionsFormRef" />
|
2024-05-16 14:00:49 +08:00
|
|
|
</template>
|
2024-06-05 15:08:24 +08:00
|
|
|
<script setup lang="ts">
|
2024-05-16 14:00:49 +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 testQuestionsForm from './form/testQuestionsForm.vue'
|
2024-06-04 14:59:10 +08:00
|
|
|
import { initiateWarningLeaflet } from '@/api/supervision-boot/survey/test'
|
2024-06-20 16:54:19 +08:00
|
|
|
import { ElMessage,ElMessageBox } from 'element-plus'
|
2024-05-22 16:30:34 +08:00
|
|
|
import { useRouter } from 'vue-router'
|
2024-06-05 15:08:24 +08:00
|
|
|
import { useDictData } from '@/stores/dictData'
|
|
|
|
|
const dictData = useDictData()
|
2024-05-22 16:30:34 +08:00
|
|
|
const { push } = useRouter()
|
|
|
|
|
const router = useRouter() // 路由对象
|
2024-05-16 14:00:49 +08:00
|
|
|
const tableRef = ref()
|
|
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
const testQuestionsFormRef = ref()
|
|
|
|
|
const tableStore = new TableStore({
|
2024-06-04 14:59:10 +08:00
|
|
|
url: '/supervision-boot/surveyTest/pageProblemSurvey',
|
2024-05-16 14:00:49 +08:00
|
|
|
publicHeight: 65,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
column: [
|
|
|
|
|
{
|
|
|
|
|
title: '序号',
|
|
|
|
|
type: 'seq',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: 60,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-06-19 16:19:57 +08:00
|
|
|
{ field: 'planName', title: '计划名称', minWidth: 120 },
|
2024-06-04 14:59:10 +08:00
|
|
|
{ field: 'deptName', title: '负责单位', minWidth: 120 },
|
|
|
|
|
{ field: 'substationName', title: '变电站', minWidth: 120 },
|
2024-05-21 16:27:27 +08:00
|
|
|
{ field: 'planStartTime', title: '计划开始时间', minWidth: 100 },
|
|
|
|
|
{ field: 'planEndTime', title: '计划结束时间', minWidth: 100 },
|
2024-06-04 14:59:10 +08:00
|
|
|
{ field: 'completeTime', title: '实际完成时间', minWidth: 100 },
|
|
|
|
|
{ field: 'completeBy', title: '测试负责人', minWidth: 120 },
|
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
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-05-16 14:00:49 +08:00
|
|
|
{
|
|
|
|
|
title: '操作',
|
2024-05-21 16:27:27 +08:00
|
|
|
minWidth: '180',
|
2024-05-16 14:00:49 +08:00
|
|
|
align: 'center',
|
|
|
|
|
render: 'buttons',
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
2024-05-21 16:27:27 +08:00
|
|
|
title: '发起告警单',
|
|
|
|
|
type: 'warning',
|
2024-05-16 14:00:49 +08:00
|
|
|
icon: 'el-icon-Open',
|
2024-06-20 16:54:19 +08:00
|
|
|
render: 'basicButton',
|
2024-05-21 16:27:27 +08:00
|
|
|
disabled: row => {
|
|
|
|
|
return row.initiateWarningFlag == 1
|
|
|
|
|
},
|
2024-06-20 16:54:19 +08:00
|
|
|
|
|
|
|
|
click: async row => {
|
|
|
|
|
const { value } = await ElMessageBox.prompt('', '整改意见', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
|
|
|
|
|
inputType: 'textarea',
|
|
|
|
|
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
|
|
|
|
inputErrorMessage: '请输入整改意见'
|
|
|
|
|
})
|
|
|
|
|
initiateWarningLeaflet({ id: row.id, reformAdvice: value }).then(res => {
|
|
|
|
|
ElMessage.success('发起告警成功!')
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
2024-05-21 16:27:27 +08:00
|
|
|
}
|
2024-05-16 14:00:49 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
2024-05-21 16:27:27 +08:00
|
|
|
title: '查看告警单',
|
2024-05-16 14:00:49 +08:00
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-Open',
|
2024-05-22 16:05:51 +08:00
|
|
|
render: 'basicButton',
|
2024-05-21 16:27:27 +08:00
|
|
|
disabled: row => {
|
|
|
|
|
return row.initiateWarningFlag == 0
|
2024-05-16 14:00:49 +08:00
|
|
|
},
|
2024-05-21 16:27:27 +08:00
|
|
|
click: row => {
|
2024-05-22 16:30:34 +08:00
|
|
|
router.push({
|
2024-06-07 14:24:44 +08:00
|
|
|
name: 'supervision/supervision/manage',
|
2024-06-20 16:54:19 +08:00
|
|
|
state: {
|
|
|
|
|
type: 1
|
2024-06-07 14:24:44 +08:00
|
|
|
}
|
2024-06-05 15:08:24 +08:00
|
|
|
})
|
2024-05-21 16:27:27 +08:00
|
|
|
}
|
2024-05-16 14:00:49 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-06-04 14:59:10 +08:00
|
|
|
tableStore.table.params.searchValue = ''
|
2024-05-16 14:00:49 +08:00
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
2024-05-21 16:27:27 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 发起告警单
|
|
|
|
|
*/
|
2024-06-04 14:59:10 +08:00
|
|
|
const initiateAlarm = async (id: string) => {
|
|
|
|
|
await initiateWarningLeaflet(id)
|
2024-05-21 16:27:27 +08:00
|
|
|
ElMessage.success('发起告警成功!')
|
|
|
|
|
// 加载数据
|
|
|
|
|
tableStore.index()
|
2024-05-16 14:00:49 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-06-05 15:08:24 +08:00
|
|
|
<style scoped lang="scss"></style>
|