diff --git a/backend/src/api/oaScheduling.js b/backend/src/api/oaScheduling.js index 3768458..0ff0ff7 100644 --- a/backend/src/api/oaScheduling.js +++ b/backend/src/api/oaScheduling.js @@ -34,6 +34,12 @@ export function getScheduleBoard(params) { return request({ url: '/backend/oa/scheduling/board', method: 'get', params }) } +// 批量按格子编辑排班:cells 为排班板多选的「员工 × 日期」任意组合 +// shift_id>0 设为该班次(有排班=调班,无排班=新增);shift_id=0 清除(休息/请假) +export function saveScheduleEntryCells(data) { + return request({ url: '/backend/oa/scheduling/entries/save-cells', method: 'post', data }) +} + /* ----------------------------- 排班模板 ----------------------------- */ // 平台预置 + 自定义模板(只读);租户调用后规则会复制到自己的方案 diff --git a/backend/src/views/apps/oa/scheduling/components/batchDialog.vue b/backend/src/views/apps/oa/scheduling/components/batchDialog.vue new file mode 100644 index 0000000..f51e1e2 --- /dev/null +++ b/backend/src/views/apps/oa/scheduling/components/batchDialog.vue @@ -0,0 +1,180 @@ + + + + + diff --git a/backend/src/views/apps/oa/scheduling/components/planDialog.vue b/backend/src/views/apps/oa/scheduling/components/planDialog.vue index 735ae80..6153937 100644 --- a/backend/src/views/apps/oa/scheduling/components/planDialog.vue +++ b/backend/src/views/apps/oa/scheduling/components/planDialog.vue @@ -2,7 +2,7 @@ - - + + - - - + + + - + - + - + - + diff --git a/backend/src/views/apps/oa/scheduling/index.vue b/backend/src/views/apps/oa/scheduling/index.vue index c442206..276b274 100644 --- a/backend/src/views/apps/oa/scheduling/index.vue +++ b/backend/src/views/apps/oa/scheduling/index.vue @@ -58,17 +58,23 @@ /> - 含下级组织 + 含下级组织 只看有排班 刷新 + {{ batchMode ? "退出批量" : "批量编辑" }} + + 导出{{ exportCount ? ` ${exportCount} 人` : "全部" }} +
{{ shift.short_name || shift.name }} @@ -85,41 +98,67 @@
-
+ +
+ 按住拖动连续选中,单击切换选中(员工 × 日期格子) + + 已选 {{ selectedCount }} 格 · {{ selectedEmployees.length }} 人 · {{ selectedDates.length }} 天 + + 尚未选择 + 批量编辑所选 + 清空选择 +
+ +
- + + - + @@ -127,13 +166,21 @@ v-for="day in dateCells" :key="day.date" class="shift-cell" - :class="{ 'is-today': day.is_today }" - @click="openCell(employee, day.date)" + :class="{ + 'is-today': day.is_today, + 'is-holiday-off': holidayOf(day.date)?.type === 1, + 'is-holiday-work': holidayOf(day.date)?.type === 0, + 'is-weekend': isWeekendDay(day) && !holidayOf(day.date), + 'is-selected': batchMode && selection[`${employee.id}|${day.date}`] + }" + @mousedown="batchMode && batchMouseDown($event)" + @mouseover="batchMode && batchMouseOver(employee.id, day.date)" + @click="batchMode ? batchClick(employee.id, day.date) : openCell(employee, day.date)" >
临 @@ -155,14 +202,24 @@
- - + + +
员工 + + 员工
{{ day.date.slice(5) }}
{{ weekdayLabel(day.weekday) }}
- {{ holidayOf(day.date).type === 1 ? "休" : "班" }} + {{ cellDayLabel(day).tag }} - {{ holidayOf(day.date).name }} + {{ cellDayLabel(day).name }}
+ + +
{{ employee.name }}
{{ employee.org_name || "未分配部门" }}