加入车位 结构图

This commit is contained in:
java110 2022-04-05 15:52:15 +08:00
parent 949d2fdecc
commit bcf3ee4e51
2 changed files with 20 additions and 19 deletions

View File

@ -2,16 +2,17 @@
<div class="row">
<div class="col-md-2">
<vc:create path="property/floorUnitTree" callBackListener="roomStructure"></vc:create>
<vc:create path="property/floorUnitTree" callBackListener="carStructure"></vc:create>
</div>
<div class="col-md-10 margin-bottom">
<div class="row margin-top-xs bg-white">
<div class="col-md-1 text-center margin-sm padding-xs" title="双击查看详情" @dblclick="_toSimplifyAcceptance(room)" v-for="(room,index) in roomStructureInfo.rooms" :style="{'background-color': _getBgColor(room)}" style="color: #fff;border-radius: 5px;cursor:pointer">
<div>{{room.floorNum}}-{{room.unitNum}}-{{room.roomNum}}</div>
<div>{{room.stateName}}</div>
<div>{{room.ownerName?room.ownerName:'无'}}</div>
<div>欠费:{{room.oweAmount}}元</div>
<div class="col-md-1 text-center margin-sm padding-xs" title="双击查看详情" @dblclick="_toSimplifyAcceptance(car)" v-for="(car,index) in carStructureInfo.cars" :style="{'background-color': _getBgColor(car)}" style="color: #fff;border-radius: 5px;cursor:pointer">
<div>{{car.areaNum}}-{{car.num}}</div>
<div>{{car.carNum}}</div>
<div>{{car.floorNum}}-{{car.unitNum}}-{{car.roomNum}}</div>
<div>{{car.ownerName?car.ownerName:'无'}}</div>
<div>欠费:{{car.oweAmount}}元</div>
</div>
</div>
</div>

View File

@ -6,8 +6,8 @@
var DEFAULT_ROWS = 10;
vc.extends({
data: {
roomStructureInfo: {
rooms: [],
carStructureInfo: {
cars: [],
}
},
@ -16,14 +16,14 @@
},
_initEvent: function() {
vc.on('roomStructure', 'switchUnit', function(_param) {
$that._loadRooms(_param.unitId)
vc.on('carStructure', 'switchUnit', function(_param) {
$that._loadCars(_param.unitId)
});
},
methods: {
_loadRooms: function(_unitId) {
_loadCars: function(_unitId) {
let param = {
params: {
page: 1,
@ -32,32 +32,32 @@
communityId: vc.getCurrentCommunity().communityId
}
}
vc.http.apiGet('/room.listRoomStructure',
vc.http.apiGet('/car.listCarStructure',
param,
function(json, res) {
let listRoomData = JSON.parse(json);
$that.roomStructureInfo.rooms = listRoomData.data;
let listCarData = JSON.parse(json);
$that.carStructureInfo.cars = listCarData.data;
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
_getBgColor: function(room) {
if (!room.ownerName) {
_getBgColor: function(car) {
if (!car.ownerName) {
return "#1AB394";
}
if (room.oweAmount > 0) {
if (car.oweAmount > 0) {
return "#DC3545";
}
return "#1296db"
},
_toSimplifyAcceptance: function(_room) {
_toSimplifyAcceptance: function(_car) {
let _date = new Date();
vc.saveData("JAVA110_IS_BACK", _date.getTime());
vc.saveData('simplifyAcceptanceSearch', {
searchType: '1',
searchValue: _room.floorNum + "-" + _room.unitNum + "-" + _room.roomNum,
searchValue: _car.floorNum + "-" + _car.unitNum + "-" + _car.roomNum,
searchPlaceholder: '请输入房屋编号 楼栋-单元-房屋 如1-1-1',
})