adtec-core-package 1.5.6 → 1.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "1.5.6",
3
+ "version": "1.5.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -52,7 +52,7 @@ const getStatus = (task: IWfTaskVo) => {
52
52
  return '提交'
53
53
  }
54
54
  if (task.commentList && task.commentList.length > 0) {
55
- return ['待办', '同意', '不同意', '终止', '委派', '转办', '终止', '撤回'][
55
+ return ['待办', '已办', '已办', '终止', '委派', '转办', '终止', '撤回'][
56
56
  Number(task.commentList[task.commentList.length - 1].type)
57
57
  ]
58
58
  }
@@ -6,7 +6,7 @@
6
6
  <div ref="taskFlexRef">
7
7
  <el-flex align="center" justify="flex-end" v-loading="taskLoading">
8
8
  <slot name="left"></slot>
9
- <el-button v-if="showCancelBtn" @click="params?.cancelFunction">{{ params?.cancelBtnText ?? '取消' }}</el-button>
9
+ <el-button v-if="params?.cancelBtnText !== ''" @click="params?.cancelFunction">{{ params?.cancelBtnText ?? '取消' }}</el-button>
10
10
  <el-button v-if="showProcessBtn" type="info" @click="processShow = true">流程详情</el-button>
11
11
  <template v-if="isAssignee">
12
12
  <el-button type="primary" @click="openDialog('assignee')">指定执行人</el-button>
@@ -31,25 +31,25 @@
31
31
  >减签</el-button
32
32
  >
33
33
  <el-button
34
- v-if="task?.operations.indexOf('refuse') > -1"
34
+ v-if="task?.operations.indexOf('refuse') > -1 && params?.refuseBtnText !== ''"
35
35
  type="danger"
36
36
  @click="openDialog('refuse')"
37
37
  >{{ params?.refuseBtnText ?? '终止' }}</el-button
38
38
  >
39
39
  <el-button
40
- v-if="task?.operations.indexOf('transfer') > -1"
40
+ v-if="task?.operations.indexOf('transfer') > -1 && params?.transferBtnText !== ''"
41
41
  type="warning"
42
42
  @click="openDialog('transfer')"
43
43
  >{{ params?.transferBtnText ?? '转办' }}</el-button
44
44
  >
45
45
  <el-button
46
- v-if="task?.operations.indexOf('back') > -1"
46
+ v-if="task?.operations.indexOf('back') > -1 && params?.backBtnText !== ''"
47
47
  type="danger"
48
48
  @click="openDialog('back')"
49
49
  >{{ params?.backBtnText ?? '退回' }}</el-button
50
50
  >
51
51
  <el-button
52
- v-if="task?.operations.indexOf('complete') > -1"
52
+ v-if="task?.operations.indexOf('complete') > -1 && params?.completeBtnText !== ''"
53
53
  type="primary"
54
54
  @click="openDialog('complete')"
55
55
  >{{ params?.completeBtnText ?? '同意' }}</el-button
@@ -94,7 +94,6 @@ const $props = defineProps({
94
94
  // modelValue: { type: Object, required: false },
95
95
  taskId: { type: String, required: true },
96
96
  showProcessBtn: { type: Boolean, required: false, default: false },
97
- showCancelBtn: { type: Boolean, required: false, default: true },
98
97
  params: { type: Object as PropType<ITaskOperate>, required: false },
99
98
  })
100
99
 
@@ -53,6 +53,7 @@ const initTodoDialog = async (params: IParameter[]) => {
53
53
  return
54
54
  }
55
55
  if (linkModelPath) {
56
+
56
57
  if (linkModelPath.indexOf('/') > -1) {
57
58
  //组件
58
59
  showComp.value = true
@@ -197,6 +197,10 @@ const handleComplete = async () => {
197
197
  }
198
198
  }
199
199
  if (dialogType.value === 'complete') {
200
+ if (!task.value.comment) {
201
+ ElMessage.warning('请填写审批意见!')
202
+ return
203
+ }
200
204
  //同意
201
205
  const askVo = {
202
206
  taskId: task.value.taskId,
@@ -206,14 +210,18 @@ const handleComplete = async () => {
206
210
  }
207
211
  //若自定义了同意函数,则调用自定义函数
208
212
  if (taskOperate.value?.completeFunction) {
209
- await taskOperate.value.completeFunction(askVo)
213
+ const res = await taskOperate.value.completeFunction(askVo)
214
+ if (res && res?.taskId) {
215
+ task.value = res
216
+ } else {
217
+ task.value = await workflowInstApi.getTaskInst(task.value.taskId)
218
+ }
210
219
  } else {
211
220
  task.value = await workflowInstApi.taskComplete(askVo)
212
221
  }
213
- dialogVisible.value = false
214
222
  //需要动态制定审批人
215
223
  if (task.value.operations && task.value.operations?.indexOf('assignee') > -1) {
216
- // assigneeRef.value?.open(task.value.taskId)
224
+ dialogVisible.value = false
217
225
  emit('openAssignee', task.value.taskId)
218
226
  return
219
227
  }
@@ -232,6 +240,7 @@ const handleComplete = async () => {
232
240
  //若自定义了终止函数,则调用自定义函数
233
241
  if (taskOperate.value?.refuseFunction) {
234
242
  await taskOperate.value.refuseFunction(askVo)
243
+ task.value = await workflowInstApi.getTaskInst(task.value.taskId)
235
244
  } else {
236
245
  task.value = await workflowInstApi.taskReject(askVo)
237
246
  }
@@ -256,6 +265,7 @@ const handleComplete = async () => {
256
265
  }
257
266
  if (taskOperate.value?.backFunction) {
258
267
  await taskOperate.value.backFunction(askVo)
268
+ task.value = await workflowInstApi.getTaskInst(task.value.taskId)
259
269
  } else {
260
270
  task.value = await workflowInstApi.taskReturn(askVo)
261
271
  }
@@ -283,12 +293,13 @@ const handleComplete = async () => {
283
293
  }
284
294
  if (taskOperate.value?.transferFunction) {
285
295
  await taskOperate.value.transferFunction(askVo)
296
+ task.value = await workflowInstApi.getTaskInst(task.value.taskId)
286
297
  } else {
287
298
  task.value = await workflowInstApi.taskTransfer(askVo)
288
299
  }
289
300
  }
290
- dialogVisible.value = false
291
301
  emit('success', task.value)
302
+ dialogVisible.value = false
292
303
  } catch (err: any) {
293
304
  frameworkUtils.messageError(err)
294
305
  } finally {
@@ -118,7 +118,7 @@ const getStatus = (task: IWfTaskVo) => {
118
118
  return '提交'
119
119
  }
120
120
  if (task.commentList && task.commentList.length > 0) {
121
- return ['待办', '同意', '不同意', '终止', '委派', '转办', '终止', '撤回'][
121
+ return ['待办', '已办', '已办', '终止', '委派', '转办', '终止', '撤回'][
122
122
  Number(task.commentList[task.commentList.length - 1].type)
123
123
  ]
124
124
  }