mrzcc
2020-02-10 4f9c122f237fbee16d5ef9c602b6db95d28ed7b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
(function(vc){
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data:{
            payFeeOrderInfo:{
                feeId:'',
                feeName:'',
                feeTypeCdName: '',
                endTime: '',
                feePrice:0.00,
                cycles:'1',
                totalFeePrice:0.00,
                receivedAmount:'',
                communityId:vc.getCurrentCommunity().communityId
            }
        },
        _initMethod:function(){
            if(vc.notNull(vc.getParam("feeId"))){
                  vc.component.payFeeOrderInfo.feeId = vc.getParam('feeId');
                  vc.component.payFeeOrderInfo.feeName = vc.getParam('feeName');
                  vc.component.payFeeOrderInfo.feeTypeCdName = vc.getParam('feeTypeCdName');
                  vc.component.payFeeOrderInfo.endTime = vc.getParam('endTime').replace(/%3A/g,':');
                  vc.component.payFeeOrderInfo.feePrice = vc.getParam('feePrice');
            };
 
            vc.component.payFeeOrderInfo.totalFeePrice = vc.component.payFeeOrderInfo.feePrice;
            vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice ;
 
 
        },
        _initEvent:function(){
 
        },
        methods:{
                payFeeValidate:function(){
                        return vc.validate.validate({
                            payFeeOrderInfo:vc.component.payFeeOrderInfo
                        },{
                            'payFeeOrderInfo.feeId':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"费用ID不能为空"
                                }
                            ],
                            'payFeeOrderInfo.cycles':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"缴费周期不能为空"
                                }
                            ],
                            'payFeeOrderInfo.receivedAmount':[
                                {
                                    limit:"required",
                                    param:"",
                                    errInfo:"实收金额不能为空"
                                },
                                {
                                    limit:"money",
                                    param:"",
                                    errInfo:"实收金额不是有效的金额"
                                }
                            ]
                        });
             },
            _payFee:function(_page,_row){
                if(!vc.component.payFeeValidate()){
                    vc.toast(vc.validate.errInfo);
                    return ;
                }
 
                vc.http.post(
                    'propertyPay',
                    'payFee',
                    JSON.stringify(vc.component.payFeeOrderInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                             $("#payFeeResult").modal({
                                           backdrop: "static",//点击空白处不关闭对话框
                                           show:true
                                        });
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(errInfo);
                     });
            },
            _changeMonth:function(_cycles){
                if('-101' == _cycles){
                    vc.component.payFeeOrderInfo.totalFeePrice = 0.00;
                    vc.component.payFeeOrderInfo.receivedAmount = '';
                    return ;
                }
                vc.component.payFeeOrderInfo.totalFeePrice = Math.floor(parseFloat(_cycles)*parseFloat(vc.component.payFeeOrderInfo.feePrice)*100)/100;
                vc.component.payFeeOrderInfo.receivedAmount = vc.component.payFeeOrderInfo.totalFeePrice ;
            },
            _back:function(){
                $('#payFeeResult').modal("hide");
                vc.getBack();
            },
            _printAndBack:function(){
                $('#payFeeResult').modal("hide");
 
                vc.getBack();
            }
        }
 
    });
})(window.vc);