feat(shipping-notice): 新增货代客户管理功能,支持客户导入、识别证据管理与客户确认

This commit is contained in:
hugo committed 2026-07-16 08:16:19 +08:00
1 parent b595e157e9
commit 4fbaed2b4c
176 files changed
+14011 -994

No files matched your search

@@ -0,0 +1,41 @@
<!--
features/chat/components/ShippingCustomerConfirmDialog.vue
用途:在 customer_review 检查点搜索并确认启用标准客户。
依赖:ShippingCustomerOption、vue-i18n。
逻辑:父 composable 提供选项与提交动作;本组件不解析邮件客户名,也不创建客户资料。
-->
<script setup lang="ts">
import { ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerOption } from '@/features/chat/types/shipping.api.types';
const props = defineProps<{ open: boolean; options: ShippingCustomerOption[]; loading: boolean }>();
const emit = defineEmits<{ close: []; search: [query: string]; confirm: [customerId: number] }>();
const { t } = useI18n();
const query = ref('');
const selectedId = ref<number | null>(null);
/** 每次打开对话框时清空上次选择。 */
watch(() => props.open, (open) => {
if (open) {
query.value = '';
selectedId.value = null;
}
});
</script>
<template>
<div v-if="open" class="admin-modal-overlay animate-fade-in items-center z-[170]">
<div class="admin-modal-panel max-w-xl max-h-[90vh] scale-100">
<div class="px-6 py-5 border-b border-subtle"><h3 class="section-title">{{ t('chat.shippingCustomer.title') }}</h3><p class="section-desc mt-1">{{ t('chat.shippingCustomer.subtitle') }}</p></div>
<div class="px-6 py-5 space-y-4 overflow-y-auto">
<div class="flex gap-2"><input v-model="query" class="input-field text-sm" :placeholder="t('chat.shippingCustomer.searchPlaceholder')" @keyup.enter="emit('search', query)" /><button type="button" class="btn-ghost" @click="emit('search', query)">{{ t('chat.shippingCustomer.search') }}</button></div>
<div class="space-y-2 max-h-80 overflow-y-auto">
<label v-for="customer in options" :key="customer.id" class="flex items-center gap-3 rounded-xl border border-default p-3 cursor-pointer hover:border-brand-300"><input v-model="selectedId" type="radio" :value="customer.id" /><span class="flex-1"><span class="font-medium text-primary">{{ customer.standard_name }}</span><span class="ml-2 font-mono text-xs text-muted">{{ customer.short_code }}</span></span></label>
<div v-if="!loading && !options.length" class="text-sm text-muted py-8 text-center">{{ t('chat.shippingCustomer.empty') }}</div>
</div>
</div>
<div class="admin-modal-footer"><button type="button" class="btn-ghost" @click="emit('close')">{{ t('common.cancel') }}</button><button type="button" class="btn-primary" :disabled="!selectedId || loading" @click="selectedId && emit('confirm', selectedId)">{{ t('chat.shippingCustomer.confirm') }}</button></div>
</div>
</div>
</template>