diff --git a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html index 8834b9993..919926a5d 100644 --- a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html +++ b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html @@ -46,6 +46,22 @@ +
+ +
+
+ +
+
+
diff --git a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js index afd1acb72..fea9e9134 100644 --- a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js +++ b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js @@ -1,4 +1,4 @@ -(function(vc, vm) { +(function (vc, vm) { vc.extends({ data: { @@ -15,16 +15,18 @@ payType: '', payTypes: [], inoutId: '', - machines: [] + machines: [], + coupons: [], + pccIds: [], } }, - _initMethod: function() { - vc.getDict('car_inout_payment', 'pay_type', function(_data) { + _initMethod: function () { + vc.getDict('car_inout_payment', 'pay_type', function (_data) { $that.parkingAreaControlCustomCarInoutInfo.payTypes = _data; }) }, - _initEvent: function() { - vc.on('parkingAreaControlCustomCarInout', 'open', function(_params) { + _initEvent: function () { + vc.on('parkingAreaControlCustomCarInout', 'open', function (_params) { vc.component.refreshParkingAreaControlCustomCarInoutInfo(); $('#parkingAreaControlCustomCarInoutModel').modal('show'); // = _params; @@ -34,7 +36,7 @@ }); }, methods: { - parkingAreaControlCustomCarInoutValidate: function() { + parkingAreaControlCustomCarInoutValidate: function () { return vc.validate.validate({ parkingAreaControlCustomCarInoutInfo: vc.component.parkingAreaControlCustomCarInoutInfo }, { @@ -45,7 +47,7 @@ }] }); }, - parkingAreaControlCustomCarInout: function() { + parkingAreaControlCustomCarInout: function () { if (!vc.component.parkingAreaControlCustomCarInoutValidate()) { vc.toast(vc.validate.errInfo); return; @@ -53,9 +55,9 @@ vc.http.apiPost( '/machine.customCarInOutCmd', JSON.stringify(vc.component.parkingAreaControlCustomCarInoutInfo), { - emulateJSON: true - }, - function(json, res) { + emulateJSON: true + }, + function (json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); let _data = JSON.parse(json); if (_data.code != 0) { @@ -66,13 +68,13 @@ vc.emit('parkingAreaControlFee', 'clear', {}) } }, - function(errInfo, error) { + function (errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - refreshParkingAreaControlCustomCarInoutInfo: function() { + refreshParkingAreaControlCustomCarInoutInfo: function () { let _payTypes = $that.parkingAreaControlCustomCarInoutInfo.payTypes; vc.component.parkingAreaControlCustomCarInoutInfo = { carNum: '', @@ -87,10 +89,12 @@ payType: '', payTypes: _payTypes, inoutId: '', - machines: [] + machines: [], + coupons: [], + pccIds: [], } }, - _loadParkingAreaControlCustomCarInoutData: function() { + _loadParkingAreaControlCustomCarInoutData: function () { let param = { params: { page: 1, @@ -104,7 +108,7 @@ //发送get请求 vc.http.apiGet('/carInout.listCarInParkingAreaCmd', param, - function(json) { + function (json) { let _feeConfigInfo = JSON.parse(json); let _data = _feeConfigInfo.data; @@ -117,12 +121,12 @@ $that.parkingAreaControlCustomCarInoutInfo.inoutId = _data[0].inoutId; $that.parkingAreaControlCustomCarInoutInfo.costMin = _data[0].hours + "时" + _data[0].min + "分"; }, - function() { + function () { console.log('请求失败处理'); } ); }, - _queryCustomCarMoney: function() { + _queryCustomCarMoney: function () { if (!$that.parkingAreaControlCustomCarInoutInfo.carNum) { return; } @@ -133,26 +137,77 @@ $that._loadOutMachinesByPaId(); } $that._loadParkingAreaControlCustomCarInoutData(); + $that._loadOutCoupons(); }, - _loadOutMachinesByPaId: function() { + _loadOutMachinesByPaId: function () { let param = { - params: { - paId: $that.parkingAreaTotalControlVideoInfo.paId, - page: 1, - row: 100, - direction: '3307', - communityId: vc.getCurrentCommunity().communityId - } + params: { + paId: $that.parkingAreaTotalControlVideoInfo.paId, + page: 1, + row: 100, + direction: '3307', + communityId: vc.getCurrentCommunity().communityId } - //发送get请求 + } + //发送get请求 vc.http.apiGet('/machine.listParkingAreaMachines', param, - function(json, res) { + function (json, res) { let _machineManageInfo = JSON.parse(json); let _machines = _machineManageInfo.data; $that.parkingAreaControlCustomCarInoutInfo.machines = _machines; }, - function(errInfo, error) { + function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _loadOutCoupons: function () { + let param = { + params: { + paId: $that.parkingAreaTotalControlVideoInfo.paId, + page: 1, + row: 30, + state: '1001', + carNum: $that.parkingAreaTotalControlVideoInfo.carNum + } + } + //发送get请求 + vc.http.apiGet('/parkingCoupon.listParkingCouponCar', + param, + function (json, res) { + let _machineManageInfo = JSON.parse(json); + let _coupons = _machineManageInfo.data; + $that.parkingAreaControlCustomCarInoutInfo.coupons = _coupons; + }, + function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, + _computeCouponMoney: function () { + let _pccIds = $that.parkingAreaTotalControlVideoInfo.pccIds; + + if(!_pccIds || _pccIds.length<1){ + return; + } + let param = { + params: { + paId: $that.parkingAreaTotalControlVideoInfo.paId, + pccIds: $that.parkingAreaTotalControlVideoInfo.pccIds.join(","), + carNum: $that.parkingAreaTotalControlVideoInfo.carNum + } + } + //发送get请求 + vc.http.apiGet('/tempCarFee.getTempCarFeeOrder', + param, + function (json, res) { + let _machineManageInfo = JSON.parse(json); + let data = _machineManageInfo.data; + $that.parkingAreaControlCustomCarInoutInfo.payCharge = data.amount; + $that.parkingAreaControlCustomCarInoutInfo.amount = data.amount; + }, + function (errInfo, error) { console.log('请求失败处理'); } );