设备管理

This commit is contained in:
FLL
2025-07-17 17:26:32 +08:00
parent 3389a864d1
commit 06e72f6e51
9 changed files with 552 additions and 136 deletions

View File

@@ -5,77 +5,27 @@ import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_expense_type'),
},
fieldName: 'costType',
label: '费用类型',
},
{
component: 'Input',
fieldName: 'chargeItem',
label: '收费项目',
label: '费用编号',
},
{
component: 'Input',
component: 'Select',
fieldName: 'costMark',
componentProps: {
options: getDictOptions('pro_cost_identification'),
},
label: '费用标识',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('pro_payment_type'),
},
fieldName: 'paymentType',
label: '付费类型',
},
{
component: 'Input',
fieldName: 'chargeCycle',
label: '缴费周期',
},
{
component: 'Input',
fieldName: 'isMobilePay',
label: '是否手机缴费',
},
{
component: 'Input',
fieldName: 'roundingMode',
label: '进位方式',
},
{
component: 'Input',
fieldName: 'currencyDecimals',
label: '保留小数',
},
{
component: 'Input',
fieldName: 'state',
label: '启用状态',
},
{
component: 'Input',
fieldName: 'formula',
label: '计算公式',
},
{
component: 'Input',
fieldName: 'unitPrice',
label: '计费单价',
},
{
component: 'Input',
fieldName: 'surcharge',
label: '附加费',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
@@ -83,8 +33,8 @@ export const querySchema: FormSchemaGetter = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键',
field: 'id',
title: '费用编号',
field: 'chargeItem',
},
{
title: '费用类型',
@@ -103,31 +53,27 @@ export const columns: VxeGridProps['columns'] = [
{
title: '费用标识',
field: 'costMark',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
return renderDict(row.costType, 'pro_cost_identification');
},
},
},
{
title: '付费类型',
field: 'paymentType',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
return renderDict(row.costType, 'pro_payment_type');
},
},
},
{
title: '缴费周期',
title: '费用周期(月)',
field: 'chargeCycle',
},
{
title: '是否手机缴费',
field: 'isMobilePay',
},
{
title: '进位方式',
field: 'roundingMode',
},
{
title: '保留小数',
field: 'currencyDecimals',
},
{
title: '启用状态',
field: 'state',
},
{
title: '计算公式',
field: 'formula',
@@ -137,13 +83,9 @@ export const columns: VxeGridProps['columns'] = [
field: 'unitPrice',
},
{
title: '附加费',
title: '附加费',
field: 'surcharge',
},
{
title: '搜索值',
field: 'searchValue',
},
{
field: 'action',
fixed: 'right',
@@ -182,7 +124,11 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '费用标识',
fieldName: 'costMark',
component: 'Input',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_cost_identification'),
},
rules: 'required',
},
{
@@ -190,28 +136,44 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'paymentType',
component: 'Select',
componentProps: {
options: getDictOptions('pro_payment_type'),
},
rules: 'selectRequired',
},
{
label: '缴费周期',
label: '费用周期(月)',
fieldName: 'chargeCycle',
component: 'Input',
},
{
label: '是否手机缴费',
label: '手机缴费',
fieldName: 'isMobilePay',
component: 'Input',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_mobile_payment'),
},
rules: 'selectRequired',
},
{
label: '进位方式',
fieldName: 'roundingMode',
component: 'Input',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_carry_method'),
},
component: 'Select',
rules: 'selectRequired',
},
{
label: '保留小数',
fieldName: 'currencyDecimals',
component: 'Input',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_keep_decimals'),
},
rules: 'selectRequired',
},
{
label: '启用状态',
@@ -221,7 +183,13 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '计算公式',
fieldName: 'formula',
component: 'Input',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRO_EXPENSE_TYPE 便于维护
options: getDictOptions('pro_calculation_formula'),
},
rules: 'selectRequired',
formItemClass:'col-span-2',
},
{
label: '计费单价',
@@ -233,9 +201,4 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'surcharge',
component: 'Input',
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
},
];