修复任务字段过滤与控件可写规则

This commit is contained in:
andy committed 2026-07-13 09:52:10 +08:00
1 parent b05001e481
commit 20eac61cb6
9 files changed
+593 -132

No files matched your search

@@ -77,6 +77,22 @@
{{ t('task.manualResolution.noSupportedMissingFields') }}
</p>
<div
v-if="unsupportedMissingFields.length"
class="manual-resolution__unsupported"
>
<strong>{{ t('task.manualResolution.unopenedFieldsTitle') }}</strong>
<ul>
<li
v-for="reference in unsupportedMissingFields"
:key="reference"
>
<span class="th-code">{{ reference }}</span>
<small>{{ t('task.manualResolution.fieldBackendUnopened') }}</small>
</li>
</ul>
</div>
<label>
<span>{{ t('task.manualResolution.reason') }}</span>
<textarea
@@ -124,7 +140,10 @@ import type {
ReservationTaskFieldResult,
} from '@/types/reservation'
import { normalizeStableCode } from '@/utils/reservationDisplay'
import { readReservationFieldValue } from '@/utils/reservationFieldRules'
import {
isReservationManualReviewFieldWritable,
readReservationFieldValue,
} from '@/utils/reservationFieldRules'
interface ManualResolutionFieldItem {
key: string
@@ -170,8 +189,11 @@ const supportedMissingFields = computed(() =>
.map((reference) => resolveMissingField(reference))
.filter((item): item is ManualResolutionFieldItem => item !== null),
)
const unsupportedMissingFields = computed(() =>
extractMissingFields(props.manualReview).filter((reference) => resolveMissingField(reference) === null),
)
const canSubmit = computed(() => {
if (!supportedMissingFields.value.length || !confirmedOrderId.value.trim()) {
if (!supportedMissingFields.value.length || unsupportedMissingFields.value.length || !confirmedOrderId.value.trim()) {
return false
}
return supportedMissingFields.value.every((item) => String(fieldOverrideInputs.value[item.key] ?? '').trim())
@@ -230,7 +252,7 @@ function resolveMissingField(reference: string): ManualResolutionFieldItem | nul
item.field_path === referenceFieldPath ||
item.legacy_field_path === referenceFieldPath,
)
if (field) {
if (field && isReservationManualReviewFieldWritable(field)) {
return {
key: field.field_pointer ?? field.field_path,
pointer: field.field_pointer ?? pointer,
@@ -350,6 +372,31 @@ function formatJson(value: unknown): string {
font-weight: 800;
}
.manual-resolution__unsupported {
display: grid;
gap: 8px;
border: 1px dashed var(--th-color-warning);
border-radius: var(--th-radius-md);
background: color-mix(in srgb, var(--th-color-warning) 12%, var(--th-color-white));
padding: 10px 12px;
}
.manual-resolution__unsupported ul {
display: grid;
gap: 6px;
margin: 0;
padding-left: 18px;
}
.manual-resolution__unsupported li {
display: grid;
gap: 2px;
}
.manual-resolution__unsupported small {
color: var(--th-color-slate-500);
}
.manual-resolution footer {
display: flex;
justify-content: flex-end;