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

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,64 +1,65 @@
<template>
<div>
<TableHeader datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input v-model="tableStore.table.params.projectName" placeholder="请输入项目名称"></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<!-- <el-button icon='el-icon-Download' type='primary'>导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
<div>
<TableHeader datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template #select>
<el-form-item label='项目名称'>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称'></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<!-- <el-button icon='el-icon-Download' type='primary'>导出</el-button> -->
</template>
</TableHeader>
<Table ref='tableRef'/>
</div>
<el-dialog
title="干扰源用户详细信息"
v-if="dialogVisible"
v-model="dialogVisible"
width="65%"
:append-to-body="true"
:close-on-click-modal="false"
draggable
>
<BpmUserReportDetail :id="interId" ref="detailsRef"></BpmUserReportDetail>
</el-dialog>
<!-- 查看详情 detail 新增/修改 create-->
<addForm
ref="addForms"
@onSubmit="tableStore.index()"
:update="update"
:normalizedControl="true"
openType="create"
></addForm>
<el-dialog
title='干扰源用户详细信息'
v-if='dialogVisible'
v-model='dialogVisible'
width='65%'
:append-to-body='true'
:close-on-click-modal='false'
draggable
>
<BpmUserReportDetail :id='interId' ref='detailsRef'></BpmUserReportDetail>
</el-dialog>
<!-- 查看详情 detail 新增/修改 create-->
<addForm
ref='addForms'
@onSubmit='tableStore.index()'
:update='update'
:normalizedControl='true'
openType='create'
></addForm>
</template>
<script setup lang="ts">
<script setup lang='ts'>
defineOptions({
name: 'supervision/interferenceUserTable'
name: 'supervision/interferenceUserTable'
})
import { ref, onMounted, provide, watch } from 'vue'
import {ref, onMounted, provide, watch} from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useDictData } from '@/stores/dictData'
import {useDictData} from '@/stores/dictData'
import addForm from '@/views/pqs/supervise/interfere/components/undocumented/addForm.vue'
import { getUserReportById } from '@/api/supervision-boot/userReport/form'
import {getUserReportById, getUserReportByFangAnId} from '@/api/supervision-boot/interfere'
import BpmUserReportDetail from '../../components/undocumented/detail.vue'
import { useAdminInfo } from '@/stores/adminInfo'
import { ElMessage, ElMessageBox } from 'element-plus'
import { userReportRenewalCancel } from '@/api/process-boot/generalTest'
import {useAdminInfo} from '@/stores/adminInfo'
import {ElMessage, ElMessageBox} from 'element-plus'
import {userReportRenewalCancel} from '@/api/process-boot/generalTest'
const dictData = useDictData()
const flag = ref(false)
const areaOptionList = dictData
@@ -73,235 +74,235 @@ const update = ref(false)
const addForms = ref()
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
return item == 'jb_dky'
}).length != 0
? true
: false
const { push, options, currentRoute } = useRouter()
const {push, options, currentRoute} = useRouter()
const TableHeaderRef = ref()
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getNormalUserPage',
publicHeight: 65,
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{ field: 'city', title: '所在地市', minWidth: 80 },
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '信息更新状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
null: '/'
}
},
url: '/supervision-boot/userReport/getNormalUserPage',
publicHeight: 65,
method: 'POST',
column: [
{title: '序号', type: 'seq', width: 80},
{field: 'city', title: '所在地市', minWidth: 80},
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{field: 'projectName', title: '项目名称', minWidth: 170},
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '信息更新状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning',
null: 'primary'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消',
null: '/'
}
},
{
title: '详细信息',
minWidth: 100,
render: 'buttons',
buttons: [
{
title: '详细信息',
minWidth: 100,
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
open(row)
}, 100)
}
}
]
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
// visible:!jb_pl.value && !jb_dky.value?true:false,
{
title: '操作',
minWidth: 300,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
row.createBy != adminInfo.$state.id ||
!(row.status == 0 || row.status == 2 || row.status == null)
)
},
disabled: row => {
return !(row.status == 0 || row.status == 2 || row.status == null)
},
click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
addForms.value.open({
title: '编辑',
row: row
})
}, 100)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({ title: '重新发起', row: row })
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '入网设计方案申请',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
// disabled: row => {
// return jb_pl.value || jb_dky.value
// },
click: row => {
toFangAn(row, 0)
}
},
{
name: 'productSetting',
title: '治理工程验收申请',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.needGovernance == 0 //&& row.type == true
},
showDisabled: row => {
return row.type == false
},
click: row => {
toFangAn(row, 1)
}
}
// {
// name: 'productSetting',
// title: '/',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// disabled: row => {
// return !jb_pl.value && !jb_dky.value
// }
// }
]
name: 'productSetting',
title: '详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
open(row)
}, 100)
}
}
],
]
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
// visible:!jb_pl.value && !jb_dky.value?true:false,
{
title: '操作',
minWidth: 300,
fixed: 'right',
render: 'buttons',
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return (
row.createBy != adminInfo.$state.id ||
!(row.status == 0 || row.status == 2 || row.status == null)
)
},
disabled: row => {
return !(row.status == 0 || row.status == 2 || row.status == null)
},
click: row => {
update.value = row.status == null ? false : true
setTimeout(() => {
addForms.value.open({
title: '编辑',
row: row
})
}, 100)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({title: '重新发起', row: row})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
},
{
name: 'productSetting',
title: '入网设计方案申请',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
// disabled: row => {
// return jb_pl.value || jb_dky.value
// },
click: row => {
toFangAn(row, 0)
}
},
{
name: 'productSetting',
title: '治理工程验收申请',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return row.needGovernance == 0 //&& row.type == true
},
showDisabled: row => {
return row.type == false
},
click: row => {
toFangAn(row, 1)
}
}
// {
// name: 'productSetting',
// title: '/',
// type: 'primary',
// icon: 'el-icon-EditPen',
// render: 'basicButton',
// disabled: row => {
// return !jb_pl.value && !jb_dky.value
// }
// }
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
@@ -315,114 +316,180 @@ tableStore.table.params.aisFileUpload = ''
const dialogVisible = ref(false)
const interId = ref()
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
const detailsRef = ref(null)
/** 打开弹窗 */
const open = async val => {
interId.value = val.id
dialogVisible.value = true
interId.value = val.id
dialogVisible.value = true
}
/** 流程实例详情 */
const handleAudit = (instanceId: string, historyInstanceId: string) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await userReportRenewalCancel(data).then(res => {
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
})
// 二次确认
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await userReportRenewalCancel(data).then(res => {
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
})
}
const needGovernance = ref()
/** 方案审查 */
const toFangAn = (row: any, typeNo: number) => {
//查询详情拿到needGovernance
/** 获得数据 */
getUserReportById(row.id).then(res => {
if (res.data.userType == '0' || res.data.userType == '1') {
needGovernance.value = res.data.userReportProjectPO?.needGovernance
} else if (
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
) {
needGovernance.value = res.data.userReportSubstationPO?.needGovernance
} else if (res.data.userType == '6') {
needGovernance.value = res.data.userReportSensitivePO?.needGovernance
}
push({
name: 'ProgramReview',
query: {
id: row.id,
type: typeNo,
needGovernance: needGovernance.value
}
})
flag.value = true
//查询详情拿到needGovernance
/** 获得数据 */
getUserReportById(row.id).then(res => {
if (res.data.userType == '0' || res.data.userType == '1') {
needGovernance.value = res.data.userReportProjectPO?.needGovernance
} else if (
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
) {
needGovernance.value = res.data.userReportSubstationPO?.needGovernance
} else if (res.data.userType == '6') {
needGovernance.value = res.data.userReportSensitivePO?.needGovernance
}
push({
name: 'ProgramReview',
query: {
id: row.id,
type: typeNo,
needGovernance: needGovernance.value
}
})
flag.value = true
})
}
const toFangAnById = (id: string, typeNo: number) => {
//查询详情拿到needGovernance
/** 获得数据 */
getUserReportByFangAnId(id).then(res => {
let userId;
if (res.data.userType == '0' || res.data.userType == '1') {
userId = res.data.userReportProjectPO?.id
needGovernance.value = res.data.userReportProjectPO?.needGovernance
} else if (
res.data.userType == '2' ||
res.data.userType == '3' ||
res.data.userType == '4' ||
res.data.userType == '5'
) {
userId = res.data.userReportSubstationPO?.id
needGovernance.value = res.data.userReportSubstationPO?.needGovernance
} else if (res.data.userType == '6') {
userId = res.data.userReportSensitivePO?.id
needGovernance.value = res.data.userReportSensitivePO?.needGovernance
}
push({
name: 'ProgramReview',
query: {
id: userId,
fangAnId: id,
type: typeNo,
needGovernance: needGovernance.value
}
})
flag.value = true
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
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
}
)
//初始进来时如果有id就直接打开重新发起
onMounted(async () => {
tableStore.index()
})
/**
* 监听 props.id变了根据id查询详细数据用户重新发起
*/
const props = defineProps(['id', 'businessKey'])
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return; // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
// 此处较为复杂,需要判断是更新、入网检测、治理工程验收
if (props.businessKey == 'user_go_net') {
// 入网检测
toFangAnById(fullId, 0)
} else if (props.businessKey == 'user_treat_check') {
// 治理工程验收
toFangAnById(fullId, 1)
} else {
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}
}, {immediate: true})
</script>

View File

@@ -1,73 +1,75 @@
<template>
<div class="default-main">
<!-- <TableHeader ref='TableHeaderRef'>
<template #select>
<el-form-item label='用户名称'>
<el-input v-model='tableStore.table.params.projectName' clearable></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='' type='primary' @click='toGoNet()'>{{ titleButton }}</el-button>
<div class="default-main">
<!-- <TableHeader ref='TableHeaderRef'>
<template #select>
<el-form-item label='用户名称'>
<el-input v-model='tableStore.table.params.projectName' clearable></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
</template>
<template #operation>
<el-button icon='' type='primary' @click='toGoNet()'>{{ titleButton }}</el-button>
<el-button style='margin-left: 50px' :icon='Back' @click='go(-1)'>返回</el-button>
</template>
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0 && !(jb_pl || jb_dky)" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button
v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)"
icon=""
type="primary"
@click="toGoNet()"
>
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef" />
<addForm
v-if="dialogVisible"
ref="addForms"
:id="bussId"
:bussType="bussType"
:title="titleButton1"
openType="detail"
@onSubmit="tableStore.index()"
></addForm>
<el-button style='margin-left: 50px' :icon='Back' @click='go(-1)'>返回</el-button>
</template>
</TableHeader> -->
<div class="header_btn">
<el-button v-if="bussType == 0 && !(jb_pl || jb_dky)" icon="" type="primary" @click="toGoNet()">
{{ titleButton }}
</el-button>
<el-button
v-if="bussType == 1 && needGovernance != '0' && !(jb_pl || jb_dky)"
icon=""
type="primary"
@click="toGoNet()"
>
{{ titleButton }}
</el-button>
<el-button style="margin-left: 50px" :icon="Back" @click="go(-1)">返回</el-button>
</div>
<Table ref="tableRef"/>
<addForm
v-if="dialogVisible"
ref="addForms"
:id="bussId"
:bussType="bussType"
:title="titleButton1"
openType="detail"
@onSubmit="tableStore.index()"
></addForm>
</div>
</template>
<script setup lang="ts">
defineOptions({
name: 'ProgramReview'
name: 'ProgramReview'
})
import { ref, onMounted, provide, nextTick, onUnmounted } from 'vue'
import {ref, onMounted, provide, nextTick, onUnmounted} from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { cancel } from '@/api/supervision-boot/interfere/index'
import { useDictData } from '@/stores/dictData'
import {cancel, userReportGoNetById} from '@/api/supervision-boot/interfere/index'
import {useDictData} from '@/stores/dictData'
import addForm from './addForm.vue'
import { useRouter, useRoute } from 'vue-router'
import { Back } from '@element-plus/icons-vue'
import { useAdminInfo } from '@/stores/adminInfo'
const { go, currentRoute, push } = useRouter()
const { query } = useRoute() // 查询参数
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import {useRouter, useRoute} from 'vue-router'
import {Back} from '@element-plus/icons-vue'
import {useAdminInfo} from '@/stores/adminInfo'
const {go, currentRoute, push} = useRouter()
const {query} = useRoute() // 查询参数
import {ElMessage} from 'element-plus'
import {ElMessageBox} from 'element-plus/es'
const needGovernance = query.needGovernance as unknown as string // 从 URL 传递过来的 是否需要治理
const dictData = useDictData()
const areaOptionList = dictData.getBasicData('jibei_area')
@@ -76,161 +78,161 @@ const jb_pl = ref(false)
const jb_dky = ref(false)
jb_pl.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_pl'
return item == 'jb_pl'
}).length != 0
? true
: false
jb_dky.value =
adminInfo.$state.roleCode.filter(item => {
return item == 'jb_dky'
return item == 'jb_dky'
}).length != 0
? true
: false
const tableStore = new TableStore({
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
url: '/supervision-boot/userReportNormal/userReportGoNetPage',
method: 'POST',
column: [
{ title: '序号', type: 'seq', width: 80 },
{ field: 'projectName', title: '用户名称', minWidth: 170 },
method: 'POST',
column: [
{title: '序号', type: 'seq', width: 80},
{field: 'projectName', title: '用户名称', minWidth: 170},
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{field: 'city', title: '所在地市', minWidth: 80},
{field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{field: 'substation', title: '厂站名称', minWidth: 100},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{field: 'createTime', title: '创建时间', minWidth: 100},
{
title: '操作',
minWidth: 180,
fixed: 'right',
render: 'buttons',
buttons: [
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'city', title: '所在地市', minWidth: 80 },
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{ field: 'substation', title: '厂站名称', minWidth: 100 },
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId)
}
},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return !(row.status == 0 || row.status == 3)
},
disabled: row => {
return !(row.status == 0 || row.status == 3)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '编辑'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{ field: 'createTime', title: '创建时间', minWidth: 100 },
{
title: '操作',
minWidth: 180,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
handleAudit(row.processInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return !(row.status == 0 || row.status == 3)
},
disabled: row => {
return !(row.status == 0 || row.status == 3)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '编辑'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 4)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
]
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 4)
},
click: row => {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
addForms.value.open(row)
}, 0)
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status !== 1
},
click: row => {
cancelLeave(row)
}
}
],
beforeSearchFun: () => {
tableStore.table.params.userReportId = bussId.value
tableStore.table.params.type = bussType.value
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
]
}
],
beforeSearchFun: () => {
tableStore.table.params.userReportId = bussId.value
tableStore.table.params.type = bussType.value
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
@@ -247,102 +249,117 @@ const titleButton1 = ref()
provide('tableStore', tableStore)
const handleVisibilityChange = async () => {
if (document.visibilityState === 'visible') {
// 在这里执行页面回到回到当前页签需要做的事情
await tableStore.index()
} else if (document.visibilityState === 'hidden') {
// 在这里执行页面离开时需要做的事情
}
if (document.visibilityState === 'visible') {
// 在这里执行页面回到回到当前页签需要做的事情
await tableStore.index()
} else if (document.visibilityState === 'hidden') {
// 在这里执行页面离开时需要做的事情
}
}
onMounted(() => {
tableStore.index()
document.addEventListener('visibilitychange', handleVisibilityChange)
onMounted(async () => {
tableStore.index()
document.addEventListener('visibilitychange', handleVisibilityChange)
if (query.fangAnId) {
//根据id查询待编辑的数据
await userReportGoNetById({id: query.fangAnId}).then(res => {
if (res && res.code == 'A0000') {
dialogVisible.value = true
titleButton1.value = '重新发起'
setTimeout(() => {
res.data.id = query.fangAnId
addForms.value.open(res.data)
}, 0)
}
})
}
})
onUnmounted(() => {
document.removeEventListener('visibilitychange', handleVisibilityChange)
document.removeEventListener('visibilitychange', handleVisibilityChange)
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
// 二次确认
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancel(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
}
if (bussType.value === 0) {
titleButton.value = '入网设计方案申请'
titleButton.value = '入网设计方案申请'
} else {
titleButton.value = '治理工程申请'
titleButton.value = '治理工程申请'
}
const addForms = ref()
const toGoNet = () => {
dialogVisible.value = true
if (bussType.value === 0) {
titleButton1.value = '入网设计方案申请'
} else {
titleButton1.value = '治理工程申请'
}
setTimeout(() => {
addForms.value.open()
}, 0)
dialogVisible.value = true
if (bussType.value === 0) {
titleButton1.value = '入网设计方案申请'
} else {
titleButton1.value = '治理工程申请'
}
setTimeout(() => {
addForms.value.open()
}, 0)
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
</script>
<style scoped lang="scss">
.header_btn {
width: 100%;
height: 60px;
display: flex;
padding: 13px 15px;
justify-content: flex-end;
align-items: center;
border: 1px solid #dddfe6;
width: 100%;
height: 60px;
display: flex;
padding: 13px 15px;
justify-content: flex-end;
align-items: center;
border: 1px solid #dddfe6;
}
</style>

View File

@@ -1,66 +1,66 @@
<template>
<TableHeader datePicker nextFlag theCurrentTime ref="TableHeaderRef">
<template #select>
<el-form-item label="项目名称">
<el-input v-model="tableStore.table.params.projectName" placeholder="请输入项目名称"></el-input>
</el-form-item>
<el-form-item label="所在地市">
<el-select v-model="tableStore.table.params.city" clearable placeholder="请选择所在地市">
<el-option
v-for="item in areaOptionList"
:key="item.id"
:label="item.name"
:value="item.name"
></el-option>
</el-select>
</el-form-item>
<TableHeader datePicker nextFlag theCurrentTime ref='TableHeaderRef'>
<template #select>
<el-form-item label='项目名称'>
<el-input v-model='tableStore.table.params.projectName' placeholder='请输入项目名称'></el-input>
</el-form-item>
<el-form-item label='所在地市'>
<el-select v-model='tableStore.table.params.city' clearable placeholder='请选择所在地市'>
<el-option
v-for='item in areaOptionList'
:key='item.id'
:label='item.name'
:value='item.name'
></el-option>
</el-select>
</el-form-item>
<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>
<template #operation>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addList">新增</el-button> -->
<el-button icon="el-icon-Plus" type="primary" @click="addFormModel">新增</el-button>
<el-button icon="el-icon-Delete" type="primary" @click="deleteEven">删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref="tableRef" :checkbox-config="checkboxConfig" />
<!-- 新增 -->
<Add ref="addRef" @onSubmit="tableStore.index()" />
<!-- 上传 -->
<Audit ref="AuditRef" @onSubmit="tableStore.index()" />
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref="addForms" @onSubmit="tableStore.index()"></addForm>
<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>
<template #operation>
<!-- <el-button icon="el-icon-Plus" type="primary" @click="addList">新增</el-button> -->
<el-button icon='el-icon-Plus' type='primary' @click='addFormModel'>新增</el-button>
<el-button icon='el-icon-Delete' type='primary' @click='deleteEven'>删除</el-button>
<!-- <el-button icon="el-icon-Download" @click="exportEvent" type="primary">导出</el-button> -->
</template>
</TableHeader>
<Table ref='tableRef' :checkbox-config='checkboxConfig'/>
<!-- 新增 -->
<Add ref='addRef' @onSubmit='tableStore.index()'/>
<!-- 上传 -->
<Audit ref='AuditRef' @onSubmit='tableStore.index()'/>
<!-- 查看详情 detail 新增/修改 create-->
<addForm ref='addForms' @onSubmit='tableStore.index()'></addForm>
</template>
<script setup lang="ts">
import { ref, onMounted, provide, watch, reactive } from 'vue'
<script setup lang='ts'>
import {ref, onMounted, provide, watch, reactive} from 'vue'
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 {useRouter} from 'vue-router'
import Add from './add.vue'
import Audit from './audit.vue'
import addForm from './addForm.vue'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { cancelFormData } from '@/api/supervision-boot/interfere/index'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { useAdminInfo } from '@/stores/adminInfo'
import { deleteUserReport } from '@/api/supervision-boot/delete/index'
import {useDictData} from '@/stores/dictData'
import {getLoadTypeUserList} from '@/api/process-boot/interference'
import {cancelFormData, getUserReportById} from '@/api/supervision-boot/interfere/index'
import {ElMessage} from 'element-plus'
import {ElMessageBox} from 'element-plus/es'
import {useAdminInfo} from '@/stores/adminInfo'
import {deleteUserReport} from '@/api/supervision-boot/delete/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push, options, currentRoute } = useRouter()
const {push, options, currentRoute} = useRouter()
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData
@@ -74,167 +74,167 @@ const show: any = ref(false)
const fileList = ref([])
const flag = ref(false)
const tableStore = new TableStore({
url: '/supervision-boot/userReport/getUserReport',
publicHeight: 65,
method: 'POST',
column: [
url: '/supervision-boot/userReport/getUserReport',
publicHeight: 65,
method: 'POST',
column: [
{
width: '60',
type: 'checkbox'
},
{title: '序号', type: 'seq', width: 80},
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'city',
title: '所在地市',
minWidth: 80
// formatter: (obj: any) => {
// return areaOptionList.filter(item => item.id == obj.row.city)[0]?.name
// }
},
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{field: 'projectName', title: '项目名称', minWidth: 170},
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130},
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{field: 'createTime', title: '开始时间', minWidth: 170},
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
width: '60',
type: 'checkbox'
},
{ title: '序号', type: 'seq', width: 80 },
// { field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'city',
title: '所在地市',
minWidth: 80
// formatter: (obj: any) => {
// return areaOptionList.filter(item => item.id == obj.row.city)[0]?.name
// }
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
field: 'substation',
title: '厂站名称',
minWidth: 100,
formatter: (row: any) => {
row.cellValue = row.cellValue ? row.cellValue : '/'
return row.cellValue
}
},
{ field: 'projectName', title: '项目名称', minWidth: 170 },
{
field: 'userType',
title: '用户性质',
minWidth: 150,
formatter: (obj: any) => {
const userType = obj.row.userType
return getUserTypeName(userType)
}
},
{ field: 'responsibleDepartment', title: '归口管理部门', minWidth: 130 },
{
field: 'userStatus',
title: '用户状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'primary',
1: 'primary',
2: 'success',
3: 'warning'
},
replaceValue: {
0: '可研',
1: '建设',
2: '运行',
3: '退运'
}
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
field: 'status',
title: '流程状态',
minWidth: 100,
render: 'tag',
custom: {
0: 'warning',
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
0: '待提交审批',
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ field: 'createTime', title: '开始时间', minWidth: 170 },
{
field: 'createBy',
title: '填报人',
minWidth: 80,
formatter: (row: any) => {
return dictData.state.userList.filter(item => item.id == row.cellValue)[0]?.name
}
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
title: '操作',
minWidth: 150,
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
disabled: row => {
return !row.processInstanceId
},
click: row => {
flag.value = true
handleAudit(row.processInstanceId, row.historyInstanceId)
}
},
{
name: 'edit',
title: '编辑',
type: 'primary',
icon: 'el-icon-Open',
render: 'basicButton',
showDisabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 0)
},
disabled: row => {
return !(row.status == 0)
},
click: row => {
addForms.value.open({
title: '编辑',
row: row
})
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || !(row.status == 3 || row.status == 4)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
]
name: 'cancel',
title: '取消',
type: 'danger',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.createBy != adminInfo.$state.id || row.status != 1
},
click: row => {
cancelLeave(row)
}
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
]
}
],
beforeSearchFun: () => {
tableStore.table.params.orgNo = tableStore.table.params.deptIndex
tableStore.table.params.relationUserName = tableStore.table.params.userName
}
})
tableStore.table.params.city = ''
tableStore.table.params.projectName = ''
@@ -247,135 +247,154 @@ tableStore.table.params.status = ''
provide('tableStore', tableStore)
// 新增
const addList = () => {
addRef.value.open()
addRef.value.open()
}
// 禁止点击
const checkboxConfig = reactive({
checkMethod: ({ row }) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
checkMethod: ({row}) => {
return adminInfo.roleCode.includes('delete_info')
? true
: row.createBy == adminInfo.$state.id && row.status == 0
}
})
const deleteEven = () => {
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
}
if (tableStore.table.selection.length == 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
} else {
deleteUserReport(tableStore.table.selection.map(item => item.id)).then(res => {
ElMessage({
type: 'success',
message: '删除成功!'
})
tableStore.index()
})
}
}
const addForms = ref()
const addFormModel = () => {
show.value = true
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
}, 0)
show.value = true
setTimeout(() => {
addForms.value.open({
title: '用户档案录入'
})
}, 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)
}
})
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)
}
})
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
// 二次确认
const {value} = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
onMounted(() => {
tableStore.index()
tableStore.index()
})
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
}
)
/** 处理审批按钮 */
const handleAudit = (instanceId: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
push({
name: 'BpmProcessInstanceDetail',
state: {
id: instanceId,
historyInstanceId
}
})
}
/**获取用户性质*/
const getUserTypeName = (userType: any) => {
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
if (userType === 0) {
return '新建电网工程'
}
if (userType === 1) {
return '扩建电网工程'
}
if (userType === 2) {
return '新建非线性负荷用户'
}
if (userType === 3) {
return '扩建非线性负荷用户'
}
if (userType === 4) {
return '新建新能源发电站'
}
if (userType === 5) {
return '扩建新能源发电站'
}
if (userType === 6) {
return '敏感及重要用户'
}
return '新建电网工程'
}
const props = defineProps({id: {type: String, default: 'null'}})
watch(() => props.id, async (newValue, oldValue) => {
if (newValue === 'null') return // 直接返回,避免后续逻辑执行
const fullId = newValue.split('@')[0]
let nowTime = Date.now()
const routeTime = Number(newValue.split('@')[1])
if (isNaN(routeTime) || nowTime - routeTime > import.meta.env.VITE_ROUTE_TIME_OUT) return // 路由时间超过500ms则不执行
await getUserReportById(fullId).then(res => {
if (res && res.code == 'A0000') {
addForms.value.open({
title: '重新发起',
row: res.data
})
}
})
}, {immediate: true})
</script>
<style scoped lang="scss"></style>
<style scoped lang='scss'></style>