mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
a7cefc8051
commit
80291a5dbd
@ -2,34 +2,59 @@
|
||||
<div class="col-lg-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<h5>资产调整</h5>
|
||||
<h5>关联房屋</h5>
|
||||
<div class="ibox-tools" style="top:10px;">
|
||||
|
||||
<button type="button" class="btn btn-primary btn-sm" v-on:click="_selectRoom()">
|
||||
<i class="glyphicon glyphicon-plus"></i>
|
||||
添加
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">房屋</label>
|
||||
<div class="col-sm-10 ">
|
||||
<input v-model="contractChangeAssetsInfo.allNum" type="text" placeholder="选填,请填写房屋 楼栋-单元-房屋 如 1-1-1023" class="form-control" @blur="_queryRoom">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">业主</label>
|
||||
<div class="col-sm-10 ">
|
||||
<input v-model="contractChangeAssetsInfo.ownerName" disabled="disabled" type="text" placeholder="必填,请填写业主"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">业主电话</label>
|
||||
<div class="col-sm-10 ">
|
||||
<input v-model="contractChangeAssetsInfo.link" disabled="disabled" type="text" placeholder="必填,请填写业主电话"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="footable table table-stripped toggle-arrow-tiny" style="margin-top:10px"
|
||||
data-page-size="10">
|
||||
<thead>
|
||||
<tr>
|
||||
<!-- <th>房屋ID</th> -->
|
||||
<th data-hide="phone" class="text-center">房屋</th>
|
||||
<th data-hide="phone" class="text-center">业主</th>
|
||||
<th data-hide="phone" class="text-center">电话</th>
|
||||
<th data-hide="phone" class="text-center">建筑面积</th>
|
||||
<th data-hide="phone" class="text-center">房屋状态</th>
|
||||
<th class="text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="room in contractChangeAssetsInfo.rooms">
|
||||
<td class="text-center">
|
||||
{{room.floorNum}}-{{room.unitNum}}-{{room.roomNum}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{room.ownerName}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{room.link}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{room.builtUpArea}}平方米
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{room.stateName}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openDelRoomModel(room)">删除</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
<vc:create path="frame/pagination"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<vc:create path="property/searchRoom" emitChooseRoom="contractChangeAssets" emitLoadData="contractChangeAssets" roomFlag="">
|
||||
</vc:create>
|
||||
</div>
|
||||
@ -7,13 +7,8 @@
|
||||
},
|
||||
data: {
|
||||
contractChangeAssetsInfo: {
|
||||
allNum: '',
|
||||
ownerName: '',
|
||||
link:'',
|
||||
roomId:'',
|
||||
objType:'',
|
||||
objId:'',
|
||||
planType: '3003'
|
||||
rooms: [],
|
||||
contractId: '',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -25,72 +20,51 @@
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
vc.initDateTime('changeStartTime', function (_value) {
|
||||
$that.contractChangeAssetsInfo.startTime = _value;
|
||||
});
|
||||
vc.initDateTime('changeEndTime', function (_value) {
|
||||
$that.contractChangeAssetsInfo.endTime = _value;
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
|
||||
vc.on('contractChangeAssets', 'contractInfo', function (param) {
|
||||
$that.contractChangeAssetsInfo.contractId = param.contractId;
|
||||
$that._loadContractRooms();
|
||||
})
|
||||
vc.on('contractChangeAssets', 'chooseRoom', function (param) {
|
||||
$that.contractChangeAssetsInfo.rooms.push(param);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
clearcontractChangeAssetsInfo: function () {
|
||||
vc.component.contractChangeAssetsInfo = {
|
||||
allNum: '',
|
||||
ownerName: '',
|
||||
link:'',
|
||||
roomId:'',
|
||||
objType:'',
|
||||
objId:'',
|
||||
planType: '3003'
|
||||
rooms: [],
|
||||
};
|
||||
},
|
||||
_queryRoom: function () {
|
||||
let _allNum = $that.contractChangeAssetsInfo.allNum;
|
||||
if (_allNum == '') {
|
||||
return;
|
||||
}
|
||||
_selectRoom: function () {
|
||||
vc.emit('searchRoom', 'openSearchRoomModel', {})
|
||||
},
|
||||
_openDelRoomModel: function (_room) {
|
||||
|
||||
let _tmpRooms = [];
|
||||
$that.contractChangeAssetsInfo.rooms.forEach(item => {
|
||||
if (item.roomId != _room.roomId) {
|
||||
_tmpRooms.push(item);
|
||||
}
|
||||
});
|
||||
$that.contractChangeAssetsInfo.rooms = _tmpRooms;
|
||||
},
|
||||
_loadContractRooms: function () {
|
||||
let param = {
|
||||
params: {
|
||||
contractId: vc.component.contractChangeAssetsInfo.contractId,
|
||||
page: 1,
|
||||
row: 1,
|
||||
communityId: vc.getCurrentCommunity().communityId
|
||||
row: 100
|
||||
}
|
||||
};
|
||||
|
||||
if (_allNum.split('-').length == 3) {
|
||||
let _allNums = _allNum.split('-')
|
||||
param.params.floorNum = _allNums[0].trim();
|
||||
param.params.unitNum = _allNums[1].trim();
|
||||
param.params.roomNum = _allNums[2].trim();
|
||||
} else {
|
||||
vc.toast('房屋填写格式错误,请填写 楼栋-单元-房屋格式')
|
||||
return;
|
||||
}
|
||||
|
||||
//发送get请求
|
||||
vc.http.get('roomCreateFee',
|
||||
'listRoom',
|
||||
vc.http.apiGet('/contract/queryContractRoom',
|
||||
param,
|
||||
function (json, res) {
|
||||
let listRoomData = JSON.parse(json);
|
||||
let _rooms = listRoomData.rooms;
|
||||
|
||||
if (_rooms.length < 1) {
|
||||
vc.toast('未找到房屋');
|
||||
$that.contractChangeAssetsInfo.allNum = '';
|
||||
return;
|
||||
}
|
||||
|
||||
$that.contractChangeAssetsInfo.roomId = _rooms[0].roomId;
|
||||
$that.contractChangeAssetsInfo.ownerName = _rooms[0].ownerName;
|
||||
$that.contractChangeAssetsInfo.link = _rooms[0].link;
|
||||
$that.contractChangeAssetsInfo.objType = '3333';
|
||||
$that.contractChangeAssetsInfo.objId = _rooms[0].roomId;
|
||||
|
||||
var _contractTFile = JSON.parse(json);
|
||||
vc.component.contractChangeAssetsInfo.rooms = _contractTFile.data;
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
signingTime: '',
|
||||
param: '',
|
||||
planType: '',
|
||||
rooms:[]
|
||||
|
||||
},
|
||||
newContract: {
|
||||
@ -39,11 +40,17 @@
|
||||
_initEvent: function () {
|
||||
vc.on('contractChangeDetailInfo', 'chooseContract', function (_app) {
|
||||
vc.copyObject(_app, vc.component.contractChangeDetailInfo);
|
||||
if($that.contractChangeDetailInfo.param == 'contractChangeAssets'){
|
||||
vc.emit('contractChangeAssets','contractInfo',vc.component.contractChangeDetailInfo);
|
||||
}
|
||||
});
|
||||
vc.on('contractChangeDetailInfo', 'notice', function (item) {
|
||||
let _changeRemark = $that.newContract.changeRemark;
|
||||
$that.newContract = vc.deepClone($that.contractChangeDetailInfo);
|
||||
$that.newContract.changeRemark = _changeRemark;
|
||||
if(item.hasOwnProperty('rooms')){
|
||||
$that.newContract.rooms = item.rooms;
|
||||
}
|
||||
vc.copyObject(item, $that.newContract);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user