diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index 96c85d1296e2e4c28dc5d789953fe31b027f7e43..7fe8876455d0f0753a5b2c353221bd7c84c0e49d 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -332,22 +332,22 @@ setupVbenVxeTable({ }, }); - // add by 星语:数量格式化,例如说:金额 - vxeUI.formats.add('formatNumber', { + // add by 星语:数量格式化,保留 3 位 + vxeUI.formats.add('formatAmount3', { tableCellFormatMethod({ cellValue }) { return erpCountInputFormatter(cellValue); }, }); - + // add by 星语:数量格式化,保留 2 位 vxeUI.formats.add('formatAmount2', { tableCellFormatMethod({ cellValue }, digits = 2) { - return `${erpNumberFormatter(cellValue, digits)}元`; + return `${erpNumberFormatter(cellValue, digits)}`; }, }); vxeUI.formats.add('formatFenToYuanAmount', { tableCellFormatMethod({ cellValue }, digits = 2) { - return `${erpNumberFormatter(fenToYuan(cellValue), digits)}元`; + return `${erpNumberFormatter(fenToYuan(cellValue), digits)}`; }, }); }, diff --git a/apps/web-antd/src/api/erp/finance/payment/index.ts b/apps/web-antd/src/api/erp/finance/payment/index.ts index e9dc1847a650d499cccb2ba01a7b9b907c210c4f..e87abfe16a29072e179c7acd9b379b8fd7b5002f 100644 --- a/apps/web-antd/src/api/erp/finance/payment/index.ts +++ b/apps/web-antd/src/api/erp/finance/payment/index.ts @@ -3,34 +3,57 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; namespace ErpFinancePaymentApi { + /** 付款单项 */ + export interface FinancePaymentItem { + id?: number; + row_id?: number; // 前端使用的临时ID + bizId: number; // 业务ID + bizType: number; // 业务类型 + bizNo: string; // 业务编号 + totalPrice: number; // 应付金额 + paidPrice: number; // 已付金额 + paymentPrice: number; // 本次付款 + remark?: string; // 备注 + } + /** 付款单信息 */ export interface FinancePayment { id?: number; // 付款单编号 no: string; // 付款单号 supplierId: number; // 供应商编号 + supplierName?: string; // 供应商名称 paymentTime: Date; // 付款时间 totalPrice: number; // 合计金额,单位:元 + discountPrice: number; // 优惠金额 + paymentPrice: number; // 实际付款金额 status: number; // 状态 remark: string; // 备注 + fileUrl?: string; // 附件 + accountId?: number; // 付款账户 + accountName?: string; // 账户名称 + financeUserId?: number; // 财务人员 + financeUserName?: string; // 财务人员姓名 + creator?: string; // 创建人 + creatorName?: string; // 创建人姓名 + items?: FinancePaymentItem[]; // 付款明细 + bizNo?: string; // 业务单号 } /** 付款单分页查询参数 */ export interface FinancePaymentPageParams extends PageParam { no?: string; + paymentTime?: [string, string]; supplierId?: number; + creator?: string; + financeUserId?: number; + accountId?: number; status?: number; - } - - /** 付款单状态更新参数 */ - export interface FinancePaymentStatusParams { - id: number; - status: number; + remark?: string; + bizNo?: string; } } -/** - * 查询付款单分页 - */ +/** 查询付款单分页 */ export function getFinancePaymentPage( params: ErpFinancePaymentApi.FinancePaymentPageParams, ) { @@ -42,47 +65,35 @@ export function getFinancePaymentPage( ); } -/** - * 查询付款单详情 - */ +/** 查询付款单详情 */ export function getFinancePayment(id: number) { return requestClient.get( `/erp/finance-payment/get?id=${id}`, ); } -/** - * 新增付款单 - */ +/** 新增付款单 */ export function createFinancePayment( data: ErpFinancePaymentApi.FinancePayment, ) { return requestClient.post('/erp/finance-payment/create', data); } -/** - * 修改付款单 - */ +/** 修改付款单 */ export function updateFinancePayment( data: ErpFinancePaymentApi.FinancePayment, ) { return requestClient.put('/erp/finance-payment/update', data); } -/** - * 更新付款单的状态 - */ -export function updateFinancePaymentStatus( - params: ErpFinancePaymentApi.FinancePaymentStatusParams, -) { +/** 更新付款单的状态 */ +export function updateFinancePaymentStatus(id: number, status: number) { return requestClient.put('/erp/finance-payment/update-status', null, { - params, + params: { id, status }, }); } -/** - * 删除付款单 - */ +/** 删除付款单 */ export function deleteFinancePayment(ids: number[]) { return requestClient.delete('/erp/finance-payment/delete', { params: { @@ -91,9 +102,7 @@ export function deleteFinancePayment(ids: number[]) { }); } -/** - * 导出付款单 Excel - */ +/** 导出付款单 Excel */ export function exportFinancePayment( params: ErpFinancePaymentApi.FinancePaymentPageParams, ) { diff --git a/apps/web-antd/src/api/erp/finance/receipt/index.ts b/apps/web-antd/src/api/erp/finance/receipt/index.ts index 37b70e764977843f4a8a1ad0bb7fcd45e536f372..a02f8c5e8639fb7e0e462e6eeff81aaa4f79cbe1 100644 --- a/apps/web-antd/src/api/erp/finance/receipt/index.ts +++ b/apps/web-antd/src/api/erp/finance/receipt/index.ts @@ -3,34 +3,57 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; namespace ErpFinanceReceiptApi { + /** 收款单项 */ + export interface FinanceReceiptItem { + id?: number; + row_id?: number; // 前端使用的临时ID + bizId: number; // 业务ID + bizType: number; // 业务类型 + bizNo: string; // 业务编号 + totalPrice: number; // 应收金额 + receiptedPrice: number; // 已收金额 + receiptPrice: number; // 本次收款 + remark?: string; // 备注 + } + /** 收款单信息 */ export interface FinanceReceipt { id?: number; // 收款单编号 no: string; // 收款单号 customerId: number; // 客户编号 + customerName?: string; // 客户名称 receiptTime: Date; // 收款时间 totalPrice: number; // 合计金额,单位:元 + discountPrice: number; // 优惠金额 + receiptPrice: number; // 实际收款金额 status: number; // 状态 remark: string; // 备注 + fileUrl?: string; // 附件 + accountId?: number; // 收款账户 + accountName?: string; // 账户名称 + financeUserId?: number; // 财务人员 + financeUserName?: string; // 财务人员姓名 + creator?: string; // 创建人 + creatorName?: string; // 创建人姓名 + items?: FinanceReceiptItem[]; // 收款明细 + bizNo?: string; // 业务单号 } /** 收款单分页查询参数 */ export interface FinanceReceiptPageParams extends PageParam { no?: string; + receiptTime?: [string, string]; customerId?: number; + creator?: string; + financeUserId?: number; + accountId?: number; status?: number; - } - - /** 收款单状态更新参数 */ - export interface FinanceReceiptStatusParams { - id: number; - status: number; + remark?: string; + bizNo?: string; } } -/** - * 查询收款单分页 - */ +/** 查询收款单分页 */ export function getFinanceReceiptPage( params: ErpFinanceReceiptApi.FinanceReceiptPageParams, ) { @@ -42,47 +65,35 @@ export function getFinanceReceiptPage( ); } -/** - * 查询收款单详情 - */ +/** 查询收款单详情 */ export function getFinanceReceipt(id: number) { return requestClient.get( `/erp/finance-receipt/get?id=${id}`, ); } -/** - * 新增收款单 - */ +/** 新增收款单 */ export function createFinanceReceipt( data: ErpFinanceReceiptApi.FinanceReceipt, ) { return requestClient.post('/erp/finance-receipt/create', data); } -/** - * 修改收款单 - */ +/** 修改收款单 */ export function updateFinanceReceipt( data: ErpFinanceReceiptApi.FinanceReceipt, ) { return requestClient.put('/erp/finance-receipt/update', data); } -/** - * 更新收款单的状态 - */ -export function updateFinanceReceiptStatus( - params: ErpFinanceReceiptApi.FinanceReceiptStatusParams, -) { +/** 更新收款单的状态 */ +export function updateFinanceReceiptStatus(id: number, status: number) { return requestClient.put('/erp/finance-receipt/update-status', null, { - params, + params: { id, status }, }); } -/** - * 删除收款单 - */ +/** 删除收款单 */ export function deleteFinanceReceipt(ids: number[]) { return requestClient.delete('/erp/finance-receipt/delete', { params: { @@ -91,9 +102,7 @@ export function deleteFinanceReceipt(ids: number[]) { }); } -/** - * 导出收款单 Excel - */ +/** 导出收款单 Excel */ export function exportFinanceReceipt( params: ErpFinanceReceiptApi.FinanceReceiptPageParams, ) { diff --git a/apps/web-antd/src/api/erp/product/category/index.ts b/apps/web-antd/src/api/erp/product/category/index.ts index 74e5465c19acf1f12aacfcf7a9185b327f8d2609..87c85531907ba9dd6930ed6268abba7527120827 100644 --- a/apps/web-antd/src/api/erp/product/category/index.ts +++ b/apps/web-antd/src/api/erp/product/category/index.ts @@ -14,9 +14,10 @@ export namespace ErpProductCategoryApi { } /** 查询产品分类列表 */ -export function getProductCategoryList() { +export function getProductCategoryList(params?: any) { return requestClient.get( '/erp/product-category/list', + { params }, ); } diff --git a/apps/web-antd/src/api/erp/purchase/in/index.ts b/apps/web-antd/src/api/erp/purchase/in/index.ts index 03b492a99844ed94c6fd9fd57073abb15620eb39..f807e2800a779b239ab240609768457a3be5e2e7 100644 --- a/apps/web-antd/src/api/erp/purchase/in/index.ts +++ b/apps/web-antd/src/api/erp/purchase/in/index.ts @@ -49,13 +49,6 @@ export namespace ErpPurchaseInApi { supplierId?: number; status?: number; } - - // TODO @nehc:updatePurchaseInStatus 是不是需要? - /** 采购入库状态更新参数 */ - export interface PurchaseInStatusParams { - id: number; - status: number; - } } /** diff --git a/apps/web-antd/src/api/erp/purchase/order/index.ts b/apps/web-antd/src/api/erp/purchase/order/index.ts index ec08dc179624a984dc1596ca9ff401b3aa2f4a85..e2cc7a214c6a16a50accc8ef9ea12ade62c7122a 100644 --- a/apps/web-antd/src/api/erp/purchase/order/index.ts +++ b/apps/web-antd/src/api/erp/purchase/order/index.ts @@ -100,12 +100,7 @@ export function updatePurchaseOrderStatus(id: number, status: number) { } /** 删除采购订单 */ -export function deletePurchaseOrder(id: number) { - return requestClient.delete(`/erp/purchase-order/delete?id=${id}`); -} - -/** 批量删除采购订单 */ -export function deletePurchaseOrderList(ids: number[]) { +export function deletePurchaseOrder(ids: number[]) { return requestClient.delete('/erp/purchase-order/delete', { params: { ids: ids.join(',') }, }); diff --git a/apps/web-antd/src/api/erp/purchase/return/index.ts b/apps/web-antd/src/api/erp/purchase/return/index.ts index 86423c46fc943e275fae9ca9b089037cc9c89add..4114f1908f29cff7382a1ef423dbbce44e781d50 100644 --- a/apps/web-antd/src/api/erp/purchase/return/index.ts +++ b/apps/web-antd/src/api/erp/purchase/return/index.ts @@ -96,11 +96,9 @@ export function updatePurchaseReturn( /** * 更新采购退货的状态 */ -export function updatePurchaseReturnStatus( - params: ErpPurchaseReturnApi.PurchaseReturnStatusParams, -) { +export function updatePurchaseReturnStatus(id: number, status: number) { return requestClient.put('/erp/purchase-return/update-status', null, { - params, + params: { id, status }, }); } diff --git a/apps/web-antd/src/api/erp/sale/order/index.ts b/apps/web-antd/src/api/erp/sale/order/index.ts index 37ce1be49ece0f2497fa10ba23cadb4c928bd520..6aff41d82d947556d27453abd4b67a61d1f67b84 100644 --- a/apps/web-antd/src/api/erp/sale/order/index.ts +++ b/apps/web-antd/src/api/erp/sale/order/index.ts @@ -24,6 +24,7 @@ export namespace ErpSaleOrderApi { depositPrice?: number; // 定金金额,单位:元 items?: SaleOrderItem[]; // 销售订单产品明细列表 } + export interface SaleOrderItem { id?: number; // 订单项编号 orderId?: number; // 采购订单编号 @@ -66,6 +67,13 @@ export function getSaleOrder(id: number) { ); } +/** 查询销售订单项列表 */ +export function getSaleOrderItemListByOrderId(orderId: number) { + return requestClient.get( + `/erp/sale-order/item/list-by-order-id?orderId=${orderId}`, + ); +} + /** 新增销售订单 */ export function createSaleOrder(data: ErpSaleOrderApi.SaleOrder) { return requestClient.post('/erp/sale-order/create', data); diff --git a/apps/web-antd/src/api/erp/sale/out/index.ts b/apps/web-antd/src/api/erp/sale/out/index.ts index dc4f5d05f31accb8db9a24c2e32347999f67e694..d78a91bafad4f04fe0ff302d94062d132703d37a 100644 --- a/apps/web-antd/src/api/erp/sale/out/index.ts +++ b/apps/web-antd/src/api/erp/sale/out/index.ts @@ -23,6 +23,7 @@ export namespace ErpSaleOutApi { fileUrl?: string; // 附件地址 items?: SaleOutItem[]; } + export interface SaleOutItem { count?: number; id?: number; @@ -49,17 +50,9 @@ export namespace ErpSaleOutApi { customerId?: number; status?: number; } - - /** 销售出库状态更新参数 */ - export interface SaleOutStatusParams { - id: number; - status: number; - } } -/** - * 查询销售出库分页 - */ +/** 查询销售出库分页 */ export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) { return requestClient.get>( '/erp/sale-out/page', @@ -69,39 +62,29 @@ export function getSaleOutPage(params: ErpSaleOutApi.SaleOutPageParams) { ); } -/** - * 查询销售出库详情 - */ +/** 查询销售出库详情 */ export function getSaleOut(id: number) { return requestClient.get(`/erp/sale-out/get?id=${id}`); } -/** - * 新增销售出库 - */ +/** 新增销售出库 */ export function createSaleOut(data: ErpSaleOutApi.SaleOut) { return requestClient.post('/erp/sale-out/create', data); } -/** - * 修改销售出库 - */ +/** 修改销售出库 */ export function updateSaleOut(data: ErpSaleOutApi.SaleOut) { return requestClient.put('/erp/sale-out/update', data); } -/** - * 更新销售出库的状态 - */ -export function updateSaleOutStatus(params: ErpSaleOutApi.SaleOutStatusParams) { +/** 更新销售出库的状态 */ +export function updateSaleOutStatus(id: number, status: number) { return requestClient.put('/erp/sale-out/update-status', null, { - params, + params: { id, status }, }); } -/** - * 删除销售出库 - */ +/** 删除销售出库 */ export function deleteSaleOut(ids: number[]) { return requestClient.delete('/erp/sale-out/delete', { params: { @@ -110,9 +93,7 @@ export function deleteSaleOut(ids: number[]) { }); } -/** - * 导出销售出库 Excel - */ +/** 导出销售出库 Excel */ export function exportSaleOut(params: ErpSaleOutApi.SaleOutPageParams) { return requestClient.download('/erp/sale-out/export-excel', { params, diff --git a/apps/web-antd/src/api/erp/sale/return/index.ts b/apps/web-antd/src/api/erp/sale/return/index.ts index 91057f4df0c6695354aa4a144c1ab534fc187189..adc718cc3ca6a85b70ddcd7f55777024f6578b31 100644 --- a/apps/web-antd/src/api/erp/sale/return/index.ts +++ b/apps/web-antd/src/api/erp/sale/return/index.ts @@ -22,6 +22,7 @@ export namespace ErpSaleReturnApi { fileUrl?: string; // 附件地址 items?: SaleReturnItem[]; } + export interface SaleReturnItem { count?: number; id?: number; @@ -48,12 +49,6 @@ export namespace ErpSaleReturnApi { customerId?: number; status?: number; } - - /** 销售退货状态更新参数 */ - export interface SaleReturnStatusParams { - id: number; - status: number; - } } /** @@ -96,11 +91,9 @@ export function updateSaleReturn(data: ErpSaleReturnApi.SaleReturn) { /** * 更新销售退货的状态 */ -export function updateSaleReturnStatus( - params: ErpSaleReturnApi.SaleReturnStatusParams, -) { +export function updateSaleReturnStatus(id: number, status: number) { return requestClient.put('/erp/sale-return/update-status', null, { - params, + params: { id, status }, }); } 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 60d581405398370459c5701f4dcfd5c112852988..386948432842048f7ec7deb813f30ac038743667 100644 --- a/apps/web-antd/src/api/erp/stock/check/index.ts +++ b/apps/web-antd/src/api/erp/stock/check/index.ts @@ -17,6 +17,7 @@ export namespace ErpStockCheckApi { creatorName?: string; // 创建人 items?: StockCheckItem[]; // 盘点产品清单 } + export interface StockCheckItem { id?: number; // 编号 warehouseId?: number; // 仓库编号 @@ -38,12 +39,6 @@ export namespace ErpStockCheckApi { no?: string; status?: number; } - - /** 库存盘点单状态更新参数 */ - export interface StockCheckStatusParams { - id: number; - status: number; - } } /** @@ -86,11 +81,9 @@ export function updateStockCheck(data: ErpStockCheckApi.StockCheck) { /** * 更新库存盘点单的状态 */ -export function updateStockCheckStatus( - params: ErpStockCheckApi.StockCheckStatusParams, -) { +export function updateStockCheckStatus(id: number, status: number) { return requestClient.put('/erp/stock-check/update-status', null, { - params, + params: { id, status }, }); } 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 8fe9bafd487869adaa21d748f0586d5fee1b352d..18e1093145a57cc51f1e87b8ce10b45afaf96735 100644 --- a/apps/web-antd/src/api/erp/stock/in/index.ts +++ b/apps/web-antd/src/api/erp/stock/in/index.ts @@ -42,12 +42,6 @@ export namespace ErpStockInApi { supplierId?: number; status?: number; } - - /** 其它入库单状态更新参数 */ - export interface StockInStatusParams { - id: number; - status: number; - } } /** @@ -86,9 +80,9 @@ export function updateStockIn(data: ErpStockInApi.StockIn) { /** * 更新其它入库单的状态 */ -export function updateStockInStatus(params: ErpStockInApi.StockInStatusParams) { +export function updateStockInStatus(id: number, status: number) { return requestClient.put('/erp/stock-in/update-status', null, { - params, + params: { id, status }, }); } 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 33e49f29923235591efdc62f55ca3e4c4d2c74b4..409ca8f64e7dc24ed9dcf21ed4853325610a4566 100644 --- a/apps/web-antd/src/api/erp/stock/move/index.ts +++ b/apps/web-antd/src/api/erp/stock/move/index.ts @@ -43,13 +43,6 @@ export namespace ErpStockMoveApi { status?: number; } - /** 库存调拨单状态更新参数 */ - export interface StockMoveStatusParams { - id: number; - status: number; - } -} - /** * 查询库存调拨单分页 */ @@ -88,11 +81,9 @@ export function updateStockMove(data: ErpStockMoveApi.StockMove) { /** * 更新库存调拨单的状态 */ -export function updateStockMoveStatus( - params: ErpStockMoveApi.StockMoveStatusParams, -) { +export function updateStockMoveStatus(id: number, status: number) { return requestClient.put('/erp/stock-move/update-status', null, { - params, + params: { id, status }, }); } 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 a3873f94841c62ec7b3b5a9f38db035a7beb6656..2f64ff8676f322443bc091e1393d9c1b2b08eaa5 100644 --- a/apps/web-antd/src/api/erp/stock/out/index.ts +++ b/apps/web-antd/src/api/erp/stock/out/index.ts @@ -39,12 +39,6 @@ export namespace ErpStockOutApi { customerId?: number; status?: number; } - - /** 其它出库单状态更新参数 */ - export interface StockOutStatusParams { - id: number; - status: number; - } } /** @@ -85,11 +79,9 @@ export function updateStockOut(data: ErpStockOutApi.StockOut) { /** * 更新其它出库单的状态 */ -export function updateStockOutStatus( - params: ErpStockOutApi.StockOutStatusParams, -) { +export function updateStockOutStatus(id: number, status: number) { return requestClient.put('/erp/stock-out/update-status', null, { - params, + params: { id, status }, }); } diff --git a/apps/web-antd/src/api/pay/app/index.ts b/apps/web-antd/src/api/pay/app/index.ts index 53f676742b5a15341b4a062bd25974198ae1033a..081c7aa77defe18ae1d25d338424c5ece1d91b31 100644 --- a/apps/web-antd/src/api/pay/app/index.ts +++ b/apps/web-antd/src/api/pay/app/index.ts @@ -16,7 +16,7 @@ export namespace PayAppApi { merchantId: number; merchantName: string; createTime?: Date; - channelCodes: string[]; + channelCodes?: string[]; } /** 更新状态请求 */ @@ -25,20 +25,16 @@ export namespace PayAppApi { status: number; } - export interface AppPageReq extends PageParam { + export interface AppPageReqVO extends PageParam { name?: string; + appKey?: string; status?: number; - remark?: string; - payNotifyUrl?: string; - refundNotifyUrl?: string; - transferNotifyUrl?: string; - merchantName?: string; createTime?: Date[]; } } /** 查询支付应用列表 */ -export function getAppPage(params: PayAppApi.AppPageReq) { +export function getAppPage(params: PayAppApi.AppPageReqVO) { return requestClient.get>('/pay/app/page', { params, }); @@ -60,7 +56,7 @@ export function updateApp(data: PayAppApi.App) { } /** 修改支付应用状态 */ -export function changeAppStatus(data: PayAppApi.UpdateStatusReq) { +export function updateAppStatus(data: PayAppApi.UpdateStatusReq) { return requestClient.put('/pay/app/update-status', data); } diff --git a/apps/web-antd/src/api/pay/demo/order/index.ts b/apps/web-antd/src/api/pay/demo/order/index.ts index 63cb1396d8fa92e107450553b6cb691e534abfed..2623510593383e80a41b35153cd71cfb01623c29 100644 --- a/apps/web-antd/src/api/pay/demo/order/index.ts +++ b/apps/web-antd/src/api/pay/demo/order/index.ts @@ -20,7 +20,7 @@ export namespace DemoOrderApi { createTime?: Date; } - export interface OrderPageReq extends PageParam { + export interface OrderPageReqVO extends PageParam { spuId?: number; createTime?: Date[]; } @@ -32,7 +32,7 @@ export function createDemoOrder(data: DemoOrderApi.Order) { } /** 获得示例订单分页 */ -export function getDemoOrderPage(params: DemoOrderApi.OrderPageReq) { +export function getDemoOrderPage(params: DemoOrderApi.OrderPageReqVO) { return requestClient.get>( '/pay/demo-order/page', { diff --git a/apps/web-antd/src/api/pay/notify/index.ts b/apps/web-antd/src/api/pay/notify/index.ts index b0b916ccb2ca18df68d20c61be3778b03baa599e..fe18ac03bdf873d01eed24372c41aacfc3311089 100644 --- a/apps/web-antd/src/api/pay/notify/index.ts +++ b/apps/web-antd/src/api/pay/notify/index.ts @@ -1,15 +1,52 @@ -import type { PageParam } from '@vben/request'; +import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; +export namespace PayNotifyApi { + /** 支付通知任务 */ + export interface NotifyTask { + id: number; + appId: number; + appName: string; + type: number; + dataId: number; + status: number; + merchantOrderId: string; + merchantRefundId?: string; + merchantTransferId?: string; + lastExecuteTime: Date; + nextNotifyTime: Date; + notifyTimes: number; + maxNotifyTimes: number; + createTime: Date; + updateTime: Date; + logs?: any[]; + } + + /** 支付通知任务分页请求 */ + export interface NotifyTaskPageReqVO extends PageParam { + appId?: number; + type?: number; + dataId?: number; + status?: number; + merchantOrderId?: string; + merchantRefundId?: string; + merchantTransferId?: string; + createTime?: Date[]; + } +} + /** 获得支付通知明细 */ export function getNotifyTaskDetail(id: number) { return requestClient.get(`/pay/notify/get-detail?id=${id}`); } /** 获得支付通知分页 */ -export function getNotifyTaskPage(params: PageParam) { - return requestClient.get('/pay/notify/page', { - params, - }); +export function getNotifyTaskPage(params: PayNotifyApi.NotifyTaskPageReqVO) { + return requestClient.get>( + '/pay/notify/page', + { + params, + }, + ); } diff --git a/apps/web-antd/src/api/pay/order/index.ts b/apps/web-antd/src/api/pay/order/index.ts index aff890dfa70bba010d8e7081e484fa0a8299c083..44554919207b431da9dfa1a6ecbed3101fa7f1aa 100644 --- a/apps/web-antd/src/api/pay/order/index.ts +++ b/apps/web-antd/src/api/pay/order/index.ts @@ -40,60 +40,19 @@ export namespace PayOrderApi { } /** 支付订单分页请求 */ - export interface OrderPageReq extends PageParam { - merchantId?: number; + export interface OrderPageReqVO extends PageParam { appId?: number; - channelId?: number; channelCode?: string; merchantOrderId?: string; - subject?: string; - body?: string; - notifyUrl?: string; - notifyStatus?: number; - amount?: number; - channelFeeRate?: number; - channelFeeAmount?: number; - status?: number; - expireTime?: Date[]; - successTime?: Date[]; - notifyTime?: Date[]; - successExtensionId?: number; - refundStatus?: number; - refundTimes?: number; - channelUserId?: string; channelOrderNo?: string; - createTime?: Date[]; - } - - /** 支付订单导出请求 */ - export interface OrderExportReq { - merchantId?: number; - appId?: number; - channelId?: number; - channelCode?: string; - merchantOrderId?: string; - subject?: string; - body?: string; - notifyUrl?: string; - notifyStatus?: number; - amount?: number; - channelFeeRate?: number; - channelFeeAmount?: number; + no?: string; status?: number; - expireTime?: Date[]; - successTime?: Date[]; - notifyTime?: Date[]; - successExtensionId?: number; - refundStatus?: number; - refundTimes?: number; - channelUserId?: string; - channelOrderNo?: string; createTime?: Date[]; } } /** 查询支付订单列表 */ -export function getOrderPage(params: PayOrderApi.OrderPageReq) { +export function getOrderPage(params: PayOrderApi.OrderPageReqVO) { return requestClient.get>('/pay/order/page', { params, }); @@ -120,6 +79,6 @@ export function submitOrder(data: any) { } /** 导出支付订单 */ -export function exportOrder(params: PayOrderApi.OrderExportReq) { +export function exportOrder(params: any) { return requestClient.download('/pay/order/export-excel', { params }); } diff --git a/apps/web-antd/src/api/pay/refund/index.ts b/apps/web-antd/src/api/pay/refund/index.ts index 44c36b7c6f35f148079ca6a23bb08c94573c2e74..bce2448bcf823f5832ac66f3ddb8e575974af17a 100644 --- a/apps/web-antd/src/api/pay/refund/index.ts +++ b/apps/web-antd/src/api/pay/refund/index.ts @@ -14,9 +14,12 @@ export namespace PayRefundApi { tradeNo: string; merchantOrderId: string; merchantRefundNo: string; + merchantRefundId: string; notifyUrl: string; notifyStatus: number; status: number; + payPrice: number; + refundPrice: number; type: number; payAmount: number; refundAmount: number; @@ -35,36 +38,7 @@ export namespace PayRefundApi { } /** 退款订单分页请求 */ - export interface RefundPageReq extends PageParam { - merchantId?: number; - appId?: number; - channelId?: number; - channelCode?: string; - orderId?: string; - tradeNo?: string; - merchantOrderId?: string; - merchantRefundNo?: string; - notifyUrl?: string; - notifyStatus?: number; - status?: number; - type?: number; - payAmount?: number; - refundAmount?: number; - reason?: string; - userIp?: string; - channelOrderNo?: string; - channelRefundNo?: string; - channelErrorCode?: string; - channelErrorMsg?: string; - channelExtras?: string; - expireTime?: Date[]; - successTime?: Date[]; - notifyTime?: Date[]; - createTime?: Date[]; - } - - /** 退款订单导出请求 */ - export interface RefundExportReq { + export interface RefundPageReqVO extends PageParam { merchantId?: number; appId?: number; channelId?: number; @@ -94,7 +68,7 @@ export namespace PayRefundApi { } /** 查询退款订单列表 */ -export function getRefundPage(params: PayRefundApi.RefundPageReq) { +export function getRefundPage(params: PayRefundApi.RefundPageReqVO) { return requestClient.get>( '/pay/refund/page', { @@ -108,22 +82,7 @@ export function getRefund(id: number) { return requestClient.get(`/pay/refund/get?id=${id}`); } -/** 创建退款订单 */ -export function createRefund(data: PayRefundApi.Refund) { - return requestClient.post('/pay/refund/create', data); -} - -/** 更新退款订单 */ -export function updateRefund(data: PayRefundApi.Refund) { - return requestClient.put('/pay/refund/update', data); -} - -/** 删除退款订单 */ -export function deleteRefund(id: number) { - return requestClient.delete(`/pay/refund/delete?id=${id}`); -} - /** 导出退款订单 */ -export function exportRefund(params: PayRefundApi.RefundExportReq) { +export function exportRefund(params: any) { return requestClient.download('/pay/refund/export-excel', { params }); } diff --git a/apps/web-antd/src/api/pay/transfer/index.ts b/apps/web-antd/src/api/pay/transfer/index.ts index 4c588cb657bda24ae800a5086a19eb384cd9865f..75cd21153a2e48dc5cf67d1d80d1f8c52fb0b710 100644 --- a/apps/web-antd/src/api/pay/transfer/index.ts +++ b/apps/web-antd/src/api/pay/transfer/index.ts @@ -6,37 +6,42 @@ export namespace PayTransferApi { /** 转账单信息 */ export interface Transfer { id: number; + no: string; appId: number; + appName: string; channelId: number; channelCode: string; merchantTransferId: string; - type: number; + channelTransferNo: string; price: number; subject: string; userName: string; - alipayLogonId: string; - openid: string; + userAccount: string; + userIp: string; status: number; + successTime: Date; createTime: Date; + updateTime: Date; + notifyUrl: string; + channelNotifyData: string; } /** 转账单分页请求 */ - export interface TransferPageReq extends PageParam { + export interface TransferPageReqVO extends PageParam { + no?: string; appId?: number; - channelId?: number; channelCode?: string; - merchantTransferId?: string; - type?: number; - price?: number; - subject?: string; - userName?: string; + merchantOrderId?: string; status?: number; + userName?: string; + userAccount?: string; + channelTransferNo?: string; createTime?: Date[]; } } /** 查询转账单列表 */ -export function getTransferPage(params: PayTransferApi.TransferPageReq) { +export function getTransferPage(params: PayTransferApi.TransferPageReqVO) { return requestClient.get>( '/pay/transfer/page', { diff --git a/apps/web-antd/src/api/pay/wallet/balance/index.ts b/apps/web-antd/src/api/pay/wallet/balance/index.ts index 71e8e76d609d8e214d9bc2c69b6a512c21967297..e3440f9117821268608ebf2f46223f1ae7269149 100644 --- a/apps/web-antd/src/api/pay/wallet/balance/index.ts +++ b/apps/web-antd/src/api/pay/wallet/balance/index.ts @@ -20,7 +20,7 @@ export namespace PayWalletApi { } /** 钱包分页请求 */ - export interface WalletPageReq extends PageParam { + export interface WalletPageReqVO extends PageParam { userId?: number; userType?: number; balance?: number; @@ -38,7 +38,7 @@ export function getWallet(params: PayWalletApi.PayWalletUserReq) { } /** 查询会员钱包列表 */ -export function getWalletPage(params: PayWalletApi.WalletPageReq) { +export function getWalletPage(params: PayWalletApi.WalletPageReqVO) { return requestClient.get>( '/pay/wallet/page', { diff --git a/apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts b/apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts index 32c3bbfaf008bcc27ca4fdc59dd1beccddd84ba5..7f8b5621fa06a6d79588672e240e3545ee90fca7 100644 --- a/apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts +++ b/apps/web-antd/src/api/pay/wallet/rechargePackage/index.ts @@ -4,7 +4,7 @@ import { requestClient } from '#/api/request'; export namespace WalletRechargePackageApi { /** 充值套餐信息 */ - export interface Package { + export interface WalletRechargePackage { id?: number; name: string; payPrice: number; @@ -14,33 +14,36 @@ export namespace WalletRechargePackageApi { } /** 查询充值套餐列表 */ -export function getPackagePage(params: PageParam) { - return requestClient.get>( - '/pay/wallet-recharge-package/page', - { - params, - }, - ); +export function getWalletRechargePackagePage(params: PageParam) { + return requestClient.get< + PageResult + >('/pay/wallet-recharge-package/page', { + params, + }); } /** 查询充值套餐详情 */ -export function getPackage(id: number) { - return requestClient.get( +export function getWalletRechargePackage(id: number) { + return requestClient.get( `/pay/wallet-recharge-package/get?id=${id}`, ); } /** 新增充值套餐 */ -export function createPackage(data: WalletRechargePackageApi.Package) { +export function createWalletRechargePackage( + data: WalletRechargePackageApi.WalletRechargePackage, +) { return requestClient.post('/pay/wallet-recharge-package/create', data); } /** 修改充值套餐 */ -export function updatePackage(data: WalletRechargePackageApi.Package) { +export function updateWalletRechargePackage( + data: WalletRechargePackageApi.WalletRechargePackage, +) { return requestClient.put('/pay/wallet-recharge-package/update', data); } /** 删除充值套餐 */ -export function deletePackage(id: number) { +export function deleteWalletRechargePackage(id: number) { return requestClient.delete(`/pay/wallet-recharge-package/delete?id=${id}`); } diff --git a/apps/web-antd/src/components/upload/input-upload.vue b/apps/web-antd/src/components/upload/input-upload.vue index ef76658bb2474e9b261d8eca202f9994d3b72d81..66495467a455603e9a5886223ebe8a0428f07329 100644 --- a/apps/web-antd/src/components/upload/input-upload.vue +++ b/apps/web-antd/src/components/upload/input-upload.vue @@ -1,5 +1,4 @@ diff --git a/apps/web-antd/src/views/erp/finance/payment/data.ts b/apps/web-antd/src/views/erp/finance/payment/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..a33430fafbb332a41b6e1825e6a7b8147fa49814 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/payment/data.ts @@ -0,0 +1,597 @@ +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 { erpPriceInputFormatter } from '@vben/utils'; + +import { getAccountSimpleList } from '#/api/erp/finance/account'; +import { getSupplierSimpleList } from '#/api/erp/purchase/supplier'; +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: 'paymentTime', + label: '付款时间', + component: 'DatePicker', + componentProps: { + disabled: formType === 'detail', + placeholder: '选择付款时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + }, + rules: 'required', + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'ApiSelect', + componentProps: { + disabled: formType === 'detail', + placeholder: '请选择供应商', + allowClear: true, + showSearch: true, + api: getSupplierSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + rules: 'required', + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + 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', + }, + { + fieldName: 'accountId', + label: '付款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择付款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + }, + { + fieldName: 'totalPrice', + label: '合计付款', + component: 'InputNumber', + componentProps: { + placeholder: '合计付款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + }, + }, + { + fieldName: 'discountPrice', + label: '优惠金额', + component: 'InputNumber', + componentProps: { + disabled: formType === 'detail', + placeholder: '请输入优惠金额', + precision: 2, + formatter: erpPriceInputFormatter, + }, + }, + { + fieldName: 'paymentPrice', + label: '实际付款', + component: 'InputNumber', + componentProps: { + placeholder: '实际付款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + }, + dependencies: { + triggerFields: ['totalPrice', 'discountPrice'], + componentProps: (values) => { + const totalPrice = values.totalPrice || 0; + const discountPrice = values.discountPrice || 0; + values.paymentPrice = totalPrice - discountPrice; + return {}; + }, + }, + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'bizNo', + title: '采购单据编号', + minWidth: 200, + }, + { + field: 'totalPrice', + title: '应付金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'paidPrice', + title: '已付金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'paymentPrice', + title: '本次付款', + minWidth: 115, + fixed: 'right', + slots: { default: 'paymentPrice' }, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '付款单号', + component: 'Input', + componentProps: { + placeholder: '请输入付款单号', + allowClear: true, + }, + }, + { + fieldName: 'paymentTime', + label: '付款时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择供应商', + allowClear: true, + showSearch: true, + api: getSupplierSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + fieldName: 'accountId', + label: '付款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择付款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + fieldNames: { + label: 'name', + value: '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, + }, + }, + { + fieldName: 'bizNo', + label: '采购单号', + component: 'Input', + componentProps: { + placeholder: '请输入采购单号', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '付款单号', + width: 180, + fixed: 'left', + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'paymentTime', + title: '付款时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'financeUserName', + title: '财务人员', + minWidth: 120, + }, + { + field: 'accountName', + title: '付款账户', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '合计付款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'discountPrice', + title: '优惠金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'paymentPrice', + title: '实际付款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 90, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 220, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 采购入库单选择表单的配置项 */ +export function usePurchaseInGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '入库单号', + component: 'Input', + componentProps: { + placeholder: '请输入入库单号', + allowClear: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择供应商', + }, + }, + { + fieldName: 'paymentStatus', + label: '付款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未付款', value: 0 }, + { label: '部分付款', value: 1 }, + { label: '全部付款', value: 2 }, + ], + placeholder: '请选择付款状态', + allowClear: true, + }, + }, + ]; +} + +/** 采购入库单选择列表的字段 */ +export function usePurchaseInGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '入库单号', + width: 200, + fixed: 'left', + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'inTime', + title: '入库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应付金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'paymentPrice', + title: '已付金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unPaymentPrice', + title: '未付金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.paymentPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} + +/** 采购退货单选择表单的配置项 */ +export function useSaleReturnGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '退货单号', + component: 'Input', + componentProps: { + placeholder: '请输入退货单号', + allowClear: true, + }, + }, + { + fieldName: 'supplierId', + label: '供应商', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择供应商', + }, + }, + { + fieldName: 'refundStatus', + label: '退款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未退款', value: 0 }, + { label: '部分退款', value: 1 }, + { label: '全部退款', value: 2 }, + ], + placeholder: '请选择退款状态', + allowClear: true, + }, + }, + ]; +} + +/** 采购退货单选择列表的字段 */ +export function useSaleReturnGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '退货单号', + width: 200, + fixed: 'left', + }, + { + field: 'supplierName', + title: '供应商', + minWidth: 120, + }, + { + field: 'returnTime', + title: '退货时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'refundPrice', + title: '已退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unRefundPrice', + title: '未退金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.refundPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/erp/finance/payment/index.vue b/apps/web-antd/src/views/erp/finance/payment/index.vue index ed6812177db6585be2f33ea130703ffe24a5a82d..7abf85a186b68ede8fff1e7d2683cf37f344dee9 100644 --- a/apps/web-antd/src/views/erp/finance/payment/index.vue +++ b/apps/web-antd/src/views/erp/finance/payment/index.vue @@ -1,34 +1,225 @@ diff --git a/apps/web-antd/src/views/erp/finance/payment/modules/form.vue b/apps/web-antd/src/views/erp/finance/payment/modules/form.vue new file mode 100644 index 0000000000000000000000000000000000000000..14ef85e8e668f3a4b54006a7c3ba057a783cbc53 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/payment/modules/form.vue @@ -0,0 +1,194 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue b/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue new file mode 100644 index 0000000000000000000000000000000000000000..3dfa62a8edc9457838593c577ad85e6a5461aaba --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/payment/modules/item-form.vue @@ -0,0 +1,292 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/payment/modules/purchase-in-select.vue b/apps/web-antd/src/views/erp/finance/payment/modules/purchase-in-select.vue new file mode 100644 index 0000000000000000000000000000000000000000..efcea61fcdbeff00c5a939c16b148685dcf00e67 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/payment/modules/purchase-in-select.vue @@ -0,0 +1,108 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/payment/modules/sale-return-select.vue b/apps/web-antd/src/views/erp/finance/payment/modules/sale-return-select.vue new file mode 100644 index 0000000000000000000000000000000000000000..e7100ad3528fd4d611d1742bab1f28465aa60024 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/payment/modules/sale-return-select.vue @@ -0,0 +1,112 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/receipt/data.ts b/apps/web-antd/src/views/erp/finance/receipt/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..e1839932a641a3c61a51f39f8e35c3f0742fb9c8 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/receipt/data.ts @@ -0,0 +1,597 @@ +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 { erpPriceInputFormatter } from '@vben/utils'; + +import { getAccountSimpleList } from '#/api/erp/finance/account'; +import { getCustomerSimpleList } from '#/api/erp/sale/customer'; +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: 'receiptTime', + label: '收款时间', + component: 'DatePicker', + componentProps: { + disabled: formType === 'detail', + placeholder: '选择收款时间', + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + }, + rules: 'required', + }, + { + fieldName: 'customerId', + label: '客户', + component: 'ApiSelect', + componentProps: { + disabled: formType === 'detail', + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + rules: 'required', + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + 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', + }, + { + fieldName: 'accountId', + label: '收款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择收款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + }, + { + fieldName: 'totalPrice', + label: '合计收款', + component: 'InputNumber', + componentProps: { + placeholder: '合计收款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + }, + }, + { + fieldName: 'discountPrice', + label: '优惠金额', + component: 'InputNumber', + componentProps: { + disabled: formType === 'detail', + placeholder: '请输入优惠金额', + precision: 2, + formatter: erpPriceInputFormatter, + }, + }, + { + fieldName: 'receiptPrice', + label: '实际收款', + component: 'InputNumber', + componentProps: { + placeholder: '实际收款', + precision: 2, + formatter: erpPriceInputFormatter, + disabled: true, + }, + dependencies: { + triggerFields: ['totalPrice', 'discountPrice'], + componentProps: (values) => { + const totalPrice = values.totalPrice || 0; + const discountPrice = values.discountPrice || 0; + values.receiptPrice = totalPrice - discountPrice; + return {}; + }, + }, + }, + ]; +} + +/** 表单的明细表格列 */ +export function useFormItemColumns(): VxeTableGridOptions['columns'] { + return [ + { type: 'seq', title: '序号', minWidth: 50, fixed: 'left' }, + { + field: 'bizNo', + title: '销售单据编号', + minWidth: 200, + }, + { + field: 'totalPrice', + title: '应收金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'receiptedPrice', + title: '已收金额', + minWidth: 100, + formatter: 'formatAmount2', + }, + { + field: 'receiptPrice', + title: '本次收款', + minWidth: 115, + fixed: 'right', + slots: { default: 'receiptPrice' }, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + slots: { default: 'remark' }, + }, + { + title: '操作', + width: 50, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '收款单号', + component: 'Input', + componentProps: { + placeholder: '请输入收款单号', + allowClear: true, + }, + }, + { + fieldName: 'receiptTime', + label: '收款时间', + component: 'RangePicker', + componentProps: { + ...getRangePickerDefaultProps(), + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择客户', + allowClear: true, + showSearch: true, + api: getCustomerSimpleList, + fieldNames: { + label: 'name', + value: 'id', + }, + }, + }, + { + fieldName: 'creator', + label: '创建人', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择创建人', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + fieldName: 'financeUserId', + label: '财务人员', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择财务人员', + allowClear: true, + showSearch: true, + api: getSimpleUserList, + fieldNames: { + label: 'nickname', + value: 'id', + }, + }, + }, + { + fieldName: 'accountId', + label: '收款账户', + component: 'ApiSelect', + componentProps: { + placeholder: '请选择收款账户', + allowClear: true, + showSearch: true, + api: getAccountSimpleList, + fieldNames: { + label: 'name', + value: '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, + }, + }, + { + fieldName: 'bizNo', + label: '销售单号', + component: 'Input', + componentProps: { + placeholder: '请输入销售单号', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '收款单号', + width: 180, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'receiptTime', + title: '收款时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'creatorName', + title: '创建人', + minWidth: 120, + }, + { + field: 'financeUserName', + title: '财务人员', + minWidth: 120, + }, + { + field: 'accountName', + title: '收款账户', + minWidth: 120, + }, + { + field: 'totalPrice', + title: '合计收款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'discountPrice', + title: '优惠金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'receiptPrice', + title: '实际收款', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 90, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + { + title: '操作', + width: 220, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} + +/** 销售出库单选择表单的配置项 */ +export function useSaleOutGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '出库单号', + component: 'Input', + componentProps: { + placeholder: '请输入出库单号', + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择客户', + }, + }, + { + fieldName: 'receiptStatus', + label: '收款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未收款', value: 0 }, + { label: '部分收款', value: 1 }, + { label: '全部收款', value: 2 }, + ], + placeholder: '请选择收款状态', + allowClear: true, + }, + }, + ]; +} + +/** 销售出库单选择列表的字段 */ +export function useSaleOutGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '出库单号', + width: 200, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'outTime', + title: '出库时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应收金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'receiptPrice', + title: '已收金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unReceiptPrice', + title: '未收金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.receiptPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} + +/** 销售退货单选择表单的配置项 */ +export function useSaleReturnGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'no', + label: '退货单号', + component: 'Input', + componentProps: { + placeholder: '请输入退货单号', + allowClear: true, + }, + }, + { + fieldName: 'customerId', + label: '客户', + component: 'Input', + componentProps: { + disabled: true, + placeholder: '已自动选择客户', + }, + }, + { + fieldName: 'refundStatus', + label: '退款状态', + component: 'Select', + componentProps: { + options: [ + { label: '未退款', value: 0 }, + { label: '部分退款', value: 1 }, + { label: '全部退款', value: 2 }, + ], + placeholder: '请选择退款状态', + allowClear: true, + }, + }, + ]; +} + +/** 销售退货单选择列表的字段 */ +export function useSaleReturnGridColumns(): VxeTableGridOptions['columns'] { + return [ + { + type: 'checkbox', + width: 50, + fixed: 'left', + }, + { + field: 'no', + title: '退货单号', + width: 200, + fixed: 'left', + }, + { + field: 'customerName', + title: '客户', + minWidth: 120, + }, + { + field: 'returnTime', + title: '退货时间', + width: 160, + formatter: 'formatDate', + }, + { + field: 'totalPrice', + title: '应退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'refundPrice', + title: '已退金额', + formatter: 'formatAmount2', + minWidth: 120, + }, + { + field: 'unRefundPrice', + title: '未退金额', + formatter: ({ row }) => { + return erpPriceInputFormatter(row.totalPrice - row.refundPrice || 0); + }, + minWidth: 120, + }, + { + field: 'status', + title: '状态', + minWidth: 100, + cellRender: { + name: 'CellDict', + props: { type: DICT_TYPE.ERP_AUDIT_STATUS }, + }, + }, + ]; +} diff --git a/apps/web-antd/src/views/erp/finance/receipt/index.vue b/apps/web-antd/src/views/erp/finance/receipt/index.vue index d173fe5ccbeb67fc6818c3b4e4ac06bd380253c0..53e65c591586ebc1fabd269742722b5b0a39cb94 100644 --- a/apps/web-antd/src/views/erp/finance/receipt/index.vue +++ b/apps/web-antd/src/views/erp/finance/receipt/index.vue @@ -1,34 +1,225 @@ diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue new file mode 100644 index 0000000000000000000000000000000000000000..7f7726fc3e7ce6955b7c5ebf1babab9fec8a8362 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/form.vue @@ -0,0 +1,194 @@ + + + \ No newline at end of file diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue new file mode 100644 index 0000000000000000000000000000000000000000..2d9230b690adc914c386f1e4583ee197eed51cf9 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/item-form.vue @@ -0,0 +1,292 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/sale-out-select.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/sale-out-select.vue new file mode 100644 index 0000000000000000000000000000000000000000..19d0231258d167c73e2820066b11280fbf148d24 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/sale-out-select.vue @@ -0,0 +1,104 @@ + + + diff --git a/apps/web-antd/src/views/erp/finance/receipt/modules/sale-return-select.vue b/apps/web-antd/src/views/erp/finance/receipt/modules/sale-return-select.vue new file mode 100644 index 0000000000000000000000000000000000000000..8dfa97c3c06b1b4e67bd52c7a2e19d79ab5c2428 --- /dev/null +++ b/apps/web-antd/src/views/erp/finance/receipt/modules/sale-return-select.vue @@ -0,0 +1,108 @@ + + + diff --git a/apps/web-antd/src/views/erp/home/index.vue b/apps/web-antd/src/views/erp/home/index.vue index 8befaf713178f48ac246c79b830510e026486010..7b9d86e26bc815d64da7a4a78ccfc15ccdb10716 100644 --- a/apps/web-antd/src/views/erp/home/index.vue +++ b/apps/web-antd/src/views/erp/home/index.vue @@ -5,8 +5,8 @@ import { DocAlert, Page } from '@vben/common-ui'; import { Col, Row, Spin } from 'ant-design-vue'; -import SummaryCard from './components/SummaryCard.vue'; -import TimeSummaryChart from './components/TimeSummaryChart.vue'; +import SummaryCard from './modules/SummaryCard.vue'; +import TimeSummaryChart from './modules/TimeSummaryChart.vue'; /** ERP首页 */ defineOptions({ name: 'ErpHome' }); diff --git a/apps/web-antd/src/views/erp/home/components/SummaryCard.vue b/apps/web-antd/src/views/erp/home/modules/SummaryCard.vue similarity index 96% rename from apps/web-antd/src/views/erp/home/components/SummaryCard.vue rename to apps/web-antd/src/views/erp/home/modules/SummaryCard.vue index fc36c15d17fe39c11e46770fedc5863c12156259..ff98e556a0585025c693719ccf4d058e64b3abf7 100644 --- a/apps/web-antd/src/views/erp/home/components/SummaryCard.vue +++ b/apps/web-antd/src/views/erp/home/modules/SummaryCard.vue @@ -32,7 +32,6 @@ const props = withDefaults(defineProps(), { }); /** 概览数据 */ -// TODO @nehc:应该是有 8 个小卡片,少了 4 个? const overviewItems = computed(() => [ { icon: SvgCardIcon, diff --git a/apps/web-antd/src/views/erp/home/components/TimeSummaryChart.vue b/apps/web-antd/src/views/erp/home/modules/TimeSummaryChart.vue similarity index 96% rename from apps/web-antd/src/views/erp/home/components/TimeSummaryChart.vue rename to apps/web-antd/src/views/erp/home/modules/TimeSummaryChart.vue index e24f2e4b17051b7200a69eaca7cc0852bcafb1a1..9bdc96eedccc6e0e9b4787f1a930a71e767230fe 100644 --- a/apps/web-antd/src/views/erp/home/components/TimeSummaryChart.vue +++ b/apps/web-antd/src/views/erp/home/modules/TimeSummaryChart.vue @@ -123,11 +123,9 @@ watch( if (!val || val.length === 0) { return; } - // 更新图表数据 const xAxisData = val.map((item) => item.time); const seriesData = val.map((item) => item.price); - const options = { ...lineChartOptions, xAxis: { @@ -141,7 +139,6 @@ watch( }, ], }; - renderEcharts(options); }, { immediate: true }, @@ -151,14 +148,6 @@ watch( onMounted(() => { initData(); }); - -/** 暴露数据给父组件使用 */ -defineExpose({ - saleSummary, - purchaseSummary, - saleTimeSummaryList, - purchaseTimeSummaryList, -}); - + + - + + - + - + - - + \ No newline at end of file diff --git a/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts b/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts index f6fa96ec04f6f1d051da956028b19c40ddfd8389..57cfbee8a7f88ea22028bcb21f70526662f16e67 100644 --- a/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts +++ b/apps/web-ele/src/views/pay/wallet/rechargePackage/data.ts @@ -1,50 +1,66 @@ import type { VbenFormSchema } from '#/adapter/form'; import type { VxeTableGridOptions } from '#/adapter/vxe-table'; -import { DICT_TYPE } from '@vben/constants'; +import { CommonStatusEnum, DICT_TYPE } from '@vben/constants'; import { getDictOptions } from '@vben/hooks'; +import { z } from '#/adapter/form'; import { getRangePickerDefaultProps } from '#/utils'; /** 新增/修改的表单 */ export function useFormSchema(): VbenFormSchema[] { return [ + { + fieldName: 'id', + component: 'Input', + dependencies: { + triggerFields: [''], + show: () => false, + }, + }, { fieldName: 'name', - label: '套餐名', + label: '套餐名称', component: 'Input', rules: 'required', + componentProps: { + placeholder: '请输入套餐名称', + }, }, { fieldName: 'payPrice', label: '支付金额(元)', component: 'InputNumber', - rules: 'required', + rules: z.number().min(0, '支付金额不能小于0'), componentProps: { min: 0, precision: 2, step: 0.01, + placeholder: '请输入支付金额', }, }, { fieldName: 'bonusPrice', label: '赠送金额(元)', component: 'InputNumber', - rules: 'required', + rules: z.number().min(0, '赠送金额不能小于0'), componentProps: { min: 0, precision: 2, step: 0.01, + placeholder: '请输入赠送金额', }, }, { fieldName: 'status', label: '开启状态', component: 'RadioGroup', - rules: 'required', componentProps: { options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + buttonStyle: 'solid', + optionType: 'button', }, + rules: z.number().default(CommonStatusEnum.ENABLE), }, ]; } @@ -56,14 +72,19 @@ export function useGridFormSchema(): VbenFormSchema[] { fieldName: 'name', label: '套餐名称', component: 'Input', + componentProps: { + placeholder: '请输入套餐名称', + clearable: true, + }, }, { fieldName: 'status', label: '状态', component: 'Select', componentProps: { - clearable: true, options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + placeholder: '请选择状态', + clearable: true, }, }, { @@ -71,8 +92,8 @@ export function useGridFormSchema(): VbenFormSchema[] { label: '创建时间', component: 'RangePicker', componentProps: { - clearable: true, ...getRangePickerDefaultProps(), + clearable: true, }, }, ]; @@ -83,25 +104,30 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { return [ { field: 'id', - title: '编号', + title: '套餐编号', + minWidth: 100, }, { field: 'name', title: '套餐名称', + minWidth: 150, }, { field: 'payPrice', title: '支付金额', + minWidth: 120, formatter: 'formatFenToYuanAmount', }, { field: 'bonusPrice', title: '赠送金额', + minWidth: 120, formatter: 'formatFenToYuanAmount', }, { field: 'status', title: '状态', + minWidth: 100, cellRender: { name: 'CellDict', props: { type: DICT_TYPE.COMMON_STATUS }, @@ -110,11 +136,12 @@ export function useGridColumns(): VxeTableGridOptions['columns'] { { field: 'createTime', title: '创建时间', + minWidth: 180, formatter: 'formatDateTime', }, { title: '操作', - width: 130, + width: 160, fixed: 'right', slots: { default: 'actions' }, }, diff --git a/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue b/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue index 3f079aad9242fd8b606742fdd66e1d21e5e5d006..f533bb5337b487ca4ff12b54486febd6fea71dbc 100644 --- a/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue +++ b/apps/web-ele/src/views/pay/wallet/rechargePackage/index.vue @@ -1,5 +1,6 @@