Skip to content

Commit 03b8bd5

Browse files
committed
BPM:调整抄送逻辑的实现,改成审批通过、不通过时,可选择抄送
1 parent de29528 commit 03b8bd5

File tree

7 files changed

+93
-375
lines changed

7 files changed

+93
-375
lines changed

src/api/bpm/processInstance/index.ts

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export type ProcessInstanceVO = {
2020
endTime: string
2121
}
2222

23-
export type ProcessInstanceCCVO = {
24-
type: number,
25-
taskName: string,
26-
taskKey: string,
27-
processInstanceName: string,
28-
processInstanceKey: string,
29-
startUserId: string,
30-
options:string [],
23+
export type ProcessInstanceCopyVO = {
24+
type: number
25+
taskName: string
26+
taskKey: string
27+
processInstanceName: string
28+
processInstanceKey: string
29+
startUserId: string
30+
options: string[]
3131
reason: string
3232
}
3333

@@ -51,20 +51,6 @@ export const getProcessInstance = async (id: number) => {
5151
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
5252
}
5353

54-
/**
55-
* 抄送
56-
* @param data 抄送数据
57-
* @returns 是否抄送成功
58-
*/
59-
export const createProcessInstanceCC = async (data) => {
60-
return await request.post({ url: '/bpm/process-instance/cc/create', data: data })
54+
export const getProcessInstanceCopyPage = async (params: any) => {
55+
return await request.get({ url: '/bpm/process-instance/copy/page', params })
6156
}
62-
63-
/**
64-
* 抄送列表
65-
* @param params
66-
* @returns
67-
*/
68-
export const getProcessInstanceCCPage = async (params) => {
69-
return await request.get({ url: '/bpm/process-instance/cc/my-page', params })
70-
}

src/utils/formatTime.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,18 @@ export function formatPast2(ms: number): string {
175175
const minute = Math.floor(ms / (60 * 1000) - day * 24 * 60 - hour * 60)
176176
const second = Math.floor(ms / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - minute * 60)
177177
if (day > 0) {
178-
return day + '天' + hour + '小时' + minute + '分钟'
178+
return day + ' 天' + hour + ' 小时 ' + minute + ' 分钟'
179179
}
180180
if (hour > 0) {
181-
return hour + '小时' + minute + '分钟'
181+
return hour + ' 小时 ' + minute + ' 分钟'
182182
}
183183
if (minute > 0) {
184-
return minute + '分钟'
184+
return minute + ' 分钟'
185185
}
186186
if (second > 0) {
187-
return second + '秒'
187+
return second + ' 秒'
188188
} else {
189-
return 0 + '秒'
189+
return 0 + ' 秒'
190190
}
191191
}
192192

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

Lines changed: 0 additions & 242 deletions
This file was deleted.

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
type="textarea"
3232
/>
3333
</el-form-item>
34+
<el-form-item label="抄送人" prop="copyUserIds">
35+
<el-select v-model="auditForms[index].copyUserIds" multiple placeholder="请选择抄送人">
36+
<el-option
37+
v-for="item in userOptions"
38+
:key="item.id"
39+
:label="item.nickname"
40+
:value="item.id"
41+
/>
42+
</el-select>
43+
</el-form-item>
3444
</el-form>
3545
<div style="margin-bottom: 20px; margin-left: 10%; font-size: 14px">
3646
<el-button type="success" @click="handleAudit(item, true)">
@@ -118,6 +128,7 @@ import TaskDelegateForm from './TaskDelegateForm.vue'
118128
import TaskAddSignDialogForm from './TaskAddSignDialogForm.vue'
119129
import { registerComponent } from '@/utils/routerHelper'
120130
import { isEmpty } from '@/utils/is'
131+
import * as UserApi from '@/api/system/user'
121132
122133
defineOptions({ name: 'BpmProcessInstanceDetail' })
123134
@@ -161,7 +172,8 @@ const handleAudit = async (task, pass) => {
161172
// 2.1 提交审批
162173
const data = {
163174
id: task.id,
164-
reason: auditForms.value[index].reason
175+
reason: auditForms.value[index].reason,
176+
copyUserIds: auditForms.value[index].copyUserIds
165177
}
166178
if (pass) {
167179
await TaskApi.approveTask(data)
@@ -180,21 +192,20 @@ const openTaskUpdateAssigneeForm = (id: string) => {
180192
taskUpdateAssigneeFormRef.value.open(id)
181193
}
182194
183-
const taskDelegateForm = ref()
184195
/** 处理审批退回的操作 */
196+
const taskDelegateForm = ref()
185197
const handleDelegate = async (task) => {
186198
taskDelegateForm.value.open(task.id)
187199
}
188200
189-
//回退弹框组件
190-
const taskReturnDialogRef = ref()
191201
/** 处理审批退回的操作 */
202+
const taskReturnDialogRef = ref()
192203
const handleBack = async (task) => {
193204
taskReturnDialogRef.value.open(task.id)
194205
}
195206
196-
const taskAddSignDialogForm = ref()
197207
/** 处理审批加签的操作 */
208+
const taskAddSignDialogForm = ref()
198209
const handleSign = async (task) => {
199210
taskAddSignDialogForm.value.open(task.id)
200211
}
@@ -304,13 +315,17 @@ const loadRunningTask = (tasks) => {
304315
// 2.3 添加到处理任务
305316
runningTasks.value.push({ ...task })
306317
auditForms.value.push({
307-
reason: ''
318+
reason: '',
319+
copyUserIds: []
308320
})
309321
})
310322
}
311323
312324
/** 初始化 */
313-
onMounted(() => {
325+
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
326+
onMounted(async () => {
314327
getDetail()
328+
// 获得用户列表
329+
userOptions.value = await UserApi.getSimpleUserList()
315330
})
316331
</script>

0 commit comments

Comments
 (0)