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
@@ -66,6 +66,7 @@ function mountStrip(projection: ShippingProcessingProjection, polling = false) {
|
||||
chat: {
|
||||
shippingOrderReview: {
|
||||
workflowProgress: { polling: '正在刷新进度…' },
|
||||
currentTask: { statusWaitingHuman: '待人工处理' },
|
||||
},
|
||||
shippingProcessing: {
|
||||
progress: {
|
||||
@@ -130,6 +131,27 @@ describe('ReviewProgressStrip', () => {
|
||||
expect(wrapper.find('[data-testid="review-progress-refresh"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('gives manual gate priority over stale automating status', () => {
|
||||
const wrapper = mountStrip(buildProjection({
|
||||
status: 'automating',
|
||||
userStatus: 'waiting_human',
|
||||
stage: 'inventory_fetching',
|
||||
currentGate: {
|
||||
gateCode: 'inventory_preparation',
|
||||
status: 'blocked_manual',
|
||||
nextActionCode: 'upload_inventory_file',
|
||||
blockingReasonCode: 'inventory_file_empty',
|
||||
attemptNo: 3,
|
||||
},
|
||||
}), true);
|
||||
const title = wrapper.get('[data-testid="review-progress-title"]').text();
|
||||
expect(title).toContain('待人工处理');
|
||||
expect(title).toContain('inventory_fetching');
|
||||
expect(title).not.toContain('系统处理中');
|
||||
expect(wrapper.find('[data-testid="review-progress-refresh"]').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-testid="review-workflow-progress-polling"]').exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('hides stage nodes and warns when stageNodes invalid', () => {
|
||||
const warn = vi.spyOn(console, 'warn').mockImplementation(() => undefined);
|
||||
const wrapper = mountStrip(buildProjection({ stageNodes: [] }));
|
||||
|
||||
@@ -44,10 +44,19 @@ const stageNodes = computed(() => readAuthoritativeStageNodes(props.projection))
|
||||
|
||||
const rangeHint = computed(() => buildProgressRangeHint(props.projection, 'workbench'));
|
||||
|
||||
/**
|
||||
* 人工阻断优先于遗留 processing/automating 投影,避免已中断任务仍显示系统处理中并持续轮询。
|
||||
*/
|
||||
const isWaitingHuman = computed(() => (
|
||||
props.projection.userStatus === 'waiting_human'
|
||||
|| String(props.projection.currentGate?.status || '').trim().toLowerCase() === 'blocked_manual'
|
||||
));
|
||||
|
||||
/**
|
||||
* 是否处于系统自动推进(用于刷新按钮,不进标题文案)。
|
||||
*/
|
||||
const isAutomating = computed(() => {
|
||||
if (isWaitingHuman.value) return false;
|
||||
const status = String(props.projection.status || '').trim().toLowerCase();
|
||||
if (!AUTOMATING_STATUSES.has(status)) return false;
|
||||
const next = String(props.projection.currentGate?.nextActionCode || '').trim().toLowerCase();
|
||||
@@ -57,11 +66,15 @@ const isAutomating = computed(() => {
|
||||
});
|
||||
|
||||
/**
|
||||
* 标题:默认「订单处理进度 · 当前阶段」;自动推进状态切换为「系统处理中 · 当前阶段」;
|
||||
* 标题:人工阻断优先显示「待人工处理 · 当前阶段」;自动推进才显示「系统处理中 · 当前阶段」;
|
||||
* 无阶段名时退化为纯标题,保证标题行至少可读。
|
||||
*/
|
||||
const titleLine = computed(() => {
|
||||
const stage = currentStageName.value;
|
||||
if (isWaitingHuman.value) {
|
||||
const waitingHuman = t('chat.shippingOrderReview.currentTask.statusWaitingHuman');
|
||||
return stage && stage !== '—' ? `${waitingHuman} · ${stage}` : waitingHuman;
|
||||
}
|
||||
if (isAutomating.value) {
|
||||
const withStage = te('chat.shippingProcessing.progress.systemProcessingWithStage');
|
||||
if (withStage && stage && stage !== '—') {
|
||||
@@ -170,7 +183,7 @@ function nodeShortLabel(stage: string): string {
|
||||
{{ t('chat.shippingProcessing.progress.currentStage', { stage: currentStageName }) }}
|
||||
</span>
|
||||
<span
|
||||
v-if="polling"
|
||||
v-if="polling && !isWaitingHuman"
|
||||
class="ml-2 text-[11px] font-normal text-muted"
|
||||
data-testid="review-workflow-progress-polling"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user