mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-02-02 03:34:59 +08:00
【功能优化】发起人自选判断优化
This commit is contained in:
parent
2aa2b4609f
commit
81d2a38363
@ -1,6 +1,6 @@
|
||||
import request from '@/config/axios'
|
||||
import { ProcessDefinitionVO } from '@/api/bpm/model'
|
||||
import { NodeType } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
export type Task = {
|
||||
id: string
|
||||
name: string
|
||||
@ -43,6 +43,7 @@ export type ApprovalNodeInfo = {
|
||||
id: number
|
||||
name: string
|
||||
nodeType: NodeType
|
||||
candidateStrategy?: CandidateStrategy
|
||||
status: number
|
||||
startTime?: Date
|
||||
endTime?: Date
|
||||
|
@ -29,7 +29,6 @@
|
||||
ref="timelineRef"
|
||||
:activity-nodes="activityNodes"
|
||||
:show-status-icon="false"
|
||||
:startUserSelectTasks="startUserSelectTasks"
|
||||
:startUserSelectAssignees="startUserSelectAssignees"
|
||||
@select-user-confirm="selectUserConfirm"
|
||||
/>
|
||||
@ -78,6 +77,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { decodeFields, setConfAndFields2 } from '@/utils/formCreate'
|
||||
import { BpmModelType } from '@/utils/constants'
|
||||
import { CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
import ProcessInstanceBpmnViewer from '../detail/ProcessInstanceBpmnViewer.vue'
|
||||
import ProcessInstanceSimpleViewer from '../detail/ProcessInstanceSimpleViewer.vue'
|
||||
import ProcessInstanceTimeline from '../detail/ProcessInstanceTimeline.vue'
|
||||
@ -103,7 +103,7 @@ const detailForm: any = ref({
|
||||
}) // 流程表单详情
|
||||
const fApi = ref<ApiAttrs>()
|
||||
// 指定审批人
|
||||
const startUserSelectTasks: any = ref([]) // 发起人需要选择审批人的用户任务列表
|
||||
const startUserSelectTasks: any = ref([]) // 发起人需要选择审批人或抄送人的任务列表
|
||||
const startUserSelectAssignees = ref({}) // 发起人选择审批人的数据
|
||||
const bpmnXML: any = ref(null) // BPMN 数据
|
||||
const simpleJson = ref<string | undefined>() // Simple 设计器数据 json 格式
|
||||
@ -140,14 +140,6 @@ const initProcessInfo = async (row: any, formVariables?: any) => {
|
||||
if (processDefinitionDetail) {
|
||||
bpmnXML.value = processDefinitionDetail.bpmnXml
|
||||
simpleJson.value = processDefinitionDetail.simpleModel
|
||||
startUserSelectTasks.value = processDefinitionDetail.startUserSelectTasks
|
||||
// 设置指定审批人
|
||||
if (startUserSelectTasks.value?.length > 0) {
|
||||
for (const userTask of startUserSelectTasks.value) {
|
||||
// 初始化数据
|
||||
startUserSelectAssignees.value[userTask.id] = []
|
||||
}
|
||||
}
|
||||
}
|
||||
// 情况二:业务表单
|
||||
} else if (row.formCustomCreatePath) {
|
||||
@ -169,6 +161,12 @@ const getApprovalDetail = async (row: any) => {
|
||||
message.error('查询不到审批详情信息!')
|
||||
return
|
||||
}
|
||||
// 获取发起人自选的任务
|
||||
startUserSelectTasks.value = data.activityNodes?.filter(node => CandidateStrategy.START_USER_SELECT === node.candidateStrategy )
|
||||
for (const node of startUserSelectTasks.value) {
|
||||
// 初始化数据
|
||||
startUserSelectAssignees.value[node.id] = []
|
||||
}
|
||||
// 获取审批节点,显示 Timeline 的数据
|
||||
activityNodes.value = data.activityNodes
|
||||
} finally {
|
||||
@ -187,7 +185,7 @@ const submitForm = async () => {
|
||||
Array.isArray(startUserSelectAssignees.value[userTask.id]) &&
|
||||
startUserSelectAssignees.value[userTask.id].length === 0
|
||||
)
|
||||
return message.warning(`请选择${userTask.name}的审批人`)
|
||||
return message.warning(`请选择${userTask.name}的候选人`)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,7 @@
|
||||
<!-- 需要自定义选择审批人 -->
|
||||
<div
|
||||
class="flex flex-wrap gap2 items-center"
|
||||
v-if="
|
||||
startUserSelectTasks?.length > 0 && Array.isArray(startUserSelectAssignees[activity.id])
|
||||
"
|
||||
v-if="isEmpty(activity.tasks) && isEmpty(activity.candidateUsers) && CandidateStrategy.START_USER_SELECT === activity.candidateStrategy"
|
||||
>
|
||||
<!-- && activity.nodeType === NodeType.USER_TASK_NODE -->
|
||||
<el-button
|
||||
@ -156,7 +154,8 @@
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
|
||||
import { TaskStatusEnum } from '@/api/bpm/task'
|
||||
import { NodeType } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
|
||||
import { isEmpty } from '@/utils/is'
|
||||
import { Check, Close, Loading, Clock, Minus, Delete } from '@element-plus/icons-vue'
|
||||
import starterSvg from '@/assets/svgs/bpm/starter.svg'
|
||||
import auditorSvg from '@/assets/svgs/bpm/auditor.svg'
|
||||
@ -170,12 +169,10 @@ withDefaults(
|
||||
defineProps<{
|
||||
activityNodes: ProcessInstanceApi.ApprovalNodeInfo[] // 审批节点信息
|
||||
showStatusIcon?: boolean // 是否显示头像右下角状态图标
|
||||
startUserSelectTasks?: any[] // 发起人需要选择审批人的用户任务列表
|
||||
startUserSelectAssignees?: any // 发起人选择审批人的数据
|
||||
}>(),
|
||||
{
|
||||
showStatusIcon: true, // 默认值为 true
|
||||
startUserSelectTasks: () => [], // 默认值为空数组
|
||||
startUserSelectAssignees: () => {}
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user