Jelajahi Sumber

考勤-补卡优化自动带出信息

zhonghuizhen 11 bulan lalu
induk
melakukan
2f21d36727

+ 18 - 3
src/views/business/attendance/makeUPVerify.vue

@@ -76,9 +76,9 @@ export default {
                 },
                 columns: [
                     { prop: 'bian_zhi_ren_', label: '申请人', tags: userOption, width: 100 },
-                    { prop: 'bian_zhi_shi_jian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'bian_zhi_shi_jian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', sortable: 'custom', width: 140 },
                     { prop: 'shen_he_ren_', label: '审批人', tags: userOption, dataType: 'stringArray', separator: ',', width: 200 },
-                    { prop: 'shen_he_shi_jian_', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'shen_he_shi_jian_', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', sortable: 'custom', width: 140 },
                     { prop: 'zhuang_tai_', label: '状态', width: 90 },
                     { prop: 'bu_ka_ri_qi_', label: '补卡日期', dateFormat: 'yyyy-MM-dd', sortable: 'custom', width: 100 },
                     { prop: 'bu_ka_shi_jian_', label: '补卡时间', dateFormat: 'HH:mm:ss', sortable: 'custom', width: 100 },
@@ -266,7 +266,22 @@ export default {
                 if (updateData.zhuangTai1 === '正常' && updateData.zhuangTai2 === '正常') {
                     updateData.kaoQinZhuangTa = '正常'
                 }
-                updateData.chiDaoShiChang = null
+                updateData.daKaCiShu += 1
+                if (updateData.zhuangTai1 === '正常' && updateData.zhuangTai2 === '正常') {
+                    // 打卡状态都正常后,迟到分钟清0
+                    updateData.chiDaoShiChang = null
+                }
+                // 计算实际工作时长
+                if (updateData.daKaShiJian1 && updateData.daKaShiJian2) {
+                    // 将时间字符串转换为Date对象
+                    const date1 = new Date(updateData.daKaShiJian1.replace(/-/g, '/'))
+                    const date2 = new Date(updateData.daKaShiJian2.replace(/-/g, '/'))
+                    // 计算时间差(毫秒)
+                    const diffInMs = date2 - date1
+                    // 转换为分钟(四舍五入保留整数)
+                    const diffInMinutes = Math.round(diffInMs / (1000 * 60))
+                    updateData.gongZuoShiChan = diffInMinutes
+                }
                 saveAttendanceDetail(updateData)
             })
         },

+ 4 - 4
src/views/business/attendance/makeUpEdit.vue

@@ -228,8 +228,8 @@ export default {
                 const sql = `select * from t_attendance_reissue where bu_ka_ri_qi_ = '${buKaRiQi}' and zhuang_tai_ = '待审核' and bian_zhi_ren_ = '${self.$store.getters.userId}' and di_dian_ = '${(second || first)}'`
                 const response = await self.$common.request('sql', sql)
                 // 过滤掉正在申请状态的班次
-                buKaBanCiArr = response.variables.data.filter(item => {
-                    return !buKaBanCiArr.some(banCi => banCi.value === item.bu_ka_ban_ci_)
+                buKaBanCiArr = buKaBanCiArr.filter(banCi => {
+                    return !response.variables.data.some(item => item.bu_ka_ban_ci_ === banCi.value)
                 })
                 if (buKaBanCiArr.length === 0) {
                     self.$message.warning('该日期异常班次已申请!')
@@ -254,9 +254,9 @@ export default {
             const type = banci.split('-')[1]
             const obj = this.yichangdata.filter(item => item.banCiBieMing === bieming)[0]
             if (type === '上班') {
-                this.formData.buKaShiJian = obj.banCiKaiShi
+                this.formData.buKaShiJian = obj.banCiKaiShi.split(' ')[1] + ':00'
             } else {
-                this.formData.buKaShiJian = obj.banCiJieShu
+                this.formData.buKaShiJian = obj.banCiJieShu.split(' ')[1] + ':00'
             }
         },
         handleFormAction ({ key }) {

+ 2 - 2
src/views/business/attendance/makeUpRecords.vue

@@ -78,9 +78,9 @@ export default {
                 },
                 columns: [
                     { prop: 'bian_zhi_ren_', label: '申请人', tags: userOption, width: 100 },
-                    { prop: 'bian_zhi_shi_jian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'bian_zhi_shi_jian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', sortable: 'custom', width: 140 },
                     { prop: 'shen_he_ren_', label: '审批人', tags: userOption, dataType: 'stringArray', separator: ',', width: 200 },
-                    { prop: 'shen_he_shi_jian_', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
+                    { prop: 'shen_he_shi_jian_', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm:ss', sortable: 'custom', width: 140 },
                     { prop: 'zhuang_tai_', label: '状态', width: 90 },
                     { prop: 'bu_ka_ri_qi_', label: '补卡日期', dateFormat: 'yyyy-MM-dd', sortable: 'custom', width: 100 },
                     { prop: 'bu_ka_shi_jian_', label: '补卡时间', dateFormat: 'HH:mm:ss', sortable: 'custom', width: 100 },

+ 1 - 1
src/views/business/​scheduleManage/adjust.vue

@@ -97,7 +97,7 @@ export default {
                     actions: [
                         { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit', hidden: function (row) { return row.status !== '已暂存' && row.status !== '已取消' } },
                         { key: 'cancel', label: '取消', type: 'danger', icon: 'ibps-icon-cancel', hidden: function (row) { return !(row.status === '待审核' && row.createBy === this.$store.getters.userId) } },
-                        { key: 'edit', label: '再次申请', type: 'primary', icon: 'ibps-icon-edit', hidden: function (row) { return row.status !== '已拒绝' } },
+                        { key: 'edit', label: '再次申请', type: 'primary', icon: 'ibps-icon-edit', hidden: function (row) { return !(row.status === '已拒绝' && row.createBy === this.$store.getters.userId) } },
                         { key: 'detail', label: '详情', type: 'primary', icon: 'ibps-icon-list-alt' }
                     ]
                 }