house
This commit is contained in:
203
src/views/system/house/AddHouse.vue
Normal file
203
src/views/system/house/AddHouse.vue
Normal file
@@ -0,0 +1,203 @@
|
||||
<template>
|
||||
<div class="AddBuildingBox">
|
||||
<PageHeader title="新建楼栋"></PageHeader>
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<el-form class="formBody" ref="formRef" :model="form" :rules="rules" label-width="180px">
|
||||
<el-form-item label="楼栋" prop="buildingID">
|
||||
<el-select v-model="form.buildingID" class="m-2" placeholder="请选择" size="large">
|
||||
<el-option v-for="item in building" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单元" prop="unit">
|
||||
<el-select v-model="form.unit" class="m-2" placeholder="请选择" size="large">
|
||||
<el-option v-for="item in units" :key="item.no" :label="item.name" :value="item.no" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="楼层" prop="floor">
|
||||
<el-select v-model="form.floor" class="m-2" placeholder="请选择" size="large">
|
||||
<el-option v-for="item in floors" :key="item.no" :label="item.name" :value="item.no" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="房间号" prop="buildingName">
|
||||
<el-input v-model="form.buildingName" placeholder="请输入房间号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="建筑面积" prop="buildingArea">
|
||||
<div class="unitBox flex align-center">
|
||||
<el-input v-model="form.buildingArea" placeholder="请输入建筑面积" />
|
||||
<span>㎡</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="套内面积" prop="internalFloorArea">
|
||||
<div class="unitBox flex align-center">
|
||||
<el-input v-model="form.internalFloorArea" placeholder="请输入套内面积" />
|
||||
<span>㎡</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="公摊面积" prop="CommonArea">
|
||||
<div class="unitBox flex align-center">
|
||||
<el-input v-model="form.CommonArea" placeholder="请输入公摊面积" />
|
||||
<span>㎡</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="房屋户型">
|
||||
<div class="houseTypebox">
|
||||
<el-input v-model="housetype[0]" placeholder="室" />
|
||||
<span>室</span>
|
||||
<el-input v-model="housetype[1]" placeholder="厅" />
|
||||
<span>厅</span>
|
||||
<el-input v-model="housetype[2]" placeholder="卫" />
|
||||
<span>卫</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="车位号" prop="buildingAddress">
|
||||
<el-select v-model="form.ParkingSpaceNumber" class="m-2" placeholder="请选择车位号" size="large">
|
||||
<el-option v-for="item in building" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="储藏室" prop="buildingDescription">
|
||||
<el-select v-model="form.storeroom" class="m-2" placeholder="请选择储藏室" size="large">
|
||||
<el-option v-for="item in building" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancelForm">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
const formRef = ref();
|
||||
const form = ref({
|
||||
buildingID: '',
|
||||
unit: '',
|
||||
floor: '',
|
||||
buildingName: '', // 房间号
|
||||
buildingArea: '', //建筑面积
|
||||
internalFloorArea: '', //套内面积
|
||||
CommonArea: '', // 公摊面积
|
||||
Housetype: '', // 房屋户型
|
||||
ParkingSpaceNumber: '', // 车位号
|
||||
storeroom: '' // 储藏室
|
||||
});
|
||||
const housetype = ref([]);
|
||||
const rules = ref({
|
||||
buildingID: [{ required: true, message: '请输入楼栋', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请选择单元', trigger: 'blur' }],
|
||||
floor: [{ required: true, message: '请选择楼层', trigger: 'blur' }],
|
||||
buildingName: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
|
||||
buildingArea: [{ required: true, message: '请输入建筑面积', trigger: 'blur' }],
|
||||
internalFloorArea: [{ required: true, message: '请输入套内面积', trigger: 'blur' }],
|
||||
CommonArea: [{ required: true, message: '请输入公摊面积', trigger: 'blur' }]
|
||||
});
|
||||
|
||||
// 楼栋
|
||||
const building = ref([
|
||||
{
|
||||
id: '1',
|
||||
name: '1号楼'
|
||||
}
|
||||
]);
|
||||
const units = ref([
|
||||
{
|
||||
no: '1',
|
||||
name: '1单元'
|
||||
},
|
||||
{
|
||||
no: '2',
|
||||
name: '2单元'
|
||||
}
|
||||
]);
|
||||
const floors = ref([
|
||||
{
|
||||
no: '1',
|
||||
name: '1层'
|
||||
},
|
||||
{
|
||||
no: '2',
|
||||
name: '2层'
|
||||
}
|
||||
]);
|
||||
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
console.log(form.value);
|
||||
}
|
||||
});
|
||||
};
|
||||
const cancelForm = () => {
|
||||
console.log('取消');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.AddBuildingBox {
|
||||
padding: 15px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.AddBuildingBody {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
background-color: white;
|
||||
padding: 15px;
|
||||
.title {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding-left: 20px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
border-bottom: 1px solid #bbbbbb;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
.addBuildingFormBody {
|
||||
.formBody {
|
||||
width: 550px;
|
||||
margin: 0 auto;
|
||||
.el-input {
|
||||
width: 440px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.el-form-item {
|
||||
margin-bottom: 20px;
|
||||
align-items: center;
|
||||
}
|
||||
.unitBox {
|
||||
.el-input {
|
||||
width: 440px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.el-button {
|
||||
width: 80px;
|
||||
height: 35px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.houseTypebox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.el-input {
|
||||
width: 100px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
span {
|
||||
margin: 0 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user