From b3942bb8ff772f14cec9bc045a348ee9d1271bd2 Mon Sep 17 00:00:00 2001 From: nehc <934298133@qq.com> Date: Mon, 28 Jul 2025 14:45:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(@vben/web-antd):=20erp-=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -移除了 stock API 中的 getStockCountByProductId 函数 -将 getStockCount 函数的使用范围从 product 模块扩展到 purchase 模块 - 更新了 PurchaseOrderItemForm 组件中的库存查询逻辑 --- apps/web-antd/src/api/erp/stock/stock/index.ts | 9 --------- .../erp/purchase/order/modules/PurchaseOrderItemForm.vue | 4 ++-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/apps/web-antd/src/api/erp/stock/stock/index.ts b/apps/web-antd/src/api/erp/stock/stock/index.ts index 2d33726ae..57d4ec229 100644 --- a/apps/web-antd/src/api/erp/stock/stock/index.ts +++ b/apps/web-antd/src/api/erp/stock/stock/index.ts @@ -60,15 +60,6 @@ export function getStockCount(productId: number) { }); } -/** - * 根据产品ID获得库存数量 - */ -export function getStockCountByProductId(productId: number) { - return requestClient.get('/erp/stock/get-count', { - params: { productId }, - }); -} - /** * 导出产品库存 Excel */ diff --git a/apps/web-antd/src/views/erp/purchase/order/modules/PurchaseOrderItemForm.vue b/apps/web-antd/src/views/erp/purchase/order/modules/PurchaseOrderItemForm.vue index 03beaa534..7eae56d17 100644 --- a/apps/web-antd/src/views/erp/purchase/order/modules/PurchaseOrderItemForm.vue +++ b/apps/web-antd/src/views/erp/purchase/order/modules/PurchaseOrderItemForm.vue @@ -9,7 +9,7 @@ import { Input, InputNumber, Select } from 'ant-design-vue'; import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { getProductSimpleList } from '#/api/erp/product/product'; -import { getStockCountByProductId } from '#/api/erp/stock/stock'; +import { getStockCount } from '#/api/erp/stock/stock'; import { usePurchaseOrderItemTableColumns } from '../data'; @@ -142,7 +142,7 @@ async function handleProductChange(productId: any, row: any) { return; } - const stockCount = await getStockCountByProductId(productId); + const stockCount = await getStockCount(productId); row.productId = productId; row.productUnitId = product.unitId;