From 8fc1138d2f2115121fd15b679ca1a20fc2ba838a Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 02 四月 2026 13:37:40 +0800
Subject: [PATCH] 绩效管理:工时汇总对接MES数据&人员考勤调整

---
 src/views/performance/attendance/index.vue |   39 +++++++--------------------------------
 1 files changed, 7 insertions(+), 32 deletions(-)

diff --git a/src/views/performance/attendance/index.vue b/src/views/performance/attendance/index.vue
index d197b61..d8089c8 100644
--- a/src/views/performance/attendance/index.vue
+++ b/src/views/performance/attendance/index.vue
@@ -225,7 +225,7 @@
   syncAttendanceRecord
 } from '@/api/performance/attendance'
 import {getDicts} from "@/api/system/dict/data";
-import dayjs from 'dayjs';
+import {getTimeRange} from "@/utils/date";
 export default {
   name: "Attendance",
   components: {
@@ -299,7 +299,7 @@
     this.selectEnumByCategory()
     this.getUserList()
     this.getTableHeight();
-    this.dateRange = this.getTimeRange()
+    this.dateRange = getTimeRange()
     this.resizeHandler = this.debounce(() => {
       this.getTableHeight();
     }, 200);
@@ -332,35 +332,7 @@
         this.dailyTypeList = response.data;
       });
     },
-    /**
-     * 鍒濆鍖栭粯璁ゆ棩鏈熻寖鍥达細杩戜竴涓湀锛堝綋鍓嶆棩鏈� - 30澶� 鑷� 褰撳墠鏃ユ湡锛�
-     */
-    getTimeRange(format = 'YYYY-MM-DD HH:mm:ss') {
-      // 鑾峰彇褰撳墠鏃堕棿
-      const now = dayjs();
-      // 鑾峰彇褰撳墠鏃ユ湡鐨勩�屾棩銆嶏紙1-31锛�
-      const currentDate = now.date();
 
-      let startTime, endTime;
-
-      // 鏍稿績閫昏緫锛氬垽鏂綋鍓嶆棩鏈熸槸鍚﹀ぇ浜�25鍙�
-      if (currentDate > 25) {
-        // 鉁� 鎯呭喌1锛氬綋鍓嶆棩>25 鈫� 褰撴湀26鍙� ~ 娆℃湀25鍙�
-        startTime = now.startOf('month').add(25, 'day'); // 褰撴湀1鍙� +25澶� = 26鍙�
-        endTime = startTime.add(1, 'month').date(25).hour(23)
-          .minute(59)
-          .second(59);     // 娆℃湀25鍙凤紙dayjs鑷姩澶勭悊璺ㄥ勾锛�
-      } else {
-        // 鉁� 鎯呭喌2锛氬綋鍓嶆棩鈮�25 鈫� 涓婃湀26鍙� ~ 褰撴湀25鍙�
-        startTime = now.subtract(1, 'month').startOf('month').add(25, 'day'); // 涓婃湀26鍙�
-        endTime = now.date(25).hour(23)
-          .minute(59)
-          .second(59); // 褰撴湀25鍙�
-      }
-
-      // 杩斿洖鏍煎紡鍖栧悗鐨勬椂闂存暟缁�
-      return [startTime.format(format), endTime.format(format)];
-    },
     //鍚屾鑰冨嫟璁板綍
     confirmSyncAttendance(){
       if(!this.syncDateRange || this.syncDateRange.length<2){
@@ -384,7 +356,10 @@
     },
     //鎵撳紑鍚屾鑰冨嫟璁板綍寮规
     openSyncAttendanceDialog(){
-      this.syncAttendanceVisible = true
+      this.syncDateRange = getTimeRange()
+      this.$nextTick(()=>{
+        this.syncAttendanceVisible = true
+      })
     },
     //鍒犻櫎鑰冨嫟璁板綍
     confirmRemoveRecord(row){
@@ -575,7 +550,7 @@
     },
     //閲嶇疆鎸夐挳
     resetQuery() {
-      this.dateRange = this.getTimeRange();
+      this.dateRange = getTimeRange();
       this.queryParams = {
         startDate: "",
         endDate: "",

--
Gitblit v1.9.3