diff --git a/src/api/index.js b/src/api/index.js index 5cc1830..80acbf2 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -8,6 +8,7 @@ import workTrain from './workTrain/index' import special from './special/index' import dict from './dict/index' import attendance from './attendance/index' +import insurance from './insurance/index' export default { project, dept, @@ -18,5 +19,6 @@ export default { workTrain, special, dict, - attendance + attendance, + insurance } \ No newline at end of file diff --git a/src/api/insurance/index.js b/src/api/insurance/index.js new file mode 100644 index 0000000..a6c6dff --- /dev/null +++ b/src/api/insurance/index.js @@ -0,0 +1,12 @@ +import request from '@/utils/request' + +const getProjectInsuranceList=(deptId,projectId)=> { + return request({ + url: `bgscreen/insurance/getProjectInsuranceList?deptId=${deptId}&projectId=${projectId}`, + method: 'get' + }) + } + +export default{ + getProjectInsuranceList +} \ No newline at end of file diff --git a/src/pages/index.vue b/src/pages/index.vue index 3cb2006..939dbf4 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -536,7 +536,8 @@ export default { //重大节点预期预警 this.majorInterval = setInterval(this.timer, 5000); //正在发生 定时器 - this.warningInterval = setInterval(this.automaticRoll, 5000); + this.warningInterval = setInterval(this.automaticRoll, 5000); + setInterval(this.getDeptWorksList, 60000); }, doPrjProcess(n, text) { this.prjProcessNav = n; @@ -553,24 +554,45 @@ export default { this.staffText = n==0?'在岗人数':'今日出勤' if (n == 0) { this.surveyUrl = 'images/survey_icon_4.png' - this.laborPersonnelData = [ - { text: "总包人员", value: this.prjInfo?.servicePersonnel||0 }, - { text: "监理人员", value: this.prjInfo?.supervisorPersonnel||0 }, - { text: "劳务人员", value: this.prjInfo?.generalContractor||0 }, - ] - let sum=0; - this.laborPersonnelData.forEach(it=>{ - sum+=it.value; - }) - this.laborPersonnelTotal = sum; } else { this.surveyUrl = 'images/survey_icon_5.png' - this.laborPersonnelTotal = 133; - this.laborPersonnelData = [ - { text: "总包人员", value: 25 }, - { text: "监理人员", value: 3 }, - { text: "劳务人员", value: 105 }, - ] + } + this.getDeptWorksList(); + }, + //查询在岗人数 + getDeptWorksList(){ + let deptId = ''; + // if (this.dept && this.dept.id != 0) { + // deptId = this.dept.id; + // } + if (this.infoNav == 0) { + //查询在岗人数 + 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}); + } + }); + } else { + //查询出勤人数 + 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}); + } + }); } }, //设备概况点击事件定时器方法 diff --git a/src/pages/projectSafety.vue b/src/pages/projectSafety.vue index 40c2e6f..e18a8f4 100644 --- a/src/pages/projectSafety.vue +++ b/src/pages/projectSafety.vue @@ -207,13 +207,13 @@
- - - + + - + @@ -323,7 +323,7 @@ export default { //特种作业人员 specialDataList:[], //保险采购明细 - insuranceData: [ + insuranceDataList: [ { name: '荟锦坊一期', dt1: '已购买', dt2: '正在办理' }, { name: '泾河智谷一期', dt1: '正在办理', dt2: '正在办理' }, { name: '泊域人才中心', dt1: '正在办理', dt2: '正在办理' }, @@ -337,11 +337,6 @@ export default { }, created() { this.init(); - this.getWorkFileList(); - this.getWorkTrainList(); - this.getEmergencyDrillList(); - this.getProjectSpecialView(); - this.getDeptWorksList(); }, mounted() { this.$bus.$on("deptChange", dept => { @@ -350,11 +345,8 @@ export default { this.getWorkTrainList(); this.getEmergencyDrillList(); this.getProjectSpecialView(); - if (this.infoNav == 0) { - this.getDeptWorksList(); - } else { - this.getWorkAttendanceList(); - } + this.getDeptWorksList(); + this.getProjectInsuranceList(); }); }, methods: { @@ -423,7 +415,9 @@ export default { if (this.dept && this.dept.id != 0) { deptId = this.dept.id; } - this.$api.attendance.getDeptWorksList(deptId).then(d => { + if (this.infoNav == 0) { + //查询在岗人数 + this.$api.attendance.getDeptWorksList(deptId).then(d => { this.laborPersonnelTotal=0; this.laborPersonnelData=[]; if(d.rows.length>0 && d.rows[0]!=null){ @@ -435,14 +429,9 @@ export default { 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 => { + } else { + //查询出勤人数 + this.$api.attendance.getWorkAttendanceList(deptId).then(d => { this.laborPersonnelTotal=0; this.laborPersonnelData=[]; if(d.rows.length>0 && d.rows[0]!=null){ @@ -454,6 +443,19 @@ export default { this.laborPersonnelData.push({text: "总包人员", value: d.rows[0].contractorPersonnel}); } }); + } + }, + getProjectInsuranceList(){ + let deptId = ''; + if (this.dept && this.dept.id != 0) { + deptId = this.dept.id; + } + this.$api.insurance.getProjectInsuranceList(deptId).then(d => { + this.insuranceDataList=[]; + if(d.rows.length>0 && d.rows[0]!=null){ + this.insuranceDataList = d.rows; + } + }); }, fmt(n) { n = "" + n; @@ -526,11 +528,10 @@ export default { this.staffText = text if (n == 0) { this.surveyUrl = 'images/survey_icon_4.png' - this.getDeptWorksList(); } else { this.surveyUrl = 'images/survey_icon_5.png' - this.getWorkAttendanceList(); } + this.getDeptWorksList(); }, doSafeNav(n, t) { this.safeNav = n; @@ -548,6 +549,14 @@ export default { this.warningInterval = setInterval(this.automaticRoll, 5000); //预警类型 定时器 this.warningTypeInterval = setInterval(this.automaticRollType, 5000); + + //定时器|一分钟执行一次 + setInterval(this.getWorkFileList, 60000); + setInterval(this.getWorkTrainList, 60000); + setInterval(this.getEmergencyDrillList, 60000); + setInterval(this.getProjectSpecialView, 60000); + setInterval(this.getDeptWorksList, 60000); + setInterval(this.getProjectInsuranceList, 60000); }, }, @@ -694,6 +703,10 @@ export default { text-align: left !important; } + td.td-center { + text-align: center !important; + } + .file-list { max-height: calc(100% - 90px); margin-right: 12px;