| | |
| | | </div> |
| | | <div class="search_input"> |
| | | <el-select v-model="schedulingQuery.userId" |
| | | filterable |
| | | placeholder="请选择" |
| | | style="width: 100%" |
| | | multiple |
| | |
| | | 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"); |
| | |
| | | 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("请选择人员"); |