Răsfoiți Sursa

考勤-考勤统计缺勤时考勤状态改为异常

zhonghuizhen 11 luni în urmă
părinte
comite
a32c0c9b41

+ 12 - 2
src/views/business/attendance/attendanceDetails.vue

@@ -164,7 +164,7 @@ export default {
                     labelWidth: 80,
                     itemWidth: 200,
                     forms: [
-                        { prop: 'Q^kao_qin_zhuang_ta^SL', label: '考勤状态', fieldType: 'select', options: [{ value: '正常', label: '正常' }, { value: '异常', label: '异常' }] },
+                        { prop: 'Q^kao_qin_zhuang_ta^S', label: '考勤状态', fieldType: 'select', options: [{ value: '正常', label: '正常' }, { value: '异常', label: '异常' }] },
                         // { prop: 'Q^yong_hu_id_^S', label: '姓名', fieldType: 'select', options: userOption },
                         { prop: '', label: '姓名', fieldType: 'slot', slotName: 'userSlot' },
                         { prop: 'Q^gong_hao_^S', label: '工号' },
@@ -195,7 +195,12 @@ export default {
                 this.listData.forEach(item => {
                     item.userName = this.getUserLabel(item.yong_hu_id_)
                     item.deptName = this.getDeptLabel(item.bu_men_)
+                    // 考勤状态-缺勤
+                    if (item.kao_qin_zhuang_ta === '') {
+                        item.kao_qin_zhuang_ta = '异常'
+                    }
                 })
+                debugger
                 this.pagination.totalCount = this.listData[0]?.total_count
             }).finally(() => {
                 this.loading = false
@@ -257,8 +262,13 @@ export default {
                         }
                     }
                 })
-
+                debugger
                 if (conditions.length > 0) { // 正常查询条件一定会大于0,因为地点必查
+                    conditions.forEach((condition, index) => {
+                        if (condition.includes('异常')) {
+                            conditions[index] = `(kao_qin_zhuang_ta = '异常' or kao_qin_zhuang_ta = '') `
+                        }
+                    })
                     let wherestr = ' WHERE ' + conditions.join(' AND ')
                     if (this.searchXinMing) {
                         wherestr += `and yong_hu_id_ in ('` + this.searchXinMing.split(',').join("','") + `')`

+ 9 - 0
src/views/business/attendance/personAttendanceDetails.vue

@@ -165,6 +165,10 @@ export default {
                 this.listData.forEach(item => {
                     item.userName = this.getUserLabel(item.yong_hu_id_)
                     item.deptName = this.getDeptLabel(item.bu_men_)
+                    // 考勤状态-缺勤
+                    if (item.kao_qin_zhuang_ta === '') {
+                        item.kao_qin_zhuang_ta = '异常'
+                    }
                 })
                 this.pagination.totalCount = this.listData[0]?.total_count || 0
             }).finally(() => {
@@ -230,6 +234,11 @@ export default {
                     }
                 })
                 if (conditions.length > 0) {
+                    conditions.forEach((condition, index) => {
+                        if (condition.includes('异常')) {
+                            conditions[index] = `(kao_qin_zhuang_ta = '异常' or kao_qin_zhuang_ta = '') `
+                        }
+                    })
                     const wherestr = ' WHERE ' + conditions.join(' AND ')
                     sql = `select t.*, (select COUNT(*) FROM t_attendance_detail ${wherestr} ) AS total_count FROM t_attendance_detail t ${wherestr} ORDER BY ri_qi_ DESC `
                 }