fix(admin): default manual node times to now

This commit is contained in:
2026-09-10 15:23:39 +08:00
parent 568f2dea8a
commit a2f1ecc6b9
2 changed files with 10 additions and 4 deletions
@@ -195,8 +195,8 @@ const fulfillmentEvents = computed<FulfillmentEvent[]>(() => {
})
function eventTagType(type: FulfillmentEvent['type']) { return ({ '仓内操作': 'info', '确认离仓': 'success', '船运节点': 'primary', '人工补录': 'warning', '异常': 'danger' } as const)[type] }
function resetManualForm() {
Object.assign(manualForm, { standardNode: '', estimatedAt: '', actualAt: '', locationCode: '', locationName: '', reason: '' })
function resetManualForm(initialTime = '') {
Object.assign(manualForm, { standardNode: '', estimatedAt: initialTime, actualAt: initialTime, locationCode: '', locationName: '', reason: '' })
manualError.value = null; manualValidationError.value = ''
}
function createIdempotencyKey() { return globalThis.crypto?.randomUUID?.() || `carrier-node-${Date.now()}-${Math.random().toString(16).slice(2)}` }
@@ -206,7 +206,8 @@ function localDateTimeNow() {
}
function openManualDialog() {
if (!props.containerBookingId) return
resetManualForm(); manualIdempotencyKey.value = createIdempotencyKey(); manualObservedAt.value = localDateTimeNow(); manualDialogOpen.value = true
const now = localDateTimeNow()
resetManualForm(now); manualIdempotencyKey.value = createIdempotencyKey(); manualObservedAt.value = now; manualDialogOpen.value = true
}
async function submitManualNode() {
manualValidationError.value = ''