From 8509d53e6fed61a9217889225e49dd89052b5f11 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 05 十二月 2024 05:42:56 +0800
Subject: [PATCH] 流程办理回显逻辑变更:处理当前节点只拉取上一个节点及本节点的表单数据,且无论提交数据还是审核都用一个页面

---
 src/views/projectProcess/detail/index.vue |   80 +++++++++++++++++++++++++++-------------
 1 files changed, 54 insertions(+), 26 deletions(-)

diff --git a/src/views/projectProcess/detail/index.vue b/src/views/projectProcess/detail/index.vue
index a819527..31d5d71 100644
--- a/src/views/projectProcess/detail/index.vue
+++ b/src/views/projectProcess/detail/index.vue
@@ -82,26 +82,32 @@
           width="100">
           <template slot-scope="scope">
             <el-button v-if="scope.row.taskStatus !== '鏈紑濮�'" @click="goToProcessDetail(scope.row)" type="text" size="small">鏌ョ湅</el-button>
-            <el-button v-if="scope.row.taskStatus === '寰呭姙'" @click="goToDo(scope.row)" type="text" size="small">鍔炵悊</el-button>
+            <el-button v-if="showHandle(scope.row)" @click="goToDo(scope.row)" type="text" size="small">鍔炵悊</el-button>
           </template>
         </el-table-column>
       </el-table>
-      <div>
-        <el-pagination
-          v-if="total > queryParams.pageSize"
-          :page-size="queryParams.pageSize"
-          :current-page="queryParams.currentPage"
-          :total="total"
-          layout="total, prev, pager, next"
-          @current-change="getList"
-        ></el-pagination>
-      </div>
+    </div>
+    <div class="table" style="margin-top: 15px">
+      <el-pagination
+        v-if="total > queryParams.pageSize"
+        @size-change="getList"
+        @current-change="getList"
+        :current-page.sync="queryParams.currentPage"
+        :page-sizes="[5, 10, 20]"
+        :page-size="100"
+        layout="sizes, prev, pager, next"
+        :total="total">
+      </el-pagination>
     </div>
   </div>
 </template>
 
 <script>
-import {getProjectProcessDetail, getProjectProcessDetailTaskList} from "@/api/projectProcess/projectProcess";
+import {
+  getProjectProcessDetail,
+  getProjectProcessDetailTaskList,
+  getTaskIsAuditing
+} from "@/api/projectProcess/projectProcess";
 
 export default {
   name: "index",
@@ -130,22 +136,31 @@
     this.getProjectProcessInfo()
   },
   methods: {
+    showHandle(row) {
+      console.log(this.$store.state.user, "鐢ㄦ埛淇℃伅")
+      if (row.taskStatus === '寰呭姙') {
+        if (row.handlerType === "USER") {
+          return this.$store.state.user.id === row.handlerId
+        } else if (row.handlerType === "DEPT") {
+          return this.$store.state.user.id === row.handlerId
+        } else if (row.handlerType === "ROLE") {
+          return this.$auth.hasRole(row.handlerUnitName)
+        }
+      } else {
+        return false
+      }
+    },
     goToDo(row) {
       // TODO 杩欓噷鐨勫垽鏂潯浠舵牴鎹疄闄呮儏鍐佃缃�
-      if (this.$auth.hasRole('admin')) {
+      // let params = {
+      //   processDefId: row.processDefId,
+      //   taskId: row.taskId
+      // }
+      // getTaskIsAuditing(params).then(res => {
+      //
+      // })
+      // if (this.showHandle(row)) {
         console.log("zhe")
-        this.$router.push({
-          path: '/flowable/task/todo/detail/index',
-          query: {
-            taskName: row.taskName,
-            startUser: row.promoterName,
-            deployId: row.deployId,
-            taskId: row.taskId,
-            procInsId: row.processInsId,
-            executionId: row.executionId
-          }
-        })
-      } else {
         this.$router.push({
           path: '/flowable/task/myProcess/send/index',
           query: {
@@ -155,7 +170,19 @@
             taskId: row.taskId
           }
         })
-      }
+      // } else {
+      //   this.$router.push({
+      //     path: '/flowable/task/todo/detail/index',
+      //     query: {
+      //       taskName: row.taskName,
+      //       startUser: row.promoterName,
+      //       deployId: row.deployId,
+      //       taskId: row.taskId,
+      //       procInsId: row.processInsId,
+      //       executionId: row.executionId
+      //     }
+      //   })
+      // }
     },
     goToProcessDetail(row) {
       this.$router.push({ path: '/flowable/task/myProcess/detail/index',
@@ -178,6 +205,7 @@
       getProjectProcessDetail(this.queryParams.projectId, this.queryParams.processDefId).then(res => {
         this.detailData = res.data
         this.taskList = res.taskList
+        this.total = res.total
         this.loading = false
       })
     },

--
Gitblit v1.8.0