From a0cc8e02560f7e72e2efb3d4540ddcd5f82aca6e Mon Sep 17 00:00:00 2001 From: luohairen <3399054449@qq.com> Date: 星期四, 05 十二月 2024 17:09:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/projectProcess/detail/index.vue | 97 +++++++++++++++++++++++++++++++++--------------- 1 files changed, 66 insertions(+), 31 deletions(-) diff --git a/src/views/projectProcess/detail/index.vue b/src/views/projectProcess/detail/index.vue index 811e3a0..31d5d71 100644 --- a/src/views/projectProcess/detail/index.vue +++ b/src/views/projectProcess/detail/index.vue @@ -1,5 +1,5 @@ <template> - <div class="app-container"> + <div class="app-container" v-loading.fullscreen.lock="loading"> <div class="top"> <div class="project-title"> <h2>椤圭洰鍚嶇О锛歿{detailData.projectName}}</h2> @@ -16,10 +16,10 @@ </div> </div> <div class="search-warp"> - <div @click="changeTab(1, 'all')" :class="{'item-warm': true, 'all-color': true, 'active': 1 === selectTabId}">鍏ㄩ儴浜嬮」锛坽{detailData.statistics.totalTaskNum}}锛�</div> - <div @click="changeTab(2, 'todo')" :class="{'item-warm': true, 'all-color': true, 'active': 2 === selectTabId}">浠e姙浜嬮」锛坽{detailData.statistics.todoTaskNum}}锛�</div> - <div @click="changeTab(3, 'current')" :class="{'item-warm': true, 'current-color': true, 'active': 3 === selectTabId}">褰撳墠鐜妭</div> - <div @click="changeTab(4, 'remaining')" :class="{'item-warm': true, 'remaining-color': true, 'active': 4 === selectTabId}">鍓╀綑浜嬮」锛坽{detailData.statistics.remainingTaskNum}}锛�</div> + <div @click="changeTab(1, 'all')" :class="{'item-warm': true, 'all-color': true, 'active': 1 === selectTabId}">鍏ㄩ儴浜嬮」<span v-if="detailData && detailData.statistics">锛坽{detailData.statistics.totalTaskNum}}锛�</span></div> + <div @click="changeTab(2, 'todo')" :class="{'item-warm': true, 'all-color': true, 'active': 2 === selectTabId}">浠e姙浜嬮」<span v-if="detailData && detailData.statistics">锛坽{detailData.statistics.todoTaskNum}}锛�</span></div> + <div @click="changeTab(3, 'todo')" :class="{'item-warm': true, 'current-color': true, 'active': 3 === selectTabId}">褰撳墠鐜妭</div> + <div @click="changeTab(4, 'remaining')" :class="{'item-warm': true, 'remaining-color': true, 'active': 4 === selectTabId}">鍓╀綑浜嬮」<span v-if="detailData && detailData.statistics">锛坽{detailData.statistics.remainingTaskNum}}锛�</span></div> <div @click="changeTab(5, 'timely')" :class="{'item-warm': true, 'timely-color': true, 'active': 5 === selectTabId}">鎸夋椂瀹屾垚锛�0锛�</div> <div @click="changeTab(6, 'overtime')" :class="{'item-warm': true, 'overtime-color': true, 'active': 6 === selectTabId}">瓒呮椂浜嬮」锛�0锛�</div> <div @click="changeTab(7, 'willOvertime')" :class="{'item-warm': true, 'willOvertime-color': true, 'active': 7 === selectTabId}">涓存湡浜嬮」锛�0锛�</div> @@ -37,6 +37,7 @@ </div> <div class="table"> <el-table + v-loading="tableLoading" :data="taskList" border style="width: 100%"> @@ -81,31 +82,39 @@ 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", data() { return { + loading: false, + tableLoading: false, detailData: {}, taskList: [], total: 0, @@ -123,25 +132,35 @@ mounted() { this.queryParams.projectId = this.$route.query.projectId this.queryParams.processDefId = this.$route.query.processDefId + this.loading = true 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: { @@ -151,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', @@ -166,6 +197,7 @@ getProjectProcessDetailTaskList(this.queryParams).then(res => { this.taskList = res.data this.total = res.total + this.tableLoading =false }) }, // 鏌ヨ璇︽儏 @@ -173,9 +205,12 @@ getProjectProcessDetail(this.queryParams.projectId, this.queryParams.processDefId).then(res => { this.detailData = res.data this.taskList = res.taskList + this.total = res.total + this.loading = false }) }, changeTab(id, event) { + this.tableLoading = true let beforeId = this.selectTabId this.selectTabId = id this.queryParams.taskType = event -- Gitblit v1.8.0