feat(shipping-notice): 人工重取库存前置候选刷新并放开行级库存源下拉
- 人工重试库存准备前置幂等重判:任务级整单重路由、行级定向重评目标行,复用裁决与冻结链路,零新动作码零契约变更 - 新版候选集 supersede 时内置失效旧库存事实,导出归档与查询服务同步适配 - 行级「库存源」下拉抽纯函数合并选项:歧义行候选置顶 + 全部已启用源去重兜底,任一已启用源可人工指定 - 库存源门禁归一 Notice→OT 身份解析;任务中心抽屉与表格接入行级重取入口 - 同步四语言文案、技术文档与实施计划
This commit is contained in:
1 parent
e38e5a63fe
commit
ea94fb28db
35 files changed
+2675
-83
No files matched your search
+2
@@ -147,6 +147,8 @@ function notice(businessNo: string, poNumber: string, partNumber: string) {
|
||||
id: Number(businessNo.slice(-2)), task_no: `SN-${businessNo}`, business_no: businessNo,
|
||||
item_kind: 'task', todo_ref: `SN-${businessNo}`, source_type: 'post_ot_fulfillment_wave',
|
||||
po_number: poNumber, customer_name: 'Customer', upload_status: 'pending',
|
||||
// 后端 SUMMARY 契约:下载能力与导出端点同一谓词(创建者或管理员)。
|
||||
can_download_export: true,
|
||||
ui_state: { stage: { code: 'freight_upload', label: '货代上传' }, lifecycle_entries: [] },
|
||||
notice_line_summary: [
|
||||
{ line_no: '10', part_number: partNumber, shipment_qty: '4', available_qty: '9' },
|
||||
|
||||
@@ -38,7 +38,7 @@ import { useShippingTodoBadge } from '../composables/useShippingTodoBadge';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import {
|
||||
isFreightUploadRow,
|
||||
isBatchDownloadableRow,
|
||||
lifecycleStageCodeOf,
|
||||
todoItemKey,
|
||||
type LifecycleStageCode,
|
||||
@@ -134,8 +134,8 @@ const filteredTasks = computed(() => (
|
||||
? tasks.value
|
||||
: tasks.value.filter((item) => lifecycleStageCodeOf(item) === lifecycleStageFilter.value)
|
||||
));
|
||||
/** 批量可选行:货代上传阶段的正式 Notice(业务约束:批量仅该阶段可用)。 */
|
||||
const selectableRows = computed(() => filteredTasks.value.filter((item) => isFreightUploadRow(item)));
|
||||
/** 批量可选行:货代上传阶段的正式 Notice 且当前用户可下载(与批量导出端点同口径)。 */
|
||||
const selectableRows = computed(() => filteredTasks.value.filter((item) => isBatchDownloadableRow(item)));
|
||||
const selectedBusinessNoSet = computed(() => new Set(selectedBusinessNos.value));
|
||||
|
||||
/** 当前桶是否为通知完成明细报表视图。 */
|
||||
@@ -366,7 +366,7 @@ async function loadTodos(resetPage = false, options?: { silent?: boolean }) {
|
||||
tasks.value = result.items || [];
|
||||
const visibleBusinessNos = new Set(
|
||||
tasks.value
|
||||
.filter((item) => isFreightUploadRow(item))
|
||||
.filter((item) => isBatchDownloadableRow(item))
|
||||
.map((item) => String(item.business_no || '').trim()),
|
||||
);
|
||||
selectedBusinessNos.value = selectedBusinessNos.value.filter((value) => visibleBusinessNos.has(value));
|
||||
|
||||
@@ -137,6 +137,9 @@ const exportFileName = computed(() => String(
|
||||
props.item?.artifact_summary?.export_file_name || '',
|
||||
));
|
||||
|
||||
/** 下载能力由后端统一谓词下发(创建者或管理员);缺失按不可下载处理。 */
|
||||
const canDownloadExport = computed(() => props.item?.can_download_export === true);
|
||||
|
||||
const lineRows = computed(() => {
|
||||
const item = props.item as ShippingTaskSummary | null;
|
||||
return Array.isArray(item?.notice_line_summary) ? item!.notice_line_summary : [];
|
||||
@@ -376,7 +379,7 @@ onBeforeUnmount(() => document.removeEventListener('keydown', onEsc));
|
||||
{{ $t('chat.shippingOrderReview.autoProgress.retryStp') }}
|
||||
</button>
|
||||
<a
|
||||
v-if="exportFileName"
|
||||
v-if="exportFileName && canDownloadExport"
|
||||
class="inline-flex cursor-pointer items-center gap-1 text-xs text-brand-700 hover:underline"
|
||||
:href="`/api/workspace/shipping-notices/${encodeURIComponent(String(item.business_no || ''))}/export`"
|
||||
target="_blank"
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { CheckSquare, Download, Upload, X } from 'lucide-vue-next';
|
||||
import type { ShippingTaskSummary } from '@/features/chat/api/shipping.api';
|
||||
import {
|
||||
isFreightUploadRow,
|
||||
isBatchDownloadableRow,
|
||||
lifecycleStageCodeOf,
|
||||
todoBlockerText,
|
||||
todoDisplayNo,
|
||||
@@ -46,7 +46,8 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const selectedSet = computed(() => new Set(props.selectedBusinessNos || []));
|
||||
const selectableRows = computed(() => props.items.filter((item) => isFreightUploadRow(item)));
|
||||
/** 复选框与全选状态消费同一可下载谓词,保证"能勾的都能下单成功"。 */
|
||||
const selectableRows = computed(() => props.items.filter((item) => isBatchDownloadableRow(item)));
|
||||
const hasSelection = computed(() => (props.selectedBusinessNos?.length || 0) > 0);
|
||||
const allSelectableChecked = computed(() => (
|
||||
selectableRows.value.length > 0
|
||||
@@ -158,7 +159,7 @@ function onToggleAll(): void {
|
||||
>
|
||||
<td v-if="selectable" class="px-3 py-2.5 align-middle">
|
||||
<input
|
||||
v-if="isFreightUploadRow(item)"
|
||||
v-if="isBatchDownloadableRow(item)"
|
||||
type="checkbox"
|
||||
:checked="selectedSet.has(String(item.business_no))"
|
||||
:aria-label="String(item.business_no)"
|
||||
|
||||
@@ -172,3 +172,12 @@ export function isFreightUploadRow(item: ShippingTaskSummary): boolean {
|
||||
return Boolean(String(item.business_no || '').trim())
|
||||
&& lifecycleStageCodeOf(item) === 'freight_upload';
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量可下载行:在上传阶段约束之上叠加下载授权谓词字段(创建者或管理员)。
|
||||
* 核心逻辑:与后端 /shipping-notices/batch/export 同一口径,无权行不可勾选,
|
||||
* 避免"勾了下单却整体 404"的体验;字段缺失(异常路径)按不可下载处理。
|
||||
*/
|
||||
export function isBatchDownloadableRow(item: ShippingTaskSummary): boolean {
|
||||
return isFreightUploadRow(item) && item.can_download_export === true;
|
||||
}
|
||||
Reference in new issue
Block a user