From a3dbb8fe40e06f9abd9718f14aaa7311bddbc150 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期四, 13 二月 2025 21:46:05 +0800
Subject: [PATCH] 除了项目中心,其它项目页面都不显示审核状态

---
 src/views/components/noticeTable.vue |  230 ++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 170 insertions(+), 60 deletions(-)

diff --git a/src/views/components/noticeTable.vue b/src/views/components/noticeTable.vue
index 099f0ac..76ca576 100644
--- a/src/views/components/noticeTable.vue
+++ b/src/views/components/noticeTable.vue
@@ -1,6 +1,6 @@
 <template>
-    <div>
-        <div class="flex justify-between mb-[15px]">
+    <div style="position: relative">
+        <div class="flex justify-between mb-[15px]" style="align-items: center;margin-bottom: 5px">
             <div class="block mb-3 font-semibold fonts">寰呭姙浜嬮」</div>
             <div class="flex text-[12px]">
                 <div
@@ -10,23 +10,24 @@
                 >
                     娴佺▼寰呭姙
                 </div>
-                <!-- <div
-                    :class="{ active: currentTab === 'progress' }"
+                <div
+                    :class="{ active: currentTab === 'schedule' }"
                     class="tab"
-                    @click="switchTab('progress')"
+                    @click="switchTab('schedule')"
                 >
                     杩涘害寰呭姙
-                </div> -->
+                </div>
             </div>
         </div>
         <el-table
+          v-loading="tableLoading"
             :data="tableData"
             :header-cell-style="{
                 background: '#F5F7FC',
                 color: '#454B5E',
                 fontSize: '12px'
             }"
-            height="280"
+            min-height="280"
             max-height="280"
         >
             <el-table-column
@@ -37,6 +38,7 @@
                 :min-width="column.minWidth"
                 :prop="column.prop"
                 :show-overflow-tooltip="true"
+                :formatter="column.formatter"
             >
             </el-table-column>
 
@@ -44,108 +46,218 @@
                 align="center"
                 fixed="right"
                 label="鎿嶄綔"
-                min-width="150"
+                min-width="90"
             >
-                <template #default="scope">
+                <template slot-scope="scope">
                     <el-button
-                        plain
                         size="small"
-                        type="primary"
+                        type="text"
                         @click="handleDetail(scope.row)"
                     >
                         鏌ョ湅</el-button
                     >
                     <el-button
-                        plain
                         size="small"
-                        type="primary"
+                        type="text"
                         @click="handleUpdate(scope.row)"
                     >
-                        澶勭疆</el-button
+                        澶勭悊</el-button
                     >
                 </template>
             </el-table-column>
         </el-table>
-        <pagination
-            v-show="total >= 0"
+      <div style="position: absolute; bottom: 0px;width: 100%;">
+        <div style="width: 100%;display: flex;flex-direction: row-reverse;align-items: center">
+          <pagination
+            style="width: 100%"
+            v-show="total > 0"
+            :page-sizes="[4]"
             :limit="queryParams.pageSize"
-            :page="queryParams.pageNum"
+            :page="queryParams.currentPage"
             :total="total"
-            @pagination="getList"
-        />
+            @pagination="pageChange"
+          />
+        </div>
+      </div>
     </div>
 </template>
 <script>
-
-import { getTodo } from '@/api/message';
+import { getProjectProcessTodo, getDetailByProcessInsId } from "@/api/projectProcess/projectProcess.js";
+import { getProjectPlanToDoList } from "@/api/projectPlan";
 export default {
     data() {
         return {
+            tableLoading: false,
             currentTab: "process",
             total: 0,
             queryParams: {
-                pageNum: 1,
-                pageSize: 10
+                currentPage: 1,
+                pageSize: 4,
             },
             tableData: [],
-            currentTableHeaders: [
-                { label: '娴佺▼鐜妭', prop: 'name', minWidth: 150, align: 'left' },
-                { label: '鐢宠椤圭洰', prop: 'businessName', minWidth: 150, align: 'left' },
-                { label: '瀹℃壒浜�', prop: 'assigneeName', minWidth: 100, align: 'left' },
-                { label: '鍓╀綑鏃堕棿', prop: 'remainingTime', minWidth: 143, align: 'left' }
-            ]
-        }
+            currentTableHeaders: [],
+            processTableHeaders: [
+                { label: "娴佺▼鐜妭", prop: "taskName", minWidth: 150, align: "left" },
+                {
+                    label: "鐢宠椤圭洰",
+                    prop: "projectName",
+                    minWidth: 150,
+                    align: "left",
+                },
+                {
+                  label: "澶勭悊浜�",
+                  prop: "handlerName",
+                  minWidth: 100,
+                  align: "left",
+                  formatter: (row) => {
+                    if (row.handlerType === 'USER') {
+                      return row.handlerName.join('銆�')
+                    } else if (row.handlerType === 'DEPT') {
+                      return row.handlerUnitName.join('銆�')
+                    } else if (row.handlerType === 'ROLE') {
+                      return row.handlerUnitName.join('銆�')
+                    }
+                  }
+                },
+                { label: "瀹屾垚鎯呭喌", prop: "taskStatus", minWidth: 143, align: "left" },
+                {
+                    label: "鍓╀綑鏃堕棿",
+                    prop: "remainingTime",
+                    minWidth: 143,
+                    align: "left",
+                },
+            ],
+            scheduleTableHeaders: [
+                {
+                    label: "寰呭姙浜嬮」",
+                    prop: "projectPlanInfoTitle",
+                    minWidth: 150,
+                    align: "left",
+                },
+                {
+                    label: "瀵瑰簲椤圭洰",
+                    prop: "projectName",
+                    minWidth: 150,
+                    align: "left",
+                },
+                { label: "瀹℃壒浜�", prop: "assigneeName", minWidth: 100, align: "left" },
+                {
+                    label: "鐘舵��",
+                    prop: "progressStatusStr",
+                    minWidth: 143,
+                    align: "left",
+                },
+                {
+                    label: "鍓╀綑鏃堕棿",
+                    prop: "remainder",
+                    minWidth: 143,
+                    align: "left",
+                },
+            ],
+        };
     },
     props: {
         calculation: Array,
-        countExceptionProjectData:Object,
+        countExceptionProjectData: Object,
     },
     created() {
+        this.currentTab = "process";
+        this.currentTableHeaders = this.processTableHeaders;
         this.getList();
     },
     methods: {
+        pageChange(data) {
+          this.queryParams.currentPage = data.page
+          this.getList()
+        },
         async getList() {
-            const resp = await getTodo(this.queryParams);
-            if (resp.code === 200) {
-                this.total.value = resp.total;
-                this.tableData.value = resp.rows;
+            var resp;
+            this.tableLoading = true
+            if (this.currentTab == "process") {
+                resp = await getProjectProcessTodo(this.queryParams);
+                if (resp.code === 200) {
+                    this.total = resp.total;
+                    this.tableData = resp.taskList;
+                    this.tableLoading = false
+                }
+            } else {
+                resp = await getProjectPlanToDoList(this.queryParams);
+                if (resp.code === 200) {
+                    this.total = resp.total;
+                    this.tableData = resp.data;
+                    this.tableLoading = false
+                }
             }
         },
-        handleDetail(row) {
-            console.log(111);
-            this.$router.push({
-                path: '/projectManage/nodeDetails',
-                query: {
-                    taskId: row.id,
-                    id: row.businessKey,
-                    disabled: 'true'
+        async handleDetail(row) {
+            if (this.currentTab == "process") {
+                const resp = await getDetailByProcessInsId({ processDefId: row.processDefId, processInsId: row.processInsId });
+                if (resp.code === 200 && resp.data.length > 0) {
+                    const projectProcess = resp.data[0]
+                  sessionStorage.removeItem("projectProDetail")
+                    this.$router.push({
+                        path: '/projectFlow/detail',
+                        query: {
+                            projectId: projectProcess.projectId,
+                            processDefId: row.processDefId,
+                            processName: row.processName
+                        }
+                    })
                 }
-            });
+            } else {
+                row.id = row.planId;
+                this.$router.push({
+                    path: "/projectManage/progressRecord",
+                    query: {
+                        data: row,
+                    },
+                });
+            }
         },
-        handleUpdate(row) {
-            this.$router.push({
-                path: '/projectManage/nodeDetails',
-                query: {
-                    taskId: row.id,
-                    id: row.businessKey
+        async handleUpdate(row) {
+            if (this.currentTab == "process") {
+                const resp = await getDetailByProcessInsId({ processDefId: row.processDefId, processInsId: row.processInsId });
+                if (resp.code === 200 && resp.data.length > 0) {
+                    const projectProcess = resp.data[0]
+                  sessionStorage.removeItem("projectProDetail")
+                    this.$router.push({
+                        path: '/projectFlow/detail',
+                        query: {
+                            projectId: projectProcess.projectId,
+                            processDefId: row.processDefId,
+                          processName: row.processName
+                        }
+                    })
                 }
-            });
-            console.log(111);
+            } else {
+                row.id = row.planId;
+                this.$router.push({
+                    path: "/projectManage/progressRecord",
+                    query: {
+                        data: row,
+                    },
+                });
+            }
         },
         switchTab(tab) {
             this.currentTab = tab;
-        }
-    }
-}
-
+            this.currentTableHeaders =
+                tab == "process" ? this.processTableHeaders : this.scheduleTableHeaders;
+            this.getList();
+        },
+    },
+};
 </script>
 
 <style lang="scss" scoped>
 .tab {
-    padding: 8px;
+    padding: 6px;
     border: 1px solid #dbdeea;
     cursor: pointer;
     width: 72px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
 }
 
 .active {
@@ -170,8 +282,7 @@
 }
 
 ::v-deep .el-pagination .btn-prev .el-icon,
- ::v-deep .el-pagination .btn-next .el-icon 
-{
+::v-deep .el-pagination .btn-next .el-icon {
     display: inline;
 }
 .flex {
@@ -179,5 +290,4 @@
     justify-content: space-between;
     font-size: 12px;
 }
-
 </style>

--
Gitblit v1.8.0