From 579bbf7f5e190c190eaef16adc1c92ce85f6e107 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 10 十二月 2024 14:21:06 +0800
Subject: [PATCH] 流程推进详情页:待办按钮的显隐逻辑完善
---
src/views/flowable/task/myProcess/send/index.vue | 92 +++++++++++++++++++++++++++++++++-------------
1 files changed, 66 insertions(+), 26 deletions(-)
diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue
index 3f23f26..ce36f2e 100644
--- a/src/views/flowable/task/myProcess/send/index.vue
+++ b/src/views/flowable/task/myProcess/send/index.vue
@@ -9,11 +9,22 @@
<!--琛ㄥ崟淇℃伅-->
<el-tab-pane label="琛ㄥ崟淇℃伅" name="1">
<!--鍒濆鍖栨祦绋嬪姞杞借〃鍗曚俊鎭�-->
- <el-col :span="16" :offset="4">
- <v-form-render :form-data="formRenderData" ref="vFormRef"/>
- <div style="margin-left:15%;margin-bottom: 20px;font-size: 14px;">
- <el-button type="primary" @click="submitForm">鎻� 浜�</el-button>
- <el-button type="primary" @click="resetForm">閲� 缃�</el-button>
+ <el-col :span="16" :offset="4" v-if="formDataList && formDataList.length > 0">
+ <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp" style="position: relative">
+ <div v-if="!formDataObj.current" style="position: absolute; top: 2px; right: 2px">
+ <el-button type="danger" disabled>椹冲洖(鍔熻兘寮�鍙戜腑)</el-button>
+ </div>
+ <div v-if="formDataObj.current" style="margin-bottom: 15px;color: #409eff">褰撳墠闃舵锛�<span style="color: red">{{formDataObj.beforeNodeName}}</span></div>
+ <div v-else style="margin-bottom: 15px;color: #409eff">鍓嶇疆闃舵锛�<span style="color: #d5904b">{{formDataObj.beforeNodeName}}</span></div>
+ <v-form-render :form-data="formDataObj.formJson" :ref="'form' + index"/>
+ </div>
+
+<!-- <v-form-render :form-data="formRenderData" ref="vFormRef"/>-->
+ <div style="display: flex;justify-content: center; align-items: center; margin: 20px 0">
+ <el-button type="primary" @click="submitForm">纭骞舵彁浜�</el-button>
+ <el-button type="primary" disabled @click="submitForm">鍗忓悓鍔炵悊(鍔熻兘寮�鍙戜腑)</el-button>
+ <el-button type="primary" disabled @click="submitForm">杞氦浠栦汉鍔炵悊(鍔熻兘寮�鍙戜腑)</el-button>
+<!-- <el-button type="primary" @click="resetForm">閲� 缃�</el-button>-->
</div>
</el-col>
</el-tab-pane>
@@ -54,6 +65,7 @@
props: {},
data() {
return {
+ formDataList: [], // 琛ㄥ崟鍒楄〃
taskId: '',
processName: '',
// 妯″瀷xml鏁版嵁
@@ -68,6 +80,7 @@
deployId: "", // 娴佺▼瀹氫箟缂栧彿
procDefId: "", // 娴佺▼瀹炰緥缂栧彿
formRenderData: {},
+ formRenderDataList: [],
variables: [], // 娴佺▼鍙橀噺鏁版嵁
taskTitle: null,
taskOpen: false,
@@ -80,7 +93,7 @@
formJson: {} // 琛ㄥ崟json
};
},
- created() {
+ mounted() {
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;
@@ -101,38 +114,56 @@
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.formDataList = res.data
+ if (this.formDataList && this.formDataList.length > 0) {
this.$nextTick(() => {
- // 鍔犺浇琛ㄥ崟濉啓鐨勬暟鎹�
- this.$refs.vFormRef.setFormData(res.data);
- // this.$nextTick(() => {
- // // 琛ㄥ崟绂佺敤
- // this.$refs.vFormRef.disableForm();
- // })
+ this.formDataList.forEach((formDataObj, index) => {
+ console.log("琛ㄥ崟鏁版嵁鍒楄〃", formDataObj.formJson)
+ let that = this
+ console.log(eval("that.$refs.form" +index)[0])
+ eval("that.$refs.form" +index)[0].setFormJson(formDataObj.formJsonObj.formJson);
+
+ eval("that.$refs.form" +index)[0].setFormData(formDataObj.formJsonObj);
+ })
+ this.formJson = this.formDataList[0].formJsonObj.formJson
})
- } else {
- this.$nextTick(() => {
- // 鍥炴樉鏁版嵁
- this.$refs.vFormRef.setFormJson(res.data);
- this.formJson = res.data;
- })
+
}
+ // 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 => {
+ console.log("鎶ラ敊浜嗭細", 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() {
- this.$refs.vFormRef.getFormData().then(formData => {
+ let that = this
+ eval("that.$refs.form" +0)[0].getFormData().then(formData => {
// 鏍规嵁褰撳墠浠诲姟鎴栬�呮祦绋嬭璁¢厤缃殑涓嬩竴姝ヨ妭鐐� todo 鏆傛椂鏈秹鍙婂埌鑰冭檻缃戝叧銆佽〃杈惧紡鍜屽鑺傜偣鎯呭喌
getNextFlowNodeByStart({deploymentId: this.deployId, variables: formData}).then(res => {
const data = res.data;
@@ -274,4 +305,13 @@
.my-label {
background: #E1F3D8;
}
+
+.form-warp {
+ padding: 20px;
+ margin-bottom: 20px;
+ box-shadow:
+ inset 0 -3em 3em rgba(0, 0, 0, 0.1),
+ 0 0 0 2px rgb(239, 239, 239),
+ 0.3em 0.3em 1em rgba(0, 0, 0, 0.3);
+}
</style>
--
Gitblit v1.8.0