From 08df9489a50a6fb608d8e0f2fb869ecbe46f2e44 Mon Sep 17 00:00:00 2001 From: haha Date: Thu, 8 May 2025 23:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=A2=9E=E5=8A=A0=E6=B5=8E?= =?UTF-8?q?=E5=B7=A5=E7=BD=91=E8=80=83=E5=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yanzhu-bigscreen/src/api/detail.js | 27 ++ .../views/detail/AttendanceDetailDialog.vue | 155 ++++++++ .../src/views/detail/JobWorkerDialog.vue | 337 ++++++++++++++++++ .../src/views/detail/attendanceInfoDlg.vue | 168 ++++----- yanzhu-bigscreen/src/views/projectDetail.vue | 40 ++- .../ProjectAttendanceController.java | 17 + 6 files changed, 655 insertions(+), 89 deletions(-) create mode 100644 yanzhu-bigscreen/src/views/detail/AttendanceDetailDialog.vue create mode 100644 yanzhu-bigscreen/src/views/detail/JobWorkerDialog.vue diff --git a/yanzhu-bigscreen/src/api/detail.js b/yanzhu-bigscreen/src/api/detail.js index d46eaa49..345db928 100644 --- a/yanzhu-bigscreen/src/api/detail.js +++ b/yanzhu-bigscreen/src/api/detail.js @@ -202,6 +202,30 @@ const groupAllByComany = (data) => { method: "post", }); }; +// 查询劳务实名制管理列表 +const listAttendance = (query) => { + return request({ + url: "/manage/bgscreen/attendance/list", + method: "get", + params: query, + }); +}; + +const groupByWorkerState = (data) => { + return request({ + url: "/manage/bgscreen/attendance/groupByWorkerState", + method: "get", + params: data, + }); +}; + +const queryWorkerByState = (data) => { + return request({ + url: "/manage/bgscreen/attendance/queryWorkerByState", + method: "get", + params: data, + }); +}; export default { groupByCraftType, @@ -213,4 +237,7 @@ export default { costOutputSelectYearAndMonth, groupByComany, groupAllByComany, + listAttendance, + groupByWorkerState, + queryWorkerByState, }; diff --git a/yanzhu-bigscreen/src/views/detail/AttendanceDetailDialog.vue b/yanzhu-bigscreen/src/views/detail/AttendanceDetailDialog.vue new file mode 100644 index 00000000..1b522622 --- /dev/null +++ b/yanzhu-bigscreen/src/views/detail/AttendanceDetailDialog.vue @@ -0,0 +1,155 @@ + + + + + + \ No newline at end of file diff --git a/yanzhu-bigscreen/src/views/detail/JobWorkerDialog.vue b/yanzhu-bigscreen/src/views/detail/JobWorkerDialog.vue new file mode 100644 index 00000000..5ceb31eb --- /dev/null +++ b/yanzhu-bigscreen/src/views/detail/JobWorkerDialog.vue @@ -0,0 +1,337 @@ + + + + + + \ No newline at end of file diff --git a/yanzhu-bigscreen/src/views/detail/attendanceInfoDlg.vue b/yanzhu-bigscreen/src/views/detail/attendanceInfoDlg.vue index c0c237f6..d8cc94ea 100644 --- a/yanzhu-bigscreen/src/views/detail/attendanceInfoDlg.vue +++ b/yanzhu-bigscreen/src/views/detail/attendanceInfoDlg.vue @@ -1,17 +1,13 @@ - + - + - + - + @@ -98,7 +94,7 @@ export default { //在岗人员 data() { return { - dpi: "", + dpi: '', show: false, title: '在岗人员', prjInfo: {}, @@ -116,93 +112,102 @@ export default { } }, mounted() { - this.dpi = this.$dpi(); - window.addEventListener("resize", () => { + this.dpi = this.$dpi() + window.addEventListener('resize', () => { if (this.dpi != this.$dpi()) { - this.dpi = this.$dpi(); - this.resize(); + this.dpi = this.$dpi() + this.resize() } - }); - this.resize(); + }) + this.resize() }, methods: { resize() { - let is1K = this.$dpi() == "1K"; - let is2K = this.$dpi() == "2K"; - this.tbHeight = is1K ? 400 : is2K ? 500 : 600; + let is1K = this.$dpi() == '1K' + let is2K = this.$dpi() == '2K' + this.tbHeight = is1K ? 400 : is2K ? 500 : 600 }, handleCurrentChange(n) { - this.index = n; - this.loadData(); + this.index = n + this.loadData() }, showDialog(opt) { - this.prjInfo = opt.prjInfo || {}; - this.type = opt.type || 0; - this.title = this.type == 0 ? "在岗人员" : "今日出勤"; - this.attendanceData = opt.attendanceData || []; - this.show = true; - this.$api.dict("pro_craft_type").then(dicts => { - this.types = dicts || []; - }); - this.$api.dict("pro_craft_post").then(dicts => { - this.pro_craft_post = dicts || []; - }); - this.index = 1; - this.loadData(); + this.prjInfo = opt.prjInfo || {} + this.type = opt.type || 0 + this.title = this.type == 0 ? '在岗人员' : '今日出勤' + this.attendanceData = opt.attendanceData || [] + this.show = true + this.$api.dict('pro_craft_type').then((dicts) => { + this.types = dicts || [] + }) + this.$api.dict('pro_craft_post').then((dicts) => { + this.pro_craft_post = dicts || [] + }) + debugger + this.index = 1 + this.loadData() }, loadData() { - let ajax = this.$api.detail.subdeptsUsersList; + if (this.prjInfo.vendorsCode == 'uni') { + this.loadDataUni() + } else { + this.loadDataJh() + } + }, + loadDataUni() { + let ajax = this.$api.detail.subdeptsUsersList let postData = { pageSize: this.size, pageNum: this.index, craftType: this.nav, comId: this.prjInfo.comId, useStatus: 0, - projectId: this.prjInfo.id - }; + projectId: this.prjInfo.id, + } if (this.type == 1) { - ajax = this.$api.detail.attendanceUbiDataList; + ajax = this.$api.detail.attendanceUbiDataList postData = { pageSize: this.size, pageNum: this.index, comId: this.prjInfo.comId, projectId: this.prjInfo.id, craftType: this.nav, - inTime: this.$dt(new Date()).format("YYYY-MM-DD") - }; - } - this.loading = true; - ajax(postData).then(d => { - this.loading = false; - if (this.type == 0) { - this.dataList = (d.rows || []).map(d => { - d.info = this.$tryToJson(d.userInfos || "{}") - d.user = d.user || {}; - if (d.info.birthDay) { - let birthDay = this.$dt(d.info.birthDay).format("YYYY-MM-DD"); - d.info.birthDayStr = birthDay; - d.info.age = this.$dt(new Date()).diff(d.info.birthDay, 'year'); - } - d.sex = d.userSex == 0 ? '男' : '女'; - d.nativePlace = d.info.nativePlace || ""; - return d; - }); - } else { - this.dataList = d.rows || []; + inTime: this.$dt(new Date()).format('YYYY-MM-DD'), } - this.total = d.total || 0; - }); + } + this.loading = true + ajax(postData).then((d) => { + this.loading = false + if (this.type == 0) { + this.dataList = (d.rows || []).map((d) => { + d.info = this.$tryToJson(d.userInfos || '{}') + d.user = d.user || {} + if (d.info.birthDay) { + let birthDay = this.$dt(d.info.birthDay).format('YYYY-MM-DD') + d.info.birthDayStr = birthDay + d.info.age = this.$dt(new Date()).diff(d.info.birthDay, 'year') + } + d.sex = d.userSex == 0 ? '男' : '女' + d.nativePlace = d.info.nativePlace || '' + return d + }) + } else { + this.dataList = d.rows || [] + } + this.total = d.total || 0 + }) }, + loadDataJh() {}, doNav(n) { - this.nav = n.value; - this.index = 1; - this.loadData(); + this.nav = n.value + this.index = 1 + this.loadData() }, getTypeCount(it) { - let tmps = this.attendanceData.filter(d => d.id == it.value) - return tmps.length > 0 ? tmps[0].value : 0; - } - } + let tmps = this.attendanceData.filter((d) => d.id == it.value) + return tmps.length > 0 ? tmps[0].value : 0 + }, + }, } @@ -277,7 +282,6 @@ export default { line-height: 28px !important; vertical-align: middle !important; } - } } @@ -340,7 +344,6 @@ export default { line-height: 36px !important; vertical-align: middle !important; } - } } } @@ -410,7 +413,6 @@ export default { line-height: 48px !important; vertical-align: middle !important; } - } } } diff --git a/yanzhu-bigscreen/src/views/projectDetail.vue b/yanzhu-bigscreen/src/views/projectDetail.vue index 1c0d515d..ab47b924 100644 --- a/yanzhu-bigscreen/src/views/projectDetail.vue +++ b/yanzhu-bigscreen/src/views/projectDetail.vue @@ -474,6 +474,8 @@ + + @@ -482,6 +484,8 @@ import projectInfoDialog from './detail/projectInfoDialog.vue' import staffSurveyChart from '@/components/staffSurveyChart.vue' import MonitAndWarning from './components/MonitAndWarning.vue' import attendanceInfoDlg from './detail/attendanceInfoDlg.vue' +import jhAttendanceDetailDialog from './detail/AttendanceDetailDialog.vue' +import jhJobWorkerDialog from './detail/JobWorkerDialog.vue' import debounce from 'lodash.debounce' export default { components: { @@ -489,6 +493,8 @@ export default { staffSurveyChart, MonitAndWarning, attendanceInfoDlg, + jhAttendanceDetailDialog, + jhJobWorkerDialog, }, data() { return { @@ -654,7 +660,6 @@ export default { }) }, loadAttendanceData() { - debugger if (this.prjInfo.vendorsCode != 'uni') { this.loadJhAttendanceData() } else { @@ -731,11 +736,34 @@ export default { this.loadAttendanceData() }, doShowAttendanceDetail() { - this.$refs.attDlg.showDialog({ - prjInfo: this.prjInfo, - attendanceData: this.attendanceData, - type: this.attendanceNav, - }) + if (this.prjInfo.vendorsCode == 'uni') { + this.$refs.attDlg.showDialog({ + prjInfo: this.prjInfo, + attendanceData: this.attendanceData, + type: this.attendanceNav, + }) + } else { + let data = { + deptId: this.prjInfo.deptId || 0, + projectId: this.prjInfo.id || 0, + attendanceTime: this.$dt(new Date()).format('YYYY-MM-DD'), + } + if (this.attendanceNav === 1) { + this.$refs.jhAttDlg.showDialog(data) + } else { + this.$refs.jhJobWorkerDlg.showDialog({ + ...data, + type: this.attendanceNav, + total: this.attendanceTotal, + datas: this.attendanceData.map((it) => { + return { + text: it.text.replace('总包人员', '101').replace('监理人员', '102').replace('劳务人员', '103'), + cnt: it.value, + } + }), + }) + } + } }, doDeviceNav(n) { this.deviceNav = n diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/ProjectAttendanceController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/ProjectAttendanceController.java index 91e30a68..e66ec1f1 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/ProjectAttendanceController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/bigscreen/ProjectAttendanceController.java @@ -2,6 +2,7 @@ package com.yanzhu.manage.controller.bigscreen; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; import com.yanzhu.common.core.web.controller.BaseController; import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.common.core.web.page.TableDataInfo; @@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.concurrent.TimeUnit; /** * 在岗出勤Conller @@ -102,4 +104,19 @@ public class ProjectAttendanceController extends BaseController { return getDataTable(list); } + @GetMapping("/list") + public TableDataInfo list(SurProjectAttendanceData surProjectAttendanceData) + { + startPage(); + String tmp=surProjectAttendanceData.getAttendanceTime(); + if(StrUtil.isNotEmpty(tmp)){ + int year= DateUtil.parse(tmp).year(); + surProjectAttendanceData.setYear(year); + } + List list = attendanceDataService.selectSurProjectAttendanceDataList(surProjectAttendanceData); + return getDataTable(list); + } + + + }