From 390c0db92848e2a0ca61f7665ec20d685a5598f9 Mon Sep 17 00:00:00 2001 From: haha Date: Tue, 9 Apr 2024 00:00:54 +0800 Subject: [PATCH] update code --- .../components/AttendanceDetailDialog.vue | 162 ++++++++++-------- 1 file changed, 91 insertions(+), 71 deletions(-) diff --git a/src/pages/components/AttendanceDetailDialog.vue b/src/pages/components/AttendanceDetailDialog.vue index 361d6a1..277f425 100644 --- a/src/pages/components/AttendanceDetailDialog.vue +++ b/src/pages/components/AttendanceDetailDialog.vue @@ -2,38 +2,43 @@
-
总包人员
-
监理人员
-
劳务人员
+
总包人员
+
监理人员
+
劳务人员
- + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + +
@@ -49,57 +54,69 @@ export default { data() { return { - loading:false, + loading: false, show: false, tableData: [], - projectId:0, - deptId:0, - size:10, - index:1, - total:0, - nav:101 + projectId: 0, + deptId: 0, + size: 10, + index: 1, + total: 0, + nav: 101 }; }, 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.projectId = data?.projectId || 0; + this.deptId = data?.deptId || 0; + this.size = 10; + this.index = 1; this.loadData(); this.show = true }, - loadData(){ - let postData={ - attendanceTime:this.$dt(new Date()).format("YYYY-MM-DD"), - projectId:this.projectId, - pageSize:this.size, - pageNum:this.index, - companyTypeId:this.nav + loadData() { + let postData = { + attendanceTime: this.$dt(new Date()).format("YYYY-MM-DD"), + projectId: this.projectId, + pageSize: this.size, + pageNum: this.index, + companyTypeId: this.nav } - this.tableData=[]; - this.loading=true; - this.$api.attendance.listAttendance(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; + this.tableData = []; + this.loading = true; + this.$api.attendance.listAttendance(postData).then(d => { + this.total = d.total || 0; + this.tableData = (d.rows || []).map(it => { + let dt1 = it.attendanceTime; + let dt2 = it.attendanceOutTime; + if ((!dt1 || !dt2) || dt1 == dt2) { + let dt = dt1 || dt2; + if (it.remark == "E") { + it.attendanceTime = dt; + it.attendanceOutTime = ""; + } else { + it.attendanceTime = ""; + it.attendanceOutTime = dt; + } + } + it.scanPhoto = it.scanPhoto && it.scanPhoto.indexOf("/profile") == 0 ? "/jhapi" + it.scanPhoto : it.scanPhoto; return it; }); - this.loading=false; + this.loading = false; }) } }, @@ -107,27 +124,30 @@ export default { \ No newline at end of file