Skip to content

Commit dcdce41

Browse files
committed
【文案修改】工作流:“回退”统一改成“退回”,和飞书保持一致
1 parent 410c3bc commit dcdce41

File tree

8 files changed

+91
-75
lines changed

8 files changed

+91
-75
lines changed

src/api/bpm/task/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ export const getTaskListByProcessInstanceId = async (processInstanceId: string)
7575
})
7676
}
7777

78-
// 获取所有可回退的节点
78+
// 获取所有可退回的节点
7979
export const getTaskListByReturn = async (id: string) => {
8080
return await request.get({ url: '/bpm/task/list-by-return', params: { id } })
8181
}
8282

83-
// 回退
83+
// 退回
8484
export const returnTask = async (data: any) => {
8585
return await request.put({ url: '/bpm/task/return', data })
8686
}

src/components/SimpleProcessDesignerV2/src/consts.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export enum ApproveMethodType {
177177
export type RejectHandler = {
178178
// 审批拒绝类型
179179
type: RejectHandlerType
180-
// 回退节点 Id
180+
// 退回节点 Id
181181
returnNodeId?: string
182182
}
183183

@@ -359,7 +359,7 @@ export enum OperationButtonType {
359359
*/
360360
ADD_SIGN = 5,
361361
/**
362-
* 回退
362+
* 退回
363363
*/
364364
RETURN = 6,
365365
/**
@@ -516,7 +516,7 @@ export const DEFAULT_BUTTON_SETTING: ButtonSetting[] = [
516516
{ id: OperationButtonType.TRANSFER, displayName: '转办', enable: true },
517517
{ id: OperationButtonType.DELEGATE, displayName: '委派', enable: true },
518518
{ id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: true },
519-
{ id: OperationButtonType.RETURN, displayName: '回退', enable: true }
519+
{ id: OperationButtonType.RETURN, displayName: '退回', enable: true }
520520
]
521521

522522
// 发起人的按钮权限。暂时定死,不可以编辑
@@ -526,7 +526,7 @@ export const START_USER_BUTTON_SETTING: ButtonSetting[] = [
526526
{ id: OperationButtonType.TRANSFER, displayName: '转办', enable: false },
527527
{ id: OperationButtonType.DELEGATE, displayName: '委派', enable: false },
528528
{ id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: false },
529-
{ id: OperationButtonType.RETURN, displayName: '回退', enable: false }
529+
{ id: OperationButtonType.RETURN, displayName: '退回', enable: false }
530530
]
531531

532532
export const MULTI_LEVEL_DEPT: DictDataVO = [

src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,7 @@
134134
prop="userIds"
135135
span="24"
136136
>
137-
<el-select
138-
v-model="configForm.userIds"
139-
clearable
140-
multiple
141-
style="width: 100%"
142-
>
137+
<el-select v-model="configForm.userIds" clearable multiple style="width: 100%">
143138
<el-option
144139
v-for="item in userOptions"
145140
:key="item.id"
@@ -183,10 +178,7 @@
183178
:key="index"
184179
class="flex items-center"
185180
>
186-
<el-radio
187-
:value="item.value"
188-
:label="item.value"
189-
>
181+
<el-radio :value="item.value" :label="item.value">
190182
{{ item.label }}
191183
</el-radio>
192184
<el-form-item prop="approveRatio">
@@ -552,7 +544,7 @@ const approveMethodChanged = () => {
552544
}
553545
formRef.value.clearValidate('approveRatio')
554546
}
555-
// 审批拒绝 可回退的节点
547+
// 审批拒绝 可退回的节点
556548
const returnTaskList = ref<SimpleFlowNode[]>([])
557549
// 审批人超时未处理设置
558550
const {

src/components/bpmnProcessDesigner/package/designer/ProcessViewer.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,12 @@ const importXML = async (xml: string) => {
282282
/** 高亮流程 */
283283
const setProcessStatus = (view: any) => {
284284
// 设置相关变量
285+
if (!view || !view.processInstance) {
286+
return
287+
}
285288
processInstance.value = view.processInstance
286289
tasks.value = view.tasks
287-
if (isLoading.value || !processInstance.value || !bpmnViewer.value) {
290+
if (isLoading.value || !bpmnViewer.value) {
288291
return
289292
}
290293
const {

src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
placement="top-end"
99
:width="420"
1010
trigger="click"
11-
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
11+
v-if="runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.APPROVE)"
1212
>
1313
<template #reference>
1414
<el-button plain type="success" @click="openPopover('approve')">
@@ -60,7 +60,7 @@
6060
placement="top-end"
6161
:width="420"
6262
trigger="click"
63-
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
63+
v-if="runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.REJECT)"
6464
>
6565
<template #reference>
6666
<el-button class="mr-20px" plain type="danger" @click="openPopover('reject')">
@@ -171,7 +171,7 @@
171171
placement="top-start"
172172
:width="420"
173173
trigger="click"
174-
v-if=" runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
174+
v-if="runningTask && isHandleTaskStatus() && isShowButton(OperationButtonType.TRANSFER)"
175175
>
176176
<template #reference>
177177
<div @click="openPopover('transfer')" class="hover-bg-gray-100 rounded-xl p-6px">
@@ -397,7 +397,9 @@
397397
placement="top-start"
398398
:width="420"
399399
trigger="click"
400-
v-if="userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)"
400+
v-if="
401+
userId === processInstance?.startUser?.id && !isEndProcessStatus(processInstance?.status)
402+
"
401403
>
402404
<template #reference>
403405
<div @click="openPopover('cancel')" class="hover-bg-gray-100 rounded-xl p-6px">
@@ -414,7 +416,7 @@
414416
label-width="100px"
415417
>
416418
<el-form-item label="撤消理由" prop="cancelReason">
417-
<span class=" text-#878c93 text-12px">&nbsp; 撤消后,该审批流程将自动结束</span>
419+
<span class="text-#878c93 text-12px">&nbsp; 撤消后,该审批流程将自动结束</span>
418420
<el-input
419421
v-model="genericForm.cancelReason"
420422
clearable
@@ -424,7 +426,9 @@
424426
/>
425427
</el-form-item>
426428
<el-form-item>
427-
<el-button :disabled="formLoading" type="primary" @click="handleCancel()">撤消</el-button>
429+
<el-button :disabled="formLoading" type="primary" @click="handleCancel()"
430+
>撤消</el-button
431+
>
428432
<el-button @click="popOverVisible.cancel = false"> 取消 </el-button>
429433
</el-form-item>
430434
</el-form>
@@ -434,15 +438,16 @@
434438
<div
435439
@click="handleReCreate()"
436440
class="hover-bg-gray-100 rounded-xl p-6px"
437-
v-if="userId === processInstance?.startUser?.id && isEndProcessStatus(processInstance?.status)
438-
&& processDefinition?.formType === 10"
441+
v-if="
442+
userId === processInstance?.startUser?.id &&
443+
isEndProcessStatus(processInstance?.status) &&
444+
processDefinition?.formType === 10
445+
"
439446
>
440447
<Icon :size="14" icon="ep:refresh" />&nbsp; 再次提交
441448
</div>
442449
<!-- 弹窗:子任务 -->
443450
<TaskSignList ref="taskSignListRef" @success="reload" />
444-
445-
446451
</div>
447452
</template>
448453
<script lang="ts" setup>
@@ -457,20 +462,22 @@ import {
457462
OPERATION_BUTTON_NAME
458463
} from '@/components/SimpleProcessDesignerV2/src/consts'
459464
import { BpmProcessInstanceStatus } from '@/utils/constants'
460-
defineOptions({ name: 'ProcessInstanceBtnConatiner' })
465+
466+
defineOptions({ name: 'ProcessInstanceBtnContainer' })
461467
462468
const router = useRouter() // 路由
463469
const message = useMessage() // 消息弹窗
464470
const { proxy } = getCurrentInstance() as any
471+
465472
const userId = useUserStoreWithOut().getUser.id // 当前登录的编号
466473
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
467474
const props = defineProps({
468475
processInstance: propTypes.object, // 流程实例信息
469-
processDefinition : propTypes.object, // 流程定义信息
476+
processDefinition: propTypes.object, // 流程定义信息
470477
userOptions: propTypes.any
471478
})
479+
472480
const formLoading = ref(false) // 表单加载中
473-
/** 气泡卡是否展示 */
474481
const popOverVisible = ref({
475482
approve: false,
476483
reject: false,
@@ -480,16 +487,15 @@ const popOverVisible = ref({
480487
return: false,
481488
copy: false,
482489
cancel: false
483-
})
484-
/** 退回节点 */
485-
const returnList = ref([] as any)
490+
}) // 气泡卡是否展示
491+
const returnList = ref([] as any) // 退回节点
492+
486493
// ========== 审批信息 ==========
487494
const runningTask = ref<any>() // 运行中的任务
488495
const genericForm = ref<any>({}) // 通用表单
489496
const approveForm = ref<any>({}) // 审批通过时,额外的补充信息
490497
const approveFormFApi = ref<any>({}) // approveForms 的 fAPi
491498
const formRef = ref()
492-
/** 表单校验规则 */
493499
const genericRule = reactive({
494500
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
495501
returnReason: [{ required: true, message: '退回理由不能为空', trigger: 'blur' }],
@@ -498,8 +504,8 @@ const genericRule = reactive({
498504
assigneeUserId: [{ required: true, message: '新审批人不能为空', trigger: 'change' }],
499505
delegateUserId: [{ required: true, message: '接收人不能为空', trigger: 'change' }],
500506
addSignUserIds: [{ required: true, message: '加签处理人不能为空', trigger: 'change' }],
501-
targetTaskDefinitionKey: [{ required: true, message: '退回节点不能为空', trigger: 'change' }]
502-
})
507+
targetTaskDefinitionKey: [{ required: true, message: '退回节点不能为空', trigger: 'change' }]
508+
}) // 表单校验规则
503509
504510
/** 监听 approveFormFApis,实现它对应的 form-create 初始化后,隐藏掉对应的表单提交按钮 */
505511
watch(
@@ -520,20 +526,16 @@ const openReturnPopover = async () => {
520526
message.warning('当前没有可退回的节点')
521527
return
522528
}
523-
openPopover('return')
529+
await openPopover('return')
524530
}
531+
525532
/** 弹出气泡卡 */
526-
const openPopover = (type: string) => {
533+
const openPopover = async (type: string) => {
527534
Object.keys(popOverVisible.value).forEach((item) => {
528-
if (item === type) {
529-
popOverVisible.value[item] = true
530-
} else {
531-
popOverVisible.value[item] = false
532-
}
533-
})
534-
nextTick().then(() => {
535-
formRef.value.resetFields()
535+
popOverVisible.value[item] = item === type
536536
})
537+
await nextTick()
538+
formRef.value.resetFields()
537539
}
538540
539541
/** 处理审批通过和不通过的操作 */
@@ -575,7 +577,7 @@ const handleAudit = async (pass: boolean) => {
575577
}
576578
}
577579
578-
/* 处理抄送 */
580+
/** 处理抄送 */
579581
const handleCopy = async () => {
580582
formLoading.value = true
581583
try {
@@ -718,7 +720,10 @@ const handleCancel = async () => {
718720
const valid = await elForm.validate()
719721
if (!valid) return
720722
// 1.2 提交取消
721-
await ProcessInstanceApi.cancelProcessInstanceByStartUser(props.processInstance.id, genericForm.value.cancelReason)
723+
await ProcessInstanceApi.cancelProcessInstanceByStartUser(
724+
props.processInstance.id,
725+
genericForm.value.cancelReason
726+
)
722727
popOverVisible.value.return = false
723728
message.success('操作成功')
724729
// 2 重新加载数据
@@ -764,8 +769,9 @@ const isHandleTaskStatus = () => {
764769
const isEndProcessStatus = (status: number) => {
765770
let isEndStatus = false
766771
if (
767-
BpmProcessInstanceStatus.APPROVE === status || BpmProcessInstanceStatus.REJECT === status ||
768-
BpmProcessInstanceStatus.CANCEL === status
772+
BpmProcessInstanceStatus.APPROVE === status ||
773+
BpmProcessInstanceStatus.REJECT === status ||
774+
BpmProcessInstanceStatus.CANCEL === status
769775
) {
770776
isEndStatus = true
771777
}
@@ -806,7 +812,6 @@ const loadTodoTask = (task: any) => {
806812
}
807813
808814
defineExpose({ loadTodoTask })
809-
810815
</script>
811816

812817
<style lang="scss" scoped>

src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,45 @@
1111
>
1212
<div class="flex flex-col items-start">
1313
<div class="font-bold"> {{ activity.name }}</div>
14-
<div class="flex items-center flex-wrap mt-1 ">
14+
<div class="flex items-center flex-wrap mt-1">
1515
<!-- 情况一:遍历每个审批节点下的【进行中】task 任务 -->
1616
<div v-for="(task, idx) in activity.tasks" :key="idx" class="flex items-center">
1717
<div class="flex flex-col pr-2">
1818
<div class="position-relative" v-if="task.assigneeUser || task.ownerUser">
1919
<!-- 信息:头像 -->
20-
<el-tooltip :content="task.reason" placement="bottom" v-if="task.assigneeUser && task.assigneeUser.avatar" effect="light">
21-
<el-avatar
22-
:size="36"
23-
:src="task.assigneeUser.avatar"
24-
/>
20+
<el-tooltip
21+
:content="task.reason"
22+
placement="bottom"
23+
v-if="task.assigneeUser && task.assigneeUser.avatar"
24+
effect="light"
25+
>
26+
<el-avatar :size="36" :src="task.assigneeUser.avatar" />
2527
</el-tooltip>
26-
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.assigneeUser && task.assigneeUser.nickname" effect="light">
27-
<el-avatar >
28+
<el-tooltip
29+
:content="task.reason"
30+
placement="bottom"
31+
v-else-if="task.assigneeUser && task.assigneeUser.nickname"
32+
effect="light"
33+
>
34+
<el-avatar>
2835
{{ task.assigneeUser.nickname.substring(0, 1) }}
2936
</el-avatar>
3037
</el-tooltip>
31-
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.avatar" effect="light">
32-
<el-avatar :src="task.ownerUser.avatar"/>
38+
<el-tooltip
39+
:content="task.reason"
40+
placement="bottom"
41+
v-else-if="task.ownerUser && task.ownerUser.avatar"
42+
effect="light"
43+
>
44+
<el-avatar :src="task.ownerUser.avatar" />
3345
</el-tooltip>
34-
<el-tooltip :content="task.reason" placement="bottom" v-else-if="task.ownerUser && task.ownerUser.nickname" effect="light">
35-
<el-avatar >
46+
<el-tooltip
47+
:content="task.reason"
48+
placement="bottom"
49+
v-else-if="task.ownerUser && task.ownerUser.nickname"
50+
effect="light"
51+
>
52+
<el-avatar>
3653
{{ task.ownerUser.nickname.substring(0, 1) }}
3754
</el-avatar>
3855
</el-tooltip>
@@ -146,7 +163,6 @@ defineProps<{
146163
147164
// 审批节点
148165
149-
150166
const statusIconMap2 = {
151167
// 未开始
152168
'-1': { color: '#e5e7ec', icon: 'ep-clock' },
@@ -160,7 +176,7 @@ const statusIconMap2 = {
160176
'3': { color: '#f46b6c', icon: 'fa-solid:times-circle' },
161177
// 取消
162178
'4': { color: '#cccccc', icon: 'ep:delete-filled' },
163-
// 回退
179+
// 退回
164180
'5': { color: '#f46b6c', icon: 'ep:remove-filled' },
165181
// 委派中
166182
'6': { color: '#448ef7', icon: 'ep:loading' },
@@ -180,7 +196,7 @@ const statusIconMap = {
180196
'3': { color: '#f46b6c', icon: Close },
181197
// 已取消
182198
'4': { color: '#cccccc', icon: Delete },
183-
// 回退
199+
// 退回
184200
'5': { color: '#f46b6c', icon: Minus },
185201
// 委派中
186202
'6': { color: '#448ef7', icon: Loading },

0 commit comments

Comments
 (0)