新增数据,开始安全巡检模块
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">基本信息</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<el-form class="formBody" label-position="left" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
||||
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="房屋" prop="houseId">
|
||||
@@ -22,7 +22,7 @@
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="租赁状态" prop="rentalStatus">
|
||||
<el-select v-model.number="form.rentalStatus" class="m-2" placeholder="请选择">
|
||||
<el-select v-model.number="form.rentalStatus" placeholder="请选择">
|
||||
<el-option v-for="(item, index) in com_rental_status" :key="index" :label="item.label" :value="Number(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -30,7 +30,7 @@
|
||||
<el-col :span="2"></el-col>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="房屋用途" prop="houseUse">
|
||||
<el-select v-model.number="form.houseUse" class="m-2" placeholder="请选择">
|
||||
<el-select v-model.number="form.houseUse" placeholder="请选择">
|
||||
<el-option v-for="(item, index) in com_house_use" :key="index" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -57,7 +57,7 @@
|
||||
<el-row>
|
||||
<el-col :span="11">
|
||||
<el-form-item label="房屋朝向" prop="type">
|
||||
<el-select v-model.number="form.houseFace" class="m-2" placeholder="请选择">
|
||||
<el-select v-model.number="form.houseFace" placeholder="请选择">
|
||||
<el-option v-for="(item, index) in houseformat" :key="index" :label="item" :value="item" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -202,7 +202,7 @@ const route = useRoute();
|
||||
|
||||
const formRef = ref();
|
||||
const houseformat = ['东', '西', '南', '北'];
|
||||
const form = ref<HouseRentalVO>({
|
||||
const form = ref({
|
||||
id: null,
|
||||
houseId: null,
|
||||
rentalName: '', // 租户姓名
|
||||
@@ -251,6 +251,8 @@ async function gettreedata() {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
console.log(form.value);
|
||||
housedeviceslist.value = form.value.facilities.split(',').filter((item) => item);
|
||||
const imgurllist = splitStringUrl(form.value.houseImageUrl);
|
||||
fileList.value = imgurllist;
|
||||
const arr = getHousePathById(treedata.value, form.value.houseId);
|
||||
@@ -354,7 +356,6 @@ const submitForm = () => {
|
||||
};
|
||||
const sendForm = (val: string) => {
|
||||
form.value.houseImageUrl = val;
|
||||
form.value.villageId = Number(localStorage.getItem('villageid'));
|
||||
// edit or add
|
||||
if (userid.value) {
|
||||
updateHouseRental(form.value).then(() => {
|
||||
@@ -363,8 +364,7 @@ const sendForm = (val: string) => {
|
||||
});
|
||||
} else {
|
||||
addHouseRental({
|
||||
...form.value,
|
||||
villageid: Number(localStorage.getItem('villageid'))
|
||||
...form.value
|
||||
}).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
<div class="AddBuildingBox">
|
||||
<PageHeader title="房屋租赁管理"></PageHeader>
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">
|
||||
<span>基础资料 </span>
|
||||
<span class="ml-20px color-blue cursor-pointer" @click="hanlededit">编辑</span>
|
||||
<div class="title flex flex-items-center flex-justify-between">
|
||||
<div>
|
||||
<span>基础资料 </span>
|
||||
<span class="ml-20px color-blue cursor-pointer" @click="hanlededit">编辑</span>
|
||||
</div>
|
||||
<el-button @click="handlBack" class="mr-10px">返回</el-button>
|
||||
</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<div class="descriptionsbox">
|
||||
@@ -46,6 +49,7 @@
|
||||
<div class="label">房屋设施:</div>
|
||||
<div class="value">
|
||||
<DictTag :options="com_house_rental_facilities" :value="HouseInfo.facilities"></DictTag>
|
||||
<span v-for="item in HouseInfo.facilitieslist" :key="item">{{ handlefacilities(item.name) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-row>
|
||||
@@ -86,6 +90,7 @@ import PageHeader from '@/components/Pageheader/index.vue';
|
||||
import { getHouseRental } from '@/api/system/houseRental';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { getHousePathById } from '@/utils/house';
|
||||
import { listHouseFacilities } from '@/api/system/HouseFacilities';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { treedata } = storeToRefs(houseStore);
|
||||
@@ -97,8 +102,7 @@ const route = useRoute();
|
||||
const router = useRouter();
|
||||
const houseRentalid = ref(null);
|
||||
const HouseInfo = ref({
|
||||
'id': '',
|
||||
house: '',
|
||||
'house': '',
|
||||
'name': null,
|
||||
'rentalStatus': null,
|
||||
'rentalName': '',
|
||||
@@ -118,14 +122,21 @@ const HouseInfo = ref({
|
||||
'houseUse': '',
|
||||
'pubBy': null,
|
||||
'pubTime': '',
|
||||
houseImageUrls: []
|
||||
'facilitieslist': [],
|
||||
'houseImageUrls': []
|
||||
});
|
||||
function init() {
|
||||
|
||||
const housefacilities = ref([]);
|
||||
async function init() {
|
||||
if (route.query.id) {
|
||||
houseRentalid.value = route.query.id;
|
||||
}
|
||||
const reslist = await listHouseFacilities();
|
||||
housefacilities.value = reslist.rows;
|
||||
|
||||
getHouseRental(houseRentalid.value).then((res) => {
|
||||
HouseInfo.value = res.data;
|
||||
HouseInfo.value.facilitieslist = res.data.facilities.split(',').filter((item) => item);
|
||||
HouseInfo.value.houseImageUrls = HouseInfo.value.houseImageUrl.split(',').filter((item) => item);
|
||||
const arr = getHousePathById(treedata.value, HouseInfo.value.houseId, 'label');
|
||||
HouseInfo.value.house = arr.join(' - ');
|
||||
@@ -133,6 +144,10 @@ function init() {
|
||||
}
|
||||
init();
|
||||
|
||||
function handlefacilities(id: string) {
|
||||
const find = housefacilities.value.find((item) => item.id === id);
|
||||
}
|
||||
|
||||
function hanlededit() {
|
||||
router.push({
|
||||
path: '/house/addhouseRental',
|
||||
@@ -141,6 +156,12 @@ function hanlededit() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handlBack() {
|
||||
router.push({
|
||||
path: '/house/houseRental'
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -129,7 +129,6 @@ const data = reactive<PageData<HouseRentalForm, HouseRentalQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
villageId: Number(localStorage.getItem('villageid')),
|
||||
houseUse: '',
|
||||
rentalName: undefined,
|
||||
rent: undefined,
|
||||
|
||||
Reference in New Issue
Block a user