From 8b3203089deb0c13d87d036417c7abf651d5368b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Mon, 29 Aug 2022 22:38:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../property/addNotepad/addNotepad.js | 2 +- .../parkingAreaControlCustomCarInout.html | 36 +++++--- .../parkingAreaControlCustomCarInout.js | 91 ++++++++++++++----- .../parkingAreaControlInCar.js | 2 +- .../parkingAreaControlVideo.js | 3 +- 5 files changed, 96 insertions(+), 38 deletions(-) diff --git a/public/components/property/addNotepad/addNotepad.js b/public/components/property/addNotepad/addNotepad.js index 3022d3334..0489612e0 100644 --- a/public/components/property/addNotepad/addNotepad.js +++ b/public/components/property/addNotepad/addNotepad.js @@ -119,7 +119,7 @@ params: { page: 1, row: 1, - roomId: '', + roomId: $that.addNotepadInfo.roomId, communityId: vc.getCurrentCommunity().communityId } }; diff --git a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html index 58ba9bb44..f55fa0e63 100644 --- a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html +++ b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.html @@ -1,5 +1,4 @@ - - + \ No newline at end of file diff --git a/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js b/public/components/property/parkingAreaControlCustomCarInout/parkingAreaControlCustomCarInout.js index d15d150fa..8f39908de 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: { @@ -8,14 +8,21 @@ remark: '', type: '1101', payCharge: '', - machineId: '' + costMin: '0', + machineId: '', + boxId: '', + payType: '', + payTypes: [], + inoutId: '' } }, - _initMethod: function () { - + _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; @@ -24,31 +31,28 @@ }); }, methods: { - parkingAreaControlCustomCarInoutValidate: function () { + parkingAreaControlCustomCarInoutValidate: function() { return vc.validate.validate({ parkingAreaControlCustomCarInoutInfo: vc.component.parkingAreaControlCustomCarInoutInfo }, { - 'parkingAreaControlCustomCarInoutInfo.carNum': [ - { - limit: "required", - param: "", - errInfo: "车牌号不能为空" - } - ] + 'parkingAreaControlCustomCarInoutInfo.carNum': [{ + limit: "required", + param: "", + errInfo: "车牌号不能为空" + }] }); }, - parkingAreaControlCustomCarInout: function () { + parkingAreaControlCustomCarInout: function() { if (!vc.component.parkingAreaControlCustomCarInoutValidate()) { vc.toast(vc.validate.errInfo); return; } vc.http.apiPost( '/machine.customCarInOutCmd', - JSON.stringify(vc.component.parkingAreaControlCustomCarInoutInfo), - { + JSON.stringify(vc.component.parkingAreaControlCustomCarInoutInfo), { emulateJSON: true }, - function (json, res) { + function(json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); let _data = JSON.parse(json); $('#parkingAreaControlCustomCarInoutModel').modal('hide'); @@ -59,21 +63,66 @@ 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: '', amount: '', remark: '', type: '1101', payCharge: '', - machineId: '' + machineId: '', + boxId: '', + costMin: '', + payType: '', + payTypes: _payTypes, + inoutId: '' } + }, + _loadParkingAreaControlCustomCarInoutData: function() { + let param = { + params: { + page: 1, + row: 1, + communityId: vc.getCurrentCommunity().communityId, + boxId: $that.parkingAreaControlCustomCarInoutInfo.boxId, + carNum: $that.parkingAreaControlCustomCarInoutInfo.carNum, + } + }; + //发送get请求 + vc.http.apiGet('/carInout.listCarInParkingAreaCmd', + param, + function(json) { + let _feeConfigInfo = JSON.parse(json); + let _data = _feeConfigInfo.data; + + if (!_data || _data.length < 1) { + vc.toast('未查询在场车辆,请检查!'); + return; + } + $that.parkingAreaControlCustomCarInout.payCharge = _data[0].payCharge; + $that.parkingAreaControlCustomCarInout.inoutId = _data[0].inoutId; + $that.parkingAreaControlCustomCarInout.costMin = _data[0].hours + "时" + _data[0].min + "分"; + }, + function() { + console.log('请求失败处理'); + } + ); + }, + _queryCustomCarMoney: function() { + if (!$that.parkingAreaControlCustomCarInoutInfo.carNum) { + return; + } + if ($that.parkingAreaControlCustomCarInoutInfo.type == '1101') { + return; + } + $that._loadParkingAreaControlCustomCarInoutData(); } } }); diff --git a/public/components/property/parkingAreaControlInCar/parkingAreaControlInCar.js b/public/components/property/parkingAreaControlInCar/parkingAreaControlInCar.js index 925a2a74c..5b1f0cffe 100644 --- a/public/components/property/parkingAreaControlInCar/parkingAreaControlInCar.js +++ b/public/components/property/parkingAreaControlInCar/parkingAreaControlInCar.js @@ -35,7 +35,7 @@ communityId: vc.getCurrentCommunity().communityId, boxId: $that.parkingAreaControlInCarInfo.boxId, carNum: $that.parkingAreaControlInCarInfo.carNum, - state: $that.parkingAreaControlInCarInfo.carNum + state: $that.parkingAreaControlInCarInfo.state } }; //发送get请求 diff --git a/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js b/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js index da9e43fd8..d8a407bce 100644 --- a/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js +++ b/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js @@ -274,7 +274,8 @@ } vc.emit('parkingAreaControlCustomCarInout', 'open', { type: _type, - machineId: _machineId + machineId: _machineId, + boxId: $that.parkingAreaControlVideoInfo.boxId }) }, unlicensedCarIn: function(_type) {