mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-25 14:17:54 +08:00
优化代码
This commit is contained in:
parent
9374f129a4
commit
67404beb1d
@ -48,11 +48,10 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">预约房屋</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="addRentingAppointmentInfo.appointmentRoomId" type="text" placeholder="选填,请填写预约房屋"
|
||||
<input v-model="addRentingAppointmentInfo.appointmentRoomNum" @blur="_loadRoomInfo" type="text" placeholder="选填,请填写预约房屋 楼栋-单元-房屋 如1-1-1023"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
tenantTel: '',
|
||||
appointmentTime: '',
|
||||
appointmentRoomId: '',
|
||||
appointmentRoomNum: '',
|
||||
remark: '',
|
||||
communitys: [],
|
||||
communityId: '',
|
||||
@ -164,7 +165,7 @@
|
||||
});
|
||||
},
|
||||
_loadAddCommunitys: function () {
|
||||
var param = {
|
||||
let param = {
|
||||
params: {
|
||||
_uId: 'ccdd00opikookjuhyyttvhnnjuuu',
|
||||
page: 1,
|
||||
@ -185,6 +186,48 @@
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
_loadRoomInfo: function () {
|
||||
let _appointmentRoomNum = $that.addRentingAppointmentInfo.appointmentRoomNum;
|
||||
if (_appointmentRoomNum.split('-').length != 3) {
|
||||
return ;
|
||||
}
|
||||
if($that.addRentingAppointmentInfo.communityId == ''){
|
||||
vc.toast('请先选择小区');
|
||||
$that.addRentingAppointmentInfo.appointmentRoomNum = '';
|
||||
return ;
|
||||
}
|
||||
let _appointmentRoomNums = _appointmentRoomNum.split('-')
|
||||
|
||||
let param = {
|
||||
params: {
|
||||
_uId: 'ccdd00opikookjuhyyttvhnnjuuu',
|
||||
page: 1,
|
||||
row: 1,
|
||||
floorNum: _appointmentRoomNums[0].trim(),
|
||||
unitNum: _appointmentRoomNums[1].trim(),
|
||||
roomNum: _appointmentRoomNums[2].trim(),
|
||||
communityId: $that.addRentingAppointmentInfo.communityId
|
||||
}
|
||||
};
|
||||
vc.http.apiGet('room.queryRooms',
|
||||
param,
|
||||
function (json, res) {
|
||||
if (res.status == 200) {
|
||||
let _rooms = JSON.parse(json).rooms;
|
||||
if (_rooms.length < 1) {
|
||||
vc.toast('未查询到房屋');
|
||||
$that.addRentingAppointmentInfo.appointmentRoomNum = '';
|
||||
return;
|
||||
}
|
||||
$that.addRentingAppointmentInfo.appointmentRoomId = _rooms[0].roomId;
|
||||
}
|
||||
}, function () {
|
||||
vc.toast('未查询到房屋');
|
||||
$that.addRentingAppointmentInfo.appointmentRoomNum = '';
|
||||
}
|
||||
);
|
||||
},
|
||||
clearAddRentingAppointmentInfo: function () {
|
||||
let _communitys = $that.addRentingAppointmentInfo.communitys;
|
||||
vc.component.addRentingAppointmentInfo = {
|
||||
@ -201,7 +244,8 @@
|
||||
unitNum: '',
|
||||
roomId: '',
|
||||
roomNum: '',
|
||||
communitys: _communitys
|
||||
communitys: _communitys,
|
||||
appointmentRoomNum: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user