From 135a2b60aa3c938738f77c6b47e20966cc10c5fb Mon Sep 17 00:00:00 2001 From: haha Date: Sat, 4 May 2024 00:57:54 +0800 Subject: [PATCH] update code --- src/api/flow/index.js | 20 +++- src/pages/engin/auditingPage.vue | 152 +++++++++++++++++++++---------- 2 files changed, 125 insertions(+), 47 deletions(-) diff --git a/src/api/flow/index.js b/src/api/flow/index.js index 237479a..8356ae8 100644 --- a/src/api/flow/index.js +++ b/src/api/flow/index.js @@ -98,6 +98,22 @@ const findFlowLabourGroupCountByApprove=(deptId,projectId)=> { }) } +//工程管理-分包单位占比 +const groupFlowBySubDeptType=(data)=>{ + return request({ + url:'bgscreen/flow/groupFlowBySubDeptType', + method:'post', + data:data + }) +} + +const listFlowBySubDeptType=(data,pageNum,pageSize)=>{ + return request({ + url:`bgscreen/flow/listFlowBySubDeptType?pageNum=${pageNum}&pageSize=${pageSize}`, + method:'post', + data:data + }) +} export default{ groupByCategory, @@ -111,5 +127,7 @@ export default{ findFormDatasByProcInsId, listByCategory, findFlowLabourList, - findFlowLabourGroupCountByApprove + findFlowLabourGroupCountByApprove, + groupFlowBySubDeptType, + listFlowBySubDeptType } diff --git a/src/pages/engin/auditingPage.vue b/src/pages/engin/auditingPage.vue index 1d96788..dea4850 100644 --- a/src/pages/engin/auditingPage.vue +++ b/src/pages/engin/auditingPage.vue @@ -185,26 +185,39 @@ -
- - - - - - - - - - - - - - - -
所属项目所属总包单位申请单位所属时间状态
泾河智谷(一期)一标段中国一冶集团有限公司陕西凯德劳务建筑有限公司2024-3-4 - 进行中 - 行中 -
+ + +
+ +
暂无数据
+
@@ -238,7 +251,12 @@ export default { chart1Data: [], elChart2: 0, flowList: [], - dataList4:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20] + dataList4: [], + data4Page: { + total: 0, + pageSize: 10, + pageIndex: 1 + } }; }, @@ -297,16 +315,51 @@ export default { this.loadCostList(); this.loadFlow(); this.initChart2(); + this.data4Page.pageIndex = 1; + this.loadFlowDataList(); + }, + handleCurrentChange(n) { + this.data4Page.pageIndex = n; + this.loadFlowDataList(); + }, + loadFlowDataList() { + let postData = {}; + if (this.project && this.project.id > 0) { + postData.projectId = this.project.id; + } else { + postData.id = this.dept.id; + } + this.$api.flow.listFlowBySubDeptType(postData, this.data4Page.pageIndex, this.data4Page.pageSize).then(d => { + let data = d.rows || []; + this.dataList4 = data; + this.data4Page.total = d.total; + }); }, initChart2() { - let opt = { "tooltip": { "trigger": "item" }, "series": [{ "top": 10, "type": "pie", "radius": "60%", - "data": [{ "name": "未发起", "value": 6 }, - { "name": " 审批中", "value": 4 }, - { "name": "审批通过", "value": 15 } - ], "label": { "alignTo": "edge", "edgeDistance": "10%", "color": "#fff", "formatter": "{name|{b}}\n{cnt|{c}}", "rich": { "cnt": { "fontSize": 10, "color": "#eee" } } } }] }; - if (this.$refs.chart2 && this.$refs.chart2.init) { - this.$refs.chart2.init(opt); + let postData = {}; + if (this.project && this.project.id > 0) { + postData.projectId = this.project.id; + } else { + postData.id = this.dept.id; } + this.$api.flow.groupFlowBySubDeptType(postData).then(d => { + let data = (d.data || []).map(it => { + return { + name: it.taskName, + value: it.taskId || 0 + } + }); + let opt = { + "tooltip": { "trigger": "item" }, "series": [{ + "top": 10, "type": "pie", "radius": "60%", + "data": data, "label": { "alignTo": "edge", "edgeDistance": "10%", "color": "#fff", "formatter": "{name|{b}}\n{cnt|{c}}", "rich": { "cnt": { "fontSize": 10, "color": "#eee" } } } + }] + }; + if (this.$refs.chart2 && this.$refs.chart2.init) { + this.$refs.chart2.init(opt); + } + }); + }, loadFlow() { let ajaxs = [ @@ -423,7 +476,7 @@ export default { th { font-size: 14px; - color:#409eff; + color: #409eff; border: solid 1px #ffffff52; line-height: 60px; } @@ -435,22 +488,26 @@ export default { line-height: 40px; } } - } - .data-list3{ - max-height: calc(100% - 40px); + } + + .data-list3 { + max-height: calc(100% - 70px); overflow-y: auto; - padding:4px; - .tr-header{ - th{ - color:#409eff; - } - } - td,th{ - border: solid 1px #409eff8c; - padding: 0px 8px; - font-size:12px; - line-height: 20px; + padding: 4px; + + .tr-header { + th { + color: #409eff; } + } + + td, + th { + border: solid 1px #409eff8c; + padding: 0px 8px; + font-size: 12px; + line-height: 20px; + } } .cost-sum { @@ -489,10 +546,13 @@ export default { .sum-table { border-collapse: collapse; - th{ - color:#409eff; + + th { + color: #409eff; } - td,th{ + + td, + th { line-height: 30px; border: solid 1px #409eff8c; padding: 0px 8px;