diff --git a/apps/web-antd/src/api/property/costManagement/costItemSetting/model.d.ts b/apps/web-antd/src/api/property/costManagement/costItemSetting/model.d.ts index d96b2701..ca472d56 100644 --- a/apps/web-antd/src/api/property/costManagement/costItemSetting/model.d.ts +++ b/apps/web-antd/src/api/property/costManagement/costItemSetting/model.d.ts @@ -71,6 +71,7 @@ export interface CostItemSettingVO { */ searchValue: string; chargeNo: string; + unit: string; } diff --git a/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-detail.vue b/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-detail.vue index e3b8ed3d..375ec687 100644 --- a/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-detail.vue +++ b/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-detail.vue @@ -57,9 +57,9 @@ async function handleOpenChange(open: boolean) { :is="renderDict(costItemSettingDetail.paymentType,'pro_payment_type')" /> - - {{ costItemSettingDetail.chargeCycle }} - + + + {{ costItemSettingDetail.unit }} @@ -83,15 +83,15 @@ async function handleOpenChange(open: boolean) { :is="renderDict(costItemSettingDetail.state,'wy_state')" /> - + - + {{ costItemSettingDetail.unitPrice }} - + {{ costItemSettingDetail.surcharge }} diff --git a/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-modal.vue b/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-modal.vue index 93022224..2fea5d67 100644 --- a/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-modal.vue +++ b/apps/web-antd/src/views/property/costManagement/costItemSetting/costItemSetting-modal.vue @@ -10,6 +10,7 @@ import { costItemSettingAdd, costItemSettingInfo, costItemSettingUpdate } from ' import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { modalSchema } from './data'; +import {getDictOptions} from "#/utils/dict"; const emit = defineEmits<{ reload: [] }>(); @@ -53,7 +54,7 @@ const [BasicModal, modalApi] = useVbenModal({ return null; } modalApi.modalLoading(true); - + initCostTypeOptions() const { id } = modalApi.getData() as { id?: number | string }; isUpdate.value = !!id; @@ -67,6 +68,39 @@ const [BasicModal, modalApi] = useVbenModal({ }, }); +/** + * 初始化费用类型 + */ +async function initCostTypeOptions() { + formApi.updateSchema([ + { + componentProps: { + // 费用类型不要保洁、会议、绿植 + options: getDictOptions('pro_expense_type'), + onChange: async (value: string) => { + if (value) { + //水费、电费、气费 + if(['5','6','8'].includes(value)){ + await formApi.setFieldValue('formula', '5');//(本层本次读数-上次读数)*单价/本层实际使用面积*本单位面积 + //停车费、租金、押金 + }else if(['2','7','9'].includes(value)){ + await formApi.setFieldValue('formula', '1');//固定费用 + //会议室使用费、绿植租赁费、保洁服务费 + }else if(['1','3','4'].includes(value)){ + await formApi.setFieldValue('formula', null); + //物业管理费 + }else{ + await formApi.setFieldValue('formula', '0');//建筑面积*单价 + } + + } + }, + }, + fieldName: 'costType', + }, + ]); +} + async function handleConfirm() { try { modalApi.lock(true); @@ -76,6 +110,18 @@ async function handleConfirm() { } // getValues获取为一个readonly的对象 需要修改必须先深拷贝一次 const data = cloneDeep(await formApi.getValues()); + //会议室使用费、绿植租赁费、保洁服务费 + if(['1','3','4'].includes(data.costType)){ + data.roundingMode=null; + data.currencyDecimals=null; + data.formula=null; + data.unitPrice=null; + data.surcharge=null; + } + //固定费用 + if(data.formula=='1'){ + data.surcharge=null; + } await (isUpdate.value ? costItemSettingUpdate(data) : costItemSettingAdd(data)); resetInitialized(); emit('reload'); diff --git a/apps/web-antd/src/views/property/costManagement/costItemSetting/data.ts b/apps/web-antd/src/views/property/costManagement/costItemSetting/data.ts index 43f36d10..805ff361 100644 --- a/apps/web-antd/src/views/property/costManagement/costItemSetting/data.ts +++ b/apps/web-antd/src/views/property/costManagement/costItemSetting/data.ts @@ -32,6 +32,7 @@ export const columns: VxeGridProps['columns'] = [ { title: '费用编号', field: 'chargeNo', + width: 180, }, { title: '费用类型', @@ -41,10 +42,12 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.costType, 'pro_expense_type'); }, }, + width: 150, }, { title: '收费项目', field: 'chargeItem', + minWidth: 180, }, { title: '费用标识', @@ -54,6 +57,7 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.costMark, 'pro_cost_identification'); }, }, + width: 180, }, { title: '付费类型', @@ -63,33 +67,18 @@ export const columns: VxeGridProps['columns'] = [ return renderDict(row.paymentType, 'pro_payment_type'); }, }, + width: 180, }, { - title: '费用周期(月)', - field: 'chargeCycle', - }, - { - title: '计算公式', - field: 'formula', - slots: { - default: ({ row }) => { - return renderDict(row.formula, 'pro_calculation_formula'); - }, - }, - }, - { - title: '计费单价', - field: 'unitPrice', - }, - { - title: '附加费用', - field: 'surcharge', + title: '单位', + field: 'unit', + minWidth: 120, }, { title: '状态', field: 'state', slots: { default: 'state' }, - width: 100, + width: 120, }, { field: 'action', @@ -114,9 +103,6 @@ export const modalSchema: FormSchemaGetter = () => [ label: '费用类型', fieldName: 'costType', component: 'Select', - componentProps: { - options: getDictOptions('pro_expense_type'), - }, rules: 'selectRequired', }, { @@ -143,12 +129,6 @@ export const modalSchema: FormSchemaGetter = () => [ }, rules: 'selectRequired', }, - { - label: '费用周期(月)', - fieldName: 'chargeCycle', - component: 'Input', - rules: 'required', - }, { label: '单位', fieldName: 'unit', @@ -158,15 +138,6 @@ export const modalSchema: FormSchemaGetter = () => [ placeholder: '请输入(如:元)', }, }, - // { - // label: '付费方式', - // fieldName: 'paymentMode', - // component: 'Select', - // componentProps: { - // options: getDictOptions('wy_fffs'), - // }, - // rules: 'selectRequired', - // }, { label: '进位方式', fieldName: 'roundingMode', @@ -175,6 +146,10 @@ export const modalSchema: FormSchemaGetter = () => [ }, component: 'Select', rules: 'selectRequired', + dependencies: { + show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)), + triggerFields: ['costType'], + }, }, { label: '保留小数', @@ -184,6 +159,10 @@ export const modalSchema: FormSchemaGetter = () => [ options: getDictOptions('pro_keep_decimals'), }, rules: 'selectRequired', + dependencies: { + show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)), + triggerFields: ['costType'], + }, }, { component: 'Select', @@ -201,18 +180,42 @@ export const modalSchema: FormSchemaGetter = () => [ componentProps: { options: getDictOptions('pro_calculation_formula'), }, - rules: 'selectRequired', + disabled:true, + defaultValue:'1', + dependencies: { + show: (fromValue) => !(['1','3','4'].includes(fromValue.costType)), + triggerFields: ['costType'], + }, + formItemClass:'col-span-2' }, { label: '计费单价', fieldName: 'unitPrice', component: 'InputNumber', rules: 'required', + dependencies: { + show: (fromValue) => ['0','5','6','8'].includes(fromValue.costType), + triggerFields: ['costType'], + }, + }, + { + label: '费用', + fieldName: 'unitPrice', + component: 'InputNumber', + rules: 'required', + dependencies: { + show: (fromValue) => ['2','7','9'].includes(fromValue.costType), + triggerFields: ['costType'], + }, }, { label: '附加费', fieldName: 'surcharge', component: 'InputNumber', rules: 'required', + dependencies: { + show: (fromValue) => ['0','5','6','8'].includes(fromValue.costType), + triggerFields: ['costType'], + }, }, ]; diff --git a/apps/web-antd/src/views/property/costManagement/houseCharge/data.ts b/apps/web-antd/src/views/property/costManagement/houseCharge/data.ts index 3d50f499..e4db5dc0 100644 --- a/apps/web-antd/src/views/property/costManagement/houseCharge/data.ts +++ b/apps/web-antd/src/views/property/costManagement/houseCharge/data.ts @@ -63,10 +63,11 @@ export const columns: VxeGridProps['columns'] = [ { title: '单位', field: 'residentUnitText', - minWidth: 150, + minWidth: 180, }, { title: '费用类型', + width: 150, field: 'costType', slots: { default: ({ row }) => {