feat: 新增支付管理其他模块

This commit is contained in:
吃货
2025-07-05 07:10:58 +08:00
parent 4562d204e0
commit 95f2d1c9bb
34 changed files with 3585 additions and 15 deletions

View File

@@ -10,7 +10,7 @@ import {
setupVbenVxeTable,
useVbenVxeGrid,
} from '@vben/plugins/vxe-table';
import { isFunction, isString } from '@vben/utils';
import { erpCountInputFormatter, erpNumberFormatter, formatPast2, isFunction, isString } from '@vben/utils';
import { ElButton, ElImage, ElPopconfirm, ElSwitch } from 'element-plus';
@@ -267,21 +267,25 @@ setupVbenVxeTable({
// 添加数量格式化,例如金额
// TODO @xingyu建议金额和数量分开哈原因是有些团队希望金额单独控制
vxeUI.formats.add('formatNumber', {
cellFormatMethod({ cellValue }, digits = 2) {
if (cellValue === null || cellValue === undefined) {
return '';
}
if (isString(cellValue)) {
cellValue = Number.parseFloat(cellValue);
}
// 如果非 number则直接返回空串
if (Number.isNaN(cellValue)) {
return '';
}
return cellValue.toFixed(digits);
vxeUI.formats.add('formatPast2', {
tableCellFormatMethod({ cellValue }) {
return formatPast2(cellValue);
},
});
// add by 星语:数量格式化,例如说:金额
vxeUI.formats.add('formatNumber', {
tableCellFormatMethod({ cellValue }) {
return erpCountInputFormatter(cellValue);
},
});
vxeUI.formats.add('formatAmount2', {
tableCellFormatMethod({ cellValue }, digits = 2) {
return `${erpNumberFormatter(cellValue, digits)}`;
},
});
},
useVbenForm,
});