| | |
| | | <div class="schedule-list-section"> |
| | | <div class="section-header"> |
| | | <h3>日程列表</h3> |
| | | <div> |
| | | <div class="header-actions"> |
| | | <el-date-picker |
| | | v-model="calendarDate" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | size="mini" |
| | | style="width: 140px; margin-right: 10px" |
| | | :clearable="false" |
| | | /> |
| | | <el-button type="text" icon="el-icon-plus" @click="handleAddSchedule">新增</el-button> |
| | | <el-button type="text" icon="el-icon-refresh" @click="getScheduleList" :disabled="scheduleRefreshing">刷新</el-button> |
| | | </div> |
| | |
| | | <div class="schedule-list-section"> |
| | | <div class="section-header"> |
| | | <h3>上报列表</h3> |
| | | <div> |
| | | <div class="header-actions"> |
| | | <el-date-picker |
| | | v-model="reportCalendarDate" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | size="mini" |
| | | style="width: 140px; margin-right: 10px" |
| | | :clearable="false" |
| | | /> |
| | | <el-button type="text" icon="el-icon-refresh" @click="getReportList" :disabled="reportRefreshing">刷新</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | watch:{ |
| | | calendarDate(newDate, oldDate) { |
| | | // 排除「点击日期单元格」导致的变化(仅日期变,月份/年份不变) |
| | | const isOnlyDayChange = |
| | | newDate.getFullYear() === oldDate.getFullYear() && |
| | | newDate.getMonth() === oldDate.getMonth() && |
| | | newDate.getDate() !== oldDate.getDate(); |
| | | // 检查是否跨月/跨年 |
| | | const isMonthChanged = |
| | | newDate.getFullYear() !== oldDate.getFullYear() || |
| | | newDate.getMonth() !== oldDate.getMonth(); |
| | | |
| | | if (!isOnlyDayChange) { |
| | | // 触发按钮点击逻辑(上月/下月/今日) |
| | | if (isMonthChanged) { |
| | | // 触发后端拉取整月数据 |
| | | this.getScheduleList(); |
| | | this.lastCalendarDate = new Date(newDate); // 更新记录的日期 |
| | | } |
| | | }, |
| | | reportCalendarDate(newDate, oldDate) { |
| | | // 排除「点击日期单元格」导致的变化(仅日期变,月份/年份不变) |
| | | const isOnlyDayChange = |
| | | newDate.getFullYear() === oldDate.getFullYear() && |
| | | newDate.getMonth() === oldDate.getMonth() && |
| | | newDate.getDate() !== oldDate.getDate(); |
| | | // 检查是否跨月/跨年 |
| | | const isMonthChanged = |
| | | newDate.getFullYear() !== oldDate.getFullYear() || |
| | | newDate.getMonth() !== oldDate.getMonth(); |
| | | |
| | | if (!isOnlyDayChange) { |
| | | // 触发按钮点击逻辑(上月/下月/今日) |
| | | if (isMonthChanged) { |
| | | // 触发后端拉取整月数据 |
| | | this.getReportList(); |
| | | this.lastReportCalendarDate = new Date(newDate); // 更新记录的日期 |
| | | } |
| | | }, |
| | | }, |