This commit is contained in:
zlwu committed 2026-08-17 20:32:18 +08:00
1 parent 9345cf4ad8
commit c3bd2c00ae
51 files changed
+14486 -15765

No files matched your search

+51 -20
View File
@@ -110,6 +110,7 @@
:key="ci"
class="chip"
:class="chip.cls"
:title="chip.title || chip.text"
>
{{ chip.text }}
</span>
@@ -179,7 +180,7 @@
v-model="dialogVisible"
class="dialog-form-layout duty-day-dialog"
:title="`配置 · ${editingDate}`"
width="640px"
width="880px"
align-center
destroy-on-close
:close-on-click-modal="false"
@@ -198,23 +199,35 @@
</div>
</div>
<template v-if="slot.enabled">
<el-form-item label="直接安排(值班人员)">
<el-select
v-model="slot.pendingUserId"
filterable
clearable
placeholder="选择员工后添加"
style="width: 100%"
@change="(v) => addAssign(slot, String(v || ''))"
>
<el-option
v-for="u in userOptions"
:key="u.value"
:label="u.label"
:value="u.value"
<div class="form-grid-2 slot-assign-row">
<el-form-item label="值班安排">
<el-select
v-model="slot.pendingUserId"
filterable
clearable
placeholder="选择员工后添加"
style="width: 100%"
@change="(v) => addAssign(slot, String(v || ''))"
>
<el-option
v-for="u in userOptions"
:key="u.value"
:label="u.label"
:value="u.value"
/>
</el-select>
</el-form-item>
<el-form-item label="工作安排">
<el-input
v-model="slot.remark"
type="textarea"
:rows="2"
maxlength="500"
show-word-limit
placeholder="可选,填写本班次工作安排"
/>
</el-select>
</el-form-item>
</el-form-item>
</div>
<div class="person-tags">
<el-tag
v-for="(a, ai) in slot.assignments"
@@ -320,6 +333,7 @@
shiftType: ShiftType
enabled: boolean
capacity: number
remark: string
pendingUserId: string
assignments: DutySlotItem['assignments']
}
@@ -329,6 +343,7 @@
shiftType: t,
enabled: false,
capacity: 1,
remark: '',
pendingUserId: '',
assignments: []
}))
@@ -473,7 +488,7 @@
dateStr: string
isToday: boolean
summary?: DutyDayItem
chips: Array<{ text: string; cls: string }>
chips: Array<{ text: string; cls: string; title?: string }>
}> = []
const prevDays = new Date(y, m - 1, 0).getDate()
@@ -484,7 +499,7 @@
for (let d = 1; d <= daysInMonth; d++) {
const dateStr = toDateStr(y, m, d)
const summary = dayMap.value.get(dateStr)
const chips: Array<{ text: string; cls: string }> = []
const chips: Array<{ text: string; cls: string; title?: string }> = []
if (summary?.slots?.length) {
for (const s of summary.slots) {
if (shiftFilter && s.shiftType !== shiftFilter) continue
@@ -494,6 +509,7 @@
if (filterKey && !matched.length) continue
const names = matched.map((a) => a.personName).filter(Boolean)
const taken = s.taken ?? (s.assignments || []).length
const remark = (s.remark || '').trim()
let text: string
if (filterKey) {
text = `${s.shiftLabel || SHIFT_LABELS[s.shiftType]} ${names.join('、')}`
@@ -502,7 +518,14 @@
} else {
text = `${s.shiftLabel || SHIFT_LABELS[s.shiftType]} ${taken}/${s.capacity}`
}
chips.push({ text, cls: SHIFT_CLS[s.shiftType] || 'am' })
if (remark) {
text = `${text} · ${remark}`
}
chips.push({
text,
cls: SHIFT_CLS[s.shiftType] || 'am',
title: remark || undefined
})
}
if (!hasFilter && !chips.length) {
chips.push({ text: '未排班 · 点击配置', cls: 'empty' })
@@ -598,6 +621,7 @@
const found = detail?.slots?.find((s) => s.shiftType === fs.shiftType)
fs.enabled = !!found
fs.capacity = found?.capacity || 1
fs.remark = (found?.remark || '').trim()
fs.pendingUserId = ''
fs.assignments = found ? [...(found.assignments || [])] : []
}
@@ -665,6 +689,7 @@
.map((s) => ({
shiftType: s.shiftType,
capacity: s.capacity,
remark: s.remark.trim() || null,
assignments: s.assignments
.filter((a) => a.source === 'assign')
.map((a) => ({
@@ -1147,6 +1172,12 @@
justify-content: space-between;
margin-bottom: 8px;
}
.slot-assign-row {
margin-bottom: 4px;
:deep(.el-form-item) {
margin-bottom: 0;
}
}
.cap-field {
display: flex;
gap: 8px;