From 5c929cfb5286a31a4e067cbc61e8774f4e7d42ae Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 06 五月 2025 11:25:41 +0800 Subject: [PATCH] 任务查看:任务名称undefined解决 --- src/views/flowable/task/myProcess/send/index.vue | 288 +++++++++++++++++++++++++++++++++++---------------------- 1 files changed, 177 insertions(+), 111 deletions(-) diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue index 702f003..32bbe07 100644 --- a/src/views/flowable/task/myProcess/send/index.vue +++ b/src/views/flowable/task/myProcess/send/index.vue @@ -3,54 +3,63 @@ <el-card class="box-card" > <div slot="header" class="clearfix" style="display: flex"> <div style="flex: 1" class="el-icon-document">{{`浠诲姟鍔炵悊锛歚 + processName}}</div> - <div style="flex: 2">{{projectName + '鈥斺��' + flowName}}</div> + <div style="flex: 2; color: #303133">{{projectName + '鈥斺��' + flowName}}</div> <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"> <!--琛ㄥ崟淇℃伅--> <el-tab-pane label="琛ㄥ崟淇℃伅" name="1"> <!--鍒濆鍖栨祦绋嬪姞杞借〃鍗曚俊鎭�--> - <el-col :span="16" :offset="4" v-loading="formLoading" class="tab-min-height"> + <el-col :span="24" v-loading="formLoading" class="tab-min-height"> <div 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"> - <!-- 褰撳墠鑺傜偣鍙崗鍚屻�佽浆鍔炵瓑鎿嶄綔 --> - <div class="op-list"> - <el-button size="small" type="primary" :disabled="submitLoading" v-loading="submitLoading" @click="submitForm">纭骞舵彁浜�</el-button> - <el-button size="small" type="primary" disabled @click="submitForm">鍗忓悓鍔炵悊(鍔熻兘寮�鍙戜腑)</el-button> - <el-button size="small" type="primary" @click="openDelegation(formDataList[0].beforeNodeName)">杞姙</el-button> - <el-button v-if="formDataObj.canJump" size="small" type="primary" @click="jumpTask()">璺宠繃</el-button> - <el-button v-if="formDataObj.canWait" size="small" type="primary" >瀹圭己</el-button> - </div> - <div class="current">褰撳墠闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div> - </div> - <div v-else-if="formDataList.length > 1"> - <!-- 鍓嶇疆鑺傜偣鍙┏鍥� --> - <div class="reject-but"> - <el-button type="danger" size="small" @click="openRejectTask(formDataObj.beforeNodeName)">椹� 鍥�</el-button> - </div> - <div class="before">鍓嶇疆闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div> - </div> - <div v-if="formDataObj != null && formDataObj.formJsonObj != null"> - <v-form-render :form-data="formDataObj.formJsonObj.formJson" :ref="'form' + index"/> - </div> - <div v-else> - <el-alert - title="鏈粦瀹氳〃鍗�" - type="warning" - :closable="false" - > - </el-alert> - </div> - <div v-if="formDataList.length <= 1"> - <div class="before_none">鍓嶇疆闃舵锛�<span>涓嶅瓨鍦ㄥ墠缃樁娈�</span></div> - <el-alert - title="涓嶅瓨鍦ㄥ墠缃樁娈�" - type="warning" - :closable="false" - > - </el-alert> - </div> + <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp"> + <el-row> + <el-col :span="18" style="position: relative"> + <div v-if="formDataObj.current"> + <!-- 褰撳墠鑺傜偣鍙崗鍚屻�佽浆鍔炵瓑鎿嶄綔 --> + <div class="op-list"> + <el-button size="small" type="primary" :disabled="formDataObj.taskStatus === '鎸傝捣' || submitLoading" v-loading="submitLoading" @click="submitForm">纭骞舵彁浜�</el-button> + <!-- <el-button size="small" type="primary" disabled @click="submitForm">鍗忓悓鍔炵悊(鍔熻兘寮�鍙戜腑)</el-button>--> + <el-button size="small" type="primary" v-if="!isWait" :disabled="formDataObj.taskStatus === '鎸傝捣'" @click="openDelegation(formDataList[0].beforeNodeName)">杞姙</el-button> + <el-button v-if="formDataObj.canJump && !isWait" :disabled="formDataObj.taskStatus === '鎸傝捣'" size="small" type="primary" @click="jumpTask()">璺宠繃</el-button> + <el-button v-if="formDataObj.canWait && !isWait" :disabled="formDataObj.taskStatus === '鎸傝捣'" size="small" type="primary" @click="waitTask()">瀹圭己</el-button> + <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus !== '鎸傝捣' && !isWait" size="small" type="primary" @click="hangup">鎸傝捣</el-button> + <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus === '鎸傝捣' && !isWait" size="small" type="primary" @click="cancelHangup">缁撴潫鎸傝捣</el-button> + </div> + <div class="current">褰撳墠闃舵锛�<span>{{formDataObj.beforeNodeName}}</span><span v-if="formDataObj.taskStatus === 'HANGUP'">锛堟寕璧蜂腑锛�</span></div> + </div> + <div v-else-if="formDataList.length > 1"> + <!-- 鍓嶇疆鑺傜偣鍙┏鍥� --> + <div class="reject-but"> + <el-button type="danger" size="small" @click="openRejectTask(formDataObj.beforeNodeName)">椹� 鍥�</el-button> + </div> + <div class="before">鍓嶇疆闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div> + </div> + <div v-if="formDataObj != null && formDataObj.formJsonObj != null"> + <v-form-render :form-data="formDataObj.formJsonObj.formJson" :ref="'form' + index"/> + </div> + <div v-else> + <el-alert + title="鏈粦瀹氳〃鍗�" + type="warning" + :closable="false" + > + </el-alert> + </div> + <div v-if="formDataList.length <= 1"> + <div class="before_none">鍓嶇疆闃舵锛�<span>涓嶅瓨鍦ㄥ墠缃樁娈�</span></div> + <el-alert + title="涓嶅瓨鍦ㄥ墠缃樁娈�" + type="warning" + :closable="false" + > + </el-alert> + </div> + </el-col> + <el-col :span="6"> + <log-time-line v-if="formDataObj.events.length > 0" :log-list="formDataObj.events"/> + </el-col> + </el-row> </div> </div> </el-col> @@ -171,11 +180,13 @@ import SingleUser from '@/components/flow/User/SingleUser' import MultUser from '@/components/flow/User/MultUser' import MyRole from '@/components/flow/Role/MyRole' -import {completeSubmitFormTask} from "@/api/flowable/process"; +import {completeSubmitFormTask, waitCompleteSubmitFormTask} from "@/api/flowable/process"; import { flowTaskForm } from "@/api/flowable/todo"; import {getNextFlowNodeByStart} from "@/api/flowable/todo"; +import LogView from "@/views/projectProcess/components/LogView"; +import LogTimeLine from "@/views/projectProcess/components/LogTimeLine"; import {rejectTask} from "@/api/flowable/process"; -import {taskDelegation, taskJump} from "@/api/projectProcess/projectProcess"; +import {cancelTaskHangup, taskDelegation, taskHangup, taskJump, taskWait} from "@/api/projectProcess/projectProcess"; export default { name: "Record", @@ -185,10 +196,13 @@ MyDept, SingleUser, MultUser, + LogView, + LogTimeLine }, props: {}, data() { return { + isWait: false, jumpDesc: '', // 璺宠繃璇存槑 rejectLoading: false, // 椹冲洖鎸夐挳鍔犺浇 submitLoading: false, // 鎻愪氦鎸夐挳鍔犺浇 @@ -266,27 +280,109 @@ this.deployId = this.$route.query && this.$route.query.deployId; this.taskId = this.$route.query && this.$route.query.taskId; this.projectName = this.$route.query && this.$route.query.projectName; + this.projectId = this.$route.query && this.$route.query.projectId; this.flowName = this.$route.query && this.$route.query.flowName; // 鍒濆鍖栬〃鍗� this.procDefId = this.$route.query && this.$route.query.procDefId; this.procInsId = this.$route.query && this.$route.query.procInsId; this.goBackParams = this.$route.query && this.$route.query.goBackParams; + this.isWait = this.$route.query && this.$route.query.isWait === 'true' ? true : false; // this.getNextFlowNodeByStart(this.deployId); this.getFlowFormData(this.taskId); }, methods: { - // 璺宠繃浠诲姟 - jumpTask() { - this.$prompt('澶囨敞璇存槑', '纭畾瑕佽烦杩囨浠诲姟鍚�', { + // 鎸傝捣浠诲姟 + hangup() { + this.$prompt('澶囨敞璇存槑', '纭畾瑕佹寕璧锋浠诲姟鍚�', { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', inputType: 'textarea' // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, // inputErrorMessage: '閭鏍煎紡涓嶆纭�' }).then(({ value }) => { + let hangupForm = { + taskId: this.taskId, + projectId: this.projectId, + processInsId: this.procInsId, + reason: value + } + taskHangup(hangupForm).then(res => { + this.$message.success("鎿嶄綔鎴愬姛") + this.goBack() + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堟寕璧锋搷浣�' + }); + }); + }, + // 鎸傝捣浠诲姟 + cancelHangup() { + this.$confirm('纭畾瑕佸彇娑堟寕璧峰悧?', '鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + let cancelHangupForm = { + taskId: this.taskId, + projectId: this.projectId, + processInsId: this.procInsId + } + cancelTaskHangup(cancelHangupForm).then(res => { + this.$message.success("鎿嶄綔鎴愬姛") + this.goBack() + }) + }) + }, + // 瀹圭己浠诲姟 + waitTask() { + this.$prompt('澶囨敞璇存槑', '纭畾瑕佸缂烘浠诲姟鍚�', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + inputType: 'textarea', + inputValidator: (value) => { + if (!value || value.trim() === '') { + return "璇峰~鍐欏娉ㄨ鏄�" + } + return true + }, + inputErrorMessage: '璇峰~鍐欏娉ㄨ鏄�' + }).then(({ value }) => { + let waitForm = { + taskId: this.taskId, + projectId: this.projectId, + processInsId: this.procInsId, + desc: value + } + taskWait(waitForm).then(res => { + this.$message.success("鎿嶄綔鎴愬姛") + this.goBack() + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '宸插彇娑堝缂烘搷浣�' + }); + }); + }, + // 璺宠繃浠诲姟 + jumpTask() { + this.$prompt('澶囨敞璇存槑', '纭畾瑕佽烦杩囨浠诲姟鍚�', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + inputType: 'textarea', + inputValidator: (value) => { + if (!value || value.trim() === '') { + return "璇峰~鍐欏娉ㄨ鏄�" + } + return true + }, + inputErrorMessage: '璇峰~鍐欏娉ㄨ鏄�' + }).then(({ value }) => { let jumpForm = { taskId: this.taskId, - projectId: this.goBackParams.projectId, + projectId: this.projectId, processInsId: this.procInsId, desc: value } @@ -344,7 +440,7 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - this.delegationForm.projectId = this.goBackParams.projectId + this.delegationForm.projectId = this.projectId this.delegationForm.processInsId = this.procInsId this.delegationButLoading = true taskDelegation(this.delegationForm).then(res => { @@ -506,7 +602,7 @@ handleClick(tab, event) { if (tab.name === '2'){ this.imgLoading = true - flowXmlAndNode({procInsId:this.procInsId,deployId:this.deployId}).then(res => { + flowXmlAndNode({processInsId:this.procInsId,deployId:this.deployId}).then(res => { this.imgLoading = false this.flowData = res.data; }) @@ -564,7 +660,7 @@ this.$router.push({ path: '/projectFlow/detail', query: { - projectId: this.goBackParams.projectId, + projectId: this.projectId, processDefId: this.goBackParams.processDefId, processName: this.goBackParams.processName } @@ -577,10 +673,10 @@ cancelButtonText: '鍙栨秷', type: 'warning' }).then(() => { - this.submitLoading = true let that = this if (eval("that.$refs.form" +0)) { eval("that.$refs.form" +0)[0].getFormData().then(formData => { + this.submitLoading = true this.formData = formData const param = { formJson: this.formJson, @@ -588,68 +684,36 @@ // 澶嶅埗瀵硅薄鐨勫睘鎬у�肩粰鏂扮殑瀵硅薄 Object.assign(param, formData); // 瀹屾垚浠诲姟 - completeSubmitFormTask(this.taskId, param).then(res => { + if (this.isWait) { + waitCompleteSubmitFormTask(this.taskId, param).then(res => { + this.$modal.msgSuccess(res.msg); + this.submitLoading = false + this.goBack(); + }) + } else { + completeSubmitFormTask(this.taskId, param).then(res => { + this.$modal.msgSuccess(res.msg); + this.submitLoading = false + this.goBack(); + }) + } + }) + } else { + // 娌″叧鑱旇〃鍗曠洿鎺ヤ紶绌� + if (this.isWait) { + waitCompleteSubmitFormTask(this.taskId, {}).then(res => { this.$modal.msgSuccess(res.msg); this.submitLoading = false this.goBack(); - }).catch((err) => { - this.submitLoading = false; - }); - }).catch((err) => { - this.submitLoading = false; - }); - } else { - // 娌″叧鑱旇〃鍗曠洿鎺ヤ紶绌� - completeSubmitFormTask(this.taskId, {}).then(res => { - this.$modal.msgSuccess(res.msg); - this.submitLoading = false - this.goBack(); - }).catch((err) => { - this.submitLoading = false; - }); + }) + } else { + completeSubmitFormTask(this.taskId, {}).then(res => { + this.$modal.msgSuccess(res.msg); + this.submitLoading = false + this.goBack(); + }) + } } - - // 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; - // if (data) { - // this.formData = formData; - // if (data.dataType === 'dynamic') { - // if (data.type === 'assignee') { // 鎸囧畾浜哄憳 - // this.checkSendUser = true; - // this.checkType = "single"; - // } else if (data.type === 'candidateUsers') { // 鍊欓�変汉鍛�(澶氫釜) - // this.checkSendUser = true; - // this.checkType = "multiple"; - // } else if (data.type === 'candidateGroups') { // 鎸囧畾缁�(鎵�灞炶鑹叉帴鏀朵换鍔�) - // this.checkSendRole = true; - // } else { // 浼氱 - // // 娴佺▼璁捐鎸囧畾鐨� elementVariable 浣滀负浼氱浜哄憳鍒楄〃 - // this.multiInstanceVars = data.vars; - // this.checkSendUser = true; - // this.checkType = "multiple"; - // } - // this.taskOpen = true; - // this.taskTitle = "閫夋嫨浠诲姟鎺ユ敹"; - // } else { - // if (this.procDefId) { - // const param = { - // formJson: this.formJson, - // } - // // 澶嶅埗瀵硅薄鐨勫睘鎬у�肩粰鏂扮殑瀵硅薄 - // Object.assign(param, formData); - // // 瀹屾垚浠诲姟 - // completeSubmitFormTask(this.taskId, param).then(res => { - // this.$modal.msgSuccess(res.msg); - // this.goBack(); - // }) - // } - // } - // } - // }) - // }) }).catch((err) => { console.log(err) this.$message({ @@ -757,6 +821,8 @@ padding: 20px; margin-top: 5px; margin-bottom: 20px; + margin-left: 3px; + margin-right: 3px; box-shadow: rgba(67, 71, 85, 0.27) 0px 0px 0.25em, rgba(90, 125, 188, 0.05) 0px 0.25em 1em; } .before { @@ -776,7 +842,7 @@ } .reject-but { position: absolute; - top: 4px; + top: -4px; right: 4px } .current { @@ -788,7 +854,7 @@ } .op-list { position: absolute; - top: 4px; + top: -4px; right: 4px; display: flex; justify-content: center; -- Gitblit v1.8.0