2024-05-16 14:00:49 +08:00
|
|
|
<template>
|
|
|
|
|
<!-- <div> 普测结果 发起预告警单</div> -->
|
2024-05-21 16:27:27 +08:00
|
|
|
<TableHeader datePicker ref='TableHeaderRef'>
|
2024-05-16 14:00:49 +08:00
|
|
|
</TableHeader>
|
2024-05-21 16:27:27 +08:00
|
|
|
<Table ref='tableRef' />
|
|
|
|
|
<testQuestionsForm ref='testQuestionsFormRef' />
|
2024-05-16 14:00:49 +08:00
|
|
|
</template>
|
2024-05-21 16:27:27 +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-05-21 16:27:27 +08:00
|
|
|
import { initiateWarningLeaflet } from '@/api/supervision-boot/survey'
|
|
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
|
2024-05-16 14:00:49 +08:00
|
|
|
const tableRef = ref()
|
|
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
const testQuestionsFormRef = ref()
|
|
|
|
|
|
|
|
|
|
const tableStore = new TableStore({
|
2024-05-21 16:27:27 +08:00
|
|
|
url: '/supervision-boot/generalSurvey/pageProblemSubstationBySurvey',
|
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-05-21 16:27:27 +08:00
|
|
|
{ field: 'orgName', title: '单位', minWidth: 120 },
|
|
|
|
|
{ field: 'subName', title: '变电站', minWidth: 120 },
|
|
|
|
|
{ field: 'planName', title: '普测计划名称', minWidth: 120 },
|
|
|
|
|
{ field: 'planCreateTime', title: '计划生成时间', minWidth: 100 },
|
|
|
|
|
{ field: 'planStartTime', title: '计划开始时间', minWidth: 100 },
|
|
|
|
|
{ field: 'planEndTime', title: '计划结束时间', minWidth: 100 },
|
|
|
|
|
{ field: 'planComplateTime', title: '实际完成时间', minWidth: 100 },
|
|
|
|
|
{ field: 'leader', title: '测试负责人', minWidth: 120 },
|
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: [
|
2024-05-21 16:27:27 +08:00
|
|
|
// {
|
|
|
|
|
// name: 'edit',
|
|
|
|
|
// title: '附件预览',
|
|
|
|
|
// type: 'primary',
|
|
|
|
|
// icon: 'el-icon-Open',
|
|
|
|
|
// render: 'confirmButton',
|
|
|
|
|
//
|
|
|
|
|
// click: row => {}
|
|
|
|
|
// },
|
2024-05-16 14:00:49 +08:00
|
|
|
{
|
|
|
|
|
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',
|
|
|
|
|
render: 'confirmButton',
|
2024-05-21 16:27:27 +08:00
|
|
|
disabled: row => {
|
|
|
|
|
return row.initiateWarningFlag == 1
|
|
|
|
|
},
|
|
|
|
|
popconfirm: {
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
confirmButtonType: 'primary',
|
|
|
|
|
title: '请确认发起发起告警单!'
|
|
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
initiateAlarm(row.planNo,row.subId)
|
|
|
|
|
}
|
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',
|
|
|
|
|
render: 'confirmButton',
|
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-16 14:00:49 +08:00
|
|
|
|
2024-05-21 16:27:27 +08:00
|
|
|
}
|
2024-05-16 14:00:49 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
|
|
|
|
tableStore.table.params.currentPage = tableStore.table.params.pageNum
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
2024-05-21 16:27:27 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 发起告警单
|
|
|
|
|
*/
|
|
|
|
|
const initiateAlarm = async (id: string,subId:string) => {
|
|
|
|
|
await initiateWarningLeaflet(id,subId)
|
|
|
|
|
ElMessage.success('发起告警成功!')
|
|
|
|
|
// 加载数据
|
|
|
|
|
tableStore.index()
|
2024-05-16 14:00:49 +08:00
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2024-05-21 16:27:27 +08:00
|
|
|
<style scoped lang='scss'></style>
|