Files
admin-sjzx/src/views/pqs/supervise/retire/index.vue

193 lines
6.9 KiB
Vue
Raw Normal View History

2024-04-16 08:41:41 +08:00
<template>
<div class="default-main">
<TableHeader area datePicker ref="TableHeaderRef">
<template #select>
<el-form-item label="问题来源">
<el-select v-model="tableStore.table.params.problemSources" clearable placeholder="请选择问题来源">
<el-option
v-for="item in problemData"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="填报进度">
<el-select v-model="tableStore.table.params.reportProcess" clearable placeholder="请选择填报进度">
<el-option
v-for="item in fillingProgress"
:key="item.code"
:label="item.name"
:value="item.code"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon="el-icon-Plus" type="primary" @click="add">新增</el-button>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
2024-04-17 09:44:50 +08:00
<!-- 新增编辑 -->
<Equipment ref="EquipmentRef" />
2024-04-16 08:41:41 +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'
2024-04-17 09:44:50 +08:00
import Equipment from './components/equipment.vue'
2024-04-16 08:41:41 +08:00
import { ElMessage, ElMessageBox } from 'element-plus'
2024-04-17 09:44:50 +08:00
import { deleteIssues } from '@/api/process-boot/electricitymanagement'
2024-04-16 08:41:41 +08:00
import { useDictData } from '@/stores/dictData'
const dictData = useDictData()
const TableHeaderRef = ref()
2024-04-17 09:44:50 +08:00
const EquipmentRef = ref()
2024-04-16 08:41:41 +08:00
const problemData = dictData.getBasicData('Problem_Sources')
const fillingProgress = dictData.getBasicData('Fill_Progress')
const auditStatus = dictData.getBasicData('Audit_Status')
defineOptions({
name: '/Processsupervision/retire'
})
const tableStore: any = new TableStore({
url: '/process-boot/electricityQuality/getIssues',
method: 'POST',
column: [
// { width: '60', type: 'checkbox' },
{
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: '问题新建时间' },
{
field: 'reportProcess',
title: '填报进度',
formatter: (row: any) => {
return fillingProgress.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
field: 'reportProcessStatus',
title: '审核状态',
formatter: (row: any) => {
return auditStatus.filter(item => item.code == row.cellValue)[0]?.name
}
},
{
title: '操作',
width: '180',
render: 'buttons',
buttons: [
{
name: 'edit',
title: '查看',
type: 'primary',
disabled: row => {
return row.reportProcessStatus == 'Init'
},
icon: 'el-icon-Plus',
render: 'basicButton',
2024-04-17 09:44:50 +08:00
click: async row => {}
2024-04-16 08:41:41 +08:00
},
{
name: 'edit',
title: '填报',
disabled: row => {
return (
row.reportProcessStatus == 'Auditt' ||
(row.reportProcess == 'Insights' && row.reportProcessStatus == 'Success') ||
row.reportProcess == 'Archived'
)
},
type: 'primary',
icon: 'el-icon-Plus',
render: 'basicButton',
2024-04-17 09:44:50 +08:00
click: row => {}
2024-04-16 08:41:41 +08:00
},
{
name: 'edit',
title: '归档',
2024-04-17 09:44:50 +08:00
2024-04-16 08:41:41 +08:00
type: 'primary',
icon: 'el-icon-SuccessFilled',
render: 'basicButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定归档?'
},
2024-04-17 09:44:50 +08:00
click: row => {}
2024-04-16 08:41:41 +08:00
},
{
name: 'edit',
title: '审核记录',
type: 'primary',
2024-04-17 09:44:50 +08:00
2024-04-16 08:41:41 +08:00
icon: 'el-icon-PieChart',
render: 'basicButton',
2024-04-17 09:44:50 +08:00
click: row => {}
2024-04-16 08:41:41 +08:00
},
{
name: 'del',
text: '删除',
type: 'danger',
icon: 'el-icon-Delete',
render: 'confirmButton',
popconfirm: {
confirmButtonText: '确认',
cancelButtonText: '取消',
confirmButtonType: 'danger',
title: '确定删除?'
},
2024-04-17 09:44:50 +08:00
2024-04-16 08:41:41 +08:00
click: row => {
deleteIssues(row.powerQualityProblemNo).then(() => {
ElMessage.success('删除成功')
tableStore.index()
})
}
}
]
}
],
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
}
})
tableStore.table.params.problemName = ''
tableStore.table.params.problemSources = ''
tableStore.table.params.reportProcess = ''
tableStore.table.params.reportProcessStatus = ''
provide('tableStore', tableStore)
onMounted(() => {
TableHeaderRef.value.setDatePicker([
{ label: '年', value: 1 },
{ label: '季', value: 2 },
{ label: '月', value: 3 }
])
tableStore.index()
})
// 新增
const add = () => {
2024-04-17 09:44:50 +08:00
EquipmentRef.value.open('新增资产')
2024-04-16 08:41:41 +08:00
}
</script>