From 55cb175f5a8862586e9fed83466bd7c5c7557c5c Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 8 Apr 2026 09:56:32 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(select):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=89=B9=E6=AC=A1=E5=92=8C=E4=BB=93=E5=BA=93=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mes/wm/materialStock/index.ts | 1 + .../task/components/ProTaskSelectDialog.vue | 2 - .../components/QcIndicatorSelectDialog.vue | 2 - .../WmArrivalNoticeLineSelectDialog.vue | 3 - .../mes/wm/batch/components/WmBatchSelect.vue | 14 +++-- .../batch/components/WmBatchSelectDialog.vue | 32 +++++++++-- .../components/WmMaterialStockSelect.vue | 20 +++++-- .../WmMaterialStockSelectDialog.vue | 57 ++++++++++++++++--- .../productreceipt/ProductReceiptLineList.vue | 1 + .../productsales/ProductSalesDetailForm.vue | 1 + .../mes/wm/returnsales/ReturnSalesForm.vue | 1 + .../wm/returnsales/ReturnSalesLineList.vue | 2 + 12 files changed, 105 insertions(+), 31 deletions(-) diff --git a/src/api/mes/wm/materialStock/index.ts b/src/api/mes/wm/materialStock/index.ts index 9368f2de2..4214dbebe 100644 --- a/src/api/mes/wm/materialStock/index.ts +++ b/src/api/mes/wm/materialStock/index.ts @@ -12,6 +12,7 @@ export interface WmMaterialStockVO { batchId: number batchCode: string warehouseId: number + warehouseCode: string warehouseName: string locationId: number locationName: string diff --git a/src/views/mes/pro/task/components/ProTaskSelectDialog.vue b/src/views/mes/pro/task/components/ProTaskSelectDialog.vue index 4e6a8ebc9..95aef4f24 100644 --- a/src/views/mes/pro/task/components/ProTaskSelectDialog.vue +++ b/src/views/mes/pro/task/components/ProTaskSelectDialog.vue @@ -1,8 +1,6 @@ - + + @@ -155,9 +166,13 @@ const props = withDefaults( defineProps<{ multiple?: boolean // true 多选(checkbox),false 单选(radio) itemId?: number // 按物料 ID 过滤 + batchId?: number // 按批次 ID 过滤 + warehouseId?: number // 按仓库 ID 过滤 + excludeVirtual?: boolean // 是否排除虚拟线边仓库存(默认 true) }>(), { - multiple: true + multiple: true, + excludeVirtual: true } ) @@ -227,6 +242,7 @@ const queryParams = reactive({ itemId: undefined as number | undefined, // 物料编号 vendorId: undefined as number | undefined, // 供应商编号 batchCode: undefined as string | undefined, // 批次号 + batchId: undefined as number | undefined, // 批次 ID warehouseId: undefined as number | undefined, // 仓库编号 locationId: undefined as number | undefined, // 库区编号 areaId: undefined as number | undefined, // 库位编号 @@ -249,7 +265,14 @@ const getList = async () => { loading.value = true try { const data = await WmMaterialStockApi.getMaterialStockPage(queryParams) - list.value = data.list + // 前端过滤虚拟线边仓(非虚拟仓查询时排除 warehouseCode 含 WIP_VIRTUAL 的记录) + if (props.excludeVirtual) { + list.value = data.list.filter( + (row: WmMaterialStockVO) => !row.warehouseCode?.includes('WIP_VIRTUAL') + ) + } else { + list.value = data.list + } total.value = data.total await nextTick() applyPreSelection() @@ -294,7 +317,8 @@ const resetQuery = () => { queryParams.itemId = props.itemId // 保持 props 传入的物料过滤 queryParams.vendorId = undefined queryParams.batchCode = undefined - queryParams.warehouseId = undefined + queryParams.batchId = props.batchId // 保持 props 传入的批次过滤 + queryParams.warehouseId = props.warehouseId // 保持 props 传入的仓库过滤 queryParams.locationId = undefined queryParams.areaId = undefined typeTreeRef.value?.reset() @@ -328,12 +352,13 @@ const open = async (selectedIds?: number[]) => { queryParams.itemTypeId = undefined queryParams.vendorId = undefined queryParams.batchCode = undefined - queryParams.warehouseId = undefined queryParams.locationId = undefined queryParams.areaId = undefined queryParams.pageNo = 1 - // 固定 itemId 过滤条件(从 props 传入) + // 固定过滤条件(从 props 传入) queryParams.itemId = props.itemId + queryParams.batchId = props.batchId + queryParams.warehouseId = props.warehouseId // 默认只查未冻结 queryParams.frozen = false // 重置分类树(清高亮 + 清搜索词) @@ -349,6 +374,22 @@ const open = async (selectedIds?: number[]) => { await getList() } defineExpose({ open }) + +// ==================== 预过滤提示 ==================== + +/** 拼装 el-alert 提示文字 */ +const alertTitle = computed(() => { + const parts: string[] = [] + if (props.batchId != null) parts.push('批次') + if (props.warehouseId != null) parts.push('仓库') + if (props.excludeVirtual) parts.push('排除虚拟仓') + return `已按${parts.join('/')}预过滤` +}) + +/** 是否显示 alert 提示 */ +const showAlert = computed(() => { + return props.batchId != null || props.warehouseId != null +})