Files
admin-web/src/modules/overseas-warehouse/components/WarehouseTransferReviewDialog.vue
T

45 lines
1.7 KiB
Vue
Raw Normal View History

2026-09-13 21:10:05 +08:00
<script setup lang="ts">
2026-09-14 20:03:27 +08:00
import '@/styles/adminDensity.css'
2026-10-16 18:25:49 +08:00
import { computed, ref } from 'vue'
2026-09-13 21:10:05 +08:00
import { ElMessage } from 'element-plus'
2026-10-16 18:25:49 +08:00
import { getApiErrorDetails } from '@/shared/api/http'
2026-09-13 21:10:05 +08:00
import AppDialog from '@/shared/components/AppDialog.vue'
2026-10-16 18:25:49 +08:00
import { reviewWarehouseTransfer } from '../api/warehouseTransfers'
2026-09-13 21:10:05 +08:00
const props = defineProps<{ modelValue: boolean; customerId: string; customerName: string; transferNo: string }>()
const emit = defineEmits<{ 'update:modelValue': [value: boolean]; reviewed: [] }>()
const open = computed({ get: () => props.modelValue, set: (value) => emit('update:modelValue', value) })
const saving = ref(false)
async function submit() {
2026-10-16 18:25:49 +08:00
if (saving.value || !open.value || !props.customerId || !props.transferNo) return
2026-09-13 21:10:05 +08:00
saving.value = true
try {
2026-10-16 18:25:49 +08:00
await reviewWarehouseTransfer(props.customerId, props.transferNo, 'APPROVE')
ElMessage.success('转运单审核通过,已推送 PDA 收货打托')
open.value = false
emit('reviewed')
} catch (cause) {
ElMessage.error(getApiErrorDetails(cause, '审核提交失败,请重试').message)
} finally {
saving.value = false
}
2026-09-13 21:10:05 +08:00
}
</script>
<template>
2026-10-16 18:25:49 +08:00
<AppDialog
v-model="open"
class="admin-density-dialog density-confirm-dialog"
:title="`仓储转运单审核 · ${transferNo || '—'}`"
2026-10-16 18:25:49 +08:00
width="min(420px, calc(100vw - 28px))"
align-center
cancel-text="返回"
confirm-text="审核通过"
:confirm-loading="saving"
@confirm="submit"
>
<section class="density-dialog-section" data-tone="source" aria-label="转运审核对象"><p class="density-dialog-note">客户:{{ customerName || '—' }}</p><div>审核通过后,转运单将进入海外仓收货打托作业。</div></section>
2026-09-13 21:10:05 +08:00
</AppDialog>
</template>