优化
This commit is contained in:
@@ -14,7 +14,7 @@ import { dateTime, statusLabel } from '../procurementPresentation'
|
||||
import type { PlatformProcurement } from '../procurementTypes'
|
||||
import type { OverseasPurchaseWarehouseOption } from '../types'
|
||||
|
||||
const props = defineProps<{ detail: PlatformProcurement; workflow: ProcurementWorkflow; customerId: string; downloading?: string; beforeOutbound: () => Promise<void> }>()
|
||||
const props = defineProps<{ detail: PlatformProcurement; workflow: ProcurementWorkflow; customerId: string; downloading?: string; beforeOutbound: () => Promise<boolean | null> }>()
|
||||
const emit = defineEmits<{ changed: []; download: [id: string] }>()
|
||||
const access = useAccessPreviewStore()
|
||||
const open = ref(false), saving = ref(false), uploading = ref(false), checkingFees = ref(false), error = ref<ApiErrorDetails | null>(null)
|
||||
@@ -40,10 +40,12 @@ async function begin(name: string, batch?: ProcurementOutbound) {
|
||||
const current = ++dialogGeneration
|
||||
if (name === 'outbounds') {
|
||||
checkingFees.value = true
|
||||
try { await props.beforeOutbound() }
|
||||
catch (failure) { if (current === dialogGeneration) ElMessage.warning(getApiErrorDetails(failure, '费用校验失败').message); return }
|
||||
let noFeeDetails = false
|
||||
try { noFeeDetails = await props.beforeOutbound() === true }
|
||||
catch { /* 费用查询仅用于提示,不能阻断采购出库。 */ }
|
||||
finally { checkingFees.value = false }
|
||||
if (current !== dialogGeneration) return
|
||||
if (noFeeDetails) ElMessage.info('没有新增费用明细,仍可继续创建出库单')
|
||||
}
|
||||
action.value = name; batchId.value = batch?.id || ''; error.value = null; warehouseLoading.value = false
|
||||
Object.assign(form, { quantity: 1, trackingNo: '', fileIds: [], warehouseId: '', decision: 'APPROVE', reason: '' }); uploadedNames.value = []
|
||||
|
||||
Reference in New Issue
Block a user