From 61816788250c93a59ae630e664e3ff9911e73712 Mon Sep 17 00:00:00 2001 From: "lj7788@126.com" Date: Thu, 10 Jul 2025 14:54:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=A6=96=E9=A1=B5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yanzhu-bigscreen/src/views/projectDetail.vue | 4 +- .../ProProjectInfoSubdeptsGroupMapper.java | 6 + .../ProProjectInfoSubdeptsUsersMapper.java | 5 + .../SurProjectAttendanceGroupMapper.java | 6 + .../ProProjectInfoSubdeptsGroupMapper.xml | 3 + .../ProProjectInfoSubdeptsUsersMapper.xml | 3 + .../SurProjectAttendanceGroupMapper.xml | 6 + .../controller/bigscreen/LaborController.java | 37 +++- .../IProProjectInfoSubdeptsGroupService.java | 6 + .../IProProjectInfoSubdeptsUsersService.java | 5 + .../ISurProjectAttendanceGroupService.java | 6 + ...roProjectInfoSubdeptsGroupServiceImpl.java | 10 +- ...roProjectInfoSubdeptsUsersServiceImpl.java | 8 + .../SurProjectAttendanceGroupServiceImpl.java | 9 + yanzhu-ui-vue3/src/api/manage/labor.js | 54 +++++- .../src/assets/icons/svg/nodata.svg | 1 + yanzhu-ui-vue3/src/views/index.vue | 163 ++++++++++++++++-- .../indexCompents/navAttJobTypeGroup.vue | 24 ++- .../views/indexCompents/navAttLaborerRate.vue | 51 ++++-- .../indexCompents/navAttLaborerTrend.vue | 12 +- .../views/indexCompents/navAttManagerRate.vue | 53 ++++-- .../views/indexCompents/navAttWokerProp.vue | 28 ++- .../views/indexCompents/navAttendanceRate.vue | 45 +++-- .../views/indexCompents/navTopAttMgrCount.vue | 13 +- .../indexCompents/navTopAttOnlineCount.vue | 13 +- .../indexCompents/navTopAttRealCount.vue | 23 +-- .../indexCompents/navTopAttWorkerCount.vue | 15 +- .../src/views/indexCompents/navTopUnit.vue | 38 +++- 28 files changed, 527 insertions(+), 120 deletions(-) create mode 100644 yanzhu-ui-vue3/src/assets/icons/svg/nodata.svg diff --git a/yanzhu-bigscreen/src/views/projectDetail.vue b/yanzhu-bigscreen/src/views/projectDetail.vue index 3b43551b..b41fe85f 100644 --- a/yanzhu-bigscreen/src/views/projectDetail.vue +++ b/yanzhu-bigscreen/src/views/projectDetail.vue @@ -713,8 +713,8 @@ export default { } if (this.attendanceNav == 1) { ajax = this.$api.detail.groupByCraftTypeByAttendance - //posData.createTime = this.$dt(new Date()).format("YYYY-MM-DD"); - posData.createTime = '2024-10-13' + posData.createTime = this.$dt(new Date()).format("YYYY-MM-DD"); + //posData.createTime = '2024-10-13' } ajax(posData).then((d) => { this.attendanceData = (d.data || []).map((it) => { diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java index bdbf4592..96e697f0 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsGroupMapper.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup; +import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import org.apache.ibatis.annotations.Param; /** @@ -77,4 +78,9 @@ public interface ProProjectInfoSubdeptsGroupMapper public void updateUseStatusByParams(Long subDeptId); public int updatePhone(@Param("oldUserPhone")String oldUserPhone, @Param("newUserPhone")String newUserPhone); + + /** + * 统计参建单位数量 + */ + Long getUnitCount(Long prjId); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java index 4be79666..8c4468a2 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/ProProjectInfoSubdeptsUsersMapper.java @@ -191,4 +191,9 @@ public interface ProProjectInfoSubdeptsUsersMapper * @return */ List getAttendanceAlert(@Param("projectId")Long prjId); + + /** + * 完成三级安全教育人数 + */ + Long getEduCompletedCount(Long prjId); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SurProjectAttendanceGroupMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SurProjectAttendanceGroupMapper.java index d091fa29..45699164 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SurProjectAttendanceGroupMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SurProjectAttendanceGroupMapper.java @@ -1,6 +1,7 @@ package com.yanzhu.manage.mapper; import com.yanzhu.manage.domain.SurProjectAttendanceGroup; +import com.yanzhu.manage.domain.SurProjectAttendanceUser; import java.util.List; @@ -83,4 +84,9 @@ public interface SurProjectAttendanceGroupMapper * @return 结果 */ public int batchSurProjectAttendanceGroup(List surProjectAttendanceGroupList); + + /** + * 统计参建单位数量 + */ + List getUnitCount(Long prjId); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml index b35a4234..345451a6 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsGroupMapper.xml @@ -197,4 +197,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update pro_project_info_subdepts_group set group_leader_phone = #{newUserPhone} where group_leader_phone = #{oldUserPhone} + \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml index 6c55caea..ef1dc1c4 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml @@ -468,4 +468,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" group by userId order by max(ifnull(inTime,outTime)) ) att on us.id=att.userId + \ No newline at end of file diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceGroupMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceGroupMapper.xml index 07b1263f..85606ba9 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceGroupMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/SurProjectAttendanceGroupMapper.xml @@ -230,4 +230,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/LaborController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/LaborController.java index 52be4b7b..b612173c 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/LaborController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/LaborController.java @@ -11,10 +11,7 @@ import com.yanzhu.manage.domain.AttendanceUbiData; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; import com.yanzhu.manage.domain.SurProjectAttendanceData; import com.yanzhu.manage.domain.SurProjectAttendanceUser; -import com.yanzhu.manage.service.IAttendanceUbiDataService; -import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService; -import com.yanzhu.manage.service.ISurProjectAttendanceDataService; -import com.yanzhu.manage.service.ISurProjectAttendanceUserService; +import com.yanzhu.manage.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -40,9 +37,14 @@ public class LaborController extends BaseController { @Autowired IProProjectInfoSubdeptsUsersService proProjectInfoSubdeptsUsersService; + @Autowired + IProProjectInfoSubdeptsGroupService proGroupService; + @Autowired ISurProjectAttendanceDataService surProjectAttendanceDataService; + @Autowired + ISurProjectAttendanceGroupService surGroupService; /** * 分组统计人员年龄,省份统计信息 * @return @@ -119,4 +121,31 @@ public class LaborController extends BaseController { } } + /** + * 统计参建单位数量 + */ + @GetMapping("/getUnitCount/{type}/{prjId}") + public AjaxResult getUnitCount(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){ + if("uni".equals(type.toLowerCase())){ + Long count=proGroupService.getUnitCount(prjId); + return AjaxResult.success(count); + }else{ + List pList=surGroupService.getUnitCount(prjId); + return AjaxResult.success(pList.size()); + } + } + + /** + * 完成三级安全教育人数 + */ + @GetMapping("/getEduCompletedCount/{type}/{prjId}") + public AjaxResult getEduCompletedCount(@PathVariable("type")String type, @PathVariable("prjId") Long prjId){ + if("uni".equals(type.toLowerCase())){ + Long count=proProjectInfoSubdeptsUsersService.getEduCompletedCount(prjId); + return AjaxResult.success(count); + }else{ + return AjaxResult.success(0); + } + } + } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsGroupService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsGroupService.java index 0744864e..3bc8d244 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsGroupService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsGroupService.java @@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import com.yanzhu.manage.domain.ProProjectInfoSubdeptsGroup; +import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers; /** * 分包单位班组Service接口 @@ -83,4 +84,9 @@ public interface IProProjectInfoSubdeptsGroupService * @return 结果 */ public int deleteProProjectInfoSubdeptsGroupById(Long id); + + /** + * 统计参建单位数量 + */ + Long getUnitCount(Long prjId); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java index 7d636d12..e02a2901 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IProProjectInfoSubdeptsUsersService.java @@ -260,4 +260,9 @@ public interface IProProjectInfoSubdeptsUsersService * @return */ List getAttendanceAlert(Long prjId); + + /** + * 完成三级安全教育人数 + */ + Long getEduCompletedCount(Long prjId); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISurProjectAttendanceGroupService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISurProjectAttendanceGroupService.java index bed8965c..decb8b51 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISurProjectAttendanceGroupService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISurProjectAttendanceGroupService.java @@ -2,6 +2,7 @@ package com.yanzhu.manage.service; import com.yanzhu.manage.domain.SurProjectAttendanceGroup; +import com.yanzhu.manage.domain.SurProjectAttendanceUser; import java.util.List; @@ -92,4 +93,9 @@ public interface ISurProjectAttendanceGroupService * @param group */ public void updateJgw(SurProjectAttendanceGroup group); + + /** + * 统计参建单位数量 + */ + List getUnitCount(Long prjId); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java index 0b673cad..2479b43e 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsGroupServiceImpl.java @@ -39,7 +39,7 @@ import java.util.Objects; * @date 2024-08-25 */ @Service -public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSubdeptsGroupService +public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSubdeptsGroupService { @Autowired @@ -486,4 +486,12 @@ public class ProProjectInfoSubdeptsGroupServiceImpl implements IProProjectInfoSu { return proProjectInfoSubdeptsGroupMapper.deleteProProjectInfoSubdeptsGroupById(id); } + + /** + * 统计参建单位数量 + */ + @Override + public Long getUnitCount(Long prjId) { + return proProjectInfoSubdeptsGroupMapper.getUnitCount(prjId); + } } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java index 035f6712..3800805b 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/ProProjectInfoSubdeptsUsersServiceImpl.java @@ -1790,4 +1790,12 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu return proProjectInfoSubdeptsUsersMapper.getAttendanceAlert(prjId); } + /** + * 完成三级安全教育人数 + */ + @Override + public Long getEduCompletedCount(Long prjId) { + return proProjectInfoSubdeptsUsersMapper.getEduCompletedCount(prjId); + } + } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SurProjectAttendanceGroupServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SurProjectAttendanceGroupServiceImpl.java index 414a9583..707fcf4f 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SurProjectAttendanceGroupServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SurProjectAttendanceGroupServiceImpl.java @@ -3,6 +3,7 @@ package com.yanzhu.manage.service.impl; import com.yanzhu.common.core.utils.DateUtils; import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.manage.domain.SurProjectAttendanceGroup; +import com.yanzhu.manage.domain.SurProjectAttendanceUser; import com.yanzhu.manage.mapper.SurProjectAttendanceGroupMapper; import com.yanzhu.manage.service.ISurProjectAttendanceGroupService; import org.springframework.beans.factory.annotation.Autowired; @@ -159,4 +160,12 @@ public class SurProjectAttendanceGroupServiceImpl implements ISurProjectAttendan updateSurProjectAttendanceGroup(g); } } + + /** + * 统计参建单位数量 + */ + @Override + public List getUnitCount(Long prjId) { + return surProjectAttendanceGroupMapper.getUnitCount(prjId); + } } diff --git a/yanzhu-ui-vue3/src/api/manage/labor.js b/yanzhu-ui-vue3/src/api/manage/labor.js index cc0ed39e..8ce45c80 100644 --- a/yanzhu-ui-vue3/src/api/manage/labor.js +++ b/yanzhu-ui-vue3/src/api/manage/labor.js @@ -1,7 +1,7 @@ import request from '@/utils/request' //劳务人员工种占比 -export function getWorkerCountGroupByType (type, prjId) { +export function getWorkerCountGroupByType(type, prjId) { return request({ url: `/manage/bgscreen/labor/getWorkerCountGroupByType/${type}/${prjId}`, method: "get", @@ -9,9 +9,59 @@ export function getWorkerCountGroupByType (type, prjId) { }; //劳务人员七天出勤趋势 -export function groupAttendanceLastWeek (type, prjId){ +export function groupAttendanceLastWeek(type, prjId) { return request({ url: `/manage/bgscreen/labor/groupAttendanceLastWeek/${type}/${prjId}`, method: "get", }); +}; + +// 统计参建单位数量 +export function getUnitCount(type, prjId) { + return request({ + url: `/manage/bgscreen/labor/getUnitCount/${type}/${prjId}`, + method: "get", + }); +} + +export function getEduCompletedCount(type, prjId) { + return request({ + url: `/manage/bgscreen/labor/getEduCompletedCount/${type}/${prjId}`, + method: "get", + }); +} + +//今日出勤人员信息(第三方考勤) +export function groupByComany(data) { + return request({ + url: `/manage/bgscreen/attendance/groupByComany`, + data: data, + method: "post", + }); +}; +//在岗人员信息(第三方考勤) +export function groupAllByComany(data) { + return request({ + url: `/manage/bgscreen/attendance/groupAllByComany`, + data: data, + method: "post", + }); +}; + +//在岗人员信息 +export function groupByCraftType(data) { + return request({ + url: "/manage/proProjectInfoSubdeptsUsers/groupByCraftType", + method: "get", + params: data, + }); +}; + +//今日出勤 +export function groupByCraftTypeByAttendance(data) { + return request({ + url: "/manage/proProjectInfoSubdeptsUsers/groupByCraftTypeByAttendance", + method: "get", + params: data, + }); }; \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/assets/icons/svg/nodata.svg b/yanzhu-ui-vue3/src/assets/icons/svg/nodata.svg new file mode 100644 index 00000000..5afd8076 --- /dev/null +++ b/yanzhu-ui-vue3/src/assets/icons/svg/nodata.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/views/index.vue b/yanzhu-ui-vue3/src/views/index.vue index ac2222b6..ee71f7d0 100644 --- a/yanzhu-ui-vue3/src/views/index.vue +++ b/yanzhu-ui-vue3/src/views/index.vue @@ -2,28 +2,28 @@
- - - - + + + + - + - + - + - - + + @@ -48,7 +48,8 @@ import navAttLaborerTrend from "./indexCompents/navAttLaborerTrend.vue"; import navAttWokerProp from "./indexCompents/navAttWokerProp.vue"; import navAttJobTypeGroup from "./indexCompents/navAttJobTypeGroup.vue"; import NavTopAttOnlineCount from "./indexCompents/navTopAttOnlineCount.vue"; - +import useUserStore from "@/store/modules/user"; +import { groupByComany, groupAllByComany,groupByCraftType,groupByCraftTypeByAttendance ,getEduCompletedCount} from "@/api/manage/labor.js"; export default { components: { navTopAttMgrCount, @@ -64,6 +65,131 @@ export default { navAttJobTypeGroup, NavTopAttOnlineCount, }, + data() { + return { + currentPrjId: null, + currentComId: null, + vendorsCode: "", + attInfo: null, + elKey: 0, + }; + }, + mounted() { + this.userStore = useUserStore(); + this.currentPrjId = this.userStore.currentPrjId; + this.currentComId = this.userStore.currentComId; + this.vendorsCode = this.userStore.vendorsCode; + if (this.vendorsCode == "jgw") { + this.vendorsCode = "uni"; + } + this.loadAttInfo(); //加载考勤人员信息 + }, + methods: { + loadAttInfo() { + if (this.vendorsCode != "uni") { + this.loadJhAttendanceData(); + } else { + this.loadUniAttendanceData(); + } + }, + loadUniAttendanceData(){ + let data={ + comId:this.currentComId, + projectId:this.currentPrjId + }; + let ajax=[]; + ajax.push(groupByCraftTypeByAttendance({...data,createTime:this.$dt(new Date()).format("YYYY-MM-DD")})) + ajax.push(groupByCraftType(data)); + ajax.push(getEduCompletedCount(this.vendorsCode,this.currentPrjId)) + Promise.all(ajax).then(res=>{ + let tmps = res[0].data || []; + let obj = { + job: { + //在岗 + total: 0, + mgr: 0, + worker: 0, + }, + att: { + //今日出勤 + total: 0, + mgr: 0, + worker: 0, + }, + edu:0 + }; + tmps.forEach(d=>{ + let cnt=(d.id||0)*1 + obj.att.total+=cnt + if(d.createBy=="管理人员"){ + obj.att.mgr+=cnt + }else{ + obj.att.worker+=cnt + } + }); + tmps = res[1].data || []; + tmps.forEach(d=>{ + let cnt=(d.id||0)*1 + obj.job.total+=cnt + if(d.createBy=="管理人员"){ + obj.job.mgr+=cnt + }else{ + obj.job.worker+=cnt + } + }) + obj.edu=res[2].data||0; + this.attInfo = obj; + this.elKey++; + }); + }, + loadJhAttendanceData() { + let ajax = []; + let data = { + projectId: this.currentPrjId, + attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD"), + }; + ajax.push(groupByComany({ ...data, id: 1 })); + ajax.push(groupAllByComany({ ...data, id: 0 })); + Promise.all(ajax).then((res) => { + let tmps = res[0].data || []; + let obj = { + job: { + //在岗 + total: 0, + mgr: 0, + worker: 0, + }, + att: { + //今日出勤 + total: 0, + mgr: 0, + worker: 0, + }, + }; + tmps.forEach((d) => { + let cnt = d.id * 1; + obj.att.total += cnt; + if (["1"].includes(d.companyTypeId)) { + obj.att.mgr += cnt; + } else { + obj.att.worker += cnt; + } + }); + tmps = res[1].data || []; + tmps.forEach((d) => { + let cnt = d.id * 1; + obj.job.total += cnt; + if (["1"].includes(d.companyTypeId)) { + obj.job.mgr += cnt; + } else { + obj.job.worker += cnt; + } + }); + this.attInfo = obj; + this.elKey++; + }); + }, + }, }; @@ -129,6 +255,23 @@ export default { justify-content: center; } } + .no-data { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + .svg-icon { + width: 100px; + height: 100px; + fill: #999; + } + div { + color: #999; + font-size: 14px; + } + } } } } diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navAttJobTypeGroup.vue b/yanzhu-ui-vue3/src/views/indexCompents/navAttJobTypeGroup.vue index 96a8ddf1..313c59bd 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navAttJobTypeGroup.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navAttJobTypeGroup.vue @@ -1,9 +1,13 @@ @@ -17,7 +21,7 @@ export default { }, data() { return { - elKey:0, + elKey: 0, chartData: [], currentPrjId: null, currentComId: null, @@ -29,7 +33,9 @@ export default { this.currentPrjId = this.userStore.currentPrjId; this.currentComId = this.userStore.currentComId; this.vendorsCode = this.userStore.vendorsCode; - console.log(this.userStore); + if(this.vendorsCode=="jgw"){ + this.vendorsCode="uni" + } this.init(); }, methods: { @@ -46,7 +52,7 @@ export default { icon: "rect", orient: "vertical", itemWidth: "50%", - + right: "10%", itemWidth: 20, itemGap: 20, @@ -66,17 +72,17 @@ export default { textStyle: { padding: [0, 0, 0, 0], fontSize: 12, - + align: "center", rich: { name: { fontSize: 12, - + padding: [5, 2, 5, 2], }, percent: { - fontSize:12, - + fontSize: 12, + padding: [0, 2, 0, 2], }, }, @@ -126,7 +132,7 @@ export default { }); this.elKey++; }); - } + }, }, }; diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerRate.vue b/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerRate.vue index 7761e875..1c1ab773 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerRate.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerRate.vue @@ -1,10 +1,12 @@ @@ -15,9 +17,17 @@ export default { components: { MyChart, }, + props: { + attInfo: { + type: Object, + default: () => { + return null; + }, + }, + }, data() { return { - chartData:[] + chartData: [], }; }, mounted() { @@ -37,7 +47,7 @@ export default { orient: "horizontal", left: "center", top: "10", - data:this.chartData.map(d=>d.name), + data: this.chartData.map((d) => d.name), textStyle: { color: "#444", fontSize: 12, @@ -46,7 +56,7 @@ export default { series: [ { type: "pie", - radius: ["30%", "60%"], // 设置为圆环图 + radius: ["30%", "60%"], // 设置为圆环图 center: ["50%", "50%"], avoidLabelOverlap: false, data: this.chartData, @@ -79,18 +89,25 @@ export default { }, init() { setTimeout(() => { - this.chartData=[{ - name:"出勤人数", - value:33 - },{ - name:"未出勤人数", - value:22 - }] - this.$refs.chart.reLoad(); - }, 1000); + let total = this.attInfo ? this.attInfo.job.worker : 0; + let totalAtt = this.attInfo ? this.attInfo.att.worker : 0; + this.chartData = [ + { + name: "出勤人数", + value: totalAtt, + }, + { + name: "未出勤人数", + value: total - totalAtt, + }, + ]; + if (this.$refs.chart) { + this.$refs.chart.reLoad(); + } + }, 400); }, }, }; - \ No newline at end of file + diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerTrend.vue b/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerTrend.vue index e0dcc861..8cd9233d 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerTrend.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navAttLaborerTrend.vue @@ -1,9 +1,13 @@ - \ No newline at end of file + diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navAttWokerProp.vue b/yanzhu-ui-vue3/src/views/indexCompents/navAttWokerProp.vue index 654a16e0..8333f761 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navAttWokerProp.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navAttWokerProp.vue @@ -1,9 +1,13 @@ @@ -13,6 +17,14 @@ export default { components: { MyChart, }, + props: { + attInfo: { + type: Object, + default: () => { + return null; + }, + }, + }, data() { return { chartData: [], @@ -77,18 +89,22 @@ export default { }, init() { setTimeout(() => { + let total = this.attInfo ? this.attInfo.job.total : 0; + let edu = this.attInfo ? this.attInfo.edu : 0; this.chartData = [ { name: "参与人数", - value: 33, + value: edu, }, { name: "未参与人数", - value: 22, + value: total - edu, }, ]; - this.$refs.chart.reLoad(); - }, 1000); + if (this.$refs.chart) { + this.$refs.chart.reLoad(); + } + }, 400); }, }, }; diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navAttendanceRate.vue b/yanzhu-ui-vue3/src/views/indexCompents/navAttendanceRate.vue index 2e3d7e77..3238fdd9 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navAttendanceRate.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navAttendanceRate.vue @@ -1,8 +1,12 @@ @@ -13,9 +17,17 @@ export default { components: { MyChart, }, + props: { + attInfo: { + type: Object, + default: () => { + return null; + }, + }, + }, data() { return { - chartData:[] + chartData: [], }; }, mounted() { @@ -35,7 +47,7 @@ export default { orient: "horizontal", left: "center", top: "10", - data:this.chartData.map(d=>d.name), + data: this.chartData.map((d) => d.name), textStyle: { color: "#444", fontSize: 12, @@ -76,15 +88,22 @@ export default { }, init() { setTimeout(() => { - this.chartData=[{ - name:"出勤人数", - value:33 - },{ - name:"未出勤人数", - value:22 - }] - this.$refs.chart.reLoad(); - }, 1000); + let total=this.attInfo?this.attInfo.job.total:0; + let totalAtt=this.attInfo?this.attInfo.att.total:0; + this.chartData = [ + { + name: "出勤人数", + value: totalAtt, + }, + { + name: "未出勤人数", + value: total-totalAtt, + }, + ]; + if (this.$refs.chart) { + this.$refs.chart.reLoad(); + } + }, 400); }, }, }; diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttMgrCount.vue b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttMgrCount.vue index 91e1d854..3bad4387 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttMgrCount.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttMgrCount.vue @@ -4,8 +4,8 @@
-
在职管理人员数
-
100
+
在岗管理人员数
+
{{attInfo?attInfo.job.mgr:0}}
@@ -13,10 +13,13 @@ diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttOnlineCount.vue b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttOnlineCount.vue index 5c88621f..a0a83ef0 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttOnlineCount.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttOnlineCount.vue @@ -4,8 +4,8 @@
-
在职工人数
-
100
+
在岗工人数
+
{{attInfo?attInfo.job.worker:0}}
@@ -13,10 +13,13 @@ diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttRealCount.vue b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttRealCount.vue index 4b28a19a..d0b1aada 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttRealCount.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttRealCount.vue @@ -4,19 +4,22 @@
-
实名认证人数
-
100
+
完成三级安全教育人数
+
{{attInfo?attInfo.edu:0}}
- - + props:{ + attInfo:{ + type:Object, + default:()=>{ + return null + } + } + } +} + \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttWorkerCount.vue b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttWorkerCount.vue index 8f3d8955..e3257e30 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navTopAttWorkerCount.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navTopAttWorkerCount.vue @@ -5,7 +5,7 @@
总人数
-
100
+
{{attInfo?attInfo.job.total:0}}
@@ -13,14 +13,13 @@ - - \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/views/indexCompents/navTopUnit.vue b/yanzhu-ui-vue3/src/views/indexCompents/navTopUnit.vue index 58addf71..3f21b694 100644 --- a/yanzhu-ui-vue3/src/views/indexCompents/navTopUnit.vue +++ b/yanzhu-ui-vue3/src/views/indexCompents/navTopUnit.vue @@ -5,22 +5,42 @@
参建单位总数
-
100
+
{{ sum }}
- \ No newline at end of file +