From 08dc5e3730284c5bdfcd05613a006a54cd3e55d1 Mon Sep 17 00:00:00 2001 From: wanghao Date: Fri, 14 Nov 2025 13:31:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(wms):=20=E5=87=BA=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E4=B8=BB=E5=AD=90=E8=A1=A8=E5=A2=9E=E5=8A=A0=EF=BC=8C=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E9=80=89=E4=B8=AD=E7=89=A9=E6=96=99=E8=AE=A1=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/outStockBill/types.ts | 6 - src/api/wms/outStockDetails/index.ts | 16 +- src/api/wms/warehouseInfo/types.ts | 6 +- src/api/wms/wmsBaseProduct/index.ts | 12 +- src/api/wms/wmsBaseProduct/types.ts | 16 +- src/components/WmsInventorySelect/index.vue | 76 ++++---- src/components/WmsProductSelect/index.vue | 20 +-- src/views/wms/inStockBill/index.vue | 24 +-- src/views/wms/inventoryDetails/index.vue | 14 +- src/views/wms/inventoryDetails/indexCount.vue | 14 +- src/views/wms/outStockBill/index.vue | 167 +++++++++++++++--- src/views/wms/wmsBaseProduct/index.vue | 36 ++-- 12 files changed, 273 insertions(+), 134 deletions(-) diff --git a/src/api/wms/outStockBill/types.ts b/src/api/wms/outStockBill/types.ts index 599861a..9e92381 100644 --- a/src/api/wms/outStockBill/types.ts +++ b/src/api/wms/outStockBill/types.ts @@ -93,7 +93,6 @@ export interface OutStockBillVO { * 更新时间 */ updateTime: string; - } export interface OutStockBillForm extends BaseEntity { @@ -147,11 +146,9 @@ export interface OutStockBillForm extends BaseEntity { * 出库(单状态1暂存 2审批中 3完成) */ outStockBillStatus?: string; - } export interface OutStockBillQuery extends PageQuery { - /** * 出库单类型 */ @@ -192,6 +189,3 @@ export interface OutStockBillQuery extends PageQuery { */ params?: any; } - - - diff --git a/src/api/wms/outStockDetails/index.ts b/src/api/wms/outStockDetails/index.ts index 3ff0c04..45f5372 100644 --- a/src/api/wms/outStockDetails/index.ts +++ b/src/api/wms/outStockDetails/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { OutStockDetailsVO, OutStockDetailsForm, OutStockDetailsQuery } from '@/api/wms/outStockDetails/types'; +import { OutStockDetailsForm, OutStockDetailsQuery, OutStockDetailsVO } from '@/api/wms/outStockDetails/types'; /** * 查询出库单明细列表 @@ -67,10 +67,10 @@ export const delOutStockDetails = (outStockDetailsId: string | number | Array => { @@ -28,7 +28,7 @@ export const getWmsBaseProduct = (productId: string | number): AxiosPromise { @@ -40,7 +40,7 @@ export const addWmsBaseProduct = (data: WmsBaseProductForm) => { }; /** - * 修改海威成品信息 + * 修改海威物料信息 * @param data */ export const updateWmsBaseProduct = (data: WmsBaseProductForm) => { @@ -52,7 +52,7 @@ export const updateWmsBaseProduct = (data: WmsBaseProductForm) => { }; /** - * 删除海威成品信息 + * 删除海威物料信息 * @param productId */ export const delWmsBaseProduct = (productId: string | number | Array) => { @@ -63,7 +63,7 @@ export const delWmsBaseProduct = (productId: string | number | Array - + + - - - + + + @@ -102,13 +103,16 @@ interface PropType { modelValue?: InventoryDetailsVO[] | InventoryDetailsVO | undefined; multiple?: boolean; data?: string | number | (string | number)[] | undefined; + warehouseId?: string | number; } const prop = withDefaults(defineProps(), { multiple: true, modelValue: undefined, - data: undefined + data: undefined, + warehouseId: undefined }); + const emit = defineEmits(['update:modelValue', 'confirmCallBack']); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -199,32 +203,6 @@ const handleQuery = () => { getList(); }; -/** 重置按钮操作 */ -const resetQuery = () => { - queryFormRef.value?.resetFields(); - queryParams.value.pageNum = 1; - queryParams.value.productName = undefined; - queryParams.value.productCode = undefined; - queryParams.value.warehouseId = undefined; - queryParams.value.batchNumber = undefined; - handleQuery(); -}; - -const handleCheckboxChange = (checked) => { - if (!prop.multiple && checked.checked) { - tableRef.value?.setCheckboxRow(selectInventoryList.value, false); - selectInventoryList.value = []; - } - const row = checked.row; - if (checked.checked) { - selectInventoryList.value.push(row); - } else { - selectInventoryList.value = selectInventoryList.value.filter((item) => { - return item.inventoryDetailsId !== row.inventoryDetailsId; - }); - } -}; - const handleCheckboxAll = (checked) => { const rows = inventoryDetailsList.value; if (checked.checked) { @@ -265,22 +243,58 @@ const initSelectInventory = async () => { const close = () => { inventoryDialog.closeDialog(); }; +// ... existing code ... +/** 重置按钮操作 */ +const resetQuery = () => { + queryFormRef.value?.resetFields(); + queryParams.value.pageNum = 1; + queryParams.value.productName = undefined; + queryParams.value.productCode = undefined; + // 不重置仓库ID,保留传入的筛选条件 + if (!prop.warehouseId) { + queryParams.value.warehouseId = undefined; + } + queryParams.value.batchNumber = undefined; + handleQuery(); +}; + +const handleCheckboxChange = (checked) => { + if (!prop.multiple && checked.checked) { + tableRef.value?.setCheckboxRow(selectInventoryList.value, false); + selectInventoryList.value = []; + } + const row = checked.row; + if (checked.checked) { + selectInventoryList.value.push(row); + } else { + selectInventoryList.value = selectInventoryList.value.filter((item) => { + return item.inventoryDetailsId !== row.inventoryDetailsId; + }); + } +}; +// ... existing code ... watch( () => inventoryDialog.visible.value, async (newValue: boolean) => { if (newValue) { + // 重新设置仓库ID筛选条件 + if (prop.warehouseId) { + queryParams.value.warehouseId = prop.warehouseId; + } await getList(); await getWarehouseList(); await initSelectInventory(); } else { tableRef.value?.clearCheckboxReserve(); tableRef.value?.clearCheckboxRow(); + // 修改重置逻辑,保留传入的仓库ID resetQuery(); selectInventoryList.value = []; } } ); +// ... existing code ... defineExpose({ open: inventoryDialog.openDialog, diff --git a/src/components/WmsProductSelect/index.vue b/src/components/WmsProductSelect/index.vue index 8f3d1d3..40876bd 100644 --- a/src/components/WmsProductSelect/index.vue +++ b/src/components/WmsProductSelect/index.vue @@ -7,11 +7,11 @@
- - + + - - + + @@ -47,9 +47,9 @@ @checkbox-change="handleCheckboxChange" > - - - + + + @@ -113,7 +113,7 @@ const queryFormRef = ref(); const tableRef = ref>(); const productDialog = useDialog({ - title: '成品选择' + title: '物料选择' }); const queryParams = ref({ @@ -149,7 +149,7 @@ const computedIds = (data) => { } }; -/** 查询成品信息列表 */ +/** 查询物料信息列表 */ const getList = async () => { loading.value = true; try { @@ -157,7 +157,7 @@ const getList = async () => { wmsBaseProductList.value = res.rows; total.value = res.total; } catch (error) { - console.error('查询成品列表失败:', error); + console.error('查询物料列表失败:', error); } finally { loading.value = false; } diff --git a/src/views/wms/inStockBill/index.vue b/src/views/wms/inStockBill/index.vue index b8c4339..4bc943a 100644 --- a/src/views/wms/inStockBill/index.vue +++ b/src/views/wms/inStockBill/index.vue @@ -221,9 +221,9 @@

已选择的物料:

- - - + + + - - + + + + - @@ -232,23 +249,53 @@

已选择的物料:

- - - - - - + + + + + + + + + + + + + + +
- +
@@ -256,12 +303,14 @@