From 92b6d45b315ce11eb6c26889d5a4b6feb71348cc Mon Sep 17 00:00:00 2001
From: luohairen <3399054449@qq.com>
Date: 星期二, 24 十二月 2024 17:41:25 +0800
Subject: [PATCH] 优化
---
src/views/components/noticeTable.vue | 165 ++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 121 insertions(+), 44 deletions(-)
diff --git a/src/views/components/noticeTable.vue b/src/views/components/noticeTable.vue
index ca39d0e..319ebda 100644
--- a/src/views/components/noticeTable.vue
+++ b/src/views/components/noticeTable.vue
@@ -10,13 +10,13 @@
>
娴佺▼寰呭姙
</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
@@ -76,8 +76,8 @@
</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 {
@@ -85,59 +85,138 @@
total: 0,
queryParams: {
pageNum: 1,
- pageSize: 10
+ pageSize: 5,
},
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: "processName",
+ minWidth: 150,
+ align: "left",
+ },
+ { label: "瀹℃壒浜�", prop: "handlerName", minWidth: 100, align: "left" },
+ { 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: [],
- countExceptionProjectData: {},
+ calculation: Array,
+ countExceptionProjectData: Object,
},
created() {
+ this.currentTab = "process";
+ this.currentTableHeaders = this.processTableHeaders;
this.getList();
},
methods: {
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.total = 0;
+ this.tableData = [];
+ if (this.currentTab == "process") {
+ resp = await getProjectProcessTodo(this.queryParams);
+ if (resp.code === 200) {
+ this.total = resp.total;
+ this.tableData = resp.taskList;
+ }
+ } else {
+ resp = await getProjectPlanToDoList(this.queryParams);
+ if (resp.code === 200) {
+ this.total = resp.total;
+ this.tableData = resp.data;
+ }
}
},
- 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]
+ this.$router.push({
+ path: '/projectFlow/detail',
+ query: {
+ projectId: projectProcess.projectId,
+ processDefId: row.processDefId
+ }
+ })
}
- });
+ } 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]
+ this.$router.push({
+ path: '/projectFlow/detail',
+ query: {
+ projectId: projectProcess.projectId,
+ processDefId: row.processDefId
+ }
+ })
}
- });
- 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>
@@ -170,8 +249,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 +257,4 @@
justify-content: space-between;
font-size: 12px;
}
-
</style>
--
Gitblit v1.8.0