From 3f4b5c228ef7b69046d18d24bd9d48c30f562e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Wed, 16 Aug 2023 20:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=B3=E5=8A=A1=E4=BA=BA=E5=91=98=E7=9B=B8?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/attendance/index.js | 20 +++++++++++++ src/api/index.js | 4 ++- src/pages/projectSafety.vue | 60 +++++++++++++++++++++++++++++-------- 3 files changed, 70 insertions(+), 14 deletions(-) create mode 100644 src/api/attendance/index.js diff --git a/src/api/attendance/index.js b/src/api/attendance/index.js new file mode 100644 index 0000000..4a21256 --- /dev/null +++ b/src/api/attendance/index.js @@ -0,0 +1,20 @@ +import request from '@/utils/request' + +const getDeptWorksList=(deptId,projectId)=> { + return request({ + url: `bgscreen/attendance/getDeptWorksList?deptId=${deptId}&projectId=${projectId}`, + method: 'get' + }) +} + +const getWorkAttendanceList=(deptId,projectId,date)=> { + return request({ + url: `bgscreen/attendance/getWorkAttendanceList?deptId=${deptId}&projectId=${projectId}&date=${date}`, + method: 'get' + }) + } + +export default{ + getDeptWorksList, + getWorkAttendanceList +} \ No newline at end of file diff --git a/src/api/index.js b/src/api/index.js index a2bee7e..5cc1830 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -7,6 +7,7 @@ import workFile from './workFile/index' import workTrain from './workTrain/index' import special from './special/index' import dict from './dict/index' +import attendance from './attendance/index' export default { project, dept, @@ -16,5 +17,6 @@ export default { workFile, workTrain, special, - dict + dict, + attendance } \ No newline at end of file diff --git a/src/pages/projectSafety.vue b/src/pages/projectSafety.vue index ea1f5ed..40c2e6f 100644 --- a/src/pages/projectSafety.vue +++ b/src/pages/projectSafety.vue @@ -318,7 +318,7 @@ export default { laborPersonnelData: [ { text: "总包人员", value: 10 }, { text: "监理人员", value: 70 }, - { text: "劳务人员", value: 20 }, + { text: "劳务人员", value: 220 }, ], //特种作业人员 specialDataList:[], @@ -341,6 +341,7 @@ export default { this.getWorkTrainList(); this.getEmergencyDrillList(); this.getProjectSpecialView(); + this.getDeptWorksList(); }, mounted() { this.$bus.$on("deptChange", dept => { @@ -349,6 +350,11 @@ export default { this.getWorkTrainList(); this.getEmergencyDrillList(); this.getProjectSpecialView(); + if (this.infoNav == 0) { + this.getDeptWorksList(); + } else { + this.getWorkAttendanceList(); + } }); }, methods: { @@ -411,6 +417,44 @@ export default { this.specialDataList = d.rows; }); }, + //查询在岗人数 + getDeptWorksList(){ + let deptId = ''; + if (this.dept && this.dept.id != 0) { + deptId = this.dept.id; + } + this.$api.attendance.getDeptWorksList(deptId).then(d => { + this.laborPersonnelTotal=0; + this.laborPersonnelData=[]; + if(d.rows.length>0 && d.rows[0]!=null){ + this.laborPersonnelTotal += d.rows[0].servicePersonnel; + this.laborPersonnelData.push({text: "劳务人员", value: d.rows[0].servicePersonnel}); + this.laborPersonnelTotal += d.rows[0].supervisorPersonnel; + this.laborPersonnelData.push({text: "监理人员", value: d.rows[0].supervisorPersonnel}); + this.laborPersonnelTotal += d.rows[0].contractorPersonnel; + this.laborPersonnelData.push({text: "总包人员", value: d.rows[0].contractorPersonnel}); + } + }); + }, + //查询出勤人数 + getWorkAttendanceList(){ + let deptId = ''; + if (this.dept && this.dept.id != 0) { + deptId = this.dept.id; + } + this.$api.attendance.getWorkAttendanceList(deptId).then(d => { + this.laborPersonnelTotal=0; + this.laborPersonnelData=[]; + if(d.rows.length>0 && d.rows[0]!=null){ + this.laborPersonnelTotal += d.rows[0].servicePersonnel; + this.laborPersonnelData.push({text: "劳务人员", value: d.rows[0].servicePersonnel}); + this.laborPersonnelTotal += d.rows[0].supervisorPersonnel; + this.laborPersonnelData.push({text: "监理人员", value: d.rows[0].supervisorPersonnel}); + this.laborPersonnelTotal += d.rows[0].contractorPersonnel; + this.laborPersonnelData.push({text: "总包人员", value: d.rows[0].contractorPersonnel}); + } + }); + }, fmt(n) { n = "" + n; return " ".substring(0, 3 - n.length) + n; @@ -482,20 +526,10 @@ export default { this.staffText = text if (n == 0) { this.surveyUrl = 'images/survey_icon_4.png' - this.laborPersonnelData = [ - { text: "总包人员", value: 118 }, - { text: "监理人员", value: 3 }, - { text: "劳务人员", value: 28 }, - ] - this.laborPersonnelTotal = 149; + this.getDeptWorksList(); } else { this.surveyUrl = 'images/survey_icon_5.png' - this.laborPersonnelTotal = 133; - this.laborPersonnelData = [ - { text: "总包人员", value: 105 }, - { text: "监理人员", value: 3 }, - { text: "劳务人员", value: 25 }, - ] + this.getWorkAttendanceList(); } }, doSafeNav(n, t) {