feat(house): 添加房屋信息表单中的单位字段支持

- 在房屋信息模型中添加了租金单位、月租金单位和面积单位字段
- 修改表单界面为面积、单价和总价字段添加单位输入框
- 更新字典选择器的代码配置从 premium 到 premium2
- 设置默认单位值为泰铢和泰铢/菜
- 修复表单提交时使用正确的租金字段映射
This commit is contained in:
2026-01-09 18:44:46 +08:00
parent 50d4497639
commit 08ef68bfe2
3 changed files with 47 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
VITE_APP_NAME=后台管理(开发环境)
#VITE_API_URL=http://127.0.0.1:9200/api
VITE_API_URL=http://127.0.0.1:9200/api
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api

View File

@@ -18,14 +18,20 @@ export interface HouseInfo {
leaseMethod?: string;
// 租金
rent?: string;
// 租金单位
rentUnit?: string;
// 月租金
monthlyRent?: string;
// 月租金单位
monthlyRentUnit?: string;
// 佣金
commission?: string;
// 物业费
propertyFees?: string;
// 面积
extent?: string;
// 面积单位
extentUnit?: string;
// 楼层
floor?: string;
// 房号

View File

@@ -50,30 +50,47 @@
<span v-else>{{ form.phone }}</span>
</a-form-item>
<a-form-item label="面积(莱)" name="extent">
<a-input
v-if="editStatus"
allow-clear
placeholder="请输入该房屋面积"
v-model:value="form.extent"
/>
<a-space v-if="editStatus">
<a-input
v-if="editStatus"
allow-clear
placeholder="房屋面积"
v-model:value="form.extent"
/>
<a-input
placeholder="单位"
v-model:value="form.extentUnit"
/>
</a-space>
<span v-else>{{ form.extent }}</span>
</a-form-item>
<a-form-item label="单价(莱)" name="rent">
<a-input
v-if="editStatus"
allow-clear
placeholder="请输入单价"
v-model:value="form.rent"
/>
<a-space v-if="editStatus">
<a-input
allow-clear
placeholder="单价"
v-model:value="form.rent"
/>
<a-input
placeholder="单位"
v-model:value="form.rentUnit"
/>
</a-space>
<span v-else>{{ form.rent }}</span>
</a-form-item>
<a-form-item label="总价" name="monthlyRent">
<a-input
v-if="editStatus"
allow-clear
placeholder="请输入总价"
v-model:value="form.monthlyRent"
/>
<a-space v-if="editStatus">
<a-input
v-if="editStatus"
allow-clear
placeholder="总价"
v-model:value="form.monthlyRent"
/>
<a-input
placeholder="单位"
v-model:value="form.rentUnit"
/>
</a-space>
<span v-else>{{ form.monthlyRent }}</span>
</a-form-item>
<!-- <a-form-item label="房号" name="roomNumber">-->
@@ -120,7 +137,7 @@
<a-form-item label="是否可溢价" name="premium">
<DictSelect
v-if="editStatus"
dict-code="premium"
dict-code="premium2"
v-model:value="form.premium"
placeholder="是否可溢价"
/>
@@ -396,8 +413,11 @@ import {ref, reactive, watch, computed} from 'vue';
houseType: undefined,
leaseMethod: undefined,
rent: undefined,
rentUnit: '泰铢',
monthlyRent: undefined,
monthlyRentUnit: undefined,
extent: undefined,
extentUnit: '泰铢/菜',
floor: undefined,
roomNumber: undefined,
realName: undefined,
@@ -673,7 +693,7 @@ import {ref, reactive, watch, computed} from 'vue';
content: content.value,
files: JSON.stringify(files.value),
houseLabel: JSON.stringify(houseLabelData.value),
monthlyRent: monthlyRent.value,
monthlyRent: form.rent,
type: props.type
};
const saveOrUpdate = isUpdate.value ? updateHouseInfo : addHouseInfo;