From 008f7cdbbf5c897b4359e8a49d887a1bfafe7945 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 16 Nov 2025 16:29:15 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E3=80=90ele=E3=80=91=E3=80=90erp?= =?UTF-8?q?=E3=80=91stock=20=E7=9A=84=E8=BF=81=E7=A7=BB=EF=BC=8810%?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/api/erp/stock/check/index.ts | 43 +-- apps/web-antd/src/api/erp/stock/in/index.ts | 39 +-- apps/web-antd/src/api/erp/stock/move/index.ts | 38 +- apps/web-antd/src/api/erp/stock/out/index.ts | 39 +-- .../src/api/erp/stock/record/index.ts | 20 +- .../web-antd/src/api/erp/stock/stock/index.ts | 48 +-- .../src/api/erp/stock/warehouse/index.ts | 10 +- apps/web-ele/src/api/erp/stock/check/index.ts | 87 +++++ apps/web-ele/src/api/erp/stock/in/index.ts | 86 +++++ apps/web-ele/src/api/erp/stock/move/index.ts | 87 +++++ apps/web-ele/src/api/erp/stock/out/index.ts | 85 +++++ .../web-ele/src/api/erp/stock/record/index.ts | 31 ++ apps/web-ele/src/api/erp/stock/stock/index.ts | 51 +++ .../src/api/erp/stock/warehouse/index.ts | 71 ++++ .../web-ele/src/views/erp/stock/check/data.ts | 305 ++++++++++++++++ .../src/views/erp/stock/check/index.vue | 215 ++++++++++++ .../views/erp/stock/check/modules/form.vue | 132 +++++++ .../erp/stock/check/modules/item-form.vue | 313 +++++++++++++++++ apps/web-ele/src/views/erp/stock/in/data.ts | 330 ++++++++++++++++++ apps/web-ele/src/views/erp/stock/in/index.vue | 212 +++++++++++ .../src/views/erp/stock/in/modules/form.vue | 128 +++++++ .../views/erp/stock/in/modules/item-form.vue | 302 ++++++++++++++++ apps/web-ele/src/views/erp/stock/move/data.ts | 316 +++++++++++++++++ .../src/views/erp/stock/move/index.vue | 215 ++++++++++++ .../src/views/erp/stock/move/modules/form.vue | 132 +++++++ .../erp/stock/move/modules/item-form.vue | 323 +++++++++++++++++ apps/web-ele/src/views/erp/stock/out/data.ts | 330 ++++++++++++++++++ .../web-ele/src/views/erp/stock/out/index.vue | 215 ++++++++++++ .../src/views/erp/stock/out/modules/form.vue | 132 +++++++ .../views/erp/stock/out/modules/item-form.vue | 300 ++++++++++++++++ .../src/views/erp/stock/record/data.ts | 133 +++++++ .../src/views/erp/stock/record/index.vue | 79 +++++ .../web-ele/src/views/erp/stock/stock/data.ts | 69 ++++ .../src/views/erp/stock/stock/index.vue | 79 +++++ .../src/views/erp/stock/warehouse/data.ts | 209 +++++++++++ .../src/views/erp/stock/warehouse/index.vue | 178 ++++++++++ .../erp/stock/warehouse/modules/form.vue | 88 +++++ 37 files changed, 5282 insertions(+), 188 deletions(-) create mode 100644 apps/web-ele/src/api/erp/stock/check/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/in/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/move/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/out/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/record/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/stock/index.ts create mode 100644 apps/web-ele/src/api/erp/stock/warehouse/index.ts create mode 100644 apps/web-ele/src/views/erp/stock/check/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/check/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/check/modules/form.vue create mode 100644 apps/web-ele/src/views/erp/stock/check/modules/item-form.vue create mode 100644 apps/web-ele/src/views/erp/stock/in/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/in/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/in/modules/form.vue create mode 100644 apps/web-ele/src/views/erp/stock/in/modules/item-form.vue create mode 100644 apps/web-ele/src/views/erp/stock/move/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/move/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/move/modules/form.vue create mode 100644 apps/web-ele/src/views/erp/stock/move/modules/item-form.vue create mode 100644 apps/web-ele/src/views/erp/stock/out/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/out/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/out/modules/form.vue create mode 100644 apps/web-ele/src/views/erp/stock/out/modules/item-form.vue create mode 100644 apps/web-ele/src/views/erp/stock/record/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/record/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/stock/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/stock/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/warehouse/data.ts create mode 100644 apps/web-ele/src/views/erp/stock/warehouse/index.vue create mode 100644 apps/web-ele/src/views/erp/stock/warehouse/modules/form.vue diff --git a/apps/web-antd/src/api/erp/stock/check/index.ts b/apps/web-antd/src/api/erp/stock/check/index.ts index 386948432..b6f9d0bea 100644 --- a/apps/web-antd/src/api/erp/stock/check/index.ts +++ b/apps/web-antd/src/api/erp/stock/check/index.ts @@ -18,6 +18,7 @@ export namespace ErpStockCheckApi { items?: StockCheckItem[]; // 盘点产品清单 } + /** 库存盘点项 */ export interface StockCheckItem { id?: number; // 编号 warehouseId?: number; // 仓库编号 @@ -33,20 +34,10 @@ export namespace ErpStockCheckApi { stockCount?: number; // 账面库存 remark?: string; // 备注 } - - /** 库存盘点单分页查询参数 */ - export interface StockCheckPageParams extends PageParam { - no?: string; - status?: number; - } } -/** - * 查询库存盘点单分页 - */ -export function getStockCheckPage( - params: ErpStockCheckApi.StockCheckPageParams, -) { +/** 查询库存盘点单分页 */ +export function getStockCheckPage(params: PageParam) { return requestClient.get>( '/erp/stock-check/page', { @@ -55,41 +46,31 @@ export function getStockCheckPage( ); } -/** - * 查询库存盘点单详情 - */ +/** 查询库存盘点单详情 */ export function getStockCheck(id: number) { return requestClient.get( `/erp/stock-check/get?id=${id}`, ); } -/** - * 新增库存盘点单 - */ +/** 新增库存盘点单 */ export function createStockCheck(data: ErpStockCheckApi.StockCheck) { return requestClient.post('/erp/stock-check/create', data); } -/** - * 修改库存盘点单 - */ +/** 修改库存盘点单 */ export function updateStockCheck(data: ErpStockCheckApi.StockCheck) { return requestClient.put('/erp/stock-check/update', data); } -/** - * 更新库存盘点单的状态 - */ +/** 更新库存盘点单的状态 */ export function updateStockCheckStatus(id: number, status: number) { return requestClient.put('/erp/stock-check/update-status', null, { params: { id, status }, }); } -/** - * 删除库存盘点单 - */ +/** 删除库存盘点 */ export function deleteStockCheck(ids: number[]) { return requestClient.delete('/erp/stock-check/delete', { params: { @@ -98,12 +79,8 @@ export function deleteStockCheck(ids: number[]) { }); } -/** - * 导出库存盘点单 Excel - */ -export function exportStockCheck( - params: ErpStockCheckApi.StockCheckPageParams, -) { +/** 导出库存盘点单 Excel */ +export function exportStockCheck(params: any) { return requestClient.download('/erp/stock-check/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/stock/in/index.ts b/apps/web-antd/src/api/erp/stock/in/index.ts index 18e109314..e68c05b36 100644 --- a/apps/web-antd/src/api/erp/stock/in/index.ts +++ b/apps/web-antd/src/api/erp/stock/in/index.ts @@ -35,19 +35,10 @@ export namespace ErpStockInApi { stockCount?: number; // 库存数量 remark?: string; // 备注 } - - /** 其它入库单分页查询参数 */ - export interface StockInPageParams extends PageParam { - no?: string; - supplierId?: number; - status?: number; - } } -/** - * 查询其它入库单分页 - */ -export function getStockInPage(params: ErpStockInApi.StockInPageParams) { +/** 查询其它入库单分页 */ +export function getStockInPage(params: PageParam) { return requestClient.get>( '/erp/stock-in/page', { @@ -56,39 +47,29 @@ export function getStockInPage(params: ErpStockInApi.StockInPageParams) { ); } -/** - * 查询其它入库单详情 - */ +/** 查询其它入库单详情 */ export function getStockIn(id: number) { return requestClient.get(`/erp/stock-in/get?id=${id}`); } -/** - * 新增其它入库单 - */ +/** 新增其它入库单 */ export function createStockIn(data: ErpStockInApi.StockIn) { return requestClient.post('/erp/stock-in/create', data); } -/** - * 修改其它入库单 - */ +/** 修改其它入库单 */ export function updateStockIn(data: ErpStockInApi.StockIn) { return requestClient.put('/erp/stock-in/update', data); } -/** - * 更新其它入库单的状态 - */ +/** 更新其它入库单的状态 */ export function updateStockInStatus(id: number, status: number) { return requestClient.put('/erp/stock-in/update-status', null, { params: { id, status }, }); } -/** - * 删除其它入库单 - */ +/** 删除其它入库单 */ export function deleteStockIn(ids: number[]) { return requestClient.delete('/erp/stock-in/delete', { params: { @@ -97,10 +78,8 @@ export function deleteStockIn(ids: number[]) { }); } -/** - * 导出其它入库单 Excel - */ -export function exportStockIn(params: ErpStockInApi.StockInPageParams) { +/** 导出其它入库单 Excel */ +export function exportStockIn(params: any) { return requestClient.download('/erp/stock-in/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/stock/move/index.ts b/apps/web-antd/src/api/erp/stock/move/index.ts index 04bb46ee4..0120a9b45 100644 --- a/apps/web-antd/src/api/erp/stock/move/index.ts +++ b/apps/web-antd/src/api/erp/stock/move/index.ts @@ -36,18 +36,10 @@ export namespace ErpStockMoveApi { toWarehouseId?: number; // 目标仓库ID totalPrice?: number; // 总价 } - - /** 库存调拨单分页查询参数 */ - export interface StockMovePageParams extends PageParam { - no?: string; - status?: number; - } } -/** - * 查询库存调拨单分页 - */ -export function getStockMovePage(params: ErpStockMoveApi.StockMovePageParams) { +/** 查询库存调拨单分页 */ +export function getStockMovePage(params: PageParam) { return requestClient.get>( '/erp/stock-move/page', { @@ -56,41 +48,31 @@ export function getStockMovePage(params: ErpStockMoveApi.StockMovePageParams) { ); } -/** - * 查询库存调拨单详情 - */ +/** 查询库存调拨单详情 */ export function getStockMove(id: number) { return requestClient.get( `/erp/stock-move/get?id=${id}`, ); } -/** - * 新增库存调拨单 - */ +/** 新增库存调拨单 */ export function createStockMove(data: ErpStockMoveApi.StockMove) { return requestClient.post('/erp/stock-move/create', data); } -/** - * 修改库存调拨单 - */ +/** 修改库存调拨单 */ export function updateStockMove(data: ErpStockMoveApi.StockMove) { return requestClient.put('/erp/stock-move/update', data); } -/** - * 更新库存调拨单的状态 - */ +/** 更新库存调拨单的状态 */ export function updateStockMoveStatus(id: number, status: number) { return requestClient.put('/erp/stock-move/update-status', null, { params: { id, status }, }); } -/** - * 删除库存调拨单 - */ +/** 删除库存调拨单 */ export function deleteStockMove(ids: number[]) { return requestClient.delete('/erp/stock-move/delete', { params: { @@ -99,9 +81,7 @@ export function deleteStockMove(ids: number[]) { }); } -/** - * 导出库存调拨单 Excel - */ -export function exportStockMove(params: ErpStockMoveApi.StockMovePageParams) { +/** 导出库存调拨单 Excel */ +export function exportStockMove(params: any) { return requestClient.download('/erp/stock-move/export-excel', { params }); } diff --git a/apps/web-antd/src/api/erp/stock/out/index.ts b/apps/web-antd/src/api/erp/stock/out/index.ts index 2f64ff867..1ecb89233 100644 --- a/apps/web-antd/src/api/erp/stock/out/index.ts +++ b/apps/web-antd/src/api/erp/stock/out/index.ts @@ -32,19 +32,10 @@ export namespace ErpStockOutApi { stockCount?: number; // 库存数量 remark?: string; // 备注 } - - /** 其它出库单分页查询参数 */ - export interface StockOutPageParams extends PageParam { - no?: string; - customerId?: number; - status?: number; - } } -/** - * 查询其它出库单分页 - */ -export function getStockOutPage(params: ErpStockOutApi.StockOutPageParams) { +/** 查询其它出库单分页 */ +export function getStockOutPage(params: PageParam) { return requestClient.get>( '/erp/stock-out/page', { @@ -53,41 +44,31 @@ export function getStockOutPage(params: ErpStockOutApi.StockOutPageParams) { ); } -/** - * 查询其它出库单详情 - */ +/** 查询其它出库单详情 */ export function getStockOut(id: number) { return requestClient.get( `/erp/stock-out/get?id=${id}`, ); } -/** - * 新增其它出库单 - */ +/** 新增其它出库单 */ export function createStockOut(data: ErpStockOutApi.StockOut) { return requestClient.post('/erp/stock-out/create', data); } -/** - * 修改其它出库单 - */ +/** 修改其它出库单 */ export function updateStockOut(data: ErpStockOutApi.StockOut) { return requestClient.put('/erp/stock-out/update', data); } -/** - * 更新其它出库单的状态 - */ +/** 更新其它出库单的状态 */ export function updateStockOutStatus(id: number, status: number) { return requestClient.put('/erp/stock-out/update-status', null, { params: { id, status }, }); } -/** - * 删除其它出库单 - */ +/** 删除其它出库单 */ export function deleteStockOut(ids: number[]) { return requestClient.delete('/erp/stock-out/delete', { params: { @@ -96,10 +77,8 @@ export function deleteStockOut(ids: number[]) { }); } -/** - * 导出其它出库单 Excel - */ -export function exportStockOut(params: ErpStockOutApi.StockOutPageParams) { +/** 导出其它出库单 Excel */ +export function exportStockOut(params: any) { return requestClient.download('/erp/stock-out/export-excel', { params, }); diff --git a/apps/web-antd/src/api/erp/stock/record/index.ts b/apps/web-antd/src/api/erp/stock/record/index.ts index 364091bfb..30bc9dae0 100644 --- a/apps/web-antd/src/api/erp/stock/record/index.ts +++ b/apps/web-antd/src/api/erp/stock/record/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpStockRecordApi { - /** ERP 产品库存明细 */ + /** 产品库存明细 */ export interface StockRecord { id?: number; // 编号 productId: number; // 产品编号 @@ -15,32 +15,16 @@ export namespace ErpStockRecordApi { bizItemId: number; // 业务项编号 bizNo: string; // 业务单号 } - - /** 库存记录分页查询参数 */ - export interface StockRecordPageParam extends PageParam { - productId?: number; - warehouseId?: number; - bizType?: number; - } } /** 查询产品库存明细分页 */ -export function getStockRecordPage( - params: ErpStockRecordApi.StockRecordPageParam, -) { +export function getStockRecordPage(params: PageParam) { return requestClient.get>( '/erp/stock-record/page', { params }, ); } -/** 查询产品库存明细详情 */ -export function getStockRecord(id: number) { - return requestClient.get( - `/erp/stock-record/get?id=${id}`, - ); -} - /** 导出产品库存明细 Excel */ export function exportStockRecord(params: any) { return requestClient.download('/erp/stock-record/export-excel', { params }); 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 df8aaaa9b..7335c6d34 100644 --- a/apps/web-antd/src/api/erp/stock/stock/index.ts +++ b/apps/web-antd/src/api/erp/stock/stock/index.ts @@ -11,49 +11,21 @@ export namespace ErpStockApi { count: number; // 库存数量 } - /** 产品库存分页查询参数 */ - export interface StockPageParams extends PageParam { - productId?: number; - warehouseId?: number; - } - /** 产品库存查询参数 */ - export interface StockQueryParams { + export interface StockQueryReqVO { productId: number; warehouseId: number; } } -/** - * 查询产品库存分页 - */ -export function getStockPage(params: ErpStockApi.StockPageParams) { +/** 查询产品库存分页 */ +export function getStockPage(params: PageParam) { return requestClient.get>('/erp/stock/page', { params, }); } -/** - * 查询产品库存详情 - */ -export function getStock(id: number) { - return requestClient.get(`/erp/stock/get?id=${id}`); -} - -/** - * 根据产品和仓库查询库存详情 - */ -export function getStockByProductAndWarehouse( - params: ErpStockApi.StockQueryParams, -) { - return requestClient.get('/erp/stock/get', { - params, - }); -} - -/** - * 获得产品库存数量 - */ +/** 获得产品库存数量 */ export function getStockCount(productId: number, warehouseId?: number) { const params: any = { productId }; if (warehouseId !== undefined) { @@ -64,19 +36,15 @@ export function getStockCount(productId: number, warehouseId?: number) { }); } -/** - * 导出产品库存 Excel - */ -export function exportStock(params: ErpStockApi.StockPageParams) { +/** 导出产品库存 Excel */ +export function exportStock(params: any) { return requestClient.download('/erp/stock/export-excel', { params, }); } -/** - * 获取库存数量 - */ -export function getWarehouseStockCount(params: ErpStockApi.StockQueryParams) { +/** 获取库存数量 */ +export function getWarehouseStockCount(params: ErpStockApi.StockQueryReqVO) { return requestClient.get('/erp/stock/get-count', { params, }); diff --git a/apps/web-antd/src/api/erp/stock/warehouse/index.ts b/apps/web-antd/src/api/erp/stock/warehouse/index.ts index a1cac8ead..e5d6e1a49 100644 --- a/apps/web-antd/src/api/erp/stock/warehouse/index.ts +++ b/apps/web-antd/src/api/erp/stock/warehouse/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpWarehouseApi { - /** ERP 仓库信息 */ + /** 仓库信息 */ export interface Warehouse { id?: number; // 仓库编号 name: string; // 仓库名称 @@ -16,16 +16,10 @@ export namespace ErpWarehouseApi { status: number; // 开启状态 defaultStatus: boolean; // 是否默认 } - - /** 仓库分页查询参数 */ - export interface WarehousePageParam extends PageParam { - name?: string; - status?: number; - } } /** 查询仓库分页 */ -export function getWarehousePage(params: ErpWarehouseApi.WarehousePageParam) { +export function getWarehousePage(params: PageParam) { return requestClient.get>( '/erp/warehouse/page', { params }, diff --git a/apps/web-ele/src/api/erp/stock/check/index.ts b/apps/web-ele/src/api/erp/stock/check/index.ts new file mode 100644 index 000000000..b6f9d0bea --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/check/index.ts @@ -0,0 +1,87 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockCheckApi { + /** 库存盘点单信息 */ + export interface StockCheck { + id?: number; // 盘点编号 + no: string; // 盘点单号 + checkTime: Date; // 盘点时间 + totalCount: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + status: number; // 状态 + remark: string; // 备注 + fileUrl?: string; // 附件 + productNames?: string; // 产品信息 + creatorName?: string; // 创建人 + items?: StockCheckItem[]; // 盘点产品清单 + } + + /** 库存盘点项 */ + export interface StockCheckItem { + id?: number; // 编号 + warehouseId?: number; // 仓库编号 + productId?: number; // 产品编号 + productName?: string; // 产品名称 + productUnitId?: number; // 产品单位编号 + productUnitName?: string; // 产品单位名称 + productBarCode?: string; // 产品条码 + count?: number; // 盈亏数量 + actualCount?: number; // 实际库存 + productPrice?: number; // 产品单价 + totalPrice?: number; // 总价 + stockCount?: number; // 账面库存 + remark?: string; // 备注 + } +} + +/** 查询库存盘点单分页 */ +export function getStockCheckPage(params: PageParam) { + return requestClient.get>( + '/erp/stock-check/page', + { + params, + }, + ); +} + +/** 查询库存盘点单详情 */ +export function getStockCheck(id: number) { + return requestClient.get( + `/erp/stock-check/get?id=${id}`, + ); +} + +/** 新增库存盘点单 */ +export function createStockCheck(data: ErpStockCheckApi.StockCheck) { + return requestClient.post('/erp/stock-check/create', data); +} + +/** 修改库存盘点单 */ +export function updateStockCheck(data: ErpStockCheckApi.StockCheck) { + return requestClient.put('/erp/stock-check/update', data); +} + +/** 更新库存盘点单的状态 */ +export function updateStockCheckStatus(id: number, status: number) { + return requestClient.put('/erp/stock-check/update-status', null, { + params: { id, status }, + }); +} + +/** 删除库存盘点 */ +export function deleteStockCheck(ids: number[]) { + return requestClient.delete('/erp/stock-check/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出库存盘点单 Excel */ +export function exportStockCheck(params: any) { + return requestClient.download('/erp/stock-check/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/stock/in/index.ts b/apps/web-ele/src/api/erp/stock/in/index.ts new file mode 100644 index 000000000..e68c05b36 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/in/index.ts @@ -0,0 +1,86 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockInApi { + /** 其它入库单信息 */ + export interface StockIn { + id?: number; // 入库编号 + no: string; // 入库单号 + supplierId: number; // 供应商编号 + supplierName?: string; // 供应商名称 + inTime: Date; // 入库时间 + totalCount: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + status: number; // 状态 + remark: string; // 备注 + fileUrl?: string; // 附件 + productNames?: string; // 产品信息 + creatorName?: string; // 创建人 + items?: StockInItem[]; // 入库产品清单 + } + + /** 其它入库单产品信息 */ + export interface StockInItem { + id?: number; // 编号 + warehouseId: number; // 仓库编号 + productId: number; // 产品编号 + productName?: string; // 产品名称 + productUnitId?: number; // 产品单位编号 + productUnitName?: string; // 产品单位名称 + productBarCode?: string; // 产品条码 + count: number; // 数量 + productPrice: number; // 产品单价 + totalPrice: number; // 总价 + stockCount?: number; // 库存数量 + remark?: string; // 备注 + } +} + +/** 查询其它入库单分页 */ +export function getStockInPage(params: PageParam) { + return requestClient.get>( + '/erp/stock-in/page', + { + params, + }, + ); +} + +/** 查询其它入库单详情 */ +export function getStockIn(id: number) { + return requestClient.get(`/erp/stock-in/get?id=${id}`); +} + +/** 新增其它入库单 */ +export function createStockIn(data: ErpStockInApi.StockIn) { + return requestClient.post('/erp/stock-in/create', data); +} + +/** 修改其它入库单 */ +export function updateStockIn(data: ErpStockInApi.StockIn) { + return requestClient.put('/erp/stock-in/update', data); +} + +/** 更新其它入库单的状态 */ +export function updateStockInStatus(id: number, status: number) { + return requestClient.put('/erp/stock-in/update-status', null, { + params: { id, status }, + }); +} + +/** 删除其它入库单 */ +export function deleteStockIn(ids: number[]) { + return requestClient.delete('/erp/stock-in/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出其它入库单 Excel */ +export function exportStockIn(params: any) { + return requestClient.download('/erp/stock-in/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/stock/move/index.ts b/apps/web-ele/src/api/erp/stock/move/index.ts new file mode 100644 index 000000000..0120a9b45 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/move/index.ts @@ -0,0 +1,87 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockMoveApi { + /** 库存调拨单信息 */ + export interface StockMove { + id?: number; // 调拨编号 + no: string; // 调拨单号 + outTime: Date; // 调拨时间 + totalCount: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + status: number; // 状态 + remark: string; // 备注 + fileUrl?: string; // 附件 + fromWarehouseId?: number; // 来源仓库编号 + createTime: Date; // 创建时间 + creator: string; // 创建人 + creatorName: string; // 创建人名称 + productNames: string; // 产品名称 + items?: StockMoveItem[]; // 子表信息 + } + + /** 库存调拨单子表信息 */ + export interface StockMoveItem { + count: number; // 数量 + fromWarehouseId?: number; // 来源仓库ID + id?: number; // ID + productBarCode: string; // 产品条形码 + productId?: number; // 产品ID + productName?: string; // 产品名称 + productPrice: number; // 产品单价 + productUnitName?: string; // 产品单位 + remark?: string; // 备注 + stockCount: number; // 库存数量 + toWarehouseId?: number; // 目标仓库ID + totalPrice?: number; // 总价 + } +} + +/** 查询库存调拨单分页 */ +export function getStockMovePage(params: PageParam) { + return requestClient.get>( + '/erp/stock-move/page', + { + params, + }, + ); +} + +/** 查询库存调拨单详情 */ +export function getStockMove(id: number) { + return requestClient.get( + `/erp/stock-move/get?id=${id}`, + ); +} + +/** 新增库存调拨单 */ +export function createStockMove(data: ErpStockMoveApi.StockMove) { + return requestClient.post('/erp/stock-move/create', data); +} + +/** 修改库存调拨单 */ +export function updateStockMove(data: ErpStockMoveApi.StockMove) { + return requestClient.put('/erp/stock-move/update', data); +} + +/** 更新库存调拨单的状态 */ +export function updateStockMoveStatus(id: number, status: number) { + return requestClient.put('/erp/stock-move/update-status', null, { + params: { id, status }, + }); +} + +/** 删除库存调拨单 */ +export function deleteStockMove(ids: number[]) { + return requestClient.delete('/erp/stock-move/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出库存调拨单 Excel */ +export function exportStockMove(params: any) { + return requestClient.download('/erp/stock-move/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/stock/out/index.ts b/apps/web-ele/src/api/erp/stock/out/index.ts new file mode 100644 index 000000000..1ecb89233 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/out/index.ts @@ -0,0 +1,85 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockOutApi { + /** 其它出库单信息 */ + export interface StockOut { + id?: number; // 出库编号 + no: string; // 出库单号 + customerId: number; // 客户编号 + outTime: Date; // 出库时间 + totalCount: number; // 合计数量 + totalPrice: number; // 合计金额,单位:元 + status: number; // 状态 + remark: string; // 备注 + fileUrl?: string; // 附件 + items?: StockOutItem[]; // 出库产品清单 + } + + /** 其它出库单产品信息 */ + export interface StockOutItem { + id?: number; // 编号 + warehouseId?: number; // 仓库编号 + productId?: number; // 产品编号 + productName?: string; // 产品名称 + productUnitId?: number; // 产品单位编号 + productUnitName?: string; // 产品单位名称 + productBarCode?: string; // 产品条码 + count: number; // 数量 + productPrice: number; // 产品单价 + totalPrice: number; // 总价 + stockCount?: number; // 库存数量 + remark?: string; // 备注 + } +} + +/** 查询其它出库单分页 */ +export function getStockOutPage(params: PageParam) { + return requestClient.get>( + '/erp/stock-out/page', + { + params, + }, + ); +} + +/** 查询其它出库单详情 */ +export function getStockOut(id: number) { + return requestClient.get( + `/erp/stock-out/get?id=${id}`, + ); +} + +/** 新增其它出库单 */ +export function createStockOut(data: ErpStockOutApi.StockOut) { + return requestClient.post('/erp/stock-out/create', data); +} + +/** 修改其它出库单 */ +export function updateStockOut(data: ErpStockOutApi.StockOut) { + return requestClient.put('/erp/stock-out/update', data); +} + +/** 更新其它出库单的状态 */ +export function updateStockOutStatus(id: number, status: number) { + return requestClient.put('/erp/stock-out/update-status', null, { + params: { id, status }, + }); +} + +/** 删除其它出库单 */ +export function deleteStockOut(ids: number[]) { + return requestClient.delete('/erp/stock-out/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出其它出库单 Excel */ +export function exportStockOut(params: any) { + return requestClient.download('/erp/stock-out/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/stock/record/index.ts b/apps/web-ele/src/api/erp/stock/record/index.ts new file mode 100644 index 000000000..30bc9dae0 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/record/index.ts @@ -0,0 +1,31 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockRecordApi { + /** 产品库存明细 */ + export interface StockRecord { + id?: number; // 编号 + productId: number; // 产品编号 + warehouseId: number; // 仓库编号 + count: number; // 出入库数量 + totalCount: number; // 总库存量 + bizType: number; // 业务类型 + bizId: number; // 业务编号 + bizItemId: number; // 业务项编号 + bizNo: string; // 业务单号 + } +} + +/** 查询产品库存明细分页 */ +export function getStockRecordPage(params: PageParam) { + return requestClient.get>( + '/erp/stock-record/page', + { params }, + ); +} + +/** 导出产品库存明细 Excel */ +export function exportStockRecord(params: any) { + return requestClient.download('/erp/stock-record/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/stock/stock/index.ts b/apps/web-ele/src/api/erp/stock/stock/index.ts new file mode 100644 index 000000000..7335c6d34 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/stock/index.ts @@ -0,0 +1,51 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpStockApi { + /** 产品库存信息 */ + export interface Stock { + id?: number; // 编号 + productId: number; // 产品编号 + warehouseId: number; // 仓库编号 + count: number; // 库存数量 + } + + /** 产品库存查询参数 */ + export interface StockQueryReqVO { + productId: number; + warehouseId: number; + } +} + +/** 查询产品库存分页 */ +export function getStockPage(params: PageParam) { + return requestClient.get>('/erp/stock/page', { + params, + }); +} + +/** 获得产品库存数量 */ +export function getStockCount(productId: number, warehouseId?: number) { + const params: any = { productId }; + if (warehouseId !== undefined) { + params.warehouseId = warehouseId; + } + return requestClient.get('/erp/stock/get-count', { + params, + }); +} + +/** 导出产品库存 Excel */ +export function exportStock(params: any) { + return requestClient.download('/erp/stock/export-excel', { + params, + }); +} + +/** 获取库存数量 */ +export function getWarehouseStockCount(params: ErpStockApi.StockQueryReqVO) { + return requestClient.get('/erp/stock/get-count', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/stock/warehouse/index.ts b/apps/web-ele/src/api/erp/stock/warehouse/index.ts new file mode 100644 index 000000000..e5d6e1a49 --- /dev/null +++ b/apps/web-ele/src/api/erp/stock/warehouse/index.ts @@ -0,0 +1,71 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpWarehouseApi { + /** 仓库信息 */ + export interface Warehouse { + id?: number; // 仓库编号 + name: string; // 仓库名称 + address: string; // 仓库地址 + sort: number; // 排序 + remark: string; // 备注 + principal: string; // 负责人 + warehousePrice: number; // 仓储费,单位:元 + truckagePrice: number; // 搬运费,单位:元 + status: number; // 开启状态 + defaultStatus: boolean; // 是否默认 + } +} + +/** 查询仓库分页 */ +export function getWarehousePage(params: PageParam) { + return requestClient.get>( + '/erp/warehouse/page', + { params }, + ); +} + +/** 查询仓库精简列表 */ +export function getWarehouseSimpleList() { + return requestClient.get( + '/erp/warehouse/simple-list', + ); +} + +/** 查询仓库详情 */ +export function getWarehouse(id: number) { + return requestClient.get( + `/erp/warehouse/get?id=${id}`, + ); +} + +/** 新增仓库 */ +export function createWarehouse(data: ErpWarehouseApi.Warehouse) { + return requestClient.post('/erp/warehouse/create', data); +} + +/** 修改仓库 */ +export function updateWarehouse(data: ErpWarehouseApi.Warehouse) { + return requestClient.put('/erp/warehouse/update', data); +} + +/** 修改仓库默认状态 */ +export function updateWarehouseDefaultStatus( + id: number, + defaultStatus: boolean, +) { + return requestClient.put('/erp/warehouse/update-default-status', null, { + params: { id, defaultStatus }, + }); +} + +/** 删除仓库 */ +export function deleteWarehouse(id: number) { + return requestClient.delete(`/erp/warehouse/delete?id=${id}`); +} + +/** 导出仓库 Excel */ +export function exportWarehouse(params: any) { + return requestClient.download('/erp/warehouse/export-excel', { params }); +} diff --git a/apps/web-ele/src/views/erp/stock/check/data.ts b/apps/web-ele/src/views/erp/stock/check/data.ts new file mode 100644 index 000000000..685e940ef --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/check/data.ts @@ -0,0 +1,305 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; +import { getSimpleUserList } from '#/api/system/user'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 表单的配置项 */ +export function useFormSchema(formType: string): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'no', + label: '盘点单号', + component: 'Input', + componentProps: { + placeholder: '系统自动生成', + disabled: true, + }, + }, + { + fieldName: 'checkTime', + label: '盘点时间', + component: 'DatePicker', + componentProps: { + placeholder: '选择盘点时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + class: '!w-full', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + autoSize: { minRows: 1, maxRows: 1 }, + disabled: formType === 'detail', + }, + formItemClass: 'col-span-2', + }, + { + fieldName: 'fileUrl', + label: '附件', + component: 'FileUpload', + componentProps: { + maxNumber: 1, + maxSize: 10, + accept: [ + 'pdf', + 'doc', + 'docx', + 'xls', + 'xlsx', + 'txt', + 'jpg', + 'jpeg', + 'png', + ], + showDescription: formType !== 'detail', + disabled: formType === 'detail', + }, + formItemClass: 'col-span-3', + }, + { + fieldName: 'items', + label: '产品清单', + component: 'Input', + formItemClass: 'col-span-3', + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'warehouseId', + title: '仓库名称', + minWidth: 150, + slots: { default: 'warehouseId' }, + }, + { + field: 'productId', + title: '产品名称', + minWidth: 200, + slots: { default: 'productId' }, + }, + { + field: 'stockCount', + title: '账面库存', + minWidth: 80, + formatter: 'formatAmount3', + }, + { + field: 'productBarCode', + title: '条码', + minWidth: 120, + }, + { + field: 'productUnitName', + title: '单位', + minWidth: 80, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + field: 'actualCount', + title: '实际库存', + minWidth: 120, + fixed: 'right', + slots: { default: 'actualCount' }, + formatter: 'formatAmount3', + }, + { + field: 'count', + title: '盈亏数量', + minWidth: 120, + fixed: 'right', + formatter: 'formatAmount3', + }, + { + field: 'productPrice', + title: '产品单价', + minWidth: 120, + fixed: 'right', + slots: { default: 'productPrice' }, + }, + { + field: 'totalPrice', + title: '金额', + minWidth: 120, + fixed: 'right', + formatter: 'formatAmount2', + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '盘点单号', + component: 'Input', + componentProps: { + placeholder: '请输入盘点单号', + allowClear: true, + }, + }, + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'checkTime', + label: '盘点时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'warehouseId', + label: '仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '盘点单号', + width: 200, + fixed: 'left', + }, + { + field: 'productNames', + title: '产品信息', + showOverflow: 'tooltip', + minWidth: 120, + }, + { + field: 'checkTime', + title: '盘点时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'totalCount', + title: '总数量', + formatter: 'formatAmount3', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '总金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/check/index.vue b/apps/web-ele/src/views/erp/stock/check/index.vue new file mode 100644 index 000000000..d9f46eb5a --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/check/index.vue @@ -0,0 +1,215 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/check/modules/form.vue b/apps/web-ele/src/views/erp/stock/check/modules/form.vue new file mode 100644 index 000000000..72e504a73 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/check/modules/form.vue @@ -0,0 +1,132 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/check/modules/item-form.vue b/apps/web-ele/src/views/erp/stock/check/modules/item-form.vue new file mode 100644 index 000000000..010326580 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/check/modules/item-form.vue @@ -0,0 +1,313 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/in/data.ts b/apps/web-ele/src/views/erp/stock/in/data.ts new file mode 100644 index 000000000..caa252a4a --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/in/data.ts @@ -0,0 +1,330 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; +import { getSimpleUserList } from '#/api/system/user'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 表单的配置项 */ +export function useFormSchema(formType: string): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'no', + label: '入库单号', + component: 'Input', + componentProps: { + placeholder: '系统自动生成', + disabled: true, + }, + }, + { + fieldName: 'inTime', + label: '入库时间', + component: 'DatePicker', + componentProps: { + placeholder: '选择入库时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + class: '!w-full', + }, + rules: 'required', + }, + { + label: '供应商', + fieldName: 'supplierId', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择供应商', + allowClear: true, + showSearch: true, + api: getSupplierSimpleList, + labelField: 'name', + valueField: 'id', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + autoSize: { minRows: 1, maxRows: 1 }, + disabled: formType === 'detail', + }, + formItemClass: 'col-span-2', + }, + { + fieldName: 'fileUrl', + label: '附件', + component: 'FileUpload', + componentProps: { + maxNumber: 1, + maxSize: 10, + accept: [ + 'pdf', + 'doc', + 'docx', + 'xls', + 'xlsx', + 'txt', + 'jpg', + 'jpeg', + 'png', + ], + showDescription: formType !== 'detail', + disabled: formType === 'detail', + }, + formItemClass: 'col-span-3', + }, + { + fieldName: 'items', + label: '入库产品清单', + component: 'Input', + formItemClass: 'col-span-3', + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'warehouseId', + title: '仓库名称', + minWidth: 150, + slots: { default: 'warehouseId' }, + }, + { + field: 'productId', + title: '产品名称', + minWidth: 200, + slots: { default: 'productId' }, + }, + { + field: 'stockCount', + title: '库存', + minWidth: 80, + formatter: 'formatAmount3', + }, + { + field: 'productBarCode', + title: '条码', + minWidth: 120, + }, + { + field: 'productUnitName', + title: '单位', + minWidth: 80, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + field: 'count', + title: '数量', + minWidth: 120, + fixed: 'right', + slots: { default: 'count' }, + }, + { + field: 'productPrice', + title: '产品单价', + minWidth: 120, + fixed: 'right', + slots: { default: 'productPrice' }, + }, + { + field: 'totalPrice', + title: '金额', + minWidth: 120, + fixed: 'right', + formatter: 'formatAmount2', + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '入库单号', + component: 'Input', + componentProps: { + placeholder: '请输入入库单号', + allowClear: true, + }, + }, + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'inTime', + label: '入库时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择供应商', + allowClear: true, + showSearch: true, + api: getSupplierSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'warehouseId', + label: '仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '入库单号', + width: 200, + fixed: 'left', + }, + { + field: 'productNames', + title: '产品信息', + showOverflow: 'tooltip', + minWidth: 120, + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'inTime', + title: '入库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'totalCount', + title: '总数量', + formatter: 'formatAmount3', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '总金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/in/index.vue b/apps/web-ele/src/views/erp/stock/in/index.vue new file mode 100644 index 000000000..e610753b1 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/in/index.vue @@ -0,0 +1,212 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/in/modules/form.vue b/apps/web-ele/src/views/erp/stock/in/modules/form.vue new file mode 100644 index 000000000..8d1e42091 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/in/modules/form.vue @@ -0,0 +1,128 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/in/modules/item-form.vue b/apps/web-ele/src/views/erp/stock/in/modules/item-form.vue new file mode 100644 index 000000000..b239ae826 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/in/modules/item-form.vue @@ -0,0 +1,302 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/move/data.ts b/apps/web-ele/src/views/erp/stock/move/data.ts new file mode 100644 index 000000000..5830a7a8d --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/move/data.ts @@ -0,0 +1,316 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; +import { getSimpleUserList } from '#/api/system/user'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 表单的配置项 */ +export function useFormSchema(formType: string): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'no', + label: '调度单号', + component: 'Input', + componentProps: { + placeholder: '系统自动生成', + disabled: true, + }, + }, + { + fieldName: 'moveTime', + label: '调度时间', + component: 'DatePicker', + componentProps: { + placeholder: '选择调度时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + class: '!w-full', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + autoSize: { minRows: 1, maxRows: 1 }, + disabled: formType === 'detail', + }, + formItemClass: 'col-span-2', + }, + { + fieldName: 'fileUrl', + label: '附件', + component: 'FileUpload', + componentProps: { + maxNumber: 1, + maxSize: 10, + accept: [ + 'pdf', + 'doc', + 'docx', + 'xls', + 'xlsx', + 'txt', + 'jpg', + 'jpeg', + 'png', + ], + showDescription: formType !== 'detail', + disabled: formType === 'detail', + }, + formItemClass: 'col-span-3', + }, + { + fieldName: 'items', + label: '产品清单', + component: 'Input', + formItemClass: 'col-span-3', + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'fromWarehouseId', + title: '调出仓库', + minWidth: 150, + slots: { default: 'fromWarehouseId' }, + }, + { + field: 'toWarehouseId', + title: '调入仓库', + minWidth: 150, + slots: { default: 'toWarehouseId' }, + }, + { + field: 'productId', + title: '产品名称', + minWidth: 200, + slots: { default: 'productId' }, + }, + { + field: 'stockCount', + title: '库存', + minWidth: 80, + formatter: 'formatAmount3', + }, + { + field: 'productBarCode', + title: '条码', + minWidth: 120, + }, + { + field: 'productUnitName', + title: '单位', + minWidth: 80, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + field: 'count', + title: '数量', + minWidth: 120, + fixed: 'right', + slots: { default: 'count' }, + }, + { + field: 'productPrice', + title: '产品单价', + minWidth: 120, + fixed: 'right', + slots: { default: 'productPrice' }, + }, + { + field: 'totalPrice', + title: '金额', + minWidth: 120, + fixed: 'right', + formatter: 'formatAmount2', + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '调度单号', + component: 'Input', + componentProps: { + placeholder: '请输入调度单号', + allowClear: true, + }, + }, + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'moveTime', + label: '调度时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'fromWarehouseId', + label: '调出仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择调出仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'toWarehouseId', + label: '调入仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择调入仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '调度单号', + width: 200, + fixed: 'left', + }, + { + field: 'productNames', + title: '产品信息', + showOverflow: 'tooltip', + minWidth: 120, + }, + { + field: 'moveTime', + title: '调度时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'totalCount', + title: '总数量', + formatter: 'formatAmount3', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '总金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/move/index.vue b/apps/web-ele/src/views/erp/stock/move/index.vue new file mode 100644 index 000000000..67c91a326 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/move/index.vue @@ -0,0 +1,215 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/move/modules/form.vue b/apps/web-ele/src/views/erp/stock/move/modules/form.vue new file mode 100644 index 000000000..94c879b99 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/move/modules/form.vue @@ -0,0 +1,132 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/move/modules/item-form.vue b/apps/web-ele/src/views/erp/stock/move/modules/item-form.vue new file mode 100644 index 000000000..3a06d56a1 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/move/modules/item-form.vue @@ -0,0 +1,323 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/out/data.ts b/apps/web-ele/src/views/erp/stock/out/data.ts new file mode 100644 index 000000000..481e5ccbf --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/out/data.ts @@ -0,0 +1,330 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getCustomerSimpleList } from '#/api/erp/sale/customer'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; +import { getSimpleUserList } from '#/api/system/user'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 表单的配置项 */ +export function useFormSchema(formType: string): VbenFormSchema[] { + return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'no', + label: '出库单号', + component: 'Input', + componentProps: { + placeholder: '系统自动生成', + disabled: true, + }, + }, + { + fieldName: 'outTime', + label: '出库时间', + component: 'DatePicker', + componentProps: { + placeholder: '选择出库时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + class: '!w-full', + }, + rules: 'required', + }, + { + label: '客户', + fieldName: 'customerId', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + labelField: 'name', + valueField: 'id', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + autoSize: { minRows: 1, maxRows: 1 }, + disabled: formType === 'detail', + }, + formItemClass: 'col-span-2', + }, + { + fieldName: 'fileUrl', + label: '附件', + component: 'FileUpload', + componentProps: { + maxNumber: 1, + maxSize: 10, + accept: [ + 'pdf', + 'doc', + 'docx', + 'xls', + 'xlsx', + 'txt', + 'jpg', + 'jpeg', + 'png', + ], + showDescription: formType !== 'detail', + disabled: formType === 'detail', + }, + formItemClass: 'col-span-3', + }, + { + fieldName: 'items', + label: '出库产品清单', + component: 'Input', + formItemClass: 'col-span-3', + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'warehouseId', + title: '仓库名称', + minWidth: 150, + slots: { default: 'warehouseId' }, + }, + { + field: 'productId', + title: '产品名称', + minWidth: 200, + slots: { default: 'productId' }, + }, + { + field: 'stockCount', + title: '库存', + minWidth: 80, + formatter: 'formatAmount3', + }, + { + field: 'productBarCode', + title: '条码', + minWidth: 120, + }, + { + field: 'productUnitName', + title: '单位', + minWidth: 80, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + field: 'count', + title: '数量', + minWidth: 120, + fixed: 'right', + slots: { default: 'count' }, + }, + { + field: 'productPrice', + title: '产品单价', + minWidth: 120, + fixed: 'right', + slots: { default: 'productPrice' }, + }, + { + field: 'totalPrice', + title: '金额', + minWidth: 120, + fixed: 'right', + formatter: 'formatAmount2', + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '出库单号', + component: 'Input', + componentProps: { + placeholder: '请输入出库单号', + allowClear: true, + }, + }, + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'outTime', + label: '出库时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'warehouseId', + label: '仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + labelField: 'nickname', + valueField: 'id', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'Select', + componentProps: { + options: getDictOptions(DICT_TYPE.ERP_AUDIT_STATUS, 'number'), + placeholder: '请选择状态', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '出库单号', + width: 200, + fixed: 'left', + }, + { + field: 'productNames', + title: '产品信息', + showOverflow: 'tooltip', + minWidth: 120, + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'outTime', + title: '出库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'totalCount', + title: '总数量', + formatter: 'formatAmount3', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '总金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 120, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 260, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/out/index.vue b/apps/web-ele/src/views/erp/stock/out/index.vue new file mode 100644 index 000000000..a44a8d93f --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/out/index.vue @@ -0,0 +1,215 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/out/modules/form.vue b/apps/web-ele/src/views/erp/stock/out/modules/form.vue new file mode 100644 index 000000000..4d84dd331 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/out/modules/form.vue @@ -0,0 +1,132 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/out/modules/item-form.vue b/apps/web-ele/src/views/erp/stock/out/modules/item-form.vue new file mode 100644 index 000000000..36c96a398 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/out/modules/item-form.vue @@ -0,0 +1,300 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/record/data.ts b/apps/web-ele/src/views/erp/stock/record/data.ts new file mode 100644 index 000000000..e4e3d0ecd --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/record/data.ts @@ -0,0 +1,133 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; +import { getRangePickerDefaultProps } from '#/utils'; + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'warehouseId', + label: '仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'bizType', + label: '类型', + component: 'Select', + componentProps: { + placeholder: '请选择类型', + allowClear: true, + options: getDictOptions(DICT_TYPE.ERP_STOCK_RECORD_BIZ_TYPE, 'number'), + }, + }, + { + fieldName: 'bizNo', + label: '业务单号', + component: 'Input', + componentProps: { + placeholder: '请输入业务单号', + allowClear: true, + }, + }, + { + fieldName: 'createTime', + label: '创建时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'productName', + title: '产品名称', + minWidth: 150, + }, + { + field: 'categoryName', + title: '产品分类', + width: 120, + }, + { + field: 'unitName', + title: '产品单位', + width: 100, + }, + { + field: 'warehouseName', + title: '仓库', + width: 120, + }, + { + field: 'bizType', + title: '类型', + width: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_STOCK_RECORD_BIZ_TYPE }, + }, + }, + { + field: 'bizNo', + title: '出入库单号', + width: 200, + showOverflow: 'tooltip', + }, + { + field: 'createTime', + title: '出入库日期', + width: 180, + formatter: 'formatDateTime', + }, + { + field: 'count', + title: '出入库数量', + width: 120, + formatter: 'formatAmount3', + }, + { + field: 'totalCount', + title: '库存量', + width: 100, + formatter: 'formatAmount3', + }, + { + field: 'creatorName', + title: '操作人', + width: 100, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/record/index.vue b/apps/web-ele/src/views/erp/stock/record/index.vue new file mode 100644 index 000000000..8c975031a --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/record/index.vue @@ -0,0 +1,79 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/stock/data.ts b/apps/web-ele/src/views/erp/stock/stock/data.ts new file mode 100644 index 000000000..037bb9c45 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/stock/data.ts @@ -0,0 +1,69 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; + +import { getProductSimpleList } from '#/api/erp/product/product'; +import { getWarehouseSimpleList } from '#/api/erp/stock/warehouse'; + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'productId', + label: '产品', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择产品', + allowClear: true, + showSearch: true, + api: getProductSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + { + fieldName: 'warehouseId', + label: '仓库', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择仓库', + allowClear: true, + showSearch: true, + api: getWarehouseSimpleList, + labelField: 'name', + valueField: 'id', + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + field: 'productName', + title: '产品名称', + minWidth: 150, + }, + { + field: 'unitName', + title: '产品单位', + minWidth: 100, + }, + { + field: 'categoryName', + title: '产品分类', + minWidth: 120, + }, + { + field: 'count', + title: '库存量', + minWidth: 100, + formatter: 'formatAmount3', + }, + { + field: 'warehouseName', + title: '仓库', + minWidth: 120, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/stock/index.vue b/apps/web-ele/src/views/erp/stock/stock/index.vue new file mode 100644 index 000000000..2b20d7475 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/stock/index.vue @@ -0,0 +1,79 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/warehouse/data.ts b/apps/web-ele/src/views/erp/stock/warehouse/data.ts new file mode 100644 index 000000000..0f38019e0 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/warehouse/data.ts @@ -0,0 +1,209 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { ErpWarehouseApi } from '#/api/erp/stock/warehouse'; + +import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; +import { getDictOptions } from '@vben/hooks'; + +import { z } from '#/adapter/form'; + +/** 新增/修改的表单 */ +export function useFormSchema(): VbenFormSchema[] { + return [ + { + component: 'Input', + fieldName: 'id', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, + { + fieldName: 'name', + label: '仓库名称', + component: 'Input', + componentProps: { + placeholder: '请输入仓库名称', + }, + rules: 'required', + }, + { + fieldName: 'address', + label: '仓库地址', + component: 'Input', + componentProps: { + placeholder: '请输入仓库地址', + }, + }, + { + fieldName: 'status', + label: '开启状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + { + fieldName: 'warehousePrice', + label: '仓储费(元)', + component: 'InputNumber', + componentProps: { + placeholder: '请输入仓储费,单位:元/天/KG', + min: 0, + precision: 2, + controlsPosition: 'right', + class: '!w-full', + }, + }, + { + fieldName: 'truckagePrice', + label: '搬运费(元)', + component: 'InputNumber', + componentProps: { + placeholder: '请输入搬运费,单位:元', + min: 0, + precision: 2, + controlsPosition: 'right', + class: '!w-full', + }, + }, + { + fieldName: 'principal', + label: '负责人', + component: 'Input', + componentProps: { + placeholder: '请输入负责人', + }, + }, + { + fieldName: 'sort', + label: '排序', + component: 'InputNumber', + componentProps: { + placeholder: '请输入排序', + precision: 0, + controlsPosition: 'right', + class: '!w-full', + }, + rules: 'required', + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + }, + }, + ]; +} + +/** 搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '仓库名称', + component: 'Input', + componentProps: { + placeholder: '请输入仓库名称', + allowClear: true, + }, + }, + { + fieldName: 'status', + label: '仓库状态', + component: 'Select', + componentProps: { + placeholder: '请选择仓库状态', + allowClear: true, + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onDefaultStatusChange?: ( + newStatus: boolean, + row: ErpWarehouseApi.Warehouse, + ) => PromiseLike, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'name', + title: '仓库名称', + minWidth: 150, + }, + { + field: 'address', + title: '仓库地址', + minWidth: 200, + showOverflow: 'tooltip', + }, + { + field: 'warehousePrice', + title: '仓储费', + minWidth: 120, + formatter: 'formatAmount2', + }, + { + field: 'truckagePrice', + title: '搬运费', + minWidth: 120, + formatter: 'formatAmount2', + }, + { + field: 'principal', + title: '负责人', + minWidth: 100, + }, + { + field: 'sort', + title: '排序', + minWidth: 80, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.COMMON_STATUS }, + }, + }, + { + field: 'defaultStatus', + title: '是否默认', + minWidth: 100, + cellRender: { + attrs: { beforeChange: onDefaultStatusChange }, + name: 'CellSwitch', + props: { + activeValue: true, + inactiveValue: false, + }, + }, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + showOverflow: 'tooltip', + }, + { + field: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/stock/warehouse/index.vue b/apps/web-ele/src/views/erp/stock/warehouse/index.vue new file mode 100644 index 000000000..e75680388 --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/warehouse/index.vue @@ -0,0 +1,178 @@ + + + diff --git a/apps/web-ele/src/views/erp/stock/warehouse/modules/form.vue b/apps/web-ele/src/views/erp/stock/warehouse/modules/form.vue new file mode 100644 index 000000000..5bd04fded --- /dev/null +++ b/apps/web-ele/src/views/erp/stock/warehouse/modules/form.vue @@ -0,0 +1,88 @@ + + +