This commit is contained in:
2026-09-24 10:11:16 +08:00
parent 671351fa7c
commit aa189146a0
5 changed files with 29 additions and 7 deletions
@@ -5,6 +5,7 @@ import { ArrowLeft, Plus, Trash2 } from '@lucide/vue'
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
import { useAuthStore } from '@/modules/auth/public'
import { useUnsavedWorkRegistration } from '@/navigation/workspace-tabs/unsavedWork'
import { createIdempotencyKey } from '@/utils/idempotencyKey'
import { createDeliveryOrder, type DeliveryOrderFee, type DeliveryTransferPayload } from '../api/deliveryOrders'
type DeliveryCreateForm = Omit<DeliveryTransferPayload, 'idempotencyKey'>
@@ -112,7 +113,7 @@ async function submit() {
submitError.value = ''
const valid = await formRef.value?.validate().catch(() => false)
if (!valid || !validateFees()) return
if (!pendingIdempotencyKey) pendingIdempotencyKey = crypto.randomUUID()
if (!pendingIdempotencyKey) pendingIdempotencyKey = createIdempotencyKey()
submitting.value = true
try {
const created = await createDeliveryOrder(requestPayload())