feat(shipping-notice): 增强订单文档 Profile 管理功能,新增复核与草稿管理

- 添加订单复核相关模型及 API,支持复核案例的创建、更新和确认
- 实现复核草稿的管理功能,允许用户对复核内容进行编辑和保存
- 引入复核事件审计,确保复核过程的可追溯性
- 更新数据库模型以支持复核和草稿的关系管理
- 完善相关服务逻辑,确保复核与草稿的状态管理和数据一致性
- 增强文档模板的管理能力,支持更复杂的业务场景
This commit is contained in:
hugo committed 2026-07-29 09:50:25 +08:00
1 parent 61ac6403c4
commit b7307fc573
147 files changed
+15108 -1522

No files matched your search

@@ -144,6 +144,19 @@ const detailIssues = computed(() => (
.filter(Boolean)
: []
));
const detailTodoTitle = computed(() => (
sanitizeShippingRuntimeStatusText(String(detail.value?.ui_state?.summary?.title || '').trim())
|| t('workspace.shippingNotice.todo.noActionTitle')
));
const detailTodoMessage = computed(() => (
sanitizeShippingRuntimeStatusText(String(detail.value?.ui_state?.summary?.message || '').trim())
|| detailIssues.value[0]
|| t('workspace.shippingNotice.todo.noActionMessage')
));
const detailTodoActionLabel = computed(() => (
String(detail.value?.ui_state?.action_buttons?.[0]?.label || '').trim()
));
const detailHasTodo = computed(() => !!detailTodoActionLabel.value);
const inventorySnapshotLabel = (triggerType?: string | null) => {
const key = String(triggerType || 'on_demand');
@@ -319,8 +332,8 @@ onMounted(async () => {
</button>
</div>
<div class="grid gap-5 lg:grid-cols-5">
<div class="lg:col-span-2 space-y-2">
<div class="grid gap-5 lg:grid-cols-[minmax(18rem,0.85fr)_minmax(0,2.15fr)]">
<div class="space-y-2">
<div v-if="loading" class="rounded-2xl border border-dashed border-default py-10 text-center text-sm text-muted">
{{ $t('workspace.shippingNotice.loading') }}
</div>
@@ -345,6 +358,12 @@ onMounted(async () => {
</span>
</div>
<div class="mt-1 truncate text-sm text-secondary">{{ item.customer_name || '—' }}</div>
<div
v-if="item.ui_state?.summary?.title"
class="mt-1 truncate text-xs font-medium text-brand-700"
>
{{ sanitizeShippingRuntimeStatusText(item.ui_state.summary.title) }}
</div>
<div class="mt-1 flex flex-wrap items-center gap-2 text-xs text-muted">
<span>{{ formatLocalDateTime(item.created_at) }}</span>
<span v-if="item.batch_index && item.batch_total" class="rounded-full bg-sky-50 px-2 py-0.5 font-medium text-sky-700">
@@ -380,7 +399,7 @@ onMounted(async () => {
</div>
</div>
<div class="lg:col-span-3 rounded-2xl border border-default bg-surface/50 p-5">
<div class="rounded-2xl border border-default bg-surface/50 p-5">
<div v-if="!selectedTaskNo" class="py-16 text-center text-sm text-muted">
{{ $t('workspace.shippingNotice.selectCase') }}
</div>
@@ -414,7 +433,33 @@ onMounted(async () => {
</div>
</div>
<ShippingWorkflowStepper :steps="detailWorkflowSteps" />
<section class="rounded-2xl border border-brand-200 bg-brand-50/50 p-4">
<div class="flex flex-wrap items-start justify-between gap-4">
<div class="min-w-0">
<div class="text-xs font-semibold uppercase tracking-wide text-brand-700">
{{ $t('workspace.shippingNotice.todo.label') }}
</div>
<h3 class="mt-1 text-base font-semibold text-primary">{{ detailTodoTitle }}</h3>
<p class="mt-1 text-sm text-secondary">{{ detailTodoMessage }}</p>
</div>
<button
v-if="chatAgentId && detailHasTodo"
type="button"
class="inline-flex shrink-0 items-center gap-1 rounded-xl bg-brand-600 px-3 py-2 text-sm font-medium text-white hover:bg-brand-700"
@click="openInChat(detail.task_no, detail.conversation_id, detail.batch_no)"
>
<ExternalLink class="h-3.5 w-3.5" />
{{ $t('workspace.shippingNotice.todo.handleInChat', { action: detailTodoActionLabel }) }}
</button>
</div>
</section>
<section class="rounded-2xl border border-default/80 bg-surface px-4 py-3">
<div class="mb-3 text-xs font-semibold uppercase tracking-wide text-muted">
{{ $t('workspace.shippingNotice.todo.workflow') }}
</div>
<ShippingWorkflowStepper :steps="detailWorkflowSteps" />
</section>
<div
v-if="detailStepProgress"
@@ -451,7 +496,9 @@ onMounted(async () => {
</div>
</div>
<dl class="grid gap-3 sm:grid-cols-2 text-sm">
<section class="rounded-2xl border border-default/80 bg-surface px-4 py-3">
<h3 class="mb-3 text-sm font-semibold text-secondary">{{ $t('workspace.shippingNotice.todo.orderOverview') }}</h3>
<dl class="grid gap-3 sm:grid-cols-2 text-sm">
<div>
<dt class="text-muted">{{ $t('workspace.shippingNotice.fields.status') }}</dt>
<dd :title="detail.process_status">{{ statusBadge(detail).label }}</dd>
@@ -462,7 +509,8 @@ onMounted(async () => {
</div>
<div><dt class="text-muted">{{ $t('workspace.shippingNotice.fields.shipTo') }}</dt><dd>{{ detail.ship_to || '—' }}</dd></div>
<div><dt class="text-muted">{{ $t('workspace.shippingNotice.fields.freightRef') }}</dt><dd>{{ detail.freight_ref_no || '—' }}</dd></div>
</dl>
</dl>
</section>
<div
v-if="hasInventorySourceFields"