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 e9dc1847a..038ed5f20 100644 --- a/apps/web-antd/src/api/erp/finance/payment/index.ts +++ b/apps/web-antd/src/api/erp/finance/payment/index.ts @@ -3,22 +3,53 @@ 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; + remark?: string; + bizNo?: string; } /** 付款单状态更新参数 */ 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 index 77fc0509d..c6caf1d84 100644 --- a/apps/web-antd/src/views/erp/finance/payment/modules/form.vue +++ b/apps/web-antd/src/views/erp/finance/payment/modules/form.vue @@ -63,15 +63,19 @@ const [Form, formApi] = useVbenForm({ schema: useFormSchema(formType.value), showDefaultActions: false, handleValuesChange: (values, changedFields) => { - // 目的:同步到 item-form 组件,触发整体的价格计算 - if (formData.value && changedFields.includes('discountPrice')) { - formData.value.discountPrice = values.discountPrice; - // 重新计算实际付款 - formData.value.paymentPrice = - formData.value.totalPrice - values.discountPrice; - formApi.setValues({ - paymentPrice: formData.value.paymentPrice, - }); + if (formData.value) { + if (changedFields.includes('supplierId')) { + formData.value.supplierId = values.supplierId; + } + // 目的:同步到 item-form 组件,触发整体的价格计算 + if (changedFields.includes('discountPrice')) { + formData.value.discountPrice = values.discountPrice; + formData.value.paymentPrice = + formData.value.totalPrice - values.discountPrice; + formApi.setValues({ + paymentPrice: formData.value.paymentPrice, + }); + } } }, }); @@ -164,15 +168,13 @@ const [Modal, modalApi] = useVbenModal({ >
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 index e0145ff1c..b3b50d394 100644 --- 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 @@ -13,6 +13,8 @@ import { Input, InputNumber, message } from 'ant-design-vue'; import { TableAction, useVbenVxeGrid } from '#/adapter/vxe-table'; import { useFormItemColumns } from '../data'; +import PurchaseInSelect from './purchase-in-select.vue'; +import SaleReturnSelect from './sale-return-select.vue'; interface Props { items?: ErpFinancePaymentApi.FinancePaymentItem[]; @@ -22,6 +24,7 @@ interface Props { const props = withDefaults(defineProps