流程审核不通过,在我的待办中直接跳转

This commit is contained in:
2024-09-13 20:04:19 +08:00
parent 3b51be9fce
commit cb9a0fe5e4
29 changed files with 3142 additions and 2578 deletions

View File

@@ -1,110 +1,243 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader>
<template v-slot:select>
<el-form-item label='任务名称'>
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称'></el-input>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
<div>
<TableHeader>
<template v-slot:select>
<el-form-item label='任务名称'>
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称'></el-input>
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref='tableRef'></Table>
</div>
</template>
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { onMounted, provide, ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import {onMounted, provide, ref, watch} from 'vue'
import {useRouter} from 'vue-router'
import {getById} from "@/api/supervision-boot/leaflet";
import {getRunningDeviceById} from "@/api/supervision-boot/device/quitRunningDev";
const router = useRouter() // 路由对象
defineOptions({
name: 'businessUser'
name: 'businessUser'
})
const { push, options, currentRoute } = useRouter()
const {push, options, currentRoute} = useRouter()
const flag = ref(false)
const tableStore = new TableStore({
url: '/bpm-boot/bpm/task/todoList',
method: 'POST',
publicHeight: 65,
column: [
url: '/bpm-boot/bpm/task/allTodoList',
method: 'POST',
publicHeight: 65,
isWebPaging: true,
column: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{title: '任务名称', field: 'taskName', minWidth: 200},
{title: '任务内容', field: 'taskContent', minWidth: 300},
{title: '任务来源', field: 'startUser', minWidth: 120},
{title: '发起时间', field: 'taskCreateTime', minWidth: 180},
{
field: 'source',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'danger',
3: 'primary'
},
replaceValue: {
1: '待审批',
2: '审批不通过',
3: '待处理'
}
},
{
title: '操作',
align: 'center',
minWidth: 100,
render: 'buttons',
buttons: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 2 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{ title: '任务名称', field: 'processInstance.name', minWidth: 200 },
{ title: '任务内容', field: 'instanceSign', minWidth: 300 },
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 120 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 120 },
{ title: '发起时间', field: 'createTime', minWidth: 180 },
{ title: '当前任务', field: 'name', minWidth: 140 },
{
title: '操作',
align: 'center',
minWidth: 100,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
flag.value = true
handleAudit(row.processInstance.id, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'productSetting',
title: '重新发起',
type: 'warning',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 3
},
click: async row => {
// 页面内tab切换
let type = 1
let key = row.businessKey
// 特殊处理预告警单
if(key == 'warn_leaflet'){
await getById(row.id).then(res => {
if(res.code == 'A0000'){
if(res.data.leafletType == 1){
type = 0
}else {
type = 1
}
}
})
}
if(key == 'quit_running_device'){
await getRunningDeviceById(row.id).then(res => {
if(res.code == 'A0000'){
if(res.data.deviceType == 1){
type = 0
}else {
type = 1
}
}
})
}
// 特殊处理终端监测点状态切换
if (
// 干扰源建档
key == 'build_user_info'
// 终端入网检测
|| key == 'device_info_add'
// 技术监督计划
|| key == 'sup_plan_add') {
type = 1
} else if (
// 干扰源用户常态化管理
key == 'user_report_update'
// 入网方案申请
|| key == 'user_go_net'
// 治理工程审核
|| key == 'user_treat_check'
// 监测点台账录入
|| key == 'line_info_add'
// 技术监督计划测试
|| key == 'survey_test') {
type = 2
} else if (
// 监测点联调
key == 'temp_line_debug'
) {
type = 3
} else if (
// 终端周期检测
key == 'timing_check_device'
) {
type = 4
}
// 业务记录id
let id = row.id
router.push({
name: row.routePath,
query: {
type,
id,
key,
t: Date.now()
}
})
}
},
{
name: 'productSetting',
title: '办理',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.source == 1 || row.source == 2
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
todo: 'todo',
historyInstanceId
}
})
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
todo: 'todo',
historyInstanceId
}
})
}
watch(
() => currentRoute.value.path,
() => {
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
if (flag.value && options.history.state.forward?.split('/')[1] == 'bpm') {
tableStore.index()
flag.value = false
}
},
{
deep: true
deep: true
}
)
</script>