From 821d0ca98a8732f18c2122913f68fce7927cc926 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 04 三月 2025 11:27:43 +0800
Subject: [PATCH] 流程日志展示挂起、取消挂起日志

---
 src/views/flowable/task/myProcess/send/index.vue |   83 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 72 insertions(+), 11 deletions(-)

diff --git a/src/views/flowable/task/myProcess/send/index.vue b/src/views/flowable/task/myProcess/send/index.vue
index 31dfc65..f0a549d 100644
--- a/src/views/flowable/task/myProcess/send/index.vue
+++ b/src/views/flowable/task/myProcess/send/index.vue
@@ -16,18 +16,32 @@
                 <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>
+                    <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" :disabled="formDataObj.taskStatus === '鎸傝捣'" @click="openDelegation(formDataList[0].beforeNodeName)">杞姙</el-button>
+                    <el-button v-if="formDataObj.canJump" :disabled="formDataObj.taskStatus === '鎸傝捣'" size="small" type="primary" @click="jumpTask()">璺宠繃</el-button>
+                    <el-button v-if="formDataObj.canWait" :disabled="formDataObj.taskStatus === '鎸傝捣'" size="small" type="primary" >瀹圭己</el-button>
+                    <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus !== '鎸傝捣'" size="small" type="primary" @click="hangup">鎸傝捣</el-button>
+                    <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus === '鎸傝捣'" size="small" type="primary" @click="cancelHangup">缁撴潫鎸傝捣</el-button>
                   </div>
-                  <div class="current">褰撳墠闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></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>
+                    <el-popover
+                      style="margin-left: 10px" v-if="formDataObj.events.length > 0"
+                      placement="right-start"
+                      title="浠诲姟鏃ュ織"
+                      width="600"
+                      trigger="hover"
+                    >
+                      <div v-if="formDataObj.events.length > 0">
+                        <log-view :log-list="formDataObj.events"/>
+                      </div>
+                      <el-button slot="reference">浠诲姟鏃ュ織</el-button>
+                    </el-popover>
                   </div>
                   <div class="before">鍓嶇疆闃舵锛�<span>{{formDataObj.beforeNodeName}}</span></div>
                 </div>
@@ -174,8 +188,9 @@
 import {completeSubmitFormTask} from "@/api/flowable/process";
 import { flowTaskForm } from "@/api/flowable/todo";
 import {getNextFlowNodeByStart} from "@/api/flowable/todo";
+import LogView from "@/views/projectProcess/components/LogView";
 import {rejectTask} from "@/api/flowable/process";
-import {taskDelegation, taskJump} from "@/api/projectProcess/projectProcess";
+import {cancelTaskHangup, taskDelegation, taskHangup, taskJump} from "@/api/projectProcess/projectProcess";
 
 export default {
   name: "Record",
@@ -185,6 +200,7 @@
     MyDept,
     SingleUser,
     MultUser,
+    LogView
   },
   props: {},
   data() {
@@ -266,6 +282,7 @@
     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;
@@ -275,6 +292,50 @@
     this.getFlowFormData(this.taskId);
   },
   methods: {
+    // 鎸傝捣浠诲姟
+    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()
+        })
+      })
+    },
     // 璺宠繃浠诲姟
     jumpTask() {
       this.$prompt('澶囨敞璇存槑', '纭畾瑕佽烦杩囨浠诲姟鍚�', {
@@ -286,7 +347,7 @@
       }).then(({ value }) => {
         let jumpForm = {
           taskId: this.taskId,
-          projectId: this.goBackParams.projectId,
+          projectId: this.projectId,
           processInsId: this.procInsId,
           desc: value
         }
@@ -344,7 +405,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 +567,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 +625,7 @@
       this.$router.push({
         path: '/projectFlow/detail',
         query: {
-          projectId: this.goBackParams.projectId,
+          projectId: this.projectId,
           processDefId: this.goBackParams.processDefId,
           processName: this.goBackParams.processName
         }

--
Gitblit v1.8.0