diff --git a/public/css/largeScreenStyle.css b/public/css/largeScreenStyle.css index e5c6cd8..5efd308 100644 --- a/public/css/largeScreenStyle.css +++ b/public/css/largeScreenStyle.css @@ -3401,7 +3401,13 @@ table{ .quality-table .el-table::before{ background: none; } - +.quality-table .el-table__footer-wrapper tbody td.el-table__cell{ + background: none ; + color: #fff ; + font-weight: bold; + font-size:16px; + border-bottom: solid 1px rgba(60, 170, 255, 0.3); +} diff --git a/src/api/attendance/index.js b/src/api/attendance/index.js index 5368a55..79aacdc 100644 --- a/src/api/attendance/index.js +++ b/src/api/attendance/index.js @@ -45,6 +45,21 @@ const todayAttendance=(data)=>{ }) } +const workerOnDuty=(data)=>{ + return request({ + url:"bgscreen/attendance/workerOnDuty", + method:"get", + params:data + }) +} + +const groupByWorkerOnDuty=(data)=>{ + return request({ + url:"bgscreen/attendance/groupByWorkerOnDuty", + method:"get", + params:data + }) +} const selectList=(data,pageNum,pageSize)=>{ return request({ url: `bgscreen/attendance/selectList?pageNum=${pageNum}&pageSize=${pageSize}`, @@ -59,5 +74,7 @@ export default{ todayAttendance, selectList, groupAllByComany, - listAttendance + listAttendance, + workerOnDuty, + groupByWorkerOnDuty } \ No newline at end of file diff --git a/src/pages/components/JobWorkerDialog.vue b/src/pages/components/JobWorkerDialog.vue index 9a6c9b2..4547dd9 100644 --- a/src/pages/components/JobWorkerDialog.vue +++ b/src/pages/components/JobWorkerDialog.vue @@ -1,16 +1,51 @@ @@ -25,56 +60,124 @@ export default { data() { return { + loading: false, show: false, tableData: [], - projectId:0, - deptId:0, - size:10, - index:1, - total:0, - nav:1, - cnt:0, + projectId: 0, + deptId: 0, + isGroup: false, + size: 10, + index: 1, + total: 0, + nav: 101, + indexData: { + total: 0, + data101: 0, + data102: 0, + data103: 0 + }, }; }, mounted() { - + }, methods: { - handleCurrentChange(n){ - this.index=n; + handleCurrentChange(n) { + this.index = n; this.loadData(); }, - doNav(n){ - this.nav=n; - this.index=1; + doNav(n) { + this.nav = n; + this.index = 1; this.loadData(); }, - showDialog(data) { - this.projectId=data?.projectId||0; - this.deptId=data?.deptId||0; - this.size=10; - this.index=1; - this.loadData(); + showDialog(data) {debugger + const getData = id => { + var tmps = data.datas.filter(d => d.text == id); + return tmps.length > 0 ? tmps[0].cnt : 0; + } + this.indexData.total = data.total; + this.indexData.data101 = getData("101"); + this.indexData.data102 = getData("102"); + this.indexData.data103 = getData("103"); + this.projectId = data?.projectId || 0; + this.deptId = data?.deptId || 0; + this.size = 10; + this.index = 1; + if (this.projectId == 0) { + this.isGroup = true; + this.loadGroupData(); + } else { + this.isGroup = false; + this.loadData(); + } this.show = true }, - loadData(){ - let postData={ - projectId:this.projectId, - deptId:this.deptId, - id:this.nav + loadGroupData() { + this.$api.attendance.groupByWorkerOnDuty({ deptId: this.deptId }).then(d => { + const getTypeId = (id) => { + let typeId = { "101": [1, 6], "102": [8], "103": [0, 2, 3, 4, 5] } + for (let k in typeId) { + let v = typeId[k]; + if (v.indexOf(id) >= 0) { + return k; + } + } + return ""; + } + let tmps = (d.data || []).map(it => { + return { + prjName: it.name, + dptName: it.groupName, + companyId: getTypeId(+it.companyId), + cnt: it.cfgid + } + }); + let sum = 0; + let obj = {}; + tmps.forEach(it => { + let k = it.prjName + "_" + it.dptName + "_"; + let o = null; + if (!obj[k]) { + o = { + prjName: it.prjName, + dptName: it.dptName, + data101: 0, + data102: 0, + data103: 0 + }; + obj[k] = o; + } else { + o = obj[k]; + } + sum += it.cnt; + o['data' + it.companyId] += it.cnt; + }); + this.tableData = []; + for (let k in obj) { + this.tableData.push(obj[k]); + } + this.total = sum; + }) + }, + loadData() { + let postData = { + projectId: this.projectId, + pageSize: this.size, + pageNum: this.index, + id: this.nav } - this.$api.attendance.selectList(postData,this.index,this.size).then(d=>{ - let cnt=0; - this.total=(d.total||0) - this.tableData=(d.rows||[]).map(it=>{ - cnt+=(it.servicePersonnel||0); - cnt+=(it.supervisorPersonnel||0); - cnt+=(it.contractorPersonnel||0); + this.tableData = []; + this.loading = true; + this.$api.attendance.workerOnDuty(postData).then(d => { + this.total = d.total || 0; + this.tableData = (d.rows || []).map(it => { + it.scanPhoto = it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0 ? "/jhapi" + it.scanPhoto : it.scanPhoto; return it; }); - this.cnt=cnt; + this.loading = false; }) } }, @@ -82,34 +185,37 @@ export default { \ No newline at end of file diff --git a/src/pages/index.vue b/src/pages/index.vue index 8d4538e..a7b8e90 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -46,7 +46,7 @@ -
在岗人数
@@ -220,6 +220,7 @@ +
@@ -234,6 +235,7 @@ import MonitAndWarning from './components/MonitAndWarning.vue' import journalismDlg from './dlg/journalismDlg.vue' import debounce from 'lodash.debounce' import AttendanceDetailDialog from './components/AttendanceDetailDialog.vue' +import AttendanceWorkerDialog from './components/AttendanceWorkerDialog.vue' import mapIndex from './index/mapIndex.vue' import JobWorkerDialog from './components/JobWorkerDialog.vue' export default { @@ -244,7 +246,7 @@ export default { indexDlg3, MonitAndWarning, journalismDlg, - AttendanceDetailDialog,mapIndex,JobWorkerDialog + AttendanceDetailDialog,mapIndex,JobWorkerDialog,AttendanceWorkerDialog }, data() { return { @@ -532,7 +534,16 @@ export default { if(this.infoNav == 1){ this.$refs.attDetailDlg.showDialog(data); }else{ - this.$refs.jobWorkerdlg.showDialog(data); + this.$refs.jobWorkerdlg.showDialog({ + ...data, + total:this.laborPersonnelTotal, + datas:this.laborPersonnelData.map(it=>{ + return { + text:it.text.replace("总包人员","101").replace("监理人员","102").replace("劳务人员","103"), + cnt:it.value + } + }) + }); } }, //查询在岗人数 @@ -546,7 +557,7 @@ export default { if (this.infoNav == 0) { ajax=this.$api.attendance.groupAllByComany } - ajax(data).then(d=>{ + ajax(data).then(d=>{ let tmps=d.data||[]; const func=(ids)=>{ let sum=0; diff --git a/src/pages/projectDetail.vue b/src/pages/projectDetail.vue index 5a57cc5..a6dbd13 100644 --- a/src/pages/projectDetail.vue +++ b/src/pages/projectDetail.vue @@ -84,7 +84,7 @@
今日出勤
- @@ -781,7 +781,16 @@ export default { if (this.infoNav == 1) { this.$refs.attDetailDlg.showDialog(data); } else { - this.$refs.jobWorkerdlg.showDialog(data); + this.$refs.jobWorkerdlg.showDialog({ + ...data, + total:this.laborPersonnelTotal, + datas:this.laborPersonnelData.map(it=>{ + return { + text:it.text.replace("总包人员","101").replace("监理人员","102").replace("劳务人员","103"), + cnt:it.value + } + }) + }); } }); },