房屋详情,单元变更
This commit is contained in:
@@ -101,6 +101,11 @@ function getStoreRoominfo(id: string) {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
if (form.value.buildingId) {
|
||||
handleChangeBuild(form.value.buildingId, () => {
|
||||
form.value.unitNo = res.data.unitNo;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// 根据小区id获取楼栋单元
|
||||
@@ -110,12 +115,14 @@ function init() {
|
||||
});
|
||||
}
|
||||
init();
|
||||
if (route.query.id) {
|
||||
storeRoomid.value = route.query.id;
|
||||
getStoreRoominfo(storeRoomid.value);
|
||||
}
|
||||
onMounted(() => {
|
||||
if (route.query.id) {
|
||||
storeRoomid.value = route.query.id;
|
||||
getStoreRoominfo(storeRoomid.value);
|
||||
}
|
||||
});
|
||||
// 根据楼栋id获取单元
|
||||
function handleChangeBuild(val: string) {
|
||||
function handleChangeBuild(val: string, callback?: () => void) {
|
||||
getBuildingOnly(val).then((res) => {
|
||||
units.value = Array.from({ length: res.data.unitCount }).map((_, index) => {
|
||||
return {
|
||||
@@ -123,6 +130,7 @@ function handleChangeBuild(val: string) {
|
||||
name: index + 1 + '单元'
|
||||
};
|
||||
});
|
||||
callback && callback();
|
||||
});
|
||||
}
|
||||
const submitForm = () => {
|
||||
@@ -146,9 +154,7 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/house/storeroom'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user