@@ -17,9 +17,9 @@
@@ -59,7 +59,6 @@ const taskDrawerVisible = defineModel
()
const props = withDefaults(
defineProps<{
processId: string
- currentData: any
}>(),
{
processId: "",
@@ -72,7 +71,7 @@ const agreeHandler = ref()
const refuseHandler = ref()
const transferHandler = ref()
const currentOpenFlowForm = ref([])
-const processInstanceId = ref("")
+const curAssignTask = ref({})
const loading = ref(false)
watch(
@@ -81,23 +80,22 @@ watch(
if (val) {
loading.value = true
try {
- const ress = await queryAssignTaskOne({ processInstanceId: props.processId })
- console.log("xxx", ress)
+ const assignTask = await queryAssignTaskOne({ processInstanceId: props.processId })
+ if (assignTask.code === 0) {
+ curAssignTask.value = assignTask.data
+ }
- const res = await queryTask(props.processId, false).finally(() => (loading.value = false))
+ const res = await queryTask(curAssignTask.value.taskId, false).finally(() => (loading.value = false))
if (res.code === 0) {
currentOpenFlowForm.value = res.data.formItems
- processInstanceId.value = res.data.processInstanceId
}
} catch (error) {
loading.value = false
currentOpenFlowForm.value = []
+ curAssignTask.value = {}
}
}
},
- {
- deep: true,
- },
)
const addLayoutOneItem = (id: number | string) => {
@@ -122,15 +120,15 @@ const deleteLayoutOneItem = (id: any, index: any) => {
// 提交任务
const submitTask = () => {
- agreeHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
+ agreeHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
}
// 拒绝任务
const refuseTask = () => {
- refuseHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
+ refuseHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
}
// 转办任务
const transferTask = () => {
- transferHandler.value.handle({ ...props.currentData, taskId: props.processId }, currentOpenFlowForm.value)
+ transferHandler.value.handle(curAssignTask.value, currentOpenFlowForm.value)
}
// 流程提交
diff --git a/src/views/flow/task/handler/agree.vue b/src/views/flow/task/handler/agree.vue
new file mode 100644
index 0000000..ae231cf
--- /dev/null
+++ b/src/views/flow/task/handler/agree.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+ 取消
+
+
+ 确定
+
+
+
+
+
+
diff --git a/src/views/flow/task/handler/refuse.vue b/src/views/flow/task/handler/refuse.vue
new file mode 100644
index 0000000..52b3f9c
--- /dev/null
+++ b/src/views/flow/task/handler/refuse.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/flow/task/handler/transfer.vue b/src/views/flow/task/handler/transfer.vue
new file mode 100644
index 0000000..9e03300
--- /dev/null
+++ b/src/views/flow/task/handler/transfer.vue
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
diff --git a/src/views/flow/task/handler/types.ts b/src/views/flow/task/handler/types.ts
new file mode 100644
index 0000000..cf302c6
--- /dev/null
+++ b/src/views/flow/task/handler/types.ts
@@ -0,0 +1,22 @@
+// First let's create types for our form data
+export interface FlowFormItem {
+ id: string
+ type: string
+ props: {
+ value: any
+ [key: string]: any
+ }
+}
+
+export interface TaskData {
+ taskId: string
+ nodeId: string
+}
+
+export interface TaskSubmitParam {
+ paramMap: Record
+ taskId: string
+ taskLocalParamMap: {
+ approveDesc: string
+ }
+}
diff --git a/src/views/flow/task/pending.vue b/src/views/flow/task/pending.vue
index 8e25587..5296a68 100644
--- a/src/views/flow/task/pending.vue
+++ b/src/views/flow/task/pending.vue
@@ -52,34 +52,73 @@
- 开始处理
+ 开始处理
-
-
+
+
+
+ {{ currentData?.processName }}
+
+
+
+
+
+
+
+
+
+ 拒绝
+ 提交
+ 转办
+
+
+
+
+
+
+
+
+
+
+
+