diff --git a/apps/web-antd/src/api/erp/finance/account/index.ts b/apps/web-antd/src/api/erp/finance/account/index.ts index e180af65f..1f630b87d 100644 --- a/apps/web-antd/src/api/erp/finance/account/index.ts +++ b/apps/web-antd/src/api/erp/finance/account/index.ts @@ -3,7 +3,7 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export namespace ErpAccountApi { - /** ERP 结算账户信息 */ + /** 结算账户信息 */ export interface Account { id?: number; // 结算账户编号 no: string; // 账户编码 @@ -13,17 +13,10 @@ export namespace ErpAccountApi { defaultStatus: boolean; // 是否默认 name: string; // 账户名称 } - - /** 结算账户分页查询参数 */ - export interface AccountPageParam extends PageParam { - name?: string; - no?: string; - status?: number; - } } /** 查询结算账户分页 */ -export function getAccountPage(params: ErpAccountApi.AccountPageParam) { +export function getAccountPage(params: PageParam) { return requestClient.get>( '/erp/account/page', { params }, 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 502811665..004713ce8 100644 --- a/apps/web-antd/src/api/erp/finance/payment/index.ts +++ b/apps/web-antd/src/api/erp/finance/payment/index.ts @@ -3,19 +3,6 @@ import type { PageParam, PageResult } from '@vben/request'; import { requestClient } from '#/api/request'; export 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; // 付款单编号 @@ -39,24 +26,22 @@ export namespace ErpFinancePaymentApi { bizNo?: string; // 业务单号 } - /** 付款单分页查询参数 */ - export interface FinancePaymentPageParams extends PageParam { - no?: string; - paymentTime?: [string, string]; - supplierId?: number; - creator?: string; - financeUserId?: number; - accountId?: number; - status?: number; - remark?: string; - bizNo?: string; + /** 付款单项 */ + 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 function getFinancePaymentPage( - params: ErpFinancePaymentApi.FinancePaymentPageParams, -) { +export function getFinancePaymentPage(params: PageParam) { return requestClient.get>( '/erp/finance-payment/page', { @@ -103,9 +88,7 @@ export function deleteFinancePayment(ids: number[]) { } /** 导出付款单 Excel */ -export function exportFinancePayment( - params: ErpFinancePaymentApi.FinancePaymentPageParams, -) { +export function exportFinancePayment(params: any) { return requestClient.download('/erp/finance-payment/export-excel', { params, }); 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 e86a3f699..f871035b5 100644 --- a/apps/web-antd/src/api/erp/finance/receipt/index.ts +++ b/apps/web-antd/src/api/erp/finance/receipt/index.ts @@ -6,7 +6,7 @@ export namespace ErpFinanceReceiptApi { /** 收款单项 */ export interface FinanceReceiptItem { id?: number; - row_id?: number; // 前端使用的临时ID + row_id?: number; // 前端使用的临时 ID bizId: number; // 业务ID bizType: number; // 业务类型 bizNo: string; // 业务编号 @@ -38,25 +38,10 @@ export namespace ErpFinanceReceiptApi { items?: FinanceReceiptItem[]; // 收款明细 bizNo?: string; // 业务单号 } - - /** 收款单分页查询参数 */ - export interface FinanceReceiptPageParams extends PageParam { - no?: string; - receiptTime?: [string, string]; - customerId?: number; - creator?: string; - financeUserId?: number; - accountId?: number; - status?: number; - remark?: string; - bizNo?: string; - } } /** 查询收款单分页 */ -export function getFinanceReceiptPage( - params: ErpFinanceReceiptApi.FinanceReceiptPageParams, -) { +export function getFinanceReceiptPage(params: PageParam) { return requestClient.get>( '/erp/finance-receipt/page', { @@ -103,9 +88,7 @@ export function deleteFinanceReceipt(ids: number[]) { } /** 导出收款单 Excel */ -export function exportFinanceReceipt( - params: ErpFinanceReceiptApi.FinanceReceiptPageParams, -) { +export function exportFinanceReceipt(params: any) { return requestClient.download('/erp/finance-receipt/export-excel', { params, }); diff --git a/apps/web-ele/src/api/erp/finance/account/index.ts b/apps/web-ele/src/api/erp/finance/account/index.ts new file mode 100644 index 000000000..1f630b87d --- /dev/null +++ b/apps/web-ele/src/api/erp/finance/account/index.ts @@ -0,0 +1,61 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpAccountApi { + /** 结算账户信息 */ + export interface Account { + id?: number; // 结算账户编号 + no: string; // 账户编码 + remark: string; // 备注 + status: number; // 开启状态 + sort: number; // 排序 + defaultStatus: boolean; // 是否默认 + name: string; // 账户名称 + } +} + +/** 查询结算账户分页 */ +export function getAccountPage(params: PageParam) { + return requestClient.get>( + '/erp/account/page', + { params }, + ); +} + +/** 查询结算账户精简列表 */ +export function getAccountSimpleList() { + return requestClient.get('/erp/account/simple-list'); +} + +/** 查询结算账户详情 */ +export function getAccount(id: number) { + return requestClient.get(`/erp/account/get?id=${id}`); +} + +/** 新增结算账户 */ +export function createAccount(data: ErpAccountApi.Account) { + return requestClient.post('/erp/account/create', data); +} + +/** 修改结算账户 */ +export function updateAccount(data: ErpAccountApi.Account) { + return requestClient.put('/erp/account/update', data); +} + +/** 修改结算账户默认状态 */ +export function updateAccountDefaultStatus(id: number, defaultStatus: boolean) { + return requestClient.put('/erp/account/update-default-status', null, { + params: { id, defaultStatus }, + }); +} + +/** 删除结算账户 */ +export function deleteAccount(id: number) { + return requestClient.delete(`/erp/account/delete?id=${id}`); +} + +/** 导出结算账户 Excel */ +export function exportAccount(params: any) { + return requestClient.download('/erp/account/export-excel', { params }); +} diff --git a/apps/web-ele/src/api/erp/finance/payment/index.ts b/apps/web-ele/src/api/erp/finance/payment/index.ts new file mode 100644 index 000000000..004713ce8 --- /dev/null +++ b/apps/web-ele/src/api/erp/finance/payment/index.ts @@ -0,0 +1,95 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export namespace ErpFinancePaymentApi { + /** 付款单信息 */ + 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 FinancePaymentItem { + id?: number; + row_id?: number; // 前端使用的临时 ID + bizId: number; // 业务ID + bizType: number; // 业务类型 + bizNo: string; // 业务编号 + totalPrice: number; // 应付金额 + paidPrice: number; // 已付金额 + paymentPrice: number; // 本次付款 + remark?: string; // 备注 + } +} + +/** 查询付款单分页 */ +export function getFinancePaymentPage(params: PageParam) { + return requestClient.get>( + '/erp/finance-payment/page', + { + params, + }, + ); +} + +/** 查询付款单详情 */ +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(id: number, status: number) { + return requestClient.put('/erp/finance-payment/update-status', null, { + params: { id, status }, + }); +} + +/** 删除付款单 */ +export function deleteFinancePayment(ids: number[]) { + return requestClient.delete('/erp/finance-payment/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出付款单 Excel */ +export function exportFinancePayment(params: any) { + return requestClient.download('/erp/finance-payment/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/api/erp/finance/receipt/index.ts b/apps/web-ele/src/api/erp/finance/receipt/index.ts new file mode 100644 index 000000000..f871035b5 --- /dev/null +++ b/apps/web-ele/src/api/erp/finance/receipt/index.ts @@ -0,0 +1,95 @@ +import type { PageParam, PageResult } from '@vben/request'; + +import { requestClient } from '#/api/request'; + +export 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 function getFinanceReceiptPage(params: PageParam) { + return requestClient.get>( + '/erp/finance-receipt/page', + { + params, + }, + ); +} + +/** 查询收款单详情 */ +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(id: number, status: number) { + return requestClient.put('/erp/finance-receipt/update-status', null, { + params: { id, status }, + }); +} + +/** 删除收款单 */ +export function deleteFinanceReceipt(ids: number[]) { + return requestClient.delete('/erp/finance-receipt/delete', { + params: { + ids: ids.join(','), + }, + }); +} + +/** 导出收款单 Excel */ +export function exportFinanceReceipt(params: any) { + return requestClient.download('/erp/finance-receipt/export-excel', { + params, + }); +} diff --git a/apps/web-ele/src/views/erp/finance/account/data.ts b/apps/web-ele/src/views/erp/finance/account/data.ts new file mode 100644 index 000000000..497d4e310 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/account/data.ts @@ -0,0 +1,188 @@ +import type { VbenFormSchema } from '#/adapter/form'; +import type { VxeTableGridOptions } from '#/adapter/vxe-table'; +import type { ErpAccountApi } from '#/api/erp/finance/account'; + +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, + }, + }, + { + component: 'Input', + fieldName: 'name', + label: '名称', + rules: 'required', + componentProps: { + placeholder: '请输入名称', + }, + }, + { + fieldName: 'status', + label: '状态', + component: 'RadioGroup', + componentProps: { + options: getDictOptions(DICT_TYPE.COMMON_STATUS, 'number'), + }, + rules: z.number().default(CommonStatusEnum.ENABLE), + }, + + { + fieldName: 'sort', + label: '排序', + component: 'InputNumber', + componentProps: { + placeholder: '请输入排序', + precision: 0, + controlsPosition: 'right', + class: '!w-full', + }, + rules: 'required', + defaultValue: 0, + }, + { + fieldName: 'defaultStatus', + label: '是否默认', + component: 'RadioGroup', + componentProps: { + options: [ + { + label: '是', + value: true, + }, + { + label: '否', + value: false, + }, + ], + }, + rules: z.boolean().default(false).optional(), + }, + { + fieldName: 'no', + label: '编码', + component: 'Input', + componentProps: { + placeholder: '请输入编码', + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Textarea', + componentProps: { + placeholder: '请输入备注', + rows: 3, + }, + }, + ]; +} + +/** 列表的搜索表单 */ +export function useGridFormSchema(): VbenFormSchema[] { + return [ + { + fieldName: 'name', + label: '名称', + component: 'Input', + componentProps: { + placeholder: '请输入名称', + allowClear: true, + }, + }, + { + fieldName: 'no', + label: '编码', + component: 'Input', + componentProps: { + placeholder: '请输入编码', + allowClear: true, + }, + }, + { + fieldName: 'remark', + label: '备注', + component: 'Input', + componentProps: { + placeholder: '请输入备注', + allowClear: true, + }, + }, + ]; +} + +/** 列表的字段 */ +export function useGridColumns( + onDefaultStatusChange?: ( + newStatus: boolean, + row: ErpAccountApi.Account, + ) => PromiseLike, +): VxeTableGridOptions['columns'] { + return [ + { + field: 'name', + title: '名称', + minWidth: 150, + }, + { + field: 'no', + title: '编码', + minWidth: 120, + }, + { + field: 'remark', + title: '备注', + minWidth: 150, + showOverflow: 'tooltip', + }, + { + 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: 'createTime', + title: '创建时间', + minWidth: 180, + formatter: 'formatDateTime', + }, + { + title: '操作', + width: 130, + fixed: 'right', + slots: { default: 'actions' }, + }, + ]; +} diff --git a/apps/web-ele/src/views/erp/finance/account/index.vue b/apps/web-ele/src/views/erp/finance/account/index.vue new file mode 100644 index 000000000..4daedf709 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/account/index.vue @@ -0,0 +1,174 @@ + + + diff --git a/apps/web-ele/src/views/erp/finance/account/modules/form.vue b/apps/web-ele/src/views/erp/finance/account/modules/form.vue new file mode 100644 index 000000000..eced899a4 --- /dev/null +++ b/apps/web-ele/src/views/erp/finance/account/modules/form.vue @@ -0,0 +1,86 @@ + + + diff --git a/packages/constants/src/system-enum.ts b/packages/constants/src/system-enum.ts index e07125c43..617afafd6 100644 --- a/packages/constants/src/system-enum.ts +++ b/packages/constants/src/system-enum.ts @@ -3,6 +3,7 @@ * * 枚举类 */ +// TODO @AI:后面拆分成 AI、ERP、OA 这种枚举 /** * AI 平台的枚举