feat(shipping-notice): 优化货运订单履约流程与用户体验

- 优化聊天附件列表为横向可滚动布局并新增配套测试用例
- 移除自动填充默认用户消息逻辑,空备注时不再伪造默认正文
- 修复流程Gate动作展示逻辑,隐藏历史遗留操作与自动阶段无效按钮
- 完善库存匹配重试与订单快照冻结校验流程
- 优化进度展示优先级,优先显示人工待处理状态
- 移除Excel导出自动推导金额逻辑,强制使用Schema配置字段
- 新增货代通用报表RPA详细设计文档
- 更新相关测试用例与断言逻辑
This commit is contained in:
hugo committed 2026-08-13 00:17:01 +08:00
1 parent dc282f3b1d
commit 11cef575b4
51 files changed
+2197 -112

No files matched your search

@@ -103,6 +103,46 @@ const attachmentUrlInputRef = ref<HTMLInputElement | null>(null);
const showAttachmentMenu = ref(false);
const showAttachmentUrlPanel = ref(false);
const attachmentUrlInput = ref('');
const attachmentScrollerRef = ref<HTMLElement | null>(null);
const attachmentCanScrollLeft = ref(false);
const attachmentCanScrollRight = ref(false);
let attachmentDragStartX = 0;
let attachmentDragScrollLeft = 0;
let attachmentDragging = false;
/** 同步附件横向带的左右可滚动状态,供箭头按钮和无障碍状态使用。 */
function updateAttachmentScrollState() {
const element = attachmentScrollerRef.value;
if (!element) return;
attachmentCanScrollLeft.value = element.scrollLeft > 1;
attachmentCanScrollRight.value = element.scrollLeft + element.clientWidth < element.scrollWidth - 1;
}
/** 按固定步长移动附件横向带,避免大量附件撑高输入区。 */
function scrollAttachments(direction: 'left' | 'right') {
attachmentScrollerRef.value?.scrollBy({ left: direction === 'left' ? -320 : 320, behavior: 'smooth' });
}
/** 开始桌面端指针拖拽;触摸端交给原生横向滚动,避免手势冲突。 */
function startAttachmentDrag(event: PointerEvent) {
const element = attachmentScrollerRef.value;
if (!element || event.pointerType === 'touch') return;
attachmentDragging = true;
attachmentDragStartX = event.clientX;
attachmentDragScrollLeft = element.scrollLeft;
element.setPointerCapture?.(event.pointerId);
}
/** 根据指针位移更新附件横向滚动位置。 */
function moveAttachmentDrag(event: PointerEvent) {
if (!attachmentDragging || !attachmentScrollerRef.value) return;
attachmentScrollerRef.value.scrollLeft = attachmentDragScrollLeft - (event.clientX - attachmentDragStartX);
}
/** 结束附件横向拖拽并恢复普通指针状态。 */
function stopAttachmentDrag() {
attachmentDragging = false;
}
/** 当前发货通知是否仍在上传或预解析,决定输入框下方的操作提示。 */
const hasShippingNoticeInProgress = computed(() => props.attachments.some(
@@ -321,11 +361,14 @@ const handleDocumentPointerDown = (event: MouseEvent | TouchEvent) => {
};
onMounted(() => {
nextTick(updateAttachmentScrollState);
window.addEventListener('resize', updateAttachmentScrollState);
document.addEventListener('mousedown', handleDocumentPointerDown);
document.addEventListener('touchstart', handleDocumentPointerDown, { passive: true });
});
onBeforeUnmount(() => {
window.removeEventListener('resize', updateAttachmentScrollState);
document.removeEventListener('mousedown', handleDocumentPointerDown);
document.removeEventListener('touchstart', handleDocumentPointerDown);
});
@@ -416,12 +459,24 @@ watch(
<div
v-if="attachments.length > 0"
data-testid="chat-attachment-list"
class="flex flex-wrap gap-2 px-2.5 pb-2 pt-1"
class="relative flex items-center gap-1 px-2.5 pb-2 pt-1"
>
<button v-if="attachmentCanScrollLeft" type="button" class="z-10 shrink-0 rounded-full border border-default bg-surface p-1 text-muted shadow-sm" aria-label="向左查看附件" @click="scrollAttachments('left')">‹</button>
<div
ref="attachmentScrollerRef"
class="flex min-w-0 flex-1 flex-nowrap gap-2 overflow-x-auto pb-1 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
:class="attachmentDragging ? 'cursor-grabbing select-none' : 'cursor-grab'"
@scroll="updateAttachmentScrollState"
@pointerdown="startAttachmentDrag"
@pointermove="moveAttachmentDrag"
@pointerup="stopAttachmentDrag"
@pointercancel="stopAttachmentDrag"
@pointerleave="stopAttachmentDrag"
>
<article
v-for="a in attachments"
:key="a.id"
class="group relative flex min-w-0 basis-full items-center gap-3 rounded-xl px-3 py-2.5 transition-colors sm:basis-[calc(50%-0.25rem)] lg:max-w-[310px]"
class="group relative flex h-[68px] w-[250px] shrink-0 items-center gap-3 rounded-xl px-3 py-2.5 transition-colors"
:class="isProcurementContractAgent && a.kind === 'local'
? 'border border-[#9cc7f2] bg-[#eef6ff]'
: 'border border-default bg-surface-soft'"
@@ -522,6 +577,8 @@ watch(
<X class="h-3.5 w-3.5" />
</button>
</article>
</div>
<button v-if="attachmentCanScrollRight" type="button" class="z-10 shrink-0 rounded-full border border-default bg-surface p-1 text-muted shadow-sm" aria-label="向右查看附件" @click="scrollAttachments('right')">›</button>
</div>
<input