This commit is contained in:
@@ -6,13 +6,11 @@ import {cloneDeep} from '@vben/utils';
|
||||
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
houseChargeAdd,
|
||||
houseChargeInfo, houseChargeRefund,
|
||||
houseChargeUpdate
|
||||
} from '#/api/property/costManagement/houseCharge';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import {modalSchemaRefund, modalSchemaUpdate} from './data';
|
||||
import {modalSchemaRefund} from './data';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {Descriptions, DescriptionsItem, Divider} from "ant-design-vue";
|
||||
import type {HouseChargeVO} from "#/api/property/costManagement/houseCharge/model";
|
||||
@@ -62,14 +60,15 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
record.value = await houseChargeInfo(id);
|
||||
if (record.value) {
|
||||
room.value = record.value.roomVo
|
||||
costItem.value = record.value.costItemsVo
|
||||
if(id){
|
||||
record.value = await houseChargeInfo(id);
|
||||
if (record.value) {
|
||||
room.value = record.value.roomVo
|
||||
costItem.value = record.value.costItemsVo
|
||||
}
|
||||
await formApi.setValues(record.value);
|
||||
}
|
||||
await formApi.setValues(record.value);
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
@@ -83,8 +82,8 @@ async function handleConfirm() {
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.costItemsId = record.value.costItemsId
|
||||
data.personId = record.value.personId
|
||||
data.costItemsId = record.value?.costItemsId
|
||||
data.personId = record.value?.personId
|
||||
await houseChargeRefund(data);
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -123,7 +122,7 @@ async function handleClosed() {
|
||||
{{ record.startTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="房间">
|
||||
{{ room.roomNumber }}
|
||||
{{ room?.roomNumber }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="面积(㎡)">
|
||||
{{ `${room?.area} (套内面积:${room?.insideInArea})` }}
|
||||
|
Reference in New Issue
Block a user