feat: 仪表盘+催办在休息日跳过填报检查

- 新增 is_working_day() 工具函数,自动跳过周末 + 可配置法定假日
- 仪表盘填报进度新增 is_rest_day 字段,休息日显示灰「休」印章
- 催办调度改用 is_working_day() 替代原始 weekday 检查
- 系统设置新增「法定节假日」配置卡片,支局长可管理假日日期

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:13:32 +08:00
parent dcb0b826de
commit a63bd6874c
6 changed files with 129 additions and 14 deletions
+46
View File
@@ -15,6 +15,8 @@ const announceLoading = ref(false)
const dailyCheckLoading = ref(false)
const notificationTime = ref('17:30')
const notificationTimeLoading = ref(false)
const holidays = ref('')
const holidaysLoading = ref(false)
const importLoading = ref(false)
const importFile = ref<File | null>(null)
@@ -32,6 +34,9 @@ onMounted(async () => {
if (res.data?.notification_time) {
notificationTime.value = res.data.notification_time
}
if (res.data?.holidays) {
holidays.value = res.data.holidays
}
} catch (_) {}
})
@@ -75,6 +80,16 @@ async function handleSaveNotificationTime() {
} finally { notificationTimeLoading.value = false }
}
async function handleSaveHolidays() {
holidaysLoading.value = true
try {
await api.put('/system-config/holidays', { value: holidays.value })
ElMessage.success('节假日已更新')
} catch (e: any) {
ElMessage.error(e.response?.data?.detail || '保存失败')
} finally { holidaysLoading.value = false }
}
function handleImportFile(e: Event) {
const target = e.target as HTMLInputElement
if (target.files?.[0]) importFile.value = target.files[0]
@@ -205,6 +220,37 @@ async function handleImportPreview() {
</div>
</el-card>
<!-- Holidays -->
<el-card class="setting-card">
<template #header>
<div class="card-header-title">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right:6px; color: var(--gold)">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
法定节假日
</div>
</template>
<div class="setting-row">
<div class="setting-col" style="flex:1">
<label class="setting-label">节假日日期逗号分隔格式 YYYY-MM-DD</label>
<div style="display:flex;gap:8px;align-items:flex-start">
<el-input
v-model="holidays"
type="textarea"
:rows="2"
placeholder="如: 2026-10-01, 2026-10-02, 2026-10-05"
style="flex:1"
/>
<el-button type="primary" :loading="holidaysLoading" @click="handleSaveHolidays" size="small">保存</el-button>
</div>
<p style="color:var(--warm-gray);font-size:12px;margin-top:6px">配置后仪表盘和催办提醒在这些日期将跳过填报检查周末自动跳过无需配置</p>
</div>
</div>
</el-card>
<!-- Import -->
<el-card class="setting-card">
<template #header>