完成运营业主信息显示

This commit is contained in:
wuxw 2025-03-02 01:37:17 +08:00
parent 329f3d2ed1
commit 87f0cf2525
4 changed files with 380 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<!-- 弹出层 modal -->
<div class="bg-white margin-top-xs padding border-radius tree-div">
<div id="jstree_communityParkingTreeDiv">
</div>
<!-- end 弹出层 moda -->
</div>

View File

@ -0,0 +1,91 @@
(function (vc) {
let DEFAULT_PAGE = 1;
let DEFAULT_ROW = 10;
vc.extends({
data: {
communityParkingTreeInfo: {
parkings: [],
callName: ''
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('communityParkingTree', 'initCommunityParkingTree', function (_param) {
$that.communityParkingTreeInfo.callName = _param.callName;
$that._loadCommunityParkingTree();
});
},
methods: {
_loadCommunityParkingTree: function () {
let param = {
params: {
hc:1.8
}
};
//发送get请求
vc.http.apiGet('/community.queryCommunityParkingTree',
param,
function (json) {
let _json = JSON.parse(json);
$that.communityParkingTreeInfo.parkings = _json.data;
$that._initJsTreeCommunityParkingTree();
},
function () {
console.log('请求失败处理');
});
},
_initJsTreeCommunityParkingTree: function () {
let _data = $that.communityParkingTreeInfo.parkings;
$.jstree.destroy()
$("#jstree_communityParkingTreeDiv").jstree({
"checkbox": {
"keep_selected_style": false
},
'state': { //一些初始化状态
"opened": true,
},
'core': {
"check_callback": true,
'data': _data
}
});
$("#jstree_communityParkingTreeDiv").on("ready.jstree", function (e, data) {
$('#jstree_communityParkingTreeDiv').jstree('select_node', _data[0].children[0].id /* , true */);
});
$('#jstree_communityParkingTreeDiv').on("changed.jstree", function (e, data) {
if (data.action == 'model' || data.action == 'ready') {
return;
}
let _selected = data.selected[0];
if (_selected.startsWith('c_')) {
vc.emit($that.communityParkingTreeInfo.callName, 'selectCommunity', {
communityName: data.node.original.communityName,
communityId: data.node.original.communityId
})
return;
}
if (_selected.startsWith('p_')) {
vc.emit($that.communityParkingTreeInfo.callName, 'selectParkingArea', {
paNum: data.node.original.num,
paId: data.node.original.paId
})
return;
}
//console.log(_selected, data.node.original.unitId)
if (_selected.startsWith('l_')) {
vc.emit($that.communityParkingTreeInfo.callName, 'selectLeaseType', {
leaseTypeName: data.node.original.leaseTypeName,
leaseType: data.node.original.leaseType
})
}
});
$('#jstree_communityParkingTreeDiv')
.on('click', '.jstree-anchor', function (e) {
$(this).jstree(true).toggle_node(e.target);
})
},
}
});
})(window.vc);

View File

@ -0,0 +1,162 @@
<div>
<div class="flex justify-start">
<div style="padding-right:0px;width: 200px;" class="room-floor-unit-tree">
<vc:create path="car/communityParkingTree"></vc:create>
</div>
<div class="margin-top-xs margin-left-sm" style="flex-grow: 1;">
<div class="ibox ">
<div class="ibox-title">
<h5>
<vc:i18n name="查询条件"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;"></div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-sm-2">
<div class="form-group input-group">
<input type="text" :placeholder="vc.i18n('请输入车牌号','adminCar')"
v-model.trim="adminCarInfo.conditions.carNumLike" class="form-control">
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请填写车位编号','adminCar')"
class=" form-control" v-model.trim="adminCarInfo.conditions.num">
</div>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_queryCommunityPublicityMethod()">
<vc:i18n name="查询" namespace="adminCar"></vc:i18n>
</button>
</div>
</div>
</div>
</div>
<div class="ibox">
<div class="ibox-title">
<h5>
<vc:i18n name="小区车辆" namespace="adminCar"></vc:i18n>
</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<div class="hc-table-div">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">
<vc:i18n name="车牌号" namespace="adminCar"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="成员车辆" namespace="adminCar"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="房屋号" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="车牌类型" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="车辆类型" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="颜色" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="业主" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="车位" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="有效期" namespace="adminCar"></vc:i18n>
</th>
<th data-hide="phone" class="text-center">
<vc:i18n name="状态" namespace="adminCar"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="备注" namespace="adminCar"></vc:i18n>
</th>
<th class="text-center">
<vc:i18n name="操作" namespace="adminCar"></vc:i18n>
</th>
</tr>
</thead>
<tbody>
<tr v-for="car in adminCarInfo.cars">
<td class="text-center">{{car.carNum}}
</td>
<td class="text-center">
<a href="javascript:void(0)">
{{car.memberCarCount || 0}}
</a>
</td>
<td class="text-center">
<div style="width: 150px;">
{{car.roomName}}
</div>
</td>
<td class="text-center" v-if="car.leaseType == 'T'">
临时车
</td>
<td class="text-center" v-else>
{{car.leaseTypeName}}
</td>
<td class="text-center">
{{car.carTypeName || '-'}}
</td>
<td class="text-center">
{{car.carColor || '-'}}
</td>
<td class="text-center hand">
<div class="">
<a target="_blank" :href="'/#/pages/owner/adminOwnerDetail?ownerId='+car.ownerId">
{{car.ownerName}}({{car.link}})
</a>
</div>
</td>
<td v-if="car.areaNum && car.state == '1001'" class="text-center">
{{car.areaNum}}-{{car.num}}
</td>
<td v-else class="text-center">
车位已释放
</td>
<td class="text-center" >
{{car.startTime}}</br>~{{car.endTime}}
</td>
<td class="text-center" v-else>
--
</td>
<td class="text-center">
{{_getCarState(car)}}
<span v-if="car.iotStateName">
({{car.iotStateName}})
</span>
</td>
<td class="text-center">
{{car.remark}}
</td>
<td class="text-center">
<div class="btn-group" >
<button class="btn-white btn btn-xs"
v-on:click="_deleteCarParkingSpace(car)">
<vc:i18n name="详情" namespace="adminCar"></vc:i18n>
</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- 分页 -->
<vc:create path="frame/pagination"></vc:create>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,121 @@
/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
adminCarInfo: {
cars: [],
states:[],
roomSubTypes:[],
total: 0,
records: 1,
moreCondition: false,
conditions: {
communityId: '',
paId: '',
leaseType: '',
ownerNameLike:'',
ownerTel:'',
carNum: '',
carNumLike: '',
}
}
},
_initMethod: function () {
vc.emit('communityParkingTree', 'initCommunityParkingTree',{
callName:'adminCar'
});
},
_initEvent: function () {
vc.on('adminCar', 'selectCommunity', function (_param) {
$that.adminCarInfo.conditions.communityId = _param.communityId;
$that.adminCarInfo.conditions.paId = '';
$that.adminCarInfo.conditions.leaseType = '';
$that._listAdminCommunityCars(DEFAULT_PAGE,DEFAULT_ROWS);
});
vc.on('adminCar', 'selectParkingArea', function (_param) {
$that.adminCarInfo.conditions.communityId = '';
$that.adminCarInfo.conditions.paId = _param.paId;
$that.adminCarInfo.conditions.leaseType = '';
$that._listAdminCommunityCars(DEFAULT_PAGE,DEFAULT_ROWS);
});
vc.on('adminCar', 'selectLeaseType', function (_param) {
$that.adminCarInfo.conditions.communityId = '';
$that.adminCarInfo.conditions.paId = '';
$that.adminCarInfo.conditions.leaseType = _param.leaseType;
$that._listAdminCommunityCars(DEFAULT_PAGE,DEFAULT_ROWS);
});
vc.on('adminCar', 'listAdminCar', function (_param) {
$that._listCommunityPublicitys(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that._listAdminCommunityCars(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listAdminCommunityCars: function (_page, _rows) {
$that.adminCarInfo.conditions.page = _page;
$that.adminCarInfo.conditions.row = _rows;
let param = {
params: $that.adminCarInfo.conditions
};
//发送get请求
vc.http.apiGet('/owner.queryAdminOwnerCars',
param,
function (json, res) {
let _json = JSON.parse(json);
$that.adminCarInfo.total = _json.total;
$that.adminCarInfo.records = _json.records;
$that.adminCarInfo.cars = _json.data;
vc.emit('pagination', 'init', {
total: $that.adminCarInfo.records,
dataCount: $that.adminCarInfo.total,
currentPage: _page
});
},
function (errInfo, error) {
console.log('请求失败处理');
}
);
},
//查询
_queryCommunityPublicityMethod: function () {
$that._listAdminCommunityCars(DEFAULT_PAGE, DEFAULT_ROWS);
},
//重置
_toAdminCarDetail: function (_room) {
vc.jumpToPage('/#/pages/community/adminCarDetail?roomId='+_room.roomId);
},
_moreCondition: function () {
if ($that.adminCarInfo.moreCondition) {
$that.adminCarInfo.moreCondition = false;
} else {
$that.adminCarInfo.moreCondition = true;
}
},
_computeTableDivWidth: function () {
let mainWidth = document.getElementsByTagName('body')[0].clientWidth - document.getElementById('menu-nav').offsetWidth;
let treeWidth = document.getElementsByClassName('room-floor-unit-tree')[0].offsetWidth;
mainWidth = mainWidth - 20 - treeWidth - 15 - 20;
//document.getElementsByClassName('hc-table-div')[0].style.width=mainWidth+'px';
return mainWidth + 'px';
},
_getCarState: function (car) {
if (car.state != null && car.state != '' && car.state != 'undefined' && car.state == '3003') {
return "到期";
}
let _carEndTime = new Date(car.endTime);
if (_carEndTime.getTime() > new Date().getTime()) {
return "正常";
}
return "到期";
},
}
});
})(window.vc);