From fa3dfc9b92cc1a8b0dcc6854218592a05bbfa72b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 12 Mar 2022 00:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8A=98=E6=89=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reviewApplyRoomDiscount.js | 109 ++++++++---------- 1 file changed, 51 insertions(+), 58 deletions(-) diff --git a/public/components/property/reviewApplyRoomDiscount/reviewApplyRoomDiscount.js b/public/components/property/reviewApplyRoomDiscount/reviewApplyRoomDiscount.js index 6e2714fd2..3f7d29db3 100755 --- a/public/components/property/reviewApplyRoomDiscount/reviewApplyRoomDiscount.js +++ b/public/components/property/reviewApplyRoomDiscount/reviewApplyRoomDiscount.js @@ -1,4 +1,4 @@ -(function (vc, vm) { +(function(vc, vm) { vc.extends({ data: { reviewApplyRoomDiscountInfo: { @@ -23,11 +23,11 @@ feeId: '', } }, - _initMethod: function () { + _initMethod: function() { vc.component._initReviewApplyRoomDiscountDateInfo(); }, - _initEvent: function () { - vc.on('reviewApplyRoomDiscount', 'openReviewApplyRoomDiscountModal', function (_params) { + _initEvent: function() { + vc.on('reviewApplyRoomDiscount', 'openReviewApplyRoomDiscountModal', function(_params) { _params = JSON.parse(_params); console.log('params here', _params); delete _params.state; @@ -43,7 +43,7 @@ }); }, methods: { - _initReviewApplyRoomDiscountDateInfo: function () { + _initReviewApplyRoomDiscountDateInfo: function() { $('.reviewStartTime').datetimepicker({ language: 'zh-CN', fontAwesome: 'fa', @@ -54,7 +54,7 @@ todayBtn: true }); $('.reviewStartTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".reviewStartTime").val(); vc.component.reviewApplyRoomDiscountInfo.startTime = value; }); @@ -68,7 +68,7 @@ todayBtn: true }); $('.reviewEndTime').datetimepicker() - .on('changeDate', function (ev) { + .on('changeDate', function(ev) { var value = $(".reviewEndTime").val(); var start = Date.parse(new Date(vc.component.reviewApplyRoomDiscountInfo.startTime)) var end = Date.parse(new Date(value)) @@ -92,12 +92,11 @@ e.currentTarget.blur(); } }, - reviewApplyRoomDiscountValidate: function () { + reviewApplyRoomDiscountValidate: function() { return vc.validate.validate({ reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo }, { - 'reviewApplyRoomDiscountInfo.discountId': [ - { + 'reviewApplyRoomDiscountInfo.discountId': [{ limit: "required", param: "", errInfo: "折扣名称不能为空" @@ -108,8 +107,7 @@ errInfo: "折扣错误" }, ], - 'reviewApplyRoomDiscountInfo.discountType': [ - { + 'reviewApplyRoomDiscountInfo.discountType': [{ limit: "required", param: "", errInfo: "折扣类型不能为空" @@ -120,8 +118,7 @@ errInfo: "折扣错误" }, ], - 'reviewApplyRoomDiscountInfo.returnWay': [ - { + 'reviewApplyRoomDiscountInfo.returnWay': [{ limit: "required", param: "", errInfo: "返还方式不能为空" @@ -132,8 +129,7 @@ errInfo: "折扣错误" }, ], - 'reviewApplyRoomDiscountInfo.startTime': [ - { + 'reviewApplyRoomDiscountInfo.startTime': [{ limit: "required", param: "", errInfo: "开始时间不能为空" @@ -144,8 +140,7 @@ errInfo: "开始时间错误" }, ], - 'reviewApplyRoomDiscountInfo.endTime': [ - { + 'reviewApplyRoomDiscountInfo.endTime': [{ limit: "required", param: "", errInfo: "结束时间不能为空" @@ -156,8 +151,7 @@ errInfo: "结束时间错误" }, ], - 'reviewApplyRoomDiscountInfo.reviewRemark': [ - { + 'reviewApplyRoomDiscountInfo.reviewRemark': [{ limit: "required", param: "", errInfo: "审批说明不能为空" @@ -168,26 +162,23 @@ errInfo: "申请申请说明" }, ], - 'reviewApplyRoomDiscountInfo.ardId': [ - { - limit: "required", - param: "", - errInfo: "申请ID不能为空" - }], - 'reviewApplyRoomDiscountInfo.state': [ - { - limit: "required", - param: "", - errInfo: "审批状态不能为空" - }] + 'reviewApplyRoomDiscountInfo.ardId': [{ + limit: "required", + param: "", + errInfo: "申请ID不能为空" + }], + 'reviewApplyRoomDiscountInfo.state': [{ + limit: "required", + param: "", + errInfo: "审批状态不能为空" + }] }); }, - reviewApplyRoomDiscountStateValidate: function () { + reviewApplyRoomDiscountStateValidate: function() { return vc.validate.validate({ reviewApplyRoomDiscountInfo: vc.component.reviewApplyRoomDiscountInfo }, { - 'reviewApplyRoomDiscountInfo.reviewRemark': [ - { + 'reviewApplyRoomDiscountInfo.reviewRemark': [{ limit: "required", param: "", errInfo: "审批说明不能为空" @@ -200,7 +191,7 @@ ] }); }, - reviewApplyRoomDiscount: function () { + reviewApplyRoomDiscount: function() { console.log(vc.component.reviewApplyRoomDiscountInfo.selectedFees); if (!vc.component.reviewApplyRoomDiscountValidate() && vc.component.reviewApplyRoomDiscountInfo.state != '5') { vc.toast(vc.validate.errInfo); @@ -209,17 +200,16 @@ vc.toast(vc.validate.errInfo); return; } - if(vc.component.reviewApplyRoomDiscountInfo.returnWay == '1002' && vc.component.reviewApplyRoomDiscountInfo.selectedFees.length <= 0){ + if (vc.component.reviewApplyRoomDiscountInfo.returnWay == '1002' && vc.component.reviewApplyRoomDiscountInfo.selectedFees.length <= 0) { vc.toast('请选择缴费记录'); return; } vc.http.apiPost( '/applyRoomDiscount/updateReviewApplyRoomDiscount', - JSON.stringify(vc.component.reviewApplyRoomDiscountInfo), - { + JSON.stringify(vc.component.reviewApplyRoomDiscountInfo), { emulateJSON: true }, - function (json, res) { + function(json, res) { //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); let _json = JSON.parse(json); if (_json.code == 0) { @@ -230,12 +220,12 @@ } vc.toast(_json.msg); }, - function (errInfo, error) { + function(errInfo, error) { console.log('请求失败处理'); vc.toast(errInfo); }); }, - refreshReviewApplyRoomDiscountInfo: function () { + refreshReviewApplyRoomDiscountInfo: function() { let _discounts = $that.reviewApplyRoomDiscountInfo.discounts; vc.component.reviewApplyRoomDiscountInfo = { ardId: '', @@ -258,7 +248,7 @@ feeId: '', } }, - _changeApplyRoomDiscountType: function () { + _changeApplyRoomDiscountType: function() { if ($that.reviewApplyRoomDiscountInfo.discountType == '') { return; } @@ -274,10 +264,11 @@ //发送get请求 vc.http.apiGet('/feeDiscount/queryFeeDiscount', param, - function (json, res) { + function(json, res) { let _feeDiscountManageInfo = JSON.parse(json); $that.reviewApplyRoomDiscountInfo.discounts = _feeDiscountManageInfo.data; - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); @@ -332,30 +323,32 @@ // ); // }, // 查询缴费历史v2 - _listFees: function () { + _listFees: function() { console.log(vc.component.reviewApplyRoomDiscountInfo); var param = { - params: { - page: 1, - row: 50, - communityId: vc.getCurrentCommunity().communityId, - feeId: vc.component.reviewApplyRoomDiscountInfo.feeId, - // startTime: vc.component.reviewApplyRoomDiscountInfo.startTime, - // endTime: vc.component.reviewApplyRoomDiscountInfo.endTime + params: { + page: 1, + row: 50, + communityId: vc.getCurrentCommunity().communityId, + feeId: vc.component.reviewApplyRoomDiscountInfo.feeId, + state: '1400' + // startTime: vc.component.reviewApplyRoomDiscountInfo.startTime, + // endTime: vc.component.reviewApplyRoomDiscountInfo.endTime + } } - } - //发送get请求 + //发送get请求 vc.http.get('propertyFee', 'listFeeDetail', param, - function (json, res) { + function(json, res) { var listFeeDetailData = JSON.parse(json); vc.component.reviewApplyRoomDiscountInfo.fees = listFeeDetailData.feeDetails; - }, function (errInfo, error) { + }, + function(errInfo, error) { console.log('请求失败处理'); } ); }, } }); -})(window.vc, window.vc.component); +})(window.vc, window.vc.component); \ No newline at end of file