Files
admin-sjzx/src/views/pqs/supervise/electricalEnergy/components/maintenance.vue

256 lines
9.2 KiB
Vue
Raw Normal View History

2024-03-12 16:15:45 +08:00
<template>
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
2024-04-02 16:43:18 +08:00
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
2024-03-12 16:15:45 +08:00
<el-option
2024-03-18 19:43:55 +08:00
v-for="item in problemData"
2024-04-02 16:43:18 +08:00
:key="item.code"
2024-03-18 19:43:55 +08:00
:label="item.name"
2024-04-02 16:43:18 +08:00
:value="item.code"
2024-03-12 16:15:45 +08:00
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
2024-04-02 16:43:18 +08:00
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
2024-03-12 16:15:45 +08:00
<el-option
2024-03-18 19:43:55 +08:00
v-for="item in fillingProgress"
:key="item.code"
2024-03-18 19:43:55 +08:00
:label="item.name"
:value="item.code"
2024-03-12 16:15:45 +08:00
></el-option>
</el-select>
</el-form-item>
2024-04-18 14:54:35 +08:00
<el-form-item label="状态">
<el-select v-model="tableStore.table.params.reportProcessStatus" clearable placeholder="请选择状态">
2024-03-12 16:15:45 +08:00
<el-option
2024-03-18 19:43:55 +08:00
v-for="item in auditStatus"
:key="item.code"
2024-03-18 19:43:55 +08:00
:label="item.name"
:value="item.code"
2024-03-12 16:15:45 +08:00
></el-option>
</el-select>
</el-form-item>
<el-form-item label="问题名称">
2024-03-18 19:43:55 +08:00
<el-input
v-model="tableStore.table.params.problemName"
clearable
placeholder="请填写问题名称"
style="width: 100%"
></el-input>
2024-03-12 16:15:45 +08:00
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
2024-03-12 16:15:45 +08:00
</template>
</TableHeader>
<Table ref="tableRef" />
<!-- 新增 -->
2024-04-07 16:40:16 +08:00
<NewlyAdd v-if="showNewlyAdded" @handleClose="handleClose" @onSubmit="beforeClose" />
2024-03-18 19:43:55 +08:00
<!-- 填报 -->
2024-04-03 16:24:14 +08:00
<el-dialog draggable title="填报" v-model="dialogVisible" width="1400px" :before-close="beforeClose">
<Filling ref="FillingRef" v-if="dialogVisible" @beforeClose="beforeClose" />
2024-04-03 16:24:14 +08:00
</el-dialog>
2024-03-18 19:43:55 +08:00
<!-- 详情 -->
<Detail ref="detailRef" />
<!-- 审核记录 -->
<recording ref="recordingRef" />
2024-03-12 16:15:45 +08:00
</template>
<script setup lang="ts">
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-04-07 16:40:16 +08:00
import { deleteIssues, archive } from '@/api/process-boot/electricitymanagement'
2024-03-12 16:15:45 +08:00
import { useDictData } from '@/stores/dictData'
import NewlyAdd from './NewlyAdd.vue'
2024-03-18 19:43:55 +08:00
import Filling from './filling.vue'
import Detail from './detail.vue'
import recording from './recording.vue'
2024-03-12 16:15:45 +08:00
const dictData = useDictData()
2024-03-18 19:43:55 +08:00
const FillingRef = ref()
2024-03-12 16:15:45 +08:00
const showNewlyAdded = ref(false)
2024-04-03 16:24:14 +08:00
const dialogVisible = ref(false)
const recordingRef = ref(false)
2024-03-12 16:15:45 +08:00
const TableHeaderRef = ref()
2024-03-18 19:43:55 +08:00
const detailRef = ref()
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
2024-03-12 16:15:45 +08:00
publicHeight: 65,
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
2024-03-12 16:15:45 +08:00
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'orgName', title: '所属单位' },
{
field: 'problemSources',
title: '问题来源'
},
{ field: 'powerQualityProblemNo', title: '问题编号' },
{ field: 'problemName', title: '问题名称' },
{ field: 'dataDate', title: '问题新建时间' },
{
2024-04-02 16:43:18 +08:00
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
2024-04-18 14:54:35 +08:00
title: '状态',
2024-04-02 16:43:18 +08:00
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
2024-04-07 16:40:16 +08:00
width: '180',
2024-03-12 16:15:45 +08:00
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
2024-04-07 16:40:16 +08:00
disabled: row => {
return row.reportProcessStatus == 'Init'
},
2024-03-12 16:15:45 +08:00
icon: 'el-icon-Plus',
render: 'basicButton',
2024-03-18 19:43:55 +08:00
click: async row => {
detailRef.value.open(row)
}
},
2024-04-02 16:43:18 +08:00
{
name: 'edit',
title: '填报',
disabled: row => {
2024-04-03 16:24:14 +08:00
return (
row.reportProcessStatus == 'Auditt' ||
2024-04-07 16:40:16 +08:00
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
2024-04-03 16:24:14 +08:00
)
2024-04-02 16:43:18 +08:00
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
click: row => {
2024-04-03 16:24:14 +08:00
dialogVisible.value = true
setTimeout(() => {
FillingRef.value.open(row)
}, 10)
2024-04-02 16:43:18 +08:00
}
},
2024-04-07 16:40:16 +08:00
{
name: 'edit',
title: '归档',
disabled: row => {
return !(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success')
},
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
click: row => {
archive(row.powerQualityProblemNo).then(() => {
ElMessage.success('归档成功!')
tableStore.index()
})
}
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-PieChart',
render: 'basicButton',
click: row => {
recordingRef.value.open(row)
}
2024-04-07 16:40:16 +08:00
},
2024-03-18 19:43:55 +08:00
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
2024-04-07 16:40:16 +08:00
disabled: row => {
return row.reportProcess == 'Archived'
},
2024-03-18 19:43:55 +08:00
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
2024-03-12 16:15:45 +08:00
}
]
}
2024-04-02 16:43:18 +08:00
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.dataDate = tableStore.table.params.searchBeginTime
tableStore.table.params.dataType = TableHeaderRef.value.datePickerRef.interval
}
2024-03-12 16:15:45 +08:00
})
2024-03-18 19:43:55 +08:00
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
2024-03-12 16:15:45 +08:00
provide('tableStore', tableStore)
onMounted(() => {
2024-03-18 19:43:55 +08:00
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
2024-04-02 16:43:18 +08:00
tableStore.index()
2024-03-12 16:15:45 +08:00
})
// 新增
const add = () => {
showNewlyAdded.value = true
}
2024-04-02 16:43:18 +08:00
// 关闭弹框
const handleClose = () => {
showNewlyAdded.value = false
}
2024-04-03 16:24:14 +08:00
// 关闭 填报
const beforeClose = () => {
dialogVisible.value = false
tableStore.index()
}
2024-03-12 16:15:45 +08:00
</script>