feat(@vben/web-antd): erp-采购订单表单逻辑
- 使用 handleValuesChange - 优化 discountPrice 和 totalPrice 的计算逻辑 - 改进子表单的验证和数据处理 - 统一数值格式化处理 - 优化表格数据的更新方式
This commit is contained in:
@@ -3,6 +3,7 @@ import type { VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
|
||||
import { erpCountInputFormatter, erpPriceInputFormatter } from '@vben/utils';
|
||||
|
||||
import { z } from '#/adapter/form';
|
||||
import { getAccountSimpleList } from '#/api/erp/finance/account';
|
||||
import { getProductSimpleList } from '#/api/erp/product/product';
|
||||
import { getSupplierSimpleList } from '#/api/erp/purchase/supplier';
|
||||
@@ -96,11 +97,11 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
min: 0,
|
||||
max: 100,
|
||||
precision: 2,
|
||||
formatter: erpPriceInputFormatter,
|
||||
style: { width: '100%' },
|
||||
},
|
||||
fieldName: 'discountPercent',
|
||||
label: '优惠率(%)',
|
||||
rules: z.number().min(0).optional(),
|
||||
},
|
||||
{
|
||||
component: 'InputNumber',
|
||||
@@ -146,11 +147,12 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
componentProps: {
|
||||
placeholder: '请输入支付订金',
|
||||
precision: 2,
|
||||
formatter: erpPriceInputFormatter,
|
||||
style: { width: '100%' },
|
||||
min: 0,
|
||||
},
|
||||
fieldName: 'depositPrice',
|
||||
label: '支付订金',
|
||||
rules: z.number().min(0).optional(),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user