From dd4c953182002b45f84e287d210463e65c5ef18f Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期六, 30 十一月 2024 14:02:10 +0800
Subject: [PATCH] 流程待办跳转
---
src/views/flowable/task/myProcess/send/index.vue | 67 ++++++++++++++++++++++++---------
1 files changed, 48 insertions(+), 19 deletions(-)
diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue
index 46eb4be..de3b8ca 100644
--- a/src/views/flowable/task/myProcess/send/index.vue
+++ b/src/views/flowable/task/myProcess/send/index.vue
@@ -2,7 +2,7 @@
<div class="app-container">
<el-card class="box-card" >
<div slot="header" class="clearfix">
- <span class="el-icon-document">鍙戣捣浠诲姟</span>
+ <span class="el-icon-document">{{`娴佺▼澶勭悊锛歚 + processName}}</span>
<el-button style="float: right;" size="mini" type="danger" @click="goBack">鍏抽棴</el-button>
</div>
<el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick">
@@ -38,7 +38,8 @@
<script>
import {definitionStart, flowXmlAndNode} from "@/api/flowable/definition";
import BpmnViewer from '@/components/Process/viewer';
-import {flowFormData} from "@/api/flowable/process";
+import {completeSubmitFormTask} from "@/api/flowable/process";
+import { flowTaskForm } from "@/api/flowable/todo";
import {getNextFlowNodeByStart} from "@/api/flowable/todo";
import FlowUser from '@/components/flow/User'
import FlowRole from '@/components/flow/Role'
@@ -53,6 +54,8 @@
props: {},
data() {
return {
+ taskId: '',
+ processName: '',
// 妯″瀷xml鏁版嵁
flowData: {},
activeName: '1', // 鍒囨崲tab鏍囩
@@ -78,11 +81,13 @@
};
},
created() {
+ this.processName = this.$route.query && this.$route.query.processName;
this.deployId = this.$route.query && this.$route.query.deployId;
+ this.taskId = this.$route.query && this.$route.query.taskId;
// 鍒濆鍖栬〃鍗�
this.procDefId = this.$route.query && this.$route.query.procDefId;
// this.getNextFlowNodeByStart(this.deployId);
- this.getFlowFormData(this.deployId);
+ this.getFlowFormData(this.taskId);
},
methods: {
handleClick(tab, event) {
@@ -93,24 +98,38 @@
}
},
/** 娴佺▼琛ㄥ崟鏁版嵁 */
- getFlowFormData(deployId) {
- const params = {deployId: deployId}
- flowFormData(params).then(res => {
- // 娴佺▼杩囩▼涓笉瀛樺湪鍒濆鍖栬〃鍗� 鐩存帴璇诲彇鐨勬祦绋嬪彉閲忎腑瀛樺偍鐨勮〃鍗曞��
- this.$nextTick(() => {
- // 鍥炴樉鏁版嵁
- this.$refs.vFormRef.setFormJson(res.data);
- this.formJson = res.data;
- })
+ getFlowFormData(taskId) {
+ const params = {taskId: taskId}
+ flowTaskForm(params).then(res => {
+ if (res.data.formJson) {
+ // 鍥炴樉琛ㄥ崟
+ this.$refs.vFormRef.setFormJson(res.data.formJson);
+ this.formJson = res.data.formJson;
+ this.$nextTick(() => {
+ // 鍔犺浇琛ㄥ崟濉啓鐨勬暟鎹�
+ this.$refs.vFormRef.setFormData(res.data);
+ // this.$nextTick(() => {
+ // // 琛ㄥ崟绂佺敤
+ // this.$refs.vFormRef.disableForm();
+ // })
+ })
+ } else {
+ this.$nextTick(() => {
+ // 鍥炴樉鏁版嵁
+ this.$refs.vFormRef.setFormJson(res.data);
+ this.formJson = res.data;
+ })
+ }
}).catch(res => {
this.goBack();
})
},
/** 杩斿洖椤甸潰 */
goBack() {
- // 鍏抽棴褰撳墠鏍囩椤靛苟杩斿洖涓婁釜椤甸潰
- const obj = { path: "/task/process", query: { t: Date.now()} };
- this.$tab.closeOpenPage(obj);
+ // // 鍏抽棴褰撳墠鏍囩椤靛苟杩斿洖涓婁釜椤甸潰
+ // const obj = { path: "/task/process", query: { t: Date.now()} };
+ // this.$tab.closeOpenPage(obj);
+ this.$tab.closePage()
},
/** 鐢宠娴佺▼琛ㄥ崟鏁版嵁鎻愪氦 */
submitForm() {
@@ -144,11 +163,16 @@
}
// 澶嶅埗瀵硅薄鐨勫睘鎬у�肩粰鏂扮殑瀵硅薄
Object.assign(param, formData);
- // 鍚姩娴佺▼骞跺皢琛ㄥ崟鏁版嵁鍔犲叆娴佺▼鍙橀噺
- definitionStart(this.procDefId, param).then(res => {
+ // 瀹屾垚浠诲姟
+ completeSubmitFormTask(this.taskId, param).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
})
+ // // 鍚姩娴佺▼骞跺皢琛ㄥ崟鏁版嵁鍔犲叆娴佺▼鍙橀噺
+ // definitionStart(this.procDefId, param).then(res => {
+ // this.$modal.msgSuccess(res.msg);
+ // this.goBack();
+ // })
}
}
}
@@ -182,11 +206,16 @@
} else {
this.$set(param, "approval", this.checkValues);
}
- // 鍚姩娴佺▼骞跺皢琛ㄥ崟鏁版嵁鍔犲叆娴佺▼鍙橀噺
- definitionStart(this.procDefId, param).then(res => {
+ // 瀹屾垚浠诲姟
+ completeSubmitFormTask(this.taskId, param).then(res => {
this.$modal.msgSuccess(res.msg);
this.goBack();
})
+ // // 鍚姩娴佺▼骞跺皢琛ㄥ崟鏁版嵁鍔犲叆娴佺▼鍙橀噺
+ // definitionStart(this.procDefId, param).then(res => {
+ // this.$modal.msgSuccess(res.msg);
+ // this.goBack();
+ // })
}
},
// 鐢ㄦ埛淇℃伅閫変腑鏁版嵁
--
Gitblit v1.8.0