我发起的菜单

This commit is contained in:
2024-06-04 13:48:56 +08:00
parent a04ea691fa
commit 15ee7efa6e
6 changed files with 822 additions and 663 deletions

View File

@@ -1,83 +1,83 @@
<template> <template>
<el-card v-loading="loading" class="box-card"> <el-card v-loading='loading' class='box-card'>
<el-col :offset="3" :span="17"> <el-col :offset='3' :span='17'>
<div class="item_line"> <div class='item_line'>
<el-timeline> <el-timeline>
<div class="end_item_line"> <div class='end_item_line'>
<div class="end_item_lines"></div> <div class='end_item_lines'></div>
<el-timeline-item <el-timeline-item
v-if="processInstance.endTime" v-if='processInstance.endTime'
:type="getProcessInstanceTimelineItemType(processInstance)" :type='getProcessInstanceTimelineItemType(processInstance)'
> >
<p style="font-weight: 700"> <p style='font-weight: 700'>
结束流程 {{ formatDate(processInstance?.endTime) }} 结束 结束流程 {{ formatDate(processInstance?.endTime) }} 结束
<el-tag :type="getTaskTimelineItemType(processInstance.status)"> <el-tag :type='getTaskTimelineItemType(processInstance.status)'>
{{ getTaskNameItemType(processInstance.status) }} {{ getTaskNameItemType(processInstance.status) }}
</el-tag> </el-tag>
</p> </p>
</el-timeline-item> </el-timeline-item>
</div> </div>
<div class="start_item_line" v-for="(item, index) in tasksList" :key="index"> <div class='start_item_line' v-for='(item, index) in tasksList' :key='index'>
<div class="start_item_lines"></div> <div class='start_item_lines'></div>
<!-- 最后一条不显示重新发起 --> <!-- 最后一条不显示重新发起 -->
<el-timeline-item type="success" v-if="index != 0 && item.status != '1'"> <el-timeline-item type='success' v-if="index != 0 && item.status != '1'">
<p style="font-weight: 700"> <p style='font-weight: 700'>
重新发起{{ item.processInstance.startUser?.name }} 重新发起{{ item.processInstance.startUser?.name }}
{{ formatDate(item?.createTime) }} 重新发起 {{ item.processInstance.name }} 流程 {{ formatDate(item?.createTime) }} 重新发起 {{ item.processInstance.name }} 流程
</p> </p>
</el-timeline-item> </el-timeline-item>
<el-timeline-item :type="getTaskTimelineItemType(item)"> <el-timeline-item :type='getTaskTimelineItemType(item)'>
<p style="font-weight: 700; margin: 8px"> <p style='font-weight: 700; margin: 8px'>
审批任务{{ item.name }} 审批任务{{ item.name }}
<el-tag :type="getTaskTimelineItemType(item.status)"> <el-tag :type='getTaskTimelineItemType(item.status)'>
{{ getTaskNameItemType(item.status) }} {{ getTaskNameItemType(item.status) }}
</el-tag> </el-tag>
<el-button <el-button
class="ml-10px" class='ml-10px'
v-if="!isEmpty(item.children)" v-if='!isEmpty(item.children)'
@click="openChildrenTask(item)" @click='openChildrenTask(item)'
size="small" size='small'
> >
<Icon icon="ep:memo" /> <Icon icon='ep:memo' />
子任务 子任务
</el-button> </el-button>
<el-button <el-button
class="ml-10px" class='ml-10px'
size="small" size='small'
v-if="item.formId > 0" v-if='item.formId > 0'
@click="handleFormDetail(item)" @click='handleFormDetail(item)'
> >
<Icon icon="ep:document" /> <Icon icon='ep:document' />
查看表单 查看表单
</el-button> </el-button>
</p> </p>
<el-card :body-style="{ padding: '10px' }"> <el-card :body-style="{ padding: '10px' }">
<label v-if="item.assigneeUser" style="margin-right: 30px; font-weight: normal"> <label v-if='item.assigneeUser' style='margin-right: 30px; font-weight: normal'>
审批人:{{ item.assigneeUser.name }} 审批人:{{ item.assigneeUser.name }}
<el-tag size="small" type="info">{{ item.assigneeUser.deptName }}</el-tag> <el-tag size='small' type='info'>{{ item.assigneeUser.deptName }}</el-tag>
</label> </label>
<label v-if="item.createTime" style="font-weight: normal">创建时间</label> <label v-if='item.createTime' style='font-weight: normal'>创建时间:</label>
<label style="font-weight: normal; color: #8a909c"> <label style='font-weight: normal; color: #8a909c'>
{{ formatDate(item?.createTime) }} {{ formatDate(item?.createTime) }}
</label> </label>
<label v-if="item.endTime" style="margin-left: 30px; font-weight: normal"> <label v-if='item.endTime' style='margin-left: 30px; font-weight: normal'>
审批时间: 审批时间:
</label> </label>
<label v-if="item.endTime" style="font-weight: normal; color: #8a909c"> <label v-if='item.endTime' style='font-weight: normal; color: #8a909c'>
{{ formatDate(item?.endTime) }} {{ formatDate(item?.endTime) }}
</label> </label>
<label v-if="item.durationInMillis" style="margin-left: 30px; font-weight: normal"> <label v-if='item.durationInMillis' style='margin-left: 30px; font-weight: normal'>
耗时: 耗时:
</label> </label>
<label v-if="item.durationInMillis" style="font-weight: normal; color: #8a909c"> <label v-if='item.durationInMillis' style='font-weight: normal; color: #8a909c'>
{{ formatPast2(item?.durationInMillis) }} {{ formatPast2(item?.durationInMillis) }}
</label> </label>
<p v-if="item.reason">审批建议{{ item.reason }}</p> <p v-if='item.reason'>审批建议:{{ item.reason }}</p>
</el-card> </el-card>
</el-timeline-item> </el-timeline-item>
</div> </div>
<el-timeline-item type="success"> <el-timeline-item type='success'>
<p style="font-weight: 700"> <p style='font-weight: 700'>
发起流程:【{{ tasksList[tasksList.length - 1]?.processInstance.startUser?.name }}】在 发起流程:【{{ tasksList[tasksList.length - 1]?.processInstance.startUser?.name }}】在
{{ formatDate(tasksList[tasksList.length - 1]?.createTime) }} 发起【 {{ formatDate(tasksList[tasksList.length - 1]?.createTime) }} 发起【
{{ tasksList[tasksList.length - 1]?.processInstance.name }} 】流程 {{ tasksList[tasksList.length - 1]?.processInstance.name }} 】流程
@@ -88,18 +88,16 @@
</el-col> </el-col>
</el-card> </el-card>
<!-- 弹窗:子任务 --> <!-- 弹窗:子任务 -->
<TaskSignList ref="taskSignListRef" @success="refresh" /> <TaskSignList ref='taskSignListRef' @success='refresh' />
<!-- 弹窗:表单 --> <!-- 弹窗:表单 -->
<el-dialog title="表单详情" v-model="taskFormVisible" width="600"> <el-dialog title='表单详情' v-model='taskFormVisible' width='600'>
<form-create ref="fApi" v-model="taskForm.value" :option="taskForm.option" :rule="taskForm.rule" /> <form-create ref='fApi' v-model='taskForm.value' :option='taskForm.option' :rule='taskForm.rule' />
</el-dialog> </el-dialog>
</template> </template>
<script lang="ts" setup> <script lang='ts' setup>
import { onMounted, provide, ref, getCurrentInstance, reactive, watch, unref, nextTick } from 'vue' import { ref, watch, nextTick } from 'vue'
import { ElMessage } from 'element-plus'
import { formatDate, formatPast2 } from '@/utils/formatTime' import { formatDate, formatPast2 } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes' import { propTypes } from '@/utils/propTypes'
import { DICT_TYPE } from '@/utils/dict'
import { isEmpty } from '@/utils/is' import { isEmpty } from '@/utils/is'
import TaskSignList from './dialog/TaskSignList.vue' import TaskSignList from './dialog/TaskSignList.vue'
import type { ApiAttrs } from '@form-create/element-ui/types/config' import type { ApiAttrs } from '@form-create/element-ui/types/config'
@@ -225,10 +223,11 @@ const refresh = () => {
emit('refresh') emit('refresh')
} }
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
.item_line { .item_line {
.end_item_line { .end_item_line {
position: relative; position: relative;
.end_item_lines { .end_item_lines {
position: absolute; position: absolute;
left: 4px; left: 4px;
@@ -238,8 +237,10 @@ const refresh = () => {
background: #eeeeee; background: #eeeeee;
} }
} }
.start_item_line { .start_item_line {
position: relative; position: relative;
.start_item_lines { .start_item_lines {
position: absolute; position: absolute;
left: 4px; left: 4px;
@@ -250,6 +251,7 @@ const refresh = () => {
} }
} }
} }
::v-deep .el-timeline-item__tail { ::v-deep .el-timeline-item__tail {
display: none !important; display: none !important;
} }

View File

@@ -1,55 +1,55 @@
<!-- 流程详情页面 tab切换 --> <!-- 流程详情页面 tab切换 -->
<template> <template>
<div class="default-main" style="overflow: hidden"> <div class='default-main' style='overflow: hidden'>
<!--返回按钮--> <!--返回按钮-->
<back-component style="margin: 8px; position: absolute; z-index: 10; top: -3px; right: 2px" /> <back-component style='margin: 8px; position: absolute; z-index: 10; top: -3px; right: 2px' />
<el-tabs type="border-card" v-model="tab" @tab-click="handleClickTab"> <el-tabs type='border-card' v-model='tab' @tab-click='handleClickTab'>
<el-tab-pane label="流程审核" name="流程审核" v-if="runningTasks.length > 0"> <el-tab-pane label='流程审核' name='流程审核' v-if='runningTasks.length > 0'>
<el-card <el-card
v-for="(item, index) in runningTasks" v-for='(item, index) in runningTasks'
:key="index" :key='index'
v-loading="processInstanceLoading" v-loading='processInstanceLoading'
class="box-card" class='box-card'
> >
<template #header> <template #header>
<span class="el-icon-picture-outline">当前任务{{ item.name }}</span> <span class='el-icon-picture-outline'>当前任务【{{ item.name }}】</span>
</template> </template>
<el-col :offset="6" :span="16"> <el-col :offset='6' :span='16'>
<el-form <el-form
:ref="'form' + index" :ref="'form' + index"
:model="auditForms[index]" :model='auditForms[index]'
:rules="auditRule" :rules='auditRule'
label-width="100px" label-width='100px'
> >
<el-form-item v-if="processInstance && processInstance.name" label="流程名"> <el-form-item v-if='processInstance && processInstance.name' label='流程名'>
{{ processInstance.name }} {{ processInstance.name }}
</el-form-item> </el-form-item>
<el-form-item v-if="processInstance && processInstance.startUser" label="发起人"> <el-form-item v-if='processInstance && processInstance.startUser' label='发起人'>
{{ processInstance?.startUser.name }} {{ processInstance?.startUser.name }}
</el-form-item> </el-form-item>
<el-form-item v-if="processInstance && processInstance.startUser" label="发起部门"> <el-form-item v-if='processInstance && processInstance.startUser' label='发起部门'>
{{ processInstance?.startUser.deptName }} {{ processInstance?.startUser.deptName }}
</el-form-item> </el-form-item>
<el-card v-if="runningTasks[index].formId != null" class="mb-15px !-mt-10px"> <el-card v-if='runningTasks[index].formId != null' class='mb-15px !-mt-10px'>
<template #header> <template #header>
<span class="el-icon-picture-outline"> <span class='el-icon-picture-outline'>
{{ runningTasks[index]?.formName }} {{ runningTasks[index]?.formName }}
</span> </span>
</template> </template>
<form-create <form-create
v-model="approveForms[index].value" v-model='approveForms[index].value'
v-model:api="approveFormFApis[index]" v-model:api='approveFormFApis[index]'
:option="approveForms[index].option" :option='approveForms[index].option'
:rule="approveForms[index].rule" :rule='approveForms[index].rule'
/> />
</el-card> </el-card>
<el-form-item label="审批建议" prop="reason" style="margin-top: 15px"> <el-form-item label='审批建议' prop='reason' style='margin-top: 15px'>
<el-input <el-input
v-model="auditForms[index].reason" v-model='auditForms[index].reason'
placeholder="请输入审批建议" placeholder='请输入审批建议'
type="textarea" type='textarea'
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label='抄送人' prop='copyUserIds'>--> <!-- <el-form-item label='抄送人' prop='copyUserIds'>-->
@@ -63,9 +63,9 @@
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
</el-form> </el-form>
<div style="margin-bottom: 20px; margin-left: 10%; font-size: 14px"> <div style='margin-bottom: 20px; margin-left: 10%; font-size: 14px'>
<el-button type="success" :icon="Select" @click="handleAudit(item, true)">通过</el-button> <el-button type='success' :icon='Select' @click='handleAudit(item, true)'>通过</el-button>
<el-button type="danger" :icon="Close" @click="handleAudit(item, false)">不通过</el-button> <el-button type='danger' :icon='Close' @click='handleAudit(item, false)'>不通过</el-button>
<!-- <el-button type='primary' @click='openTaskUpdateAssigneeForm(item.id)'>--> <!-- <el-button type='primary' @click='openTaskUpdateAssigneeForm(item.id)'>-->
<!-- <Icon icon='ep:edit' />--> <!-- <Icon icon='ep:edit' />-->
<!-- 转办--> <!-- 转办-->
@@ -83,63 +83,62 @@
</el-col> </el-col>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="申请信息" name="申请信息"> <el-tab-pane label='申请信息' name='申请信息'>
<!-- 申请信息 --> <!-- 申请信息 -->
<el-card v-loading="processInstanceLoading" class="box-card"> <el-card v-loading='processInstanceLoading' class='box-card'>
<template #header> <template #header>
<span class="el-icon-document">申请信息{{ processInstance.name }}</span> <span class='el-icon-document'>申请信息【{{ processInstance.name }}】</span>
</template> </template>
<!-- 情况一:流程表单 --> <!-- 情况一:流程表单 -->
<el-col v-if="processInstance?.processDefinition?.formType === 10" :offset="6" :span="16"> <el-col v-if='processInstance?.processDefinition?.formType === 10' :offset='6' :span='16'>
<form-create <form-create
v-model="detailForm.value" v-model='detailForm.value'
v-model:api="fApi" v-model:api='fApi'
:option="detailForm.option" :option='detailForm.option'
:rule="detailForm.rule" :rule='detailForm.rule'
/> />
</el-col> </el-col>
<!-- 情况二:业务表单 --> <!-- 情况二:业务表单 -->
<div v-if="processInstance?.processDefinition?.formType === 20"> <div v-if='processInstance?.processDefinition?.formType === 20'>
<BusinessFormComponent :id="processInstance.businessKey" :applyTitle="processInstance.name" /> <BusinessFormComponent :id='processInstance.businessKey' :applyTitle='processInstance.name' />
</div> </div>
</el-card> </el-card>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="审批记录" name="审批记录"> <el-tab-pane label='审批记录' name='审批记录'>
<!-- 审批记录 --> <!-- 审批记录 -->
<ProcessInstanceTaskList <ProcessInstanceTaskList
:loading="tasksLoad" :loading='tasksLoad'
:process-instance="processInstance" :process-instance='processInstance'
:tasks="tasks" :tasks='tasks'
@refresh="getTaskList" @refresh='getTaskList'
/> />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="流程图" name="流程图"> <el-tab-pane label='流程图' name='流程图'>
<ProcessInstanceBpmnViewer <ProcessInstanceBpmnViewer
ref="mapRef" ref='mapRef'
:id="`${id}`" :id='`${id}`'
:bpmn-xml="bpmnXml" :bpmn-xml='bpmnXml'
:loading="processInstanceLoading" :loading='processInstanceLoading'
:process-instance="processInstance" :process-instance='processInstance'
:tasks="tasks" :tasks='tasks'
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<ContentWrap> <ContentWrap>
<!-- 弹窗:转派审批人 --> <!-- 弹窗:转派审批人 -->
<TaskTransferForm ref="taskTransferFormRef" @success="getDetail" /> <TaskTransferForm ref='taskTransferFormRef' @success='getDetail' />
<!-- 弹窗:回退节点 --> <!-- 弹窗:回退节点 -->
<TaskReturnForm ref="taskReturnFormRef" @success="getDetail" /> <TaskReturnForm ref='taskReturnFormRef' @success='getDetail' />
<!-- 弹窗:委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中--> <!-- 弹窗:委派,将任务委派给别人处理,处理完成后,会重新回到原审批人手中-->
<TaskDelegateForm ref="taskDelegateForm" @success="getDetail" /> <TaskDelegateForm ref='taskDelegateForm' @success='getDetail' />
<!-- 弹窗加签当前任务审批人为A向前加签选了一个C则需要C先审批然后再是A审批向后加签BA审批完需要B再审批完才算完成这个任务节点 --> <!-- 弹窗加签当前任务审批人为A向前加签选了一个C则需要C先审批然后再是A审批向后加签BA审批完需要B再审批完才算完成这个任务节点 -->
<TaskSignCreateForm ref="taskSignCreateFormRef" @success="getDetail" /> <TaskSignCreateForm ref='taskSignCreateFormRef' @success='getDetail' />
</ContentWrap> </ContentWrap>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang='ts' setup>
import { onMounted, provide, ref, getCurrentInstance, reactive, watch, unref, nextTick, markRaw } from 'vue' import { onMounted, ref, getCurrentInstance, reactive, watch, unref, nextTick, markRaw } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { useUserStore } from '@/stores/modules/user'
import ContentWrap from '@/components/ContentWrap/src/ContentWrap.vue' import ContentWrap from '@/components/ContentWrap/src/ContentWrap.vue'
import { setConfAndFields2 } from '@/utils/formCreate' import { setConfAndFields2 } from '@/utils/formCreate'
import type { ApiAttrs } from '@form-create/element-ui/types/config' import type { ApiAttrs } from '@form-create/element-ui/types/config'
@@ -349,7 +348,7 @@ const getTaskList = async () => {
stepList.value.push(vv) stepList.value.push(vv)
}) })
}) })
tasks.value=[] tasks.value = []
}) })
} finally { } finally {
tasksLoad.value = false tasksLoad.value = false
@@ -361,7 +360,7 @@ const getTaskList = async () => {
*/ */
const loadRunningTask = tasks => { const loadRunningTask = tasks => {
//清空数据 //清空数据
runningTasks.value=[] runningTasks.value = []
// tasks.length = 1 // tasks.length = 1
tasks?.forEach(task => { tasks?.forEach(task => {
if (!isEmpty(task.children)) { if (!isEmpty(task.children)) {
@@ -400,8 +399,8 @@ const userOptions = ref([]) // 用户列表
watch( watch(
() => stepList.value, () => stepList.value,
(val, oldVal) => { (val, oldVal) => {
if (val&&val.length!=0 ) { if (val && val.length != 0) {
tasks.value=[] tasks.value = []
val.map(task => { val.map(task => {
if (task.status !== 4) { if (task.status !== 4) {
tasks.value.push(task) tasks.value.push(task)
@@ -426,8 +425,8 @@ watch(
} }
}, },
{ {
immediate:true, immediate: true,
deep:true, deep: true
} }
) )
@@ -444,7 +443,7 @@ onMounted(async () => {
} }
}) })
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
::v-deep .el-tab-pane { ::v-deep .el-tab-pane {
height: calc(100vh - 200px) !important; height: calc(100vh - 200px) !important;
overflow: auto !important; overflow: auto !important;

View File

@@ -3,17 +3,17 @@
<div> <div>
<TableHeader date-picker> <TableHeader date-picker>
<template v-slot:select> <template v-slot:select>
<el-form-item label="任务名称"> <el-form-item label='任务名称'>
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入任务名称" /> <el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称' />
</el-form-item> </el-form-item>
</template> </template>
</TableHeader> </TableHeader>
<!--表格--> <!--表格-->
<Table ref="tableRef"></Table> <Table ref='tableRef'></Table>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang='ts'>
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue' import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue' import TableHeader from '@/components/table/header/index.vue'
@@ -32,7 +32,14 @@ const tableStore = new TableStore({
method: 'POST', method: 'POST',
publicHeight: 65, publicHeight: 65,
column: [ column: [
{ title: '序号', type: 'seq', width: 80 }, {
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'processInstance.name', minWidth: 130 }, { title: '任务名称', field: 'processInstance.name', minWidth: 130 },
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 }, { title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 }, { title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },

View File

@@ -1,21 +1,26 @@
<template> <template>
<div class="default-main"> <div class='default-main'>
<el-tabs v-model="activeName" type="border-card"> <el-tabs v-model='activeName' type='border-card'>
<el-tab-pane label="待办任务" name="1"> <el-tab-pane label='待办任务' name='1'>
<TodoTask v-if="activeName == '1'" /> <TodoTask v-if="activeName == '1'" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="已办任务" name="2"> <el-tab-pane label='已办任务' name='2'>
<DoneTask v-if="activeName == '2'" /> <DoneTask v-if="activeName == '2'" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label='我发起的' name='3'>
<MyInstance v-if="activeName == '3'" />
</el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang='ts'>
import { ref } from 'vue' import { ref } from 'vue'
import TodoTask from './todo/index.vue' import TodoTask from './todo/index.vue'
import DoneTask from './done/index.vue' import DoneTask from './done/index.vue'
import MyInstance from './myInstance/index.vue'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
defineOptions({ defineOptions({
// name: 'bpm/task' // name: 'bpm/task'
}) })
@@ -24,11 +29,12 @@ const activeName = ref('1')
const layout = mainHeight(63) as any const layout = mainHeight(63) as any
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
.bars_w { .bars_w {
width: 100%; width: 100%;
height: 500px; height: 500px;
} }
:deep(.el-tabs__content) { :deep(.el-tabs__content) {
height: v-bind('layout.height'); height: v-bind('layout.height');
overflow-y: auto; overflow-y: auto;

View File

@@ -0,0 +1,138 @@
<!--待办事项列表-->
<template>
<div>
<TableHeader date-picker>
<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 } from 'vue'
import { formatDate, formatPast2 } from '@/utils/formatTime'
import { useRouter } from 'vue-router'
defineOptions({
name: 'businessUser'
})
const { push } = useRouter()
const tableStore = new TableStore({
url: '/bpm-boot/bpm/processInstance/myPage',
method: 'POST',
publicHeight: 65,
column: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'name', minWidth: 130 },
{ title: '流程分类', field: 'category', minWidth: 130 },
{
field: 'status',
title: '流程状态',
render: 'tag',
minWidth: 130,
custom: {
1: 'primary',
2: 'success',
3: 'danger',
4: 'warning'
},
replaceValue: {
1: '审批中',
2: '审批通过',
3: '审批不通过',
4: '已取消'
}
},
{ title: '发起时间', field: 'startTime', minWidth: 140 },
{ title: '结束时间', field: 'endTime', minWidth: 140 },
{
title: '耗时', field: 'durationInMillis', minWidth: 130,
formatter: (obj: any) => {
const millis = obj.row.durationInMillis
return millis > 0 ? formatPast2(millis) : ''
}
},
{
title: '当前审批任务', field: 'tasks', minWidth: 140,
formatter: (obj: any) => {
const tasks = obj.row.tasks
if (tasks) {
return tasks[0].name
} else {
return ''
}
// return millis > 0 ? formatPast2(millis) : '--'
}
},
{
title: '操作',
align: 'center',
minWidth: '180',
fixed: 'right',
render: 'buttons',
buttons: [
{
name: 'productSetting',
title: '流程详情',
type: 'primary',
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
handleAudit(row.id)
}
}
]
}
],
beforeSearchFun: () => {
for (let key in tableStore.table.params) {
if (tableStore.table.params[key] === '') {
delete tableStore.table.params[key]
}
}
}
})
onMounted(() => {
// 加载数据
tableStore.index()
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
/** 处理审批按钮 */
const handleAudit = (instanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: instanceId
}
})
}
</script>

View File

@@ -1,7 +1,7 @@
<!--待办事项列表--> <!--待办事项列表-->
<template> <template>
<div > <div>
<TableHeader date-picker> <TableHeader>
<template v-slot:select> <template v-slot:select>
<el-form-item label='任务名称'> <el-form-item label='任务名称'>
<el-input <el-input
@@ -37,7 +37,14 @@ const tableStore = new TableStore({
method: 'POST', method: 'POST',
publicHeight: 65, publicHeight: 65,
column: [ column: [
{ title: '序号', type: 'seq', width: 80 }, {
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ title: '任务名称', field: 'processInstance.name', minWidth: 130 }, { title: '任务名称', field: 'processInstance.name', minWidth: 130 },
{ title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 }, { title: '发起人', field: 'processInstance.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 }, { title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },