45 lines
1.7 KiB
Vue
45 lines
1.7 KiB
Vue
<script setup lang="ts">
|
||
import '@/styles/adminDensity.css'
|
||
import { computed, ref } from 'vue'
|
||
import { ElMessage } from 'element-plus'
|
||
import { getApiErrorDetails } from '@/shared/api/http'
|
||
import AppDialog from '@/shared/components/AppDialog.vue'
|
||
import { reviewWarehouseTransfer } from '../api/warehouseTransfers'
|
||
|
||
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() {
|
||
if (saving.value || !open.value || !props.customerId || !props.transferNo) return
|
||
saving.value = true
|
||
try {
|
||
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
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<AppDialog
|
||
v-model="open"
|
||
class="admin-density-dialog density-confirm-dialog"
|
||
:title="`仓储转运单审核 · ${transferNo || '—'}`"
|
||
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>
|
||
</AppDialog>
|
||
</template>
|