v1.9 优化房屋 商铺 业主功能

This commit is contained in:
wuxw 2025-10-14 10:06:48 +08:00
parent acfe91a9ac
commit c65859c6b6
15 changed files with 53 additions and 45 deletions

View File

@ -59,7 +59,7 @@ export function queryRoomsWithSell(params) {
params
}).then(response => {
const res = response.data
if (res.code === 0) {
if (res.code == 0) {
resolve(res)
} else {
reject(new Error(res.msg || '查询已售房屋信息失败'))
@ -79,11 +79,12 @@ export function queryRoomsWithOutSell(params) {
params
}).then(response => {
const res = response.data
if (res.code === 0) {
resolve(res)
} else {
reject(new Error(res.msg || '查询未售房屋信息失败'))
if(res.rooms){
res.rooms.forEach(room => {
room.roomName = room.floorNum+"-"+room.unitNum+"-"+room.roomNum
});
}
resolve(res)
}).catch(error => {
reject(error)
})

View File

@ -40,7 +40,7 @@ export default {
this.visible = false
this.$emit('success')
} catch (error) {
this.$message.error(this.$t('listOwner.deleteFailed'))
this.$message.error(error)
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<el-dialog :visible.sync="dialogVisible" :title="$t('ownerCars.title')" width="80%" top="5vh" @close="handleClose">
<el-dialog :visible.sync="dialogVisible" :title="$t('ownerCars.title')" width="80%" @close="handleClose">
<el-row>
<el-col :span="24">
<div class="table-container">
@ -100,6 +100,6 @@ export default {
<style scoped>
.table-container {
margin-top: 15px;
margin-top: 0px;
}
</style>

View File

@ -2,14 +2,14 @@
<el-dialog :title="$t('shops.addShop')" :visible.sync="dialogVisible" width="40%">
<el-form ref="form" :model="formData" :rules="rules" label-width="120px">
<el-form-item :label="$t('shops.shopNumber')" prop="roomNum">
<el-input v-model="formData.roomNum" :placeholder="$t('shops.shopNumberPlaceholder')"></el-input>
<el-input v-model="formData.roomNum" :placeholder="$t('shops.shopNumber')"></el-input>
</el-form-item>
<el-form-item :label="$t('shops.shopFloor')" prop="layer">
<el-input v-model="formData.layer" :placeholder="$t('shops.floorRequired')"></el-input>
</el-form-item>
<el-form-item :label="$t('shops.building')" prop="floorId">
<el-select v-model="formData.floorId" :placeholder="$t('shops.building')" style="width: 100%">
<el-option v-for="item in floors" :key="item.floorId" :label="item.floorNum + $t('shops.building')"
<el-option v-for="item in floors" :key="item.floorId" :label="item.floorNum"
:value="item.floorId"></el-option>
</el-select>
</el-form-item>

View File

@ -98,8 +98,8 @@ export default {
computed: {
formTitle() {
return this.formData.shopsState === '2007'
? this.$t('shops.sell') + this.$t('shops.shopInfo')
: this.$t('shops.rent') + this.$t('shops.shopInfo')
? this.$t('shops.sellShop')
: this.$t('shops.rentShop')
}
},
methods: {

View File

@ -18,7 +18,7 @@
<el-col :span="12">
<el-form-item :label="$t('room.editRoom.unit')" required>
<el-select v-model="form.unitId" :placeholder="$t('room.editRoom.placeholder.unit')" style="width: 100%;">
<el-option v-for="unit in units" :key="unit.unitId" :label="`${unit.unitNum}${$t('room.editRoom.unit')}`"
<el-option v-for="unit in units" :key="unit.unitId" :label="`${unit.unitNum}`"
:value="unit.unitId" />
</el-select>
</el-form-item>

View File

@ -81,7 +81,7 @@ export default {
floorId: item.floorId,
floorNum: item.floorNum,
icon: 'el-icon-office-building',
text: `${item.floorNum}${this.$t('room.floorUnitTree.building')}(${item.floorName})`,
text: `${item.floorNum}(${item.floorName})`,
children: []
}
treeData.push(floorMap[item.floorId])
@ -91,7 +91,7 @@ export default {
floorMap[item.floorId].children.push({
id: `u_${item.unitId}`,
unitId: item.unitId,
text: `${item.unitNum}${this.$t('room.floorUnitTree.unit')}`,
text: `${item.unitNum}`,
icon: 'el-icon-house'
})
}

View File

@ -115,9 +115,9 @@ export default {
}
let response
if (this.roomFlag === '1') {
if (this.roomFlag == '1') {
response = await queryRoomsWithSell(params)
} else if (this.roomFlag === '2') {
} else if (this.roomFlag == '2') {
response = await queryRoomsWithOutSell(params)
} else {
response = await queryRooms(params)
@ -127,7 +127,7 @@ export default {
this.pagination.total = response.total || 0
} catch (error) {
console.error('Failed to load room info:', error)
this.$message.error(this.$t('searchRoom.loadFailed'))
this.$message.error(error)
}
},
chooseRoom(room) {
@ -166,14 +166,6 @@ export default {
this.rooms = rooms
}
},
mounted() {
this.$on('listener-floor-info', this.listenerFloorInfo)
this.$on('show-owner-rooms', this.showOwnerRooms)
},
beforeDestroy() {
this.$off('listener-floor-info', this.listenerFloorInfo)
this.$off('show-owner-rooms', this.showOwnerRooms)
}
}
</script>

View File

@ -412,7 +412,7 @@ export default {
openOwnerDetail(owner) {
console.log('Owner detail:', owner)
//
this.$router.push(`/views/owner/ownerDetail?ownerId=${owner.ownerId}`)
this.$router.push(`/views/owner/ownerDetail?ownerId=${owner.ownerId}&needBack=Y`)
},

View File

@ -55,7 +55,7 @@
</el-col>
</el-row>
<search-room ref="searchRoomRef" :roomFlag="2" @chooseRoom="handleChooseRoom" />
<search-room ref="searchRoomRef" :roomFlag="roomFlag" @chooseRoom="handleChooseRoom" />
</div>
</template>
@ -73,6 +73,7 @@ export default {
},
data() {
return {
roomFlag: '2',
roomBindOwnerInfo: {
roomId: '',
roomName: '',

View File

@ -189,11 +189,16 @@ export default {
}
}
},
created() {
async created() {
this.addRoomViewInfo.communityId = getCommunityId()
this.addRoomViewInfo.floorId = this.$route.query.floorId
this._loadRoomAttrSpec()
this._loadDictData()
this._loadFloor()
if(this.addRoomViewInfo.floorId){
await this._loadUnit()
this.addRoomViewInfo.unitId = this.$route.query.unitId
}
},
methods: {
async _loadDictData() {

View File

@ -451,8 +451,8 @@ export const messages = {
editRoom: {
title: '修改房屋',
roomNum: '房屋编号',
layer: '房屋楼层',
unit: '房屋单元',
layer: '楼层',
unit: '单元',
roomType: '房屋类型',
apartment1: '户型室',
apartment2: '户型厅',

View File

@ -31,10 +31,10 @@
<i class="el-icon-plus"></i>
<span>{{ $t('roomList.importRoom') }}</span>
</el-button>
<el-button type="primary" size="small" @click="showMarkdown">
<!-- <el-button type="primary" size="small" @click="showMarkdown">
<i class="el-icon-document"></i>
<span>{{ $t('roomList.document') }}</span>
</el-button>
</el-button> -->
</div>
<!-- 替换原有的 el-row 布局为可拖拽布局 -->
@ -525,8 +525,13 @@ export default {
this.$refs.floorUnitTree.refreshTree(param)
},
//
openAddRoom() {
this.$router.push('/views/room/addRoomView')
async openAddRoom() {
let _floorId = this.roomInfo.conditions.floorId;
if(this.roomInfo.conditions.unitId){
const unitData = await this.loadUnits(this.roomInfo.conditions.unitId)
_floorId = unitData.floorId;
}
this.$router.push('/views/room/addRoomView?floorId='+_floorId+"&unitId="+this.roomInfo.conditions.unitId)
},
openEditRoomModel(room) {

View File

@ -57,7 +57,9 @@ export const messages = {
tenantNameRequired: 'Tenant name is required',
leaseStartRequired: 'Lease start date is required',
leaseEndRequired: 'Lease end date is required',
phoneFormatError: 'Invalid phone format'
phoneFormatError: 'Invalid phone format',
rentShop:'rent shop',
sellShop:'sell shop'
}
},
zh: {
@ -67,7 +69,7 @@ export const messages = {
shopId: '商铺ID',
shopIdPlaceholder: '请填写商铺ID',
shopNumber: '商铺编号',
shopNumberPlaceholder: '请填写商铺编号(格式:楼栋-商铺)',
shopNumberPlaceholder: '商铺编号(格式:楼栋-商铺)',
state: '状态',
statePlaceholder: '请选择状态',
rented: '已出租',
@ -118,7 +120,9 @@ export const messages = {
tenantNameRequired: '租户名称不能为空',
leaseStartRequired: '起租时间不能为空',
leaseEndRequired: '截租时间不能为空',
phoneFormatError: '手机号格式错误'
phoneFormatError: '手机号格式错误',
rentShop:'出租商铺',
sellShop:'出售商铺'
}
}
}

View File

@ -7,15 +7,15 @@
<span>{{ $t('shops.queryCondition') }}</span>
</div>
<el-form :inline="true" :model="queryParams" class="demo-form-inline text-left">
<el-form-item :label="$t('shops.shopId')">
<el-form-item>
<el-input v-model.trim="queryParams.roomId" :placeholder="$t('shops.shopIdPlaceholder')"
clearable></el-input>
</el-form-item>
<el-form-item :label="$t('shops.shopNumber')">
<el-form-item>
<el-input v-model.trim="queryParams.roomNum" :placeholder="$t('shops.shopNumberPlaceholder')"
clearable></el-input>
</el-form-item>
<el-form-item :label="$t('shops.state')">
<el-form-item>
<el-select v-model="queryParams.state" :placeholder="$t('shops.statePlaceholder')" clearable
style="width: 100%">
<el-option :label="$t('shops.rented')" value="2006"></el-option>
@ -176,9 +176,9 @@ export default {
this.loading = true
queryShops(this.queryParams)
.then(res => {
this.shopsData = res.rooms
this.pagination.total = res.total
this.dealShopsAttr(res.rooms)
this.shopsData = res.rooms
this.pagination.total = res.total
this.dealShopsAttr(res.rooms)
})
.catch(error => {
console.error(error)
@ -231,7 +231,7 @@ export default {
},
dealShopsAttr(shopss) {
//
// this.listColumns = ['Attr1', 'Attr2'] // API
// this.listColumns = ['Attr1', 'Attr2'] // API
shopss.forEach(shop => {
shop.listValues = [] // API
})