feat:【antd】【erp 系统】sale 重构代码风格(修复“优惠后金额”未计算的问题)

This commit is contained in:
YunaiV
2025-10-04 16:48:03 +08:00
parent 888a6d9ec8
commit dd9fd6e284
4 changed files with 20 additions and 32 deletions

View File

@@ -162,6 +162,15 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
formatter: erpPriceInputFormatter,
disabled: true,
},
dependencies: {
triggerFields: ['totalPrice', 'otherPrice'],
componentProps: (values) => {
const totalPrice = values.totalPrice || 0;
const otherPrice = values.otherPrice || 0;
values.discountedPrice = totalPrice - otherPrice;
return {};
},
},
},
{
fieldName: 'otherPrice',