扩展用户管理字段与组织编码生成,顶部改为仓库下拉;Nana 分 AI 与专属顾问 Tab,仓库页移除客服字段,并完善扫描语音与订单相关页面。 Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.7 KiB
Vue
51 lines
1.7 KiB
Vue
<script lang="ts" setup>
|
|
import { computed, onMounted, ref } from 'vue';
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
import { getOrderTemplateList } from '@/api/order';
|
|
import CustomTemplateModal from '@/views/order/placeOrder/components/CustomTemplateModal.vue';
|
|
|
|
defineOptions({ name: 'OrderTemplateMapping' });
|
|
|
|
const route = useRoute();
|
|
const router = useRouter();
|
|
const visible = ref(true);
|
|
const standardTemplateOptions = ref<Array<{ templateKey: string; label: string; id?: number }>>([]);
|
|
|
|
const templateId = computed(() => Number(route.query.templateId || 0));
|
|
|
|
async function loadStandardTemplates() {
|
|
const result = await getOrderTemplateList({ page: 1, pageSize: 100, type: 'standard' });
|
|
const items = (result.items || []).map((raw: any) => ({
|
|
templateKey: String(raw.templateKey ?? raw.TemplateKey ?? 'dedicated_small_parcel_v1'),
|
|
label: String(raw.name ?? raw.Name ?? raw.templateKey ?? '标准模板'),
|
|
id: Number(raw.id ?? raw.Id ?? 0) || undefined,
|
|
}));
|
|
standardTemplateOptions.value = items.length
|
|
? items
|
|
: [{ templateKey: 'dedicated_small_parcel_v1', label: '专线小包模板' }];
|
|
}
|
|
|
|
function handleClose() {
|
|
visible.value = false;
|
|
router.replace({ path: '/order/placeOrder' });
|
|
}
|
|
|
|
onMounted(async () => {
|
|
if (!templateId.value) {
|
|
handleClose();
|
|
return;
|
|
}
|
|
await loadStandardTemplates();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<CustomTemplateModal
|
|
v-model:visible="visible"
|
|
:template-id="templateId"
|
|
:standard-template-options="standardTemplateOptions"
|
|
@update:visible="(open) => !open && handleClose()"
|
|
@success="handleClose"
|
|
/>
|
|
</template>
|