2024-05-21 16:36:17 +08:00
|
|
|
<!---技术监督计划-->
|
2024-05-20 18:48:48 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="default-main">
|
2024-05-21 16:36:17 +08:00
|
|
|
<TableHeader area datePicker ref="TableHeaderRef">
|
2024-06-05 14:34:23 +08:00
|
|
|
<template #select>
|
|
|
|
|
<el-form-item label="审核状态">
|
|
|
|
|
<el-select v-model="tableStore.table.params.status" clearable placeholder="请选择审核状态">
|
|
|
|
|
<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-21 16:36:17 +08:00
|
|
|
<template #operation>
|
|
|
|
|
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
|
|
|
|
|
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
|
|
|
|
|
</template>
|
|
|
|
|
</TableHeader>
|
|
|
|
|
<Table ref="tableRef" />
|
|
|
|
|
<!-- 新增弹框 -->
|
|
|
|
|
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
|
|
|
|
|
<!-- 实施问题弹框 -->
|
|
|
|
|
<effectProblem
|
|
|
|
|
ref="effectProblemList"
|
|
|
|
|
@onSubmit="tableStore.index()"
|
|
|
|
|
:effectProblemForm="effectProblemForm"
|
|
|
|
|
></effectProblem>
|
2024-05-20 18:48:48 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
2024-05-21 16:36:17 +08:00
|
|
|
import { ref, onMounted, provide, nextTick } from 'vue'
|
2024-05-20 18:48:48 +08:00
|
|
|
import { mainHeight } from '@/utils/layout'
|
2024-05-21 16:36:17 +08:00
|
|
|
import TableStore from '@/utils/tableStore'
|
|
|
|
|
import Table from '@/components/table/index.vue'
|
|
|
|
|
import TableHeader from '@/components/table/header/index.vue'
|
|
|
|
|
import { useRouter } from 'vue-router'
|
|
|
|
|
import { getLoadTypeUserList } from '@/api/process-boot/interference'
|
|
|
|
|
import { useDictData } from '@/stores/dictData'
|
2024-06-06 09:54:28 +08:00
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
|
|
import { ElMessageBox } from 'element-plus/es'
|
2024-06-05 14:34:23 +08:00
|
|
|
const dictData = useDictData()
|
|
|
|
|
const statusSelect = dictData.statusSelect()
|
2024-05-21 16:36:17 +08:00
|
|
|
import addForm from './components/addForm.vue'
|
|
|
|
|
import effectProblem from './components/effectProblem/index.vue'
|
2024-06-02 17:55:37 +08:00
|
|
|
import { planDetailsAudit, sendAlarm } from '@/api/supervision-boot/plan/index'
|
2024-06-04 16:54:33 +08:00
|
|
|
import { useAdminInfo } from '@/stores/adminInfo'
|
|
|
|
|
import { cancelPlanFormData } from '@/api/supervision-boot/plan/index'
|
|
|
|
|
//获取登陆用户姓名和部门
|
|
|
|
|
const adminInfo = useAdminInfo()
|
2024-05-20 18:48:48 +08:00
|
|
|
defineOptions({
|
2024-06-02 17:55:37 +08:00
|
|
|
name: 'plan'
|
2024-05-20 18:48:48 +08:00
|
|
|
})
|
2024-06-04 18:06:17 +08:00
|
|
|
const flag = ref(false)
|
2024-05-27 20:11:14 +08:00
|
|
|
// const layout = mainHeight(120) as any
|
2024-06-05 14:34:23 +08:00
|
|
|
|
2024-06-04 18:06:17 +08:00
|
|
|
const { push, options, currentRoute } = useRouter()
|
2024-05-27 15:35:38 +08:00
|
|
|
const router = useRouter() // 路由对象
|
2024-05-21 16:36:17 +08:00
|
|
|
const TableHeaderRef = ref()
|
|
|
|
|
const tableRef = ref()
|
|
|
|
|
//字典获取监督类型
|
|
|
|
|
const supvTypeList = dictData.getBasicData('supv_type')
|
|
|
|
|
//字典获取监督阶段
|
|
|
|
|
const supvStageList = dictData.getBasicData('supv_stage')
|
|
|
|
|
//字典获取监督对象类型
|
|
|
|
|
const supvObjTypeList = dictData.getBasicData('supv_obj_type')
|
|
|
|
|
const tableStore = new TableStore({
|
|
|
|
|
url: '/supervision-boot/superPlan/pagePlan',
|
2024-05-27 20:11:14 +08:00
|
|
|
// publicHeight: 65,
|
2024-05-21 16:36:17 +08:00
|
|
|
method: 'POST',
|
|
|
|
|
column: [
|
|
|
|
|
{ title: '序号', type: 'seq', width: 80 },
|
|
|
|
|
{
|
|
|
|
|
field: 'province',
|
|
|
|
|
title: '所属省份',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return row.cellValue ? row.cellValue : '/'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'city',
|
|
|
|
|
title: '所属地市',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return row.cellValue ? row.cellValue : '/'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'county',
|
|
|
|
|
title: '所属县区',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return row.cellValue ? row.cellValue : '/'
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-05-22 11:00:42 +08:00
|
|
|
{
|
|
|
|
|
field: 'supvOrgName',
|
|
|
|
|
title: '监督单位',
|
|
|
|
|
minWidth: 170
|
|
|
|
|
},
|
2024-05-21 16:36:17 +08:00
|
|
|
{ field: 'workPlanName', title: '计划名称', minWidth: 170 },
|
2024-05-22 11:00:42 +08:00
|
|
|
{
|
|
|
|
|
field: 'planSupvDate',
|
|
|
|
|
title: '计划监督时间',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return row.cellValue.replace('T', ' ')
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-05-21 16:36:17 +08:00
|
|
|
{
|
|
|
|
|
field: 'status',
|
|
|
|
|
title: '审核状态',
|
|
|
|
|
minWidth: 100,
|
|
|
|
|
render: 'tag',
|
|
|
|
|
custom: {
|
|
|
|
|
1: 'primary',
|
|
|
|
|
2: 'success',
|
|
|
|
|
3: 'danger',
|
|
|
|
|
4: 'warning'
|
|
|
|
|
},
|
|
|
|
|
replaceValue: {
|
|
|
|
|
1: '审批中',
|
|
|
|
|
2: '审批通过',
|
|
|
|
|
3: '审批不通过',
|
|
|
|
|
4: '已取消'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'supvType',
|
|
|
|
|
title: '监督类型',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return supvTypeList.filter(item => item.id === row.cellValue)[0]?.name
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'supvStage',
|
|
|
|
|
title: '监督阶段',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return supvStageList.filter(item => item.id === row.cellValue)[0]?.name
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'supvObjType',
|
|
|
|
|
title: '监督对象类型',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return supvObjTypeList.filter(item => item.id === row.cellValue)[0]?.name
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'objType',
|
|
|
|
|
title: '监督对象属性',
|
|
|
|
|
minWidth: 170,
|
|
|
|
|
formatter: (row: any) => {
|
|
|
|
|
return row.cellValue == '1' ? '在运站' : '新(改、扩)建站'
|
|
|
|
|
}
|
|
|
|
|
},
|
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-21 16:36:17 +08:00
|
|
|
{
|
|
|
|
|
title: '操作',
|
2024-05-27 15:35:38 +08:00
|
|
|
minWidth: 300,
|
2024-05-21 16:36:17 +08:00
|
|
|
fixed: 'right',
|
|
|
|
|
render: 'buttons',
|
|
|
|
|
buttons: [
|
|
|
|
|
{
|
|
|
|
|
name: 'productSetting',
|
|
|
|
|
title: '流程详情',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
click: row => {
|
2024-06-04 18:06:17 +08:00
|
|
|
flag.value = true
|
2024-06-04 16:54:33 +08:00
|
|
|
handleDetails(row.processInstanceId, row.historyInstanceId)
|
2024-05-21 16:36:17 +08:00
|
|
|
},
|
|
|
|
|
disabled: row => {
|
|
|
|
|
return !row.processInstanceId
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'productSetting',
|
|
|
|
|
title: '实施问题',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
2024-06-05 13:28:21 +08:00
|
|
|
disabled: row => {
|
|
|
|
|
return row.createBy != adminInfo.$state.id ||row.status!=3
|
|
|
|
|
},
|
2024-05-21 16:36:17 +08:00
|
|
|
click: row => {
|
|
|
|
|
handleEffectProblem(row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'productSetting',
|
|
|
|
|
title: '提交审核',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
2024-05-22 14:18:55 +08:00
|
|
|
disabled: row => {
|
|
|
|
|
return row.processInstanceId
|
|
|
|
|
},
|
2024-05-21 16:36:17 +08:00
|
|
|
click: row => {
|
|
|
|
|
handleAudit(row)
|
|
|
|
|
}
|
2024-05-27 15:35:38 +08:00
|
|
|
},
|
2024-06-04 16:54:33 +08:00
|
|
|
{
|
|
|
|
|
name: 'edit',
|
|
|
|
|
title: '重新发起',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
icon: 'el-icon-Open',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
disabled: row => {
|
2024-06-04 18:06:17 +08:00
|
|
|
return row.createBy != adminInfo.$state.id || row.status != 3
|
2024-06-04 16:54:33 +08:00
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
addForms.value.open({
|
|
|
|
|
title: '重新发起',
|
|
|
|
|
row: row
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-06-03 18:00:32 +08:00
|
|
|
{
|
|
|
|
|
name: 'cancel',
|
|
|
|
|
title: '取消',
|
|
|
|
|
type: 'danger',
|
|
|
|
|
icon: 'el-icon-Open',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
disabled: row => {
|
2024-06-06 09:54:28 +08:00
|
|
|
return row.createBy != adminInfo.$state.id || row.status != 1||!row.processInstanceId
|
2024-06-03 18:00:32 +08:00
|
|
|
},
|
|
|
|
|
click: row => {
|
2024-06-04 16:54:33 +08:00
|
|
|
cancelLeave(row)
|
2024-06-03 18:00:32 +08:00
|
|
|
}
|
|
|
|
|
},
|
2024-05-27 15:35:38 +08:00
|
|
|
{
|
|
|
|
|
name: 'productSetting',
|
|
|
|
|
title: '发起告警单',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-EditPen',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
disabled: row => {
|
|
|
|
|
return row.isUploadHead == 1
|
|
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
handleAlarmForm(row)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'edit',
|
|
|
|
|
title: '查看告警单',
|
|
|
|
|
type: 'primary',
|
|
|
|
|
icon: 'el-icon-Open',
|
|
|
|
|
render: 'basicButton',
|
|
|
|
|
disabled: row => {
|
|
|
|
|
return row.isUploadHead == 0
|
|
|
|
|
},
|
|
|
|
|
click: row => {
|
|
|
|
|
router.push({
|
2024-06-07 14:24:44 +08:00
|
|
|
name: 'supervision/supervision/manage',
|
|
|
|
|
state:{
|
|
|
|
|
type:1
|
|
|
|
|
}
|
2024-05-27 15:35:38 +08:00
|
|
|
})
|
|
|
|
|
}
|
2024-05-21 16:36:17 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
beforeSearchFun: () => {
|
|
|
|
|
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
|
|
|
|
|
// tableStore.table.params.relationUserName = tableStore.table.params.userName
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-06-05 15:21:43 +08:00
|
|
|
tableStore.table.params.status = ''
|
2024-05-21 16:36:17 +08:00
|
|
|
// tableStore.table.params.loadType = ''
|
|
|
|
|
// tableStore.table.params.userName = ''
|
|
|
|
|
// tableStore.table.params.fileUploadflag = ''
|
|
|
|
|
provide('tableStore', tableStore)
|
|
|
|
|
const addForms = ref()
|
|
|
|
|
const addFormModel = () => {
|
|
|
|
|
setTimeout(() => {
|
2024-06-02 17:55:37 +08:00
|
|
|
addForms.value.open({
|
|
|
|
|
title: '技术监督计划'
|
|
|
|
|
})
|
2024-05-21 16:36:17 +08:00
|
|
|
}, 0)
|
|
|
|
|
}
|
|
|
|
|
const exportEvent = () => {
|
|
|
|
|
let form = JSON.parse(JSON.stringify(tableStore.table.params))
|
|
|
|
|
form.pageNum = 1
|
|
|
|
|
form.pageSize = tableStore.table.total
|
|
|
|
|
getLoadTypeUserList(form).then(res => {
|
|
|
|
|
tableRef.value.getRef().exportData({
|
|
|
|
|
filename: '未建档非线性用户', // 文件名字
|
|
|
|
|
sheetName: 'Sheet1',
|
|
|
|
|
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
|
|
|
|
useStyle: true,
|
|
|
|
|
data: res.data.records, // 数据源 // 过滤那个字段导出
|
|
|
|
|
columnFilterMethod: function (column: any) {
|
|
|
|
|
return !(column.$columnIndex === 0)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
//
|
2024-06-04 16:54:33 +08:00
|
|
|
const handleDetails = (id: any, historyInstanceId: any) => {
|
2024-05-21 16:36:17 +08:00
|
|
|
push({
|
|
|
|
|
name: 'BpmProcessInstanceDetail',
|
2024-06-04 16:54:33 +08:00
|
|
|
state: {
|
|
|
|
|
id: id,
|
|
|
|
|
historyInstanceId
|
2024-05-21 16:36:17 +08:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
/** 提交审核按钮 */
|
|
|
|
|
const handleAudit = (row: any) => {
|
|
|
|
|
planDetailsAudit({ id: row.planId }).then(res => {
|
2024-06-04 16:54:33 +08:00
|
|
|
ElMessage.success('提交审核成功!')
|
2024-05-21 16:36:17 +08:00
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-05-27 15:35:38 +08:00
|
|
|
//发起告警单
|
2024-06-02 17:55:37 +08:00
|
|
|
const handleAlarmForm = (row: any) => {
|
2024-05-27 15:35:38 +08:00
|
|
|
sendAlarm({ id: row.planId }).then(res => {
|
|
|
|
|
ElMessage.success('发起告警单成功!')
|
|
|
|
|
tableStore.index()
|
|
|
|
|
})
|
|
|
|
|
}
|
2024-06-04 16:54:33 +08:00
|
|
|
/**取消流程操作*/
|
|
|
|
|
const cancelLeave = async (row: any) => {
|
|
|
|
|
// 二次确认
|
|
|
|
|
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
|
|
|
|
|
inputErrorMessage: '取消原因不能为空'
|
|
|
|
|
})
|
|
|
|
|
// 发起取消
|
|
|
|
|
let data = {
|
2024-06-06 09:54:28 +08:00
|
|
|
id: row.planId,
|
2024-06-04 16:54:33 +08:00
|
|
|
processInstanceId: row.processInstanceId,
|
|
|
|
|
reason: value
|
|
|
|
|
}
|
|
|
|
|
await cancelPlanFormData(data)
|
|
|
|
|
ElMessage.success('取消成功')
|
|
|
|
|
// 加载数据
|
|
|
|
|
tableStore.index()
|
|
|
|
|
}
|
2024-05-21 16:36:17 +08:00
|
|
|
// 实施问题按钮
|
|
|
|
|
const effectProblemList = ref()
|
|
|
|
|
const effectProblemForm: any = ref({})
|
|
|
|
|
const handleEffectProblem = (row: any) => {
|
2024-05-28 14:11:01 +08:00
|
|
|
// effectProblemForm.value = row
|
|
|
|
|
// effectProblemList.value.open()
|
|
|
|
|
push({
|
|
|
|
|
name: 'PlanEffectProblem',
|
|
|
|
|
query: {
|
|
|
|
|
id: row.planId
|
|
|
|
|
}
|
|
|
|
|
})
|
2024-05-21 16:36:17 +08:00
|
|
|
}
|
2024-06-04 18:06:17 +08:00
|
|
|
watch(
|
|
|
|
|
() => currentRoute.value.path,
|
|
|
|
|
() => {
|
|
|
|
|
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
|
|
|
|
|
tableStore.index()
|
|
|
|
|
flag.value = false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
deep: true
|
|
|
|
|
}
|
|
|
|
|
)
|
2024-05-20 18:48:48 +08:00
|
|
|
</script>
|