From 5b5a3ec32e479b6c43822fd0192cde6e2f3b31e5 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 26 十二月 2024 17:47:16 +0800 Subject: [PATCH] 赋码demo --- src/views/flowable/task/myProcess/send/index.vue | 68 ++++++++++++++++++++++++++++----- 1 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue index d0b86cd..bf6e5f4 100644 --- a/src/views/flowable/task/myProcess/send/index.vue +++ b/src/views/flowable/task/myProcess/send/index.vue @@ -10,7 +10,10 @@ <el-tab-pane label="琛ㄥ崟淇℃伅" name="1"> <!--鍒濆鍖栨祦绋嬪姞杞借〃鍗曚俊鎭�--> <el-col :span="16" :offset="4" v-if="formDataList && formDataList.length > 0"> - <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp"> + <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" @click="openRejectTask(formDataObj.beforeNodeDefId)">椹冲洖</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"/> @@ -19,8 +22,8 @@ <!-- <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" @click="submitForm">鍗忓悓鍔炵悊</el-button> - <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> @@ -40,6 +43,28 @@ </span> </el-dialog> </el-card> + + + <el-dialog + :title="`椹冲洖锛歚 + rejectForm.projectName" + :visible.sync="rejectShow" + width="950px" + :destroy-on-close="true" + :close-on-click-modal="false" + > + <div> + <el-input + type="textarea" + :rows="3" + placeholder="瀹℃牳寤鸿" + v-model="rejectForm.auditOpinion"> + </el-input> + </div> + <div> + <el-button type="danger" size="small" @click="rejectTask">椹冲洖</el-button> + </div> + </el-dialog> + </div> </template> @@ -51,6 +76,7 @@ import {getNextFlowNodeByStart} from "@/api/flowable/todo"; import FlowUser from '@/components/flow/User' import FlowRole from '@/components/flow/Role' +import {rejectTask} from "@/api/projectProcess/projectProcess"; export default { name: "Record", @@ -62,7 +88,9 @@ props: {}, data() { return { - formDataList: [], + rejectShow: false, + goBackParams: {}, + formDataList: [], // 琛ㄥ崟鍒楄〃 taskId: '', processName: '', // 妯″瀷xml鏁版嵁 @@ -87,7 +115,12 @@ checkValues: null, // 閫変腑浠诲姟鎺ユ敹浜哄憳鏁版嵁 formData: {}, // 濉啓鐨勮〃鍗曟暟鎹�, multiInstanceVars: '', // 浼氱鑺傜偣 - formJson: {} // 琛ㄥ崟json + formJson: {}, // 琛ㄥ崟json + rejectForm: { + auditOpinion: '', // 瀹℃牳鎰忚 + taskId: '', + rejectedTaskDefKey: '' // 琚┏鍥炵殑浠诲姟key + } }; }, mounted() { @@ -96,10 +129,22 @@ this.taskId = this.$route.query && this.$route.query.taskId; // 鍒濆鍖栬〃鍗� this.procDefId = this.$route.query && this.$route.query.procDefId; + this.goBackParams = this.$route.query && this.$route.query.goBackParams; // this.getNextFlowNodeByStart(this.deployId); this.getFlowFormData(this.taskId); }, methods: { + rejectTask() { + rejectTask(this.rejectForm).then(res => { + this.rejectShow = false + this.$message.success("椹冲洖鎴愬姛") + }) + }, + openRejectTask(rejectedTaskDefKey) { + this.rejectForm.rejectedTaskDefKey = rejectedTaskDefKey; + this.rejectForm.taskId = this.taskId; + this.rejectShow = true + }, handleClick(tab, event) { if (tab.name === '2'){ flowXmlAndNode({deployId:this.deployId}).then(res => { @@ -112,8 +157,6 @@ const params = {taskId: taskId} flowTaskForm(params).then(res => { this.formDataList = res.data - // this.formRenderDataList = res.data.map(item => item.formJson) - // console.log("琛ㄥ崟鏁版嵁鍒楄〃", this.formRenderDataList) if (this.formDataList && this.formDataList.length > 0) { this.$nextTick(() => { this.formDataList.forEach((formDataObj, index) => { @@ -154,10 +197,13 @@ }, /** 杩斿洖椤甸潰 */ goBack() { - // // 鍏抽棴褰撳墠鏍囩椤靛苟杩斿洖涓婁釜椤甸潰 - // const obj = { path: "/task/process", query: { t: Date.now()} }; - // this.$tab.closeOpenPage(obj); - this.$tab.closePage() + this.$router.push({ + path: '/projectFlow/detail', + query: { + projectId: this.goBackParams.projectId, + processDefId: this.goBackParams.processDefId + } + }) }, /** 鐢宠娴佺▼琛ㄥ崟鏁版嵁鎻愪氦 */ submitForm() { -- Gitblit v1.8.0