我发起的菜单

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

View File

@@ -1,55 +1,55 @@
<!-- 流程详情页面 tab切换 -->
<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" />
<el-tabs type="border-card" v-model="tab" @tab-click="handleClickTab">
<el-tab-pane label="流程审核" name="流程审核" v-if="runningTasks.length > 0">
<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-tab-pane label='流程审核' name='流程审核' v-if='runningTasks.length > 0'>
<el-card
v-for="(item, index) in runningTasks"
:key="index"
v-loading="processInstanceLoading"
class="box-card"
v-for='(item, index) in runningTasks'
:key='index'
v-loading='processInstanceLoading'
class='box-card'
>
<template #header>
<span class="el-icon-picture-outline">当前任务{{ item.name }}</span>
<span class='el-icon-picture-outline'>当前任务【{{ item.name }}】</span>
</template>
<el-col :offset="6" :span="16">
<el-col :offset='6' :span='16'>
<el-form
:ref="'form' + index"
:model="auditForms[index]"
:rules="auditRule"
label-width="100px"
:model='auditForms[index]'
:rules='auditRule'
label-width='100px'
>
<el-form-item v-if="processInstance && processInstance.name" label="流程名">
<el-form-item v-if='processInstance && processInstance.name' label='流程名'>
{{ processInstance.name }}
</el-form-item>
<el-form-item v-if="processInstance && processInstance.startUser" label="发起人">
<el-form-item v-if='processInstance && processInstance.startUser' label='发起人'>
{{ processInstance?.startUser.name }}
</el-form-item>
<el-form-item v-if="processInstance && processInstance.startUser" label="发起部门">
<el-form-item v-if='processInstance && processInstance.startUser' label='发起部门'>
{{ processInstance?.startUser.deptName }}
</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>
<span class="el-icon-picture-outline">
<span class='el-icon-picture-outline'>
{{ runningTasks[index]?.formName }}
</span>
</template>
<form-create
v-model="approveForms[index].value"
v-model:api="approveFormFApis[index]"
:option="approveForms[index].option"
:rule="approveForms[index].rule"
v-model='approveForms[index].value'
v-model:api='approveFormFApis[index]'
:option='approveForms[index].option'
:rule='approveForms[index].rule'
/>
</el-card>
<el-form-item label="审批建议" prop="reason" style="margin-top: 15px">
<el-form-item label='审批建议' prop='reason' style='margin-top: 15px'>
<el-input
v-model="auditForms[index].reason"
placeholder="请输入审批建议"
type="textarea"
v-model='auditForms[index].reason'
placeholder='请输入审批建议'
type='textarea'
/>
</el-form-item>
<!-- <el-form-item label='抄送人' prop='copyUserIds'>-->
@@ -63,9 +63,9 @@
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-form>
<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="danger" :icon="Close" @click="handleAudit(item, false)">不通过</el-button>
<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='danger' :icon='Close' @click='handleAudit(item, false)'>不通过</el-button>
<!-- <el-button type='primary' @click='openTaskUpdateAssigneeForm(item.id)'>-->
<!-- <Icon icon='ep:edit' />-->
<!-- 转办-->
@@ -83,63 +83,62 @@
</el-col>
</el-card>
</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>
<span class="el-icon-document">申请信息{{ processInstance.name }}</span>
<span class='el-icon-document'>申请信息【{{ processInstance.name }}】</span>
</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
v-model="detailForm.value"
v-model:api="fApi"
:option="detailForm.option"
:rule="detailForm.rule"
v-model='detailForm.value'
v-model:api='fApi'
:option='detailForm.option'
:rule='detailForm.rule'
/>
</el-col>
<!-- 情况二:业务表单 -->
<div v-if="processInstance?.processDefinition?.formType === 20">
<BusinessFormComponent :id="processInstance.businessKey" :applyTitle="processInstance.name" />
<div v-if='processInstance?.processDefinition?.formType === 20'>
<BusinessFormComponent :id='processInstance.businessKey' :applyTitle='processInstance.name' />
</div>
</el-card>
</el-tab-pane>
<el-tab-pane label="审批记录" name="审批记录">
<el-tab-pane label='审批记录' name='审批记录'>
<!-- 审批记录 -->
<ProcessInstanceTaskList
:loading="tasksLoad"
:process-instance="processInstance"
:tasks="tasks"
@refresh="getTaskList"
:loading='tasksLoad'
:process-instance='processInstance'
:tasks='tasks'
@refresh='getTaskList'
/>
</el-tab-pane>
<el-tab-pane label="流程图" name="流程图">
<el-tab-pane label='流程图' name='流程图'>
<ProcessInstanceBpmnViewer
ref="mapRef"
:id="`${id}`"
:bpmn-xml="bpmnXml"
:loading="processInstanceLoading"
:process-instance="processInstance"
:tasks="tasks"
ref='mapRef'
:id='`${id}`'
:bpmn-xml='bpmnXml'
:loading='processInstanceLoading'
:process-instance='processInstance'
:tasks='tasks'
/>
</el-tab-pane>
</el-tabs>
<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再审批完才算完成这个任务节点 -->
<TaskSignCreateForm ref="taskSignCreateFormRef" @success="getDetail" />
<TaskSignCreateForm ref='taskSignCreateFormRef' @success='getDetail' />
</ContentWrap>
</div>
</template>
<script lang="ts" setup>
import { onMounted, provide, ref, getCurrentInstance, reactive, watch, unref, nextTick, markRaw } from 'vue'
<script lang='ts' setup>
import { onMounted, ref, getCurrentInstance, reactive, watch, unref, nextTick, markRaw } from 'vue'
import { ElMessage } from 'element-plus'
import { useUserStore } from '@/stores/modules/user'
import ContentWrap from '@/components/ContentWrap/src/ContentWrap.vue'
import { setConfAndFields2 } from '@/utils/formCreate'
import type { ApiAttrs } from '@form-create/element-ui/types/config'
@@ -349,7 +348,7 @@ const getTaskList = async () => {
stepList.value.push(vv)
})
})
tasks.value=[]
tasks.value = []
})
} finally {
tasksLoad.value = false
@@ -361,7 +360,7 @@ const getTaskList = async () => {
*/
const loadRunningTask = tasks => {
//清空数据
runningTasks.value=[]
runningTasks.value = []
// tasks.length = 1
tasks?.forEach(task => {
if (!isEmpty(task.children)) {
@@ -400,8 +399,8 @@ const userOptions = ref([]) // 用户列表
watch(
() => stepList.value,
(val, oldVal) => {
if (val&&val.length!=0 ) {
tasks.value=[]
if (val && val.length != 0) {
tasks.value = []
val.map(task => {
if (task.status !== 4) {
tasks.value.push(task)
@@ -426,8 +425,8 @@ watch(
}
},
{
immediate:true,
deep:true,
immediate: true,
deep: true
}
)
@@ -444,7 +443,7 @@ onMounted(async () => {
}
})
</script>
<style lang="scss" scoped>
<style lang='scss' scoped>
::v-deep .el-tab-pane {
height: calc(100vh - 200px) !important;
overflow: auto !important;

View File

@@ -3,17 +3,17 @@
<div>
<TableHeader date-picker>
<template v-slot:select>
<el-form-item label="任务名称">
<el-input v-model="tableStore.table.params.searchValue" placeholder="请输入任务名称" />
<el-form-item label='任务名称'>
<el-input v-model='tableStore.table.params.searchValue' placeholder='请输入任务名称' />
</el-form-item>
</template>
</TableHeader>
<!--表格-->
<Table ref="tableRef"></Table>
<Table ref='tableRef'></Table>
</div>
</template>
<script setup lang="ts">
<script setup lang='ts'>
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
@@ -32,7 +32,14 @@ const tableStore = new TableStore({
method: 'POST',
publicHeight: 65,
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.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },

View File

@@ -1,21 +1,26 @@
<template>
<div class="default-main">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="待办任务" name="1">
<div class='default-main'>
<el-tabs v-model='activeName' type='border-card'>
<el-tab-pane label='待办任务' name='1'>
<TodoTask v-if="activeName == '1'" />
</el-tab-pane>
<el-tab-pane label="已办任务" name="2">
<el-tab-pane label='已办任务' name='2'>
<DoneTask v-if="activeName == '2'" />
</el-tab-pane>
<el-tab-pane label='我发起的' name='3'>
<MyInstance v-if="activeName == '3'" />
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup lang="ts">
<script setup lang='ts'>
import { ref } from 'vue'
import TodoTask from './todo/index.vue'
import DoneTask from './done/index.vue'
import MyInstance from './myInstance/index.vue'
import { mainHeight } from '@/utils/layout'
defineOptions({
// name: 'bpm/task'
})
@@ -24,11 +29,12 @@ const activeName = ref('1')
const layout = mainHeight(63) as any
</script>
<style lang="scss" scoped>
<style lang='scss' scoped>
.bars_w {
width: 100%;
height: 500px;
}
:deep(.el-tabs__content) {
height: v-bind('layout.height');
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>
<div >
<TableHeader date-picker>
<div>
<TableHeader>
<template v-slot:select>
<el-form-item label='任务名称'>
<el-input
@@ -37,7 +37,14 @@ const tableStore = new TableStore({
method: 'POST',
publicHeight: 65,
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.startUser.name', minWidth: 130 },
{ title: '发起部门', field: 'processInstance.startUser.deptName', minWidth: 130 },