diff --git a/src/service/api/work-report.ts b/src/service/api/work-report.ts index 9a9d627..bc6ff88 100644 --- a/src/service/api/work-report.ts +++ b/src/service/api/work-report.ts @@ -287,6 +287,8 @@ function normalizeWeeklyReport(response: WeeklyReportResponse): Api.WorkReport.W allowEdit: normalizeBooleanFlag(response.allowEdit), terminal: normalizeBooleanFlag(response.terminal), isBusinessTrip: normalizeBooleanFlag(response.isBusinessTrip), + periodStartDate: normalizeDateText(response.periodStartDate) ?? '', + periodEndDate: normalizeDateText(response.periodEndDate) ?? '', totalWorkHours: normalizeReportTotalWorkHours(response.totalWorkHours, fallbackTotalWorkHours), submitTime: response.submitTime ?? null, reviewItems: response.reviewItems?.map(normalizeReviewItem) ?? [], diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 62d6202..bf60d36 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -130,13 +130,11 @@ declare module 'vue' { IconMdiFolderOpen: typeof import('~icons/mdi/folder-open')['default'] IconMdiFolderOutline: typeof import('~icons/mdi/folder-outline')['default'] IconMdiFolderPlusOutline: typeof import('~icons/mdi/folder-plus-outline')['default'] - IconMdiFolderZipOutline: typeof import('~icons/mdi/folder-zip-outline')['default'] IconMdiInboxMultipleOutline: typeof import('~icons/mdi/inbox-multiple-outline')['default'] IconMdiInformationOutline: typeof import('~icons/mdi/information-outline')['default'] IconMdiKeyboardEsc: typeof import('~icons/mdi/keyboard-esc')['default'] IconMdiKeyboardReturn: typeof import('~icons/mdi/keyboard-return')['default'] IconMdiLinkVariant: typeof import('~icons/mdi/link-variant')['default'] - IconMdiPenCheckOutline: typeof import('~icons/mdi/pen-check-outline')['default'] IconMdiPencilOutline: typeof import('~icons/mdi/pencil-outline')['default'] IconMdiPlus: typeof import('~icons/mdi/plus')['default'] IconMdiRefresh: typeof import('~icons/mdi/refresh')['default'] diff --git a/src/views/_builtin/login/index.vue b/src/views/_builtin/login/index.vue index 78c8975..8934525 100644 --- a/src/views/_builtin/login/index.vue +++ b/src/views/_builtin/login/index.vue @@ -369,9 +369,9 @@ const turbines = [ - + + + diff --git a/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue b/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue index 7764026..016a5c8 100644 --- a/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue +++ b/src/views/personal-center/my-performance/modules/performance-sign-off-dialog.vue @@ -54,7 +54,7 @@ const title = computed(() => (isImportOnly.value ? '导入绩效压缩包' : ' const confirmText = computed(() => (isImportOnly.value ? '开始导入' : '确认执行')); const teamLabelText = computed(() => { if (needsZipFile.value) { - return '压缩包中含有的下属'; + return '全部下属'; } return props.teamLabel || '当前范围'; diff --git a/src/views/personal-center/work-report/shared/types.ts b/src/views/personal-center/work-report/shared/types.ts index fc3a159..00ec9b4 100644 --- a/src/views/personal-center/work-report/shared/types.ts +++ b/src/views/personal-center/work-report/shared/types.ts @@ -117,9 +117,21 @@ export function formatWeeklyPeriodLabel( endDate?: string | null, periodLabel?: string | null ) { - const startDate = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodStartDate : rowOrStart; - const rangeEndDate = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodEndDate : endDate; - const fallbackLabel = typeof rowOrStart === 'object' && rowOrStart ? rowOrStart.periodLabel : periodLabel; + const isRowPayload = + typeof rowOrStart === 'object' && + rowOrStart !== null && + !Array.isArray(rowOrStart) && + ('periodStartDate' in rowOrStart || 'periodEndDate' in rowOrStart || 'periodLabel' in rowOrStart); + let startDate: string | null | undefined; + if (isRowPayload) { + startDate = rowOrStart.periodStartDate; + } else if (typeof rowOrStart === 'string') { + startDate = rowOrStart; + } else { + startDate = undefined; + } + const rangeEndDate: string | null | undefined = isRowPayload ? rowOrStart.periodEndDate : endDate; + const fallbackLabel: string | null | undefined = isRowPayload ? rowOrStart.periodLabel : periodLabel; const referenceDate = dayjs(startDate || rangeEndDate); if (referenceDate.isValid()) { diff --git a/src/views/personal-center/work-report/weekly/modules/fill-page.vue b/src/views/personal-center/work-report/weekly/modules/fill-page.vue index fb8b31a..55baa30 100644 --- a/src/views/personal-center/work-report/weekly/modules/fill-page.vue +++ b/src/views/personal-center/work-report/weekly/modules/fill-page.vue @@ -12,6 +12,7 @@ import { type WorkReportStructuredTask, formatPeriodDateRange, formatPeriodLabel, + formatWeeklyPeriodLabel, getStructuredSections, getStructuredTasks } from '../../shared/types'; @@ -866,7 +867,15 @@ const totalHours = computed(() => { return (props.model.reviewItems || []).reduce((sum, item) => sum + Number(item.workHours || 0), 0); }); + const periodText = computed(() => { + const weeklyLabel = formatWeeklyPeriodLabel( + props.model.periodStartDate || undefined, + props.model.periodEndDate || undefined, + props.model.periodLabel || props.period + ); + if (weeklyLabel && weeklyLabel !== '--') return weeklyLabel; + const rangeText = formatPeriodDateRange( props.model.periodStartDate || undefined, props.model.periodEndDate || undefined @@ -875,10 +884,12 @@ const periodText = computed(() => { return formatPeriodLabel(props.model.periodLabel || props.period) || '--'; }); + const totalTravelDays = computed(() => { const total = travelSegments.value.reduce((sum, segment) => sum + Number(segment.days || 0), 0); return Math.round(total * 10) / 10; }); + const hasCompleteTravelSegment = computed(() => travelSegments.value.some(isCompleteTravelSegment)); function calcSegmentDays(segment: TravelSegment) {