diff --git a/app.js b/app.js index 4b4cb0be0..0ba9148d2 100644 --- a/app.js +++ b/app.js @@ -34,10 +34,10 @@ let opts = { //app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts)); //app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts)); //app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); -//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); -//app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts)); -app.use('/callComponent',proxy('http://192.168.1.16:8012',opts)); -app.use('/app',proxy('http://192.168.1.16:8012',opts)); +app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts)); +app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts)); +//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts)); +//app.use('/app',proxy('http://192.168.1.16:8012',opts)); //app.listen(3000); app.use(express.json()); diff --git a/public/components/property/editCar/editCar.html b/public/components/property/editCar/editCar.html new file mode 100644 index 000000000..398e54fb9 --- /dev/null +++ b/public/components/property/editCar/editCar.html @@ -0,0 +1,72 @@ + \ No newline at end of file diff --git a/public/components/property/editCar/editCar.js b/public/components/property/editCar/editCar.js new file mode 100644 index 000000000..49f5f2449 --- /dev/null +++ b/public/components/property/editCar/editCar.js @@ -0,0 +1,204 @@ +/** + 权限组 +**/ +(function (vc) { + + vc.extends({ + data: { + editCarInfo: { + carId: '', + carNum: '', + carBrand: '', + carType: '', + carColor: '', + remark: "", + startTime: '', + endTime: '', + carNumType: '' + }, + carTypes: [ + { + key: '9901', + value: '家用小汽车' + }, + { + key: '9902', + value: '客车' + }, + { + key: '9903', + value: '货车' + } + ] + }, + _initMethod: function () { + var param = { + params: { + name: 'owner_car', + type: 'car_type' + } + } + //发送get请求 + vc.http.get('hireParkingSpace', + 'listCarType', + param, + function (json, res) { + var carTypes = JSON.parse(json); + + vc.component.carTypes = carTypes; + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + + vc.component._initDateInfo(); + }, + _initEvent: function () { + vc.on('editCar', 'openEditCar', function (_carInfo) { + vc.copyObject(_carInfo, $that.editCarInfo); + $('#editCarModal').modal('show'); + }); + + }, + methods: { + editCarValidate: function () { + return vc.validate.validate({ + editCarInfo: vc.component.editCarInfo + }, { + + 'editCarInfo.carNum': [ + { + limit: "required", + param: "", + errInfo: "车牌号不能为空" + }, + { + limit: "maxin", + param: "2,12", + errInfo: "车牌号不正确" + } + ], + 'editCarInfo.carBrand': [ + { + limit: "required", + param: "", + errInfo: "车品牌不能为空" + }, + { + limit: "maxLength", + param: "50", + errInfo: "车品牌超出限制" + } + ], + 'editCarInfo.carType': [ + { + limit: "required", + param: "", + errInfo: "车类型不能为空" + } + ], + 'editCarInfo.startTime': [ + { + limit: "required", + param: "", + errInfo: "起租时间不能为空" + } + ], + 'editCarInfo.endTime': [ + { + limit: "required", + param: "", + errInfo: "结租时间不能为空" + } + ], + 'editCarInfo.carColor': [ + { + limit: "required", + param: "", + errInfo: "车颜色不能为空" + }, + { + limit: "maxLength", + param: "12", + errInfo: "车颜色超出限制" + } + ] + }); + }, + _submitEditCarInfo: function () { + if (!vc.component.editCarValidate()) { + return; + } + + vc.component.editCarInfo.communityId = vc.getCurrentCommunity().communityId; + + vc.http.apiPost( + 'owner.editOwnerCar', + JSON.stringify(vc.component.editCarInfo), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + //关闭model + $('#editCarModal').modal('hide'); + vc.emit('lisOwnerCar', 'listOwnerCarData', {}); + + for (let key in $that.editCarInfo) { + $that.editCarInfo[key] = ''; + } + return; + } + vc.toast(json); + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.toast(errInfo); + }); + }, + _initDateInfo: function () { + vc.component.editCarInfo.startTime = vc.dateFormat(new Date().getTime()); + $('.editStartTime').datetimepicker({ + language: 'zh-CN', + fontAwesome: 'fa', + format: 'yyyy-mm-dd hh:ii:ss', + initTime: true, + initialDate: new Date(), + autoClose: 1, + todayBtn: true + + }); + $('.editStartTime').datetimepicker() + .on('changeDate', function (ev) { + var value = $(".editStartTime").val(); + vc.component.editCarInfo.startTime = value; + }); + $('.editEndTime').datetimepicker({ + language: 'zh-CN', + fontAwesome: 'fa', + format: 'yyyy-mm-dd hh:ii:ss', + initTime: true, + initialDate: new Date(), + autoClose: 1, + todayBtn: true + }); + $('.editEndTime').datetimepicker() + .on('changeDate', function (ev) { + var value = $(".editEndTime").val(); + var start = Date.parse(new Date(vc.component.editCarInfo.startTime)) + var end = Date.parse(new Date(value)) + if (start - end >= 0) { + vc.toast("结租时间必须大于起租时间") + $(".editEndTime").val('') + } else { + vc.component.editCarInfo.endTime = value; + } + }); + }, + + } + }); + +})(window.vc); \ No newline at end of file diff --git a/public/pages/property/hireParkingSpace/hireParkingSpace.js b/public/pages/property/hireParkingSpace/hireParkingSpace.js index 20e4ea4c2..d1a550561 100644 --- a/public/pages/property/hireParkingSpace/hireParkingSpace.js +++ b/public/pages/property/hireParkingSpace/hireParkingSpace.js @@ -76,13 +76,15 @@ return ; } - var param = { - communityId:vc.getCurrentCommunity().communityId, - data:vc.component.hireParkingSpaceInfo.infos - } + let _infos = vc.component.hireParkingSpaceInfo.infos + + let param = _infos[2]; + param.communityId = vc.getCurrentCommunity().communityId; + param.ownerId = _infos[1].ownerId; + param.psId = _infos[0].psId; vc.http.apiPost( - 'owner.saveOwnerCars', + 'owner.saveOwnerCar', JSON.stringify(param), { emulateJSON:true diff --git a/public/pages/property/listOwnerCar/listOwnerCar.html b/public/pages/property/listOwnerCar/listOwnerCar.html index b8fbddfdc..e1a0dcef7 100644 --- a/public/pages/property/listOwnerCar/listOwnerCar.html +++ b/public/pages/property/listOwnerCar/listOwnerCar.html @@ -94,7 +94,7 @@ {{car.carBrand}} - {{car.carType}} + {{car.carTypeName}} {{car.carColor}} @@ -115,12 +115,16 @@ {{car.endTime}} - {{car.state}} + {{car.stateName}}
+ v-on:click="_deleteCarParkingSpace(car)">释放车位 +
+
+
- - - - + + \ No newline at end of file diff --git a/public/pages/property/listOwnerCar/listOwnerCar.js b/public/pages/property/listOwnerCar/listOwnerCar.js index 2e7711ef1..e60e96ce9 100644 --- a/public/pages/property/listOwnerCar/listOwnerCar.js +++ b/public/pages/property/listOwnerCar/listOwnerCar.js @@ -12,7 +12,7 @@ conditions: { carNum: '', num: '', - state:'' + state: '' } } }, @@ -29,12 +29,12 @@ }, methods: { _listOwnerCar: function (_page, _row) { + let _params = $that.listOwnerCarInfo.conditions; + _params.page = _page; + _params.row = _row; + _params.communityId = vc.getCurrentCommunity().communityId; var param = { - params: { - page: _page, - row: _row, - communityId: vc.getCurrentCommunity().communityId, - } + params: _params } //发送get请求 @@ -58,9 +58,12 @@ ); }, - _addOwnerCar:function(){ //出租 + _addOwnerCar: function () { //出租 vc.jumpToPage('/admin.html#/pages/property/hireParkingSpace'); }, + _openEditOwnerCar: function (_car) { + vc.emit('editCar', 'openEditCar', _car); + }, _queryMethod: function () { $that._listOwnerCar(DEFAULT_PAGE, DEFAULT_ROWS); }, @@ -71,9 +74,31 @@ $that.listOwnerCarInfo.moreCondition = true; } }, - _openDelOwnerCarModel:function(_car){ - vc.emit('deleteOwnerCar','openOwnerCarModel',_car); + _openDelOwnerCarModel: function (_car) { + vc.emit('deleteOwnerCar', 'openOwnerCarModel', _car); }, + _deleteCarParkingSpace: function (_car) { + vc.http.apiPost( + 'owner.deleteCarParkingSpace', + JSON.stringify(_car), + { + emulateJSON: true + }, + function (json, res) { + //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); + if (res.status == 200) { + vc.toast('释放成功'); + $that._listOwnerCar(DEFAULT_PAGE, DEFAULT_ROWS); + return; + } + vc.toast(json); + }, + function (errInfo, error) { + console.log('请求失败处理'); + + vc.toast(errInfo); + }); + } } }) })(window.vc); \ No newline at end of file diff --git a/public/pages/property/listParkingSpace/listParkingSpace.html b/public/pages/property/listParkingSpace/listParkingSpace.html index 205d16658..4399c7728 100644 --- a/public/pages/property/listParkingSpace/listParkingSpace.html +++ b/public/pages/property/listParkingSpace/listParkingSpace.html @@ -85,36 +85,35 @@ - - - - + + + + + - - - + + +
车位ID车位编码停车场ID停车场编号停车场车位车位状态 面积车位ID 操作
- {{parkingSpace.psId}} - - {{parkingSpace.num}} + {{parkingSpace.areaNum}}号停车场 - {{parkingSpace.paId}} - - {{parkingSpace.areaNum}} + {{parkingSpace.num}}车位 {{vc.component._viewParkingSpaceState(parkingSpace.state)}} {{parkingSpace.area}} + {{parkingSpace.psId}} +