liu
2026-09-21 ce79794f67bd71758086cea81047189ac1808512
fix(排班管理): 支持人员搜索并修正周次日期

Co-Authored-By: Claude <noreply@anthropic.com>
已修改1个文件
13 ■■■■■ 文件已修改
src/views/personnelManagement/classsSheduling/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/personnelManagement/classsSheduling/index.vue
@@ -275,6 +275,7 @@
        </div>
        <div class="search_input">
          <el-select v-model="schedulingQuery.userId"
                     filterable
                     placeholder="请选择"
                     style="width: 100%"
                     multiple
@@ -593,9 +594,11 @@
      proxy.$modal.msgError("请选择周次");
      return;
    }
    let time = schedulingQuery.week.getTime();
    // 周选择器返回该周周日,排班范围按日历的周日到周六计算
    const startDate = new Date(schedulingQuery.week);
    const endDate = new Date(startDate);
    endDate.setDate(startDate.getDate() + 6);
    // 格式化日期为 YYYY-MM-DD 格式
    const formatDate = date => {
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -603,10 +606,8 @@
      return `${year}-${month}-${day}`;
    };
    let startWeek =
      formatDate(new Date(time - 24 * 60 * 60 * 1000)) + " 00:00:00";
    let endWeek =
      formatDate(new Date(time + 24 * 60 * 60 * 1000 * 5)) + " 00:00:00";
    const startWeek = formatDate(startDate) + " 00:00:00";
    const endWeek = formatDate(endDate) + " 00:00:00";
    if (!schedulingQuery.userId || schedulingQuery.userId.length == 0) {
      proxy.$modal.msgError("请选择人员");