소스 검색

针对泓浒,增加刷新考勤功能,日期传月初到月末

Lijy 1 개월 전
부모
커밋
eead96b3da
1개의 변경된 파일40개의 추가작업 그리고 3개의 파일을 삭제
  1. 40 3
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 40 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1785,6 +1785,9 @@
                     </el-input>
                     <selectCat v-if="user.userNameNeedTranslate == '1'" :filterable="true" :searchBoxTop="'1'" :size="'small'" :subject="usersList" :subjectId="usersListId" :distinction="'15'" :clearable="true" @selectCal="selectCal"></selectCat>
                     <div style="float: right; vertical-align: middle;height:32px">
+                        <el-link v-if="user.companyId==7536" style="margin-right: 14px"
+                        type="primary" v-loading="refreshAttendanceLoading"
+                        @click="refreshAttendanceCli()" >刷新考勤</el-link>
                         <el-link
                         type="primary" v-loading="remindering"
                         @click="batchRejectAndRemind()" >一键驳回并提醒</el-link>
@@ -2682,6 +2685,7 @@
                 transferWorkingHoursVisable: false,
                 multiOptionData:[],
                 businessTripsArray: [],
+                refreshAttendanceLoading: false
             };
         },
         watch: {
@@ -2766,6 +2770,39 @@
         },
         methods: {
             ...mapMutations(['upDataLoading']),
+            // 刷新考勤
+            refreshAttendanceCli() {
+                const firstDay = this.dayjs(this.date, 'YYYY-MM').startOf('month');
+                const lastDay = this.dayjs(this.date, 'YYYY-MM').endOf('month');
+                const formData = {
+                    startDate: firstDay.format('YYYY-MM-DD'),
+                    endDate: lastDay.format('YYYY-MM-DD')
+                }
+                this.refreshAttendanceLoading = true;
+                this.http.post('/user-fv-time/syncHongHuFvTime',{
+                    ...formData
+                },res => {
+                    this.refreshAttendanceLoading = false;
+                    if(res.code == 'ok'){
+                        this.$message({
+                            message: `刷新成功!`,
+                            type: 'success'
+                        })
+                        this.showReportTimeLessThanCardTimeList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },err => {
+                    this.refreshAttendanceLoading = false;
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
+            },
             // 已填工时情况表设置背景色
             hasworkTblCellStyle({ columnIndex, row, column }) {
                 if(columnIndex > 2) {
@@ -2820,9 +2857,9 @@
                 this.http.post(
                     "/report/getReportTimeLessThanCardTimeList",
                     {
-                    date: this.notfullSelectDateMonth,
-                    deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
-                    userId: this.usersListId
+                        date: this.notfullSelectDateMonth,
+                        deptId: this.deptIdForHasReport.length>0?this.deptIdForHasReport[this.deptIdForHasReport.length-1]:null,
+                        userId: this.usersListId,
                     },
                     (res) => {
                     if (res.code == "ok") {