diff --git a/src/api/room/roomApi.js b/src/api/room/roomApi.js index e57327f..64c17e3 100644 --- a/src/api/room/roomApi.js +++ b/src/api/room/roomApi.js @@ -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) }) diff --git a/src/components/owner/deleteOwner.vue b/src/components/owner/deleteOwner.vue index 2510759..77cb018 100644 --- a/src/components/owner/deleteOwner.vue +++ b/src/components/owner/deleteOwner.vue @@ -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) } } } diff --git a/src/components/owner/ownerCars.vue b/src/components/owner/ownerCars.vue index b6296af..9f9ffc7 100644 --- a/src/components/owner/ownerCars.vue +++ b/src/components/owner/ownerCars.vue @@ -1,5 +1,5 @@ @@ -73,6 +73,7 @@ export default { }, data() { return { + roomFlag: '2', roomBindOwnerInfo: { roomId: '', roomName: '', diff --git a/src/views/room/addRoomViewList.vue b/src/views/room/addRoomViewList.vue index 010ea7d..0b0a385 100644 --- a/src/views/room/addRoomViewList.vue +++ b/src/views/room/addRoomViewList.vue @@ -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() { diff --git a/src/views/room/roomLang.js b/src/views/room/roomLang.js index b557211..db211e6 100644 --- a/src/views/room/roomLang.js +++ b/src/views/room/roomLang.js @@ -451,8 +451,8 @@ export const messages = { editRoom: { title: '修改房屋', roomNum: '房屋编号', - layer: '房屋楼层', - unit: '房屋单元', + layer: '楼层', + unit: '单元', roomType: '房屋类型', apartment1: '户型室', apartment2: '户型厅', diff --git a/src/views/room/roomList.vue b/src/views/room/roomList.vue index 282c4b6..54315fa 100644 --- a/src/views/room/roomList.vue +++ b/src/views/room/roomList.vue @@ -31,10 +31,10 @@ {{ $t('roomList.importRoom') }} - + @@ -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) { diff --git a/src/views/room/shopsLang.js b/src/views/room/shopsLang.js index 711a4d1..9fbd9e8 100644 --- a/src/views/room/shopsLang.js +++ b/src/views/room/shopsLang.js @@ -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:'出售商铺' } } } \ No newline at end of file diff --git a/src/views/room/shopsList.vue b/src/views/room/shopsList.vue index a1e905b..2de1310 100644 --- a/src/views/room/shopsList.vue +++ b/src/views/room/shopsList.vue @@ -7,15 +7,15 @@ {{ $t('shops.queryCondition') }} - + - + - + @@ -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获取 })