WXL
2 天以前 96dd34f77d81db58f54e3d0ad4a8cc8082189a61
考勤相关更改
已修改4个文件
已添加4个文件
301 ■■■■ 文件已修改
src/api/officeManagementApi/checkingIn.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/officeManagementApi/conference.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/officeManagementApi/index.js 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/officeManagementApi/studies.js 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/OfficeRelated/checkingIn/checkingInInfo.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/OfficeRelated/checkingIn/components/AttendanceCalendar.vue 119 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/OfficeRelated/checkingIn/components/BusinessTripTable.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/OfficeRelated/checkingIn/mockData.js 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/officeManagementApi/checkingIn.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
import request from '@/utils/request'
// æ¡ˆä¾‹åˆ—表及详情
export function meetinglist(data) {
  return request({
    url: '/project/meeting/list',
    method: 'post',
    data: data
  })
}
// è€ƒå‹¤ä¿®æ”¹
export function meetingedit(data) {
  return request({
    url: '/project/meeting/edit',
    method: 'post',
    data: data
  })
}
// è€ƒå‹¤è¯¦æƒ…
export function meetingInfo(id) {
  return request({
    url: '/project/meeting/getInfo/' + id,
    method: 'get'
  })
}
src/api/officeManagementApi/conference.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
import request from '@/utils/request'
// æ¡ˆä¾‹åˆ—表及详情
export function meetinglist(data) {
  return request({
    url: '/project/meeting/list',
    method: 'post',
    data: data
  })
}
// ä¼šè®®çºªè¦ä¿®æ”¹
export function meetingedit(data) {
  return request({
    url: '/project/meeting/edit',
    method: 'post',
    data: data
  })
}
// ä¼šè®®çºªè¦è¯¦æƒ…
export function meetingInfo(id) {
  return request({
    url: '/project/meeting/getInfo/' + id,
    method: 'get'
  })
}
src/api/officeManagementApi/index.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
export * from "./affirm";
export * from "./allocation";
export * from "./appear";
export * from "./assess";
export * from "./course";
export * from "./ethicalReview";
export * from "./decide";
export * from "./GetWitness";
export * from "./maintain";
export * from "./OrganUtilization";
export * from "./transfer";
src/api/officeManagementApi/studies.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
import request from '@/utils/request'
// æ¡ˆä¾‹åˆ—表及详情
export function meetinglist(data) {
  return request({
    url: '/project/meeting/list',
    method: 'post',
    data: data
  })
}
// è¿›ä¿®ä¿®æ”¹
export function meetingedit(data) {
  return request({
    url: '/project/meeting/edit',
    method: 'post',
    data: data
  })
}
// è¿›ä¿®è¯¦æƒ…
export function meetingInfo(id) {
  return request({
    url: '/project/meeting/getInfo/' + id,
    method: 'get'
  })
}
src/views/OfficeRelated/checkingIn/checkingInInfo.vue
@@ -50,10 +50,7 @@
        </el-tab-pane>
        <el-tab-pane label="出差记录" name="businessTripList">
          <personal-business-trip-table
            :data="businessTripData"
            :loading="loading"
          />
          <person-business :data="businessTripData" :loading="loading" />
        </el-tab-pane>
        <el-tab-pane label="日历视图" name="calendar">
          <attendance-calendar
@@ -145,14 +142,14 @@
    generatePersonalAttendanceData() {
      const data = [];
      const currentMonth = 12; // 12月
      const currentMonth = 4; // 12月
      for (let day = 1; day <= 31; day++) {
        if (Math.random() > 0.2) {
          // 80%的出勤率
          data.push({
            id: day,
            date: `2024-${currentMonth
            date: `2026-${currentMonth
              .toString()
              .padStart(2, "0")}-${day.toString().padStart(2, "0")}`,
            checkIn: `08:${String(Math.floor(Math.random() * 30)).padStart(
@@ -175,22 +172,22 @@
      return [
        {
          id: 1,
          tripNumber: "BT202412001",
          tripNumber: "BT202612001",
          startCity: "北京",
          endCity: "上海",
          startDate: "2024-12-05",
          endDate: "2024-12-08",
          startDate: "2026-04-05",
          endDate: "2026-04-08",
          distance: 1200,
          purpose: "客户会议",
          status: "已完成"
        },
        {
          id: 2,
          tripNumber: "BT202412002",
          tripNumber: "BT202612002",
          startCity: "北京",
          endCity: "广州",
          startDate: "2024-12-15",
          endDate: "2024-12-18",
          startDate: "2026-04-012",
          endDate: "2026-04-16",
          distance: 1900,
          purpose: "项目调研",
          status: "已完成"
src/views/OfficeRelated/checkingIn/components/AttendanceCalendar.vue
@@ -1,10 +1,24 @@
<template>
  <div class="attendance-calendar">
    <el-calendar v-model="calendarValue">
      <template #date-cell="{ data }">
    <!-- <el-button @click="refreshCalendar" size="small" type="primary"
      >刷新</el-button
    > -->
    <!-- Element UI çš„æ—¥åŽ†ç»„ä»¶ -->
    <el-calendar v-model="value">
      <template slot="dateCell" slot-scope="{ date, data }">
        <div class="calendar-date">
          <div class="date-number">{{ data.day.split('-')[2] }}</div>
          <div class="date-number">
            {{
              data.day
                .split("-")
                .slice(1)
                .join("-")
            }}
          </div>
          <!-- <div style="font-size: 10px; color: #666;">{{ data.day }}</div> -->
          <div class="date-events">
            <!-- Element UI ä¸­ä½¿ç”¨æ’槽作用域 -->
            <div
              v-for="event in getDateEvents(data.day)"
              :key="event.id"
@@ -23,46 +37,91 @@
<script>
export default {
  name: 'AttendanceCalendar',
  name: "AttendanceCalendar",
  props: {
    attendanceData: Array,
    businessTripData: Array
  },
  data() {
    return {
      calendarValue: new Date()
      value: new Date(), // Element UI ä½¿ç”¨ value
      localAttendanceData: [],
      localBusinessTripData: []
    };
  },
  watch: {
    attendanceData: {
      immediate: true,
      handler(val) {
        this.localAttendanceData = val || [];
        console.log("考勤数据:", this.localAttendanceData);
        this.$nextTick(() => {
          this.$forceUpdate(); // Vue 2 çš„强制更新
        });
      }
    },
    businessTripData: {
      immediate: true,
      handler(val) {
        this.localBusinessTripData = val || [];
        console.log("出差数据:", this.localBusinessTripData);
        this.$nextTick(() => {
          this.$forceUpdate();
        });
      }
    }
  },
  mounted() {
    console.log("Calendar mounted with Vue 2.6.12");
    this.testMethod();
  },
  methods: {
    refreshCalendar() {
      console.log("手动刷新日历");
      this.$forceUpdate();
    },
    testMethod() {
      console.log("测试方法是否可调用");
      console.log("getDateEvents æµ‹è¯•:", this.getDateEvents("2024-01-15"));
    },
    getDateEvents(date) {
      const events = []
      console.log("getDateEvents è¢«è°ƒç”¨, æ—¥æœŸ:", date);
      console.log("当前考勤数据:", this.localAttendanceData);
      console.log("当前出差数据:", this.localBusinessTripData);
      // æ£€æŸ¥å‡ºå‹¤è®°å½•
      const attendance = this.attendanceData.find(item => item.date === date)
      const events = [];
      // è€ƒå‹¤æ•°æ®
      const attendance = (this.localAttendanceData || []).find(item => {
        return item && item.date === date;
      });
      if (attendance) {
        events.push({
          id: `attendance-${date}`,
          type: 'attendance',
          text: `${attendance.checkIn}-${attendance.checkOut}`
        })
          type: "attendance",
          text: `${attendance.checkIn || "--"}-${attendance.checkOut || "--"}`
        });
      }
      // æ£€æŸ¥å‡ºå·®è®°å½•
      const businessTrip = this.businessTripData.find(item =>
        date >= item.startDate && date <= item.endDate
      )
      // å‡ºå·®æ•°æ®
      const businessTrip = (this.localBusinessTripData || []).find(item => {
        return item && date >= item.startDate && date <= item.endDate;
      });
      if (businessTrip) {
        events.push({
          id: `business-trip-${date}`,
          type: 'business-trip',
          text: `出差: ${businessTrip.endCity}`
        })
          type: "business-trip",
          text: `出差: ${businessTrip.endCity || ""}`
        });
      }
      return events
      console.log("找到的事件:", events);
      return events;
    }
  }
}
};
</script>
<style scoped>
@@ -72,6 +131,7 @@
.calendar-date {
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
}
@@ -79,6 +139,7 @@
.date-number {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 16px;
}
.date-events {
@@ -91,6 +152,19 @@
  align-items: center;
  margin-bottom: 2px;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 2px;
  background-color: #f5f7fa;
}
.event-item.attendance {
  background-color: #f0f9eb;
  color: #67c23a;
}
.event-item.business-trip {
  background-color: #ecf5ff;
  color: #409eff;
}
.event-dot {
@@ -107,10 +181,13 @@
.event-item.business-trip .event-dot {
  background-color: #409eff;
}
::v-deep .el-calendar-table .el-calendar-day {
  height: 115px;
}
.event-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
</style>
src/views/OfficeRelated/checkingIn/components/BusinessTripTable.vue
@@ -122,6 +122,7 @@
  },
  computed: {
    filteredData() {
      let data = this.data.filter(item => {
        const nameMatch = !this.filters.employeeName ||
          item.employeeName.includes(this.filters.employeeName)
src/views/OfficeRelated/checkingIn/mockData.js
@@ -3,47 +3,47 @@
    // å‘˜å·¥è€ƒå‹¤æ•°æ® - éœ€è¦è¡¥å……完整月份的数据
    attendanceData: [
      // 12月1-4日
      { id: 1, date: '2024-12-01', checkIn: '08:30', checkOut: '18:00', status: 'present', workHours: 9.5 },
      { id: 2, date: '2024-12-02', checkIn: '09:15', checkOut: '18:00', status: 'late', workHours: 8.75 },
      { id: 3, date: '2024-12-03', checkIn: '08:45', checkOut: '17:30', status: 'present', workHours: 8.75 },
      { id: 4, date: '2024-12-04', checkIn: '08:25', checkOut: '18:10', status: 'present', workHours: 9.75 },
      { id: 1, date: '2026-04-01', checkIn: '08:30', checkOut: '18:00', status: 'present', workHours: 9.5 },
      { id: 2, date: '2026-04-02', checkIn: '09:15', checkOut: '18:00', status: 'late', workHours: 8.75 },
      { id: 3, date: '2026-04-03', checkIn: '08:45', checkOut: '17:30', status: 'present', workHours: 8.75 },
      { id: 4, date: '2026-04-04', checkIn: '08:25', checkOut: '18:10', status: 'present', workHours: 9.75 },
      // 12月5-8日(5号缺勤,5-8号出差)
      { id: 5, date: '2024-12-05', checkIn: null, checkOut: null, status: 'absent', workHours: 0 },
      { id: 6, date: '2024-12-06', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 7, date: '2024-12-07', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 8, date: '2024-12-08', checkIn: '08:40', checkOut: '17:45', status: 'present', workHours: 9.0 },
      { id: 5, date: '2026-04-05', checkIn: null, checkOut: null, status: 'absent', workHours: 0 },
      { id: 6, date: '2026-04-06', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 7, date: '2026-04-07', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 8, date: '2026-04-08', checkIn: '08:40', checkOut: '17:45', status: 'present', workHours: 9.0 },
      // 12月9-14日
      { id: 9, date: '2024-12-09', checkIn: '08:35', checkOut: '18:05', status: 'present', workHours: 9.5 },
      { id: 10, date: '2024-12-10', checkIn: '09:05', checkOut: '17:50', status: 'late', workHours: 8.75 },
      { id: 11, date: '2024-12-11', checkIn: '08:50', checkOut: '18:15', status: 'present', workHours: 9.5 },
      { id: 12, date: '2024-12-12', checkIn: '08:30', checkOut: '17:40', status: 'present', workHours: 9.0 },
      { id: 13, date: '2024-12-13', checkIn: '08:55', checkOut: '18:00', status: 'present', workHours: 9.0 },
      { id: 14, date: '2024-12-14', checkIn: '08:45', checkOut: '17:50', status: 'present', workHours: 9.0 },
      { id: 9, date: '2026-04-09', checkIn: '08:35', checkOut: '18:05', status: 'present', workHours: 9.5 },
      { id: 10, date: '2026-04-10', checkIn: '09:05', checkOut: '17:50', status: 'late', workHours: 8.75 },
      { id: 11, date: '2026-04-11', checkIn: '08:50', checkOut: '18:15', status: 'present', workHours: 9.5 },
      { id: 12, date: '2026-04-12', checkIn: '08:30', checkOut: '17:40', status: 'present', workHours: 9.0 },
      { id: 13, date: '2026-04-13', checkIn: '08:55', checkOut: '18:00', status: 'present', workHours: 9.0 },
      { id: 14, date: '2026-04-14', checkIn: '08:45', checkOut: '17:50', status: 'present', workHours: 9.0 },
      // 12月15-18日(出差)
      { id: 15, date: '2024-12-15', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 16, date: '2024-12-16', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 17, date: '2024-12-17', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 18, date: '2024-12-18', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 15, date: '2026-04-15', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 16, date: '2026-04-16', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 17, date: '2026-04-17', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      { id: 18, date: '2026-04-18', checkIn: null, checkOut: null, status: 'trip', workHours: 0 },
      // 12月19-24日
      { id: 19, date: '2024-12-19', checkIn: '08:35', checkOut: '18:05', status: 'present', workHours: 9.5 },
      { id: 20, date: '2024-12-20', checkIn: '08:40', checkOut: '17:55', status: 'present', workHours: 9.25 },
      { id: 21, date: '2024-12-21', checkIn: null, checkOut: null, status: 'absent', workHours: 0 }, // å‘¨å…­
      { id: 22, date: '2024-12-22', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      { id: 23, date: '2024-12-23', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      { id: 24, date: '2024-12-24', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      { id: 19, date: '2026-04-19', checkIn: '08:35', checkOut: '18:05', status: 'present', workHours: 9.5 },
      { id: 20, date: '2026-04-20', checkIn: '08:40', checkOut: '17:55', status: 'present', workHours: 9.25 },
      { id: 21, date: '2026-04-21', checkIn: null, checkOut: null, status: 'absent', workHours: 0 }, // å‘¨å…­
      { id: 22, date: '2026-04-22', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      { id: 23, date: '2026-04-23', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      { id: 24, date: '2026-04-24', checkIn: null, checkOut: null, status: 'trip', workHours: 0 }, // å‡ºå·®
      // 12月25-31日
      { id: 25, date: '2024-12-25', checkIn: '08:50', checkOut: '17:45', status: 'present', workHours: 8.75 },
      { id: 26, date: '2024-12-26', checkIn: '09:10', checkOut: '17:40', status: 'late', workHours: 8.5 },
      { id: 27, date: '2024-12-27', checkIn: '08:35', checkOut: '18:00', status: 'present', workHours: 9.25 },
      { id: 28, date: '2024-12-28', checkIn: '08:45', checkOut: '17:50', status: 'present', workHours: 9.0 },
      { id: 29, date: '2024-12-29', checkIn: null, checkOut: null, status: 'absent', workHours: 0 }, // å‘¨æ—¥
      { id: 30, date: '2024-12-30', checkIn: '08:30', checkOut: '17:30', status: 'present', workHours: 9.0 },
      { id: 31, date: '2024-12-31', checkIn: '08:40', checkOut: '16:00', status: 'present', workHours: 7.5 }
      { id: 25, date: '2026-04-25', checkIn: '08:50', checkOut: '17:45', status: 'present', workHours: 8.75 },
      { id: 26, date: '2026-04-26', checkIn: '09:10', checkOut: '17:40', status: 'late', workHours: 8.5 },
      { id: 27, date: '2026-04-27', checkIn: '08:35', checkOut: '18:00', status: 'present', workHours: 9.25 },
      { id: 28, date: '2026-04-28', checkIn: '08:45', checkOut: '17:50', status: 'present', workHours: 9.0 },
      { id: 29, date: '2026-04-29', checkIn: null, checkOut: null, status: 'absent', workHours: 0 }, // å‘¨æ—¥
      { id: 30, date: '2026-04-30', checkIn: '08:30', checkOut: '17:30', status: 'present', workHours: 9.0 },
      { id: 31, date: '2026-04-31', checkIn: '08:40', checkOut: '16:00', status: 'present', workHours: 7.5 }
    ],
    // å‡ºå·®æ•°æ® - éœ€è¦è°ƒæ•´æ—¥æœŸèŒƒå›´åŒ¹é…
@@ -53,8 +53,8 @@
        tripNumber: 'BT202412001',
        startCity: '北京',
        endCity: '上海',
        startDate: '2024-12-05',
        endDate: '2024-12-07', // è°ƒæ•´ä¸º7号结束
        startDate: '2026-04-05',
        endDate: '2026-04-07', // è°ƒæ•´ä¸º7号结束
        distance: 1200,
        purpose: '客户会议',
        status: 'completed'
@@ -64,8 +64,8 @@
        tripNumber: 'BT202412002',
        startCity: '北京',
        endCity: '广州',
        startDate: '2024-12-15',
        endDate: '2024-12-18',
        startDate: '2026-04-15',
        endDate: '2026-04-18',
        distance: 1900,
        purpose: '项目调研',
        status: 'completed'
@@ -75,8 +75,8 @@
        tripNumber: 'BT202412003',
        startCity: '北京',
        endCity: '深圳',
        startDate: '2024-12-22',
        endDate: '2024-12-24',
        startDate: '2026-04-22',
        endDate: '2026-04-24',
        distance: 1950,
        purpose: '技术交流',
        status: 'completed'