feat(shipping-notice): 优化货运订单履约流程与用户体验
- 优化聊天附件列表为横向可滚动布局并新增配套测试用例 - 移除自动填充默认用户消息逻辑,空备注时不再伪造默认正文 - 修复流程Gate动作展示逻辑,隐藏历史遗留操作与自动阶段无效按钮 - 完善库存匹配重试与订单快照冻结校验流程 - 优化进度展示优先级,优先显示人工待处理状态 - 移除Excel导出自动推导金额逻辑,强制使用Schema配置字段 - 新增货代通用报表RPA详细设计文档 - 更新相关测试用例与断言逻辑
This commit is contained in:
1 parent
dc282f3b1d
commit
11cef575b4
51 files changed
+2197
-112
No files matched your search
+46
-2
@@ -35,6 +35,12 @@ const props = defineProps<{
|
||||
retryable?: boolean;
|
||||
blockingReason?: ShippingProcessingBlockingReason | null;
|
||||
primaryAction?: ShippingProcessingPrimaryAction | null;
|
||||
recoveryActions?: Array<{
|
||||
code: string;
|
||||
i18nKey?: string | null;
|
||||
label_key?: string | null;
|
||||
parameters?: Record<string, unknown>;
|
||||
}>;
|
||||
|
||||
taskMissing?: boolean;
|
||||
confirmedTaskId?: number | null;
|
||||
@@ -169,6 +175,9 @@ const showNextStep = computed(() => {
|
||||
const showBusinessAction = computed(() => {
|
||||
if (props.loading) return false;
|
||||
if (props.taskMissing) return false;
|
||||
// [STEP] 自动处理期间没有人工业务动作;只保留外层的刷新进度入口。
|
||||
// 防止正式任务编辑等历史 primary_action 穿透到库存获取运行态。
|
||||
if (props.userStatus === 'running') return false;
|
||||
if (props.retryable) return true;
|
||||
const code = String(props.primaryAction?.code || '').trim();
|
||||
if (!code) return false;
|
||||
@@ -186,7 +195,13 @@ const businessActionLabel = computed(() => {
|
||||
}
|
||||
const pa = props.primaryAction;
|
||||
if (!pa) return '';
|
||||
const i18nKey = String(pa.i18nKey || '').trim();
|
||||
// Gate action presentation uses label_key; normalize it at the shared card boundary
|
||||
// so every gate renders its business label instead of exposing the action code.
|
||||
const i18nKey = String(
|
||||
pa.i18nKey
|
||||
|| (pa as ShippingProcessingPrimaryAction & { label_key?: string | null }).label_key
|
||||
|| '',
|
||||
).trim();
|
||||
if (i18nKey && te(i18nKey)) {
|
||||
return t(i18nKey);
|
||||
}
|
||||
@@ -214,13 +229,31 @@ const businessActionTitle = computed(() => {
|
||||
});
|
||||
|
||||
const actionIsRetry = computed(() => Boolean(props.retryable) || String(props.primaryAction?.code || '') === 'retry');
|
||||
const recoveryActions = computed(() => (props.recoveryActions || []).filter((action) => {
|
||||
const code = String(action.code || '').trim();
|
||||
return code && code !== String(props.primaryAction?.code || '').trim();
|
||||
}));
|
||||
|
||||
function recoveryActionLabel(action: (typeof recoveryActions.value)[number]): string {
|
||||
const key = String(
|
||||
action.i18nKey
|
||||
|| action.label_key
|
||||
|| `workspace.shippingNotice.processGate.actionCodes.${action.code}`,
|
||||
).trim();
|
||||
return key && te(key) ? t(key) : action.code;
|
||||
}
|
||||
|
||||
function handleBusinessActionClick() {
|
||||
const primaryActionCode = String(props.primaryAction?.code || '').trim();
|
||||
if (props.retryable && primaryActionCode && primaryActionCode !== 'retry') {
|
||||
emit('action', primaryActionCode, props.primaryAction?.parameters ?? {});
|
||||
return;
|
||||
}
|
||||
if (actionIsRetry.value) {
|
||||
emit('retry');
|
||||
return;
|
||||
}
|
||||
emit('action', String(props.primaryAction?.code || ''), props.primaryAction?.parameters ?? {});
|
||||
emit('action', primaryActionCode, props.primaryAction?.parameters ?? {});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,6 +390,17 @@ type ReviewCurrentUserStatus =
|
||||
/>
|
||||
{{ businessActionLabel }}
|
||||
</button>
|
||||
<button
|
||||
v-for="action in recoveryActions"
|
||||
:key="action.code"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1 rounded-md border border-sky-300 bg-white px-2.5 py-1.5 text-xs font-medium text-sky-800 shadow-sm transition hover:bg-sky-50 disabled:opacity-50 dark:border-sky-700 dark:bg-sky-900 dark:text-sky-100 dark:hover:bg-sky-800"
|
||||
:data-testid="`review-current-task-recovery-${action.code}`"
|
||||
:disabled="retrying || locating"
|
||||
@click="$emit('action', action.code, action.parameters || {})"
|
||||
>
|
||||
{{ recoveryActionLabel(action) }}
|
||||
</button>
|
||||
<button
|
||||
v-if="showLocateAction"
|
||||
type="button"
|
||||
|
||||
Reference in new issue
Block a user