diff --git a/public/components/car/communityParkingTree/communityParkingTree.html b/public/components/car/communityParkingTree/communityParkingTree.html new file mode 100644 index 000000000..f90c51134 --- /dev/null +++ b/public/components/car/communityParkingTree/communityParkingTree.html @@ -0,0 +1,6 @@ + +
+
+
+ +
\ No newline at end of file diff --git a/public/components/car/communityParkingTree/communityParkingTree.js b/public/components/car/communityParkingTree/communityParkingTree.js new file mode 100644 index 000000000..55a7baf72 --- /dev/null +++ b/public/components/car/communityParkingTree/communityParkingTree.js @@ -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); \ No newline at end of file diff --git a/public/pages/car/adminCar/adminCar.html b/public/pages/car/adminCar/adminCar.html new file mode 100644 index 000000000..0153824bc --- /dev/null +++ b/public/pages/car/adminCar/adminCar.html @@ -0,0 +1,162 @@ +
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
{{car.carNum}} + + + {{car.memberCarCount || 0}} + + +
+ {{car.roomName}} +
+
+ 临时车 + + {{car.leaseTypeName}} + + {{car.carTypeName || '-'}} + + {{car.carColor || '-'}} + + + + {{car.areaNum}}-{{car.num}} + + 车位已释放 + + {{car.startTime}}
~{{car.endTime}} +
+ -- + + {{_getCarState(car)}} + + ({{car.iotStateName}}) + + + {{car.remark}} + +
+ +
+
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/public/pages/car/adminCar/adminCar.js b/public/pages/car/adminCar/adminCar.js new file mode 100644 index 000000000..2571e0e11 --- /dev/null +++ b/public/pages/car/adminCar/adminCar.js @@ -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); \ No newline at end of file