费用管理

This commit is contained in:
FLL
2025-07-18 19:48:05 +08:00
parent 355d14ab9e
commit b81c30696b
8 changed files with 750 additions and 23 deletions

View File

@@ -1,13 +1,12 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'chargeItem',
fieldName: 'chargeNo',
label: '费用编号',
},
{
@@ -28,20 +27,17 @@ export const querySchema: FormSchemaGetter = () => [
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '费用编号',
field: 'chargeItem',
field: 'chargeNo',
},
{
title: '费用类型',
field: 'costType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
return renderDict(row.costType, 'pro_expense_type');
},
},
@@ -55,8 +51,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'costMark',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
return renderDict(row.costType, 'pro_cost_identification');
return renderDict(row.costMark, 'pro_cost_identification');
},
},
},
@@ -65,8 +60,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'paymentType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
return renderDict(row.costType, 'pro_payment_type');
return renderDict(row.paymentType, 'pro_payment_type');
},
},
},
@@ -77,6 +71,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '计算公式',
field: 'formula',
slots: {
default: ({ row }) => {
return renderDict(row.formula, 'pro_calculation_formula');
},
},
},
{
title: '计费单价',
@@ -86,6 +85,12 @@ export const columns: VxeGridProps['columns'] = [
title: '附加费用',
field: 'surcharge',
},
{
title: '状态',
field: 'state',
slots: {default: 'state'},
width: 100,
},
{
field: 'action',
fixed: 'right',
@@ -110,7 +115,6 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'costType',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_expense_type'),
},
rules: 'selectRequired',
@@ -126,7 +130,6 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'costMark',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_cost_identification'),
},
rules: 'required',
@@ -144,13 +147,22 @@ export const modalSchema: FormSchemaGetter = () => [
label: '费用周期(月)',
fieldName: 'chargeCycle',
component: 'Input',
rules: 'required',
},
{
label: '单位',
fieldName: 'unit',
component: 'Input',
rules: 'required',
componentProps: {
placeholder: '请输入(如:元)',
},
},
{
label: '手机缴费',
fieldName: 'isMobilePay',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_mobile_payment'),
},
rules: 'selectRequired',
@@ -159,7 +171,6 @@ export const modalSchema: FormSchemaGetter = () => [
label: '进位方式',
fieldName: 'roundingMode',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_carry_method'),
},
component: 'Select',
@@ -170,22 +181,24 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'currencyDecimals',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_keep_decimals'),
},
rules: 'selectRequired',
},
{
label: '启用状态',
component: 'Select',
componentProps: {
options: getDictOptions('wy_state'),
},
fieldName: 'state',
component: 'Input',
label: '状态',
rules: 'selectRequired',
},
{
label: '计算公式',
fieldName: 'formula',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_calculation_formula'),
},
rules: 'selectRequired',
@@ -195,10 +208,12 @@ export const modalSchema: FormSchemaGetter = () => [
label: '计费单价',
fieldName: 'unitPrice',
component: 'Input',
rules: 'required',
},
{
label: '附加费',
fieldName: 'surcharge',
component: 'Input',
rules: 'required',
},
];