Explorar o código

修复考勤bug

zhonghuizhen hai 9 meses
pai
achega
db36a9bfaf

+ 27 - 6
src/views/business/attendance/attendanceDetails.vue

@@ -19,7 +19,7 @@
     >
       <template slot="time">
         <el-date-picker
-          v-model="daterRange"
+          v-model="computedDateRange"
           size="mini"
           type="daterange"
           :picker-options="pickerOptions"
@@ -125,7 +125,7 @@
                 }"
               >
                 {{
-                  !row.daKaShiJian1
+                  (!row.daKaShiJian1 && row.banCiMing != '休息')
                     ? '缺勤'
                     : row.zhuangTai1 === '异常'
                       ? '迟到'
@@ -161,7 +161,7 @@
                 }"
               >
                 {{
-                  !row.daKaShiJian2
+                  (!row.daKaShiJian2 && row.banCiMing != '休息')
                     ? '缺勤'
                     : row.zhuangTai2 === '异常'
                       ? '迟到'
@@ -210,6 +210,7 @@ import ibpsUserSelector from '@/business/platform/org/selector'
 import FixHeight from '@/mixins/height'
 import IbpsExport from '@/plugins/export'
 import ActionUtils from '@/utils/action'
+import { del } from 'vue'
 
 export default {
   components: {
@@ -319,7 +320,18 @@ export default {
       }
     }
   },
-  computed: {},
+  computed: { 
+    computedDateRange: {
+      get() {
+        // 直接返回数据值
+        return this.daterRange;
+      },
+      set(newValue) {
+        // 当清空时设置回空数组
+        this.daterRange = newValue || [];
+      }
+    }
+  },
   created() {
     this.loadData()
   },
@@ -337,7 +349,11 @@ export default {
               item.deptName = this.getDeptLabel(item.buMen)
               // 考勤状态-缺勤
               if (item.kaoQinZhuangTa === '') {
-                item.kaoQinZhuangTa = '异常'
+                if(item.banCiMing == '休息'){
+                  item.kaoQinZhuangTa = '无需打卡'
+                }else{
+                  item.kaoQinZhuangTa = '异常'
+                }
               }
             })
             this.pagination.totalCount = res.data.pageResult.totalCount
@@ -365,7 +381,7 @@ export default {
         ? this.$refs['crud'].getSearcFormData()
         : {}
       searchParam['Q^di_dian_^S'] = second || first
-      searchParam['Q^ri_qi_^DGT'] = this.$common.getDateNow()
+      searchParam['Q^ri_qi_^DG'] = this.getYesterday()
       if (this.daterRange.length > 0) {
         searchParam['Q^ri_qi_^DL'] = this.daterRange[0]
         searchParam['Q^ri_qi_^DG'] = this.daterRange[1]
@@ -470,6 +486,11 @@ export default {
       ]
       this.handleExport(exportColumns, this.listData, `考勤明细统计数据`)
     },
+    getYesterday(){
+      const date = new Date(this.$common.getDateNow())
+      date.setDate(date.getDate() - 1)
+      return date.toISOString().split('T')[0]
+    },
     handleExport(columns, data, title, message, nameKey = 'name') {
       IbpsExport.excel({
         columns: columns,

+ 11 - 1
src/views/business/attendance/attendanceOverview.vue

@@ -19,7 +19,7 @@
       >
           <template slot="time">
               <el-date-picker
-                  v-model="daterRange"
+                  v-model="computedDateRange"
                   size="mini"
                   type="daterange"
                   :picker-options="pickerOptions"
@@ -152,6 +152,16 @@ export default {
       }
   },
   computed: {
+    computedDateRange: {
+      get() {
+        // 直接返回数据值
+        return this.daterRange;
+      },
+      set(newValue) {
+        // 当清空时设置回空数组
+        this.daterRange = newValue || [];
+      }
+    }
   },
   created () {
       const daterRange = this.getTodayDate()

+ 13 - 2
src/views/business/attendance/attendanceStatistics.vue

@@ -19,7 +19,7 @@
     >
       <template slot="time">
         <el-date-picker
-          v-model="daterRange"
+          v-model="computedDateRange"
           size="mini"
           type="daterange"
           :picker-options="pickerOptions"
@@ -281,7 +281,18 @@ export default {
       }
     }
   },
-  computed: {},
+  computed: {
+    computedDateRange: {
+      get() {
+        // 直接返回数据值
+        return this.daterRange;
+      },
+      set(newValue) {
+        // 当清空时设置回空数组
+        this.daterRange = newValue || [];
+      }
+    }
+  },
   created() {
     const daterRange = this.getTodayDate()
     this.daterRange = [daterRange.sDay, daterRange.eDay]

+ 28 - 10
src/views/business/attendance/personAttendanceDetails.vue

@@ -19,7 +19,7 @@
     >
       <template slot="time">
         <el-date-picker
-          v-model="daterRange"
+          v-model="computedDateRange"
           size="mini"
           type="daterange"
           :picker-options="pickerOptions"
@@ -114,7 +114,7 @@
                 }"
               >
                 {{
-                  !row.daKaShiJian1
+                  (!row.daKaShiJian1 && row.banCiMing != '休息')
                     ? '缺勤'
                     : row.zhuangTai1 === '异常'
                       ? '迟到'
@@ -150,9 +150,9 @@
                 }"
               >
                 {{
-                  !row.daKaShiJian2
-                    ? '缺勤'
-                    : row.zhuangTai2 === '异常'
+                    (!row.daKaShiJian2 && row.banCiMing != '休息')
+                      ? '缺勤'
+                      : row.zhuangTai2 === '异常'
                       ? '迟到'
                       : row.zhuangTai2
                 }}
@@ -276,7 +276,18 @@ export default {
       }
     }
   },
-  computed: {},
+  computed: { 
+    computedDateRange: {
+      get() {
+        // 直接返回数据值
+        return this.daterRange;
+      },
+      set(newValue) {
+        // 当清空时设置回空数组
+        this.daterRange = newValue || [];
+      }
+    }
+  },
   created() {
     this.loadData()
   },
@@ -294,9 +305,12 @@ export default {
               item.deptName = this.getDeptLabel(item.buMen)
               // 考勤状态-缺勤
               if (item.kaoQinZhuangTa === '') {
-                item.kaoQinZhuangTa = '异常'
+                if(item.banCiMing == '休息'){
+                  item.kaoQinZhuangTa = '无需打卡'
+                }else{
+                  item.kaoQinZhuangTa = '异常'
+                }
               }
-
             })
             this.pagination.totalCount = res.data.pageResult.totalCount
           }
@@ -322,7 +336,7 @@ export default {
         ? this.$refs['crud'].getSearcFormData()
         : {}
       searchParam['Q^di_dian_^S'] = second || first
-      searchParam['Q^ri_qi_^DGT'] = this.$common.getDateNow()
+      searchParam['Q^ri_qi_^DG'] = this.getYesterday()
       if (this.daterRange.length > 0) {
         searchParam['Q^ri_qi_^DL'] = this.daterRange[0]
         searchParam['Q^ri_qi_^DG'] = this.daterRange[1]
@@ -340,7 +354,11 @@ export default {
       ActionUtils.setSorts(this.sorts, sort)
       this.loadData()
     },
-
+    getYesterday(){
+      const date = new Date(this.$common.getDateNow())
+      date.setDate(date.getDate() - 1)
+      return date.toISOString().split('T')[0]
+    },
     // 操作处理
     handleAction(command, _, selection) {
       switch (command) {