zhangjiaqing
8 天以前 1cef3adee31c6934c0da4b4f0b8a6f5ac03b364f
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            payFeeOrderInfo: {
                feeId: '',
                isContractFee: '',
                feeName: '',
                feeTypeCdName: '',
                feeTypeCd: '',
                primeRates: '',
                primeRate: '',
                endTime: '',
                payStartDate: '',
                payEndDate: '',
                maxEndTime: '',
                startTime: '',
                monthCount: 0,
                feeFlag: '',
                feePrice: 0.00,
                tempCycles: '',
                cycles: '',
                paymentCycles: [],
                totalFeePrice: 0.00,
                receivedAmount: '',
                receivedAmountNumber: '',
                communityId: vc.getCurrentCommunity().communityId,
                payerObjName: '',
                payerObjId: '',
                payerObjType: '',
                invoiceNo: '',
                receiptNo: '',
                remark: '',
                transferorName: '',
                builtUpArea: 0.0,
                squarePrice: 0.0,
                additionalAmount: 0.0,
                receiptId: '',
                showEndTime: '',
                accountList: [],
                integralAmount: '',
                cashAmount: '',
                couponAmount: '',
                selectDiscount: [],
                totalDiscountMoney: 0.0,
                scale: 1, // 编码映射-应收款取值标识
                decimalPlace: 2,
                receivedAmountSwitch: '',
                createTime: vc.dateTimeFormat(new Date().getTime()),
                accountAmount: 0.0, // 账户金额
                viewAccountAmount: 0.0, // 账户金额
                deductionAmount: 0.0, //抵扣金额
                redepositAmount: 0.0, //转存金额
                selectUserAccount: [], // 选中的账户
                authCode: '',
                orderId: '',
                offlinePayFeeSwitch: '1',
                flag: '',
                custEndTime: '',
                configId: '',
                roomName: '',
                sign: 1,
                integralQuantity: 0,
                customStartTime: '',
                customEndTime: ''
            }
        },
        watch: {
            'payFeeOrderInfo.receivedAmount': {
                deep: true,
                handler: function () {
                    //计算折扣金额和转存金额
                    $that._doComputeAccountRedepositDeduction();
                }
            }
        },
        _initMethod: function () {
            $that.payFeeOrderInfo.feeId = vc.getParam('feeId');
            $that.payFeeOrderInfo.isContractFee = vc.getParam('isContractFee');
            $that.payFeeOrderInfo.monthCount = vc.getParam('monthCount'); // 提取 monthCount
            $that._initCustEndDate();
            $that.listAndComputeFeeInfo();
        },
        _initEvent: function () {
            // 子组件折扣change事件
            vc.on('payFeeOrder', 'changeDiscountPrice', function (_param) {
                // 用未格式化的总金额减优惠金额
                let _totalFeePrice = $that.payFeeOrderInfo.totalFeePrice;
                if (_totalFeePrice < 0) {
                    return;
                }
                let _totalDiscountMoney = _param.totalDiscountMoney;
                //如果应收小区 优惠金额 则不优惠
                if (_totalFeePrice < _totalDiscountMoney) {
                    vc.toast("实收款不能为负数!")
                }
                $that.payFeeOrderInfo.selectDiscount = _param.selectDiscount;
                $that.payFeeOrderInfo.totalDiscountMoney = _totalDiscountMoney;
                // 该处js做减法后,会出现小数点后取不尽的bug,再次处理
                let receivedAmount = _totalFeePrice - _totalDiscountMoney;
                $that.payFeeOrderInfo.receivedAmount = $that._getFixedNum(receivedAmount);
            });
            // 用户账户组件事件
            vc.on('payFeeOrder', 'changeUserAmountPrice', function (_param) {
                $that.payFeeOrderInfo.selectUserAccount = _param.selectAccount;
                $that.payFeeOrderInfo.accountAmount = _param.totalUserAmount;
                $that.payFeeOrderInfo.accountList = _param.accountList;
                $that.payFeeOrderInfo.integralAmount = _param.integralAmount;
                $that.payFeeOrderInfo.cashAmount = _param.cashAmount;
                $that.payFeeOrderInfo.couponAmount = _param.couponAmount;
                $that._doComputeAccountRedepositDeduction();
            });
            // 账户预缴弹窗
            vc.on('payFeeOrder', 'openAddModalWithParams', function (_param) {
                _param.redepositAmount = $that.payFeeOrderInfo.redepositAmount;
                _param.receivedAmount = $that.payFeeOrderInfo.receivedAmount;
                vc.emit('prestoreAccount2', 'openAddModalWithParams', _param)
            });
 
            vc.on('payFeeOrder', 'initData', function (_param) {
                console.log('=======_param==========', _param);
                // 重新赋值下拉列表
                $that.payFeeOrderInfo.paymentCycles = [];
                for (let _index = 1; _index < 7; _index++) {
                    $that.payFeeOrderInfo.paymentCycles.push(_index * _param.paymentCycle);
                }
            })
        },
        methods: {
            popOverShowMsg1: function () {
                $('.popover-show1').popover('show');
            },
            popOverHideMsg1: function () {
                $('.popover-show1').popover('hide');
            },
            _initCustEndDate: function () {
                vc.initDate('cust-endTime', function (_value) {
                    $that.payFeeOrderInfo.custEndTime = _value;
                    let start = Date.parse(new Date($that.payFeeOrderInfo.endTime))
                    let end = Date.parse(new Date($that.payFeeOrderInfo.custEndTime))
                    let deadline = Date.parse(new Date($that.payFeeOrderInfo.maxEndTime)); // 获取费用截止时间
                    if (start - end >= 0) {
                        vc.toast("结束时间必须大于起始时间")
                        $that.payFeeOrderInfo.custEndTime = '';
                        return;
                    }
                    if (end > deadline) { // 检查结束时间是否大于费用截止时间
                        vc.toast("结束时间不能大于费用截止时间");
                        $that.payFeeOrderInfo.custEndTime = ''; // 清空选择
                        return;
                    }
            
                    $that.listAndComputeFeeInfo(103)
                });
                vc.initDate('customStartTime', function (_value) {
                    $that.payFeeOrderInfo.customStartTime = _value;
                    let start = Date.parse(new Date($that.payFeeOrderInfo.endTime))
                    let end = Date.parse(new Date($that.payFeeOrderInfo.customStartTime))
                    let deadline = Date.parse(new Date($that.payFeeOrderInfo.maxEndTime));
                    if (start - end > 0) {
                        vc.toast("缴费开始时间必须大于起始时间")
                        $that.payFeeOrderInfo.customStartTime = '';
                        return;
                    }
                    if ($that.payFeeOrderInfo.customEndTime && end > deadline) { // 结合结束时间检查
                        vc.toast("缴费开始时间不能晚于费用截止时间");
                        $that.payFeeOrderInfo.customStartTime = ''; // 清空选择
                        return;
                    }
                    if ($that.payFeeOrderInfo.customEndTime) {
                        $that.listAndComputeFeeInfo(105)
                    }
                });
                vc.initDate('customEndTime', function (_value) {
                    $that.payFeeOrderInfo.customEndTime = _value;
                    let start = Date.parse(new Date($that.payFeeOrderInfo.customStartTime))
                    let end = Date.parse(new Date($that.payFeeOrderInfo.customEndTime))
                    let deadline = Date.parse(new Date($that.payFeeOrderInfo.maxEndTime));
                    if (start - end >= 0) {
                        vc.toast("缴费开始时间必须大于缴费结束时间")
                        $that.payFeeOrderInfo.customEndTime = '';
                        return;
                    }
                    if (end > deadline) { // 检查自定义结束时间是否大于费用截止时间
                        vc.toast("结束时间不能大于费用截止时间");
                        $that.payFeeOrderInfo.customEndTime = ''; // 清空选择
                        return;
                    }
                    if ($that.payFeeOrderInfo.customStartTime) {
                        $that.listAndComputeFeeInfo(105)
                    }
                })
                // 查询用户账户
                vc.initDateTime('payFeeOrderCreateTime', function (_value) {
                    $that.payFeeOrderInfo.createTime = _value;
                });
                //与字典表支付方式关联
                vc.getDict('pay_fee_detail', "prime_rate", function (_data) {
                    $that.payFeeOrderInfo.primeRates = _data;
                });
                vc.emit('payFeeUserAccount', 'computeFeeUserAmount', {
                    feeId: $that.payFeeOrderInfo.feeId,
                    isContractFee: $that.payFeeOrderInfo.isContractFee,
                });
            },
            _useUserAccountChange: function (e) {
                if (e.target.checked) {
                    // 查询用户账户
                    vc.emit('payFeeUserAccount', 'computeFeeUserAmount', {
                        feeId: $that.payFeeOrderInfo.feeId,
                    });
                } else {
                    // 隐藏用户账户
                    vc.emit('payFeeUserAccount', 'clear', {});
                }
            },
            payFeeValidate: function () {
                return vc.validate.validate({
                    payFeeOrderInfo: $that.payFeeOrderInfo
                }, {
                    'payFeeOrderInfo.feeId': [{
                        limit: "required",
                        param: "",
                        errInfo: "费用ID不能为空"
                    }],
                    'payFeeOrderInfo.cycles': [{
                        limit: "required",
                        param: "",
                        errInfo: "缴费周期不能为空"
                    }],
                    'payFeeOrderInfo.primeRate': [{
                        limit: "required",
                        param: "",
                        errInfo: "支付方式不能为空"
                    }],
                    'payFeeOrderInfo.receivedAmount': [{
                            limit: "required",
                            param: "",
                            errInfo: "实收金额不能为空"
                        },
                        {
                            limit: "money",
                            param: "",
                            errInfo: "实收金额不是有效的金额"
                        }
                    ]
                });
            },
            /**
             * 点击 “提交缴费”
             */
            _openPayFee: function (_type) {
                // 周期不为空且不是自定义周期
                if ($that.payFeeOrderInfo.tempCycles != "" && $that.payFeeOrderInfo.tempCycles != '-102') {
                    $that.payFeeOrderInfo.cycles = $that.payFeeOrderInfo.tempCycles;
                }
                // 一次性费用
                if ($that.payFeeOrderInfo.feeFlag == '2006012') {
                    $that.payFeeOrderInfo.cycles = '1';
                    $that.payFeeOrderInfo.tempCycles = '1';
                }
                // 新增缴费周期必选项
                if ($that.payFeeOrderInfo.tempCycles == "") {
                    vc.toast("请选择缴费周期");
                    return;
                }
                if ($that.payFeeOrderInfo.primeRate == '7' && $that.payFeeOrderInfo.transferorName == "") {
                    vc.toast("请输入转账人");
                    return;
                }
                if (!$that.payFeeValidate()) {
                    vc.toast(vc.validate.errInfo);
                    return;
                }
                // 缴费周期为正整数时,显示缴费结束时间
                if (!(/(^[1-9]\d*$)/.test($that.payFeeOrderInfo.cycles))) {
                    $that.payFeeOrderInfo.showEndTime = '';
                } else {
                    $that.payFeeOrderInfo.showEndTime = vc.addMonth(new Date($that.payFeeOrderInfo.endTime), parseInt($that.payFeeOrderInfo.cycles));
                }
                if ($that.payFeeOrderInfo.selectUserAccount.length > 0 &&
                    $that.payFeeOrderInfo.accountAmount >= $that.payFeeOrderInfo.receivedAmount) {
                    $that.payFeeOrderInfo.flag = "";
                }
                if ($that.payFeeOrderInfo.selectUserAccount.length == 1) { //现金账户
                    $that.payFeeOrderInfo.integralAmount = "";
                } else {
                    $that.payFeeOrderInfo.integralAmount = "";
                    $that.payFeeOrderInfo.cashAmount = "";
                }
                $that.payFeeOrderInfo.selectUserAccount.forEach(item => {
                    let number = 0.0;
                    let number2 = 0.0;
                    //现金账户
                    if ($that.payFeeOrderInfo.receivedAmount && $that.payFeeOrderInfo.flag != 'true' && parseFloat(item.amount) > parseFloat($that.payFeeOrderInfo.receivedAmount)) {
                        $that.payFeeOrderInfo.cashAmount = $that.payFeeOrderInfo.receivedAmount;
                    } else if ($that.payFeeOrderInfo.receivedAmountNumber != null && $that.payFeeOrderInfo.receivedAmountNumber != '' && parseFloat(item.amount) > parseFloat($that.payFeeOrderInfo.receivedAmountNumber)) {
                        $that.payFeeOrderInfo.cashAmount = $that.payFeeOrderInfo.receivedAmountNumber;
                    } else {
                        $that.payFeeOrderInfo.cashAmount = item.amount;
                    }
                });
                $that.payFeeOrderInfo.payType = _type;
                console.log("payFeeOrderInfo", $that.payFeeOrderInfo);
 
 
                vc.emit('payFeeOrderConfirm', 'openConfirm', $that.payFeeOrderInfo);
            },
            /**
             * 下拉 change 事件
             * @param {*} _cycles
             */
            _changeMonth: function (_cycles) {
                $that.payFeeOrderInfo.custEndTime = '';
                if ('-102' == _cycles) {
                    $that.payFeeOrderInfo.totalFeePrice = 0.00;
                    $that.payFeeOrderInfo.receivedAmount = 0.00;
                    if ($that.payFeeOrderInfo.cycles) {
                        $that.listAndComputeFeeInfo($that.payFeeOrderInfo.cycles);
                    }
                    return;
                } else if ('-101' == _cycles) {
                    $that.payFeeOrderInfo.cycles = "101";
                    return;
                } else if ('-103' == _cycles) {
                    $that.payFeeOrderInfo.cycles = "103";
                    return;
                } else if ('-105' == _cycles) {
                    $that.payFeeOrderInfo.cycles = "105";
                    return;
                }
                let _newCycles = _cycles;
                if (_cycles == '') {
                    _newCycles = $that.payFeeOrderInfo.paymentCycles[0];
                }
                $that.listAndComputeFeeInfo(_newCycles);
            },
            /**
             * 输入 自定义 缴费周期
             * @param {*} _cycles
             */
            changeCycle: function (_cycles) {
                if (_cycles == '') {
                    return;
                }
                if (this.payFeeOrderInfo.tempCycles === '-102' && parseInt(_cycles) > parseInt(this.payFeeOrderInfo.monthCount)) {
                    vc.toast(`自定义周期不能大于 ${this.payFeeOrderInfo.monthCount} 个月`);
                    this.payFeeOrderInfo.cycles = ''; // 重置输入
                    return;
                }
                $that.listAndComputeFeeInfo(_cycles);
            },
            /**
             * 格式化数字
             */
            _getFixedNum: function (num) {
                if ($that.payFeeOrderInfo.toFixedSign == 2) {
                    return $that._mathToFixed1(num);
                } else if ($that.payFeeOrderInfo.toFixedSign == 3) {
                    return $that._mathCeil(num);
                } else if ($that.payFeeOrderInfo.toFixedSign == 4) {
                    return $that._mathFloor(num);
                } else if ($that.payFeeOrderInfo.toFixedSign == 5) {
                    return $that._mathRound(num);
                } else {
                    return $that._mathToFixed2(num);
                }
            },
            /**
             * 向上取整
             */
            _mathCeil: function (_price) {
                return Math.ceil(_price);
            },
            /**
             * 向下取整
             */
            _mathFloor: function (_price) {
                return Math.floor(_price);
            },
            /**
             * 四首五入取整
             */
            _mathRound: function (_price) {
                return Math.round(_price);
            },
            /**
             * 保留小数点后一位
             */
            _mathToFixed1: function (_price) {
                return parseFloat(_price).toFixed(1);
            },
            /**
             * 保留小数点后两位
             */
            _mathToFixed2: function (_price) {
                return parseFloat(_price).toFixed(2);
            },
            listAndComputeFeeInfo: function (_cycles) {
                if (!vc.notNull($that.payFeeOrderInfo.feeId)) {
                    return;
                }
                if (!_cycles) {
                    _cycles = 1;
                }
 
                let param = {
                    params: {
                        communityId: vc.getCurrentCommunity().communityId,
                        feeId: $that.payFeeOrderInfo.feeId,
                        isContractFee: $that.payFeeOrderInfo.isContractFee,
                        page: 1,
                        row: 1,
                        cycle: _cycles
                    }
                };
                // if (_cycles && _cycles == 103) {
                //     let _custEndTime = vc.dateAdd($that.payFeeOrderInfo.custEndTime);
                //     //前端选择会默认 少一天 所以 加上一天
                //     param.params.custEndTime = _custEndTime;
                // }
                // if (_cycles && _cycles == 105) {
                //     let _customEndTime = vc.dateAdd($that.payFeeOrderInfo.customEndTime);
                //     //前端选择会默认 少一天 所以 加上一天
                //     param.params.customEndTime = _customEndTime;
                //     param.params.customStartTime = $that.payFeeOrderInfo.customStartTime
                // }
 
                if (_cycles && _cycles == 103) {
                    // let _custEndTime = vc.dateAdd($that.payFeeOrderInfo.custEndTime);
                    //前端选择会默认 少一天 所以 加上一天
                    param.params.custEndTime = $that.payFeeOrderInfo.custEndTime;
                }
                if (_cycles && _cycles == 105) {
                    // let _customEndTime = vc.dateAdd($that.payFeeOrderInfo.customEndTime);
                    //前端选择会默认 少一天 所以 加上一天
                    param.params.customEndTime = $that.payFeeOrderInfo.customEndTime;
                    param.params.customStartTime = $that.payFeeOrderInfo.customStartTime
                }
                //发送get请求
                vc.http.apiGet('/feeApi/listFeeObj',
                    param,
                    function (json, res) {
                        let listRoomData = JSON.parse(json);
                        // 检查是否有 data
                        if (!listRoomData || !listRoomData.data) {
                            console.error('无效的返回数据:', listRoomData);
                            vc.toast('返回的数据无效,请稍后重试。');
                            return;
                        }
 
                        if (listRoomData.data.hasOwnProperty('custEndTime')) {
                            delete listRoomData.data.custEndTime
                        }
                        if (listRoomData.data.hasOwnProperty('customEndTime')) {
                            delete listRoomData.data.customEndTime
                        }
                        vc.copyObject(listRoomData.data, $that.payFeeOrderInfo);
                        // 由于返回的键与档期那页面自定义的键不一致,单独赋值toFiexedSign
                        vc.emit('payFeeOrder', 'initData', listRoomData.data);
                        $that.payFeeOrderInfo.totalFeePrice = listRoomData.data.feeTotalPrice;
                        $that.payFeeOrderInfo.receivedAmount = listRoomData.data.feeTotalPrice;
                        let _deadlineTime = new Date(listRoomData.data.deadlineTime);
                        let _maxEndTime = new Date(listRoomData.data.maxEndTime);
                        if (_deadlineTime.getTime() > _maxEndTime.getTime()) {
                            vc.toast('超过最大计费结束时间,' + vc.dateSub(listRoomData.data.maxEndTime, listRoomData.data.feeFlag) + ",请用更小缴费周期或者自定义结束时间缴费");
                            return;
                        }
                        vc.emit('payFeeDiscount', 'computeFeeDiscount', {
                            feeId: $that.payFeeOrderInfo.feeId,
                            cycles: _cycles,
                            payerObjId: $that.payFeeOrderInfo.payerObjId,
                            payerObjType: $that.payFeeOrderInfo.payerObjType,
                            endTime: $that.payFeeOrderInfo.endTime,
                            custEndTime: $that.payFeeOrderInfo.custEndTime,
                            customStartTime: $that.payFeeOrderInfo.customStartTime,
                            customEndTime: $that.payFeeOrderInfo.customEndTime,
 
                        });
                        vc.emit('payFeeCoupon', 'computeFeeCoupon', {
                            feeId: $that.payFeeOrderInfo.feeId,
                            cycles: _cycles,
                            payerObjId: $that.payFeeOrderInfo.payerObjId,
                            payerObjType: $that.payFeeOrderInfo.payerObjType,
                            endTime: $that.payFeeOrderInfo.endTime
                        });
                        vc.emit('payFeeDeposit', 'computeFeeDeposit', {
                            payerObjId: $that.payFeeOrderInfo.payerObjId,
                            payerObjType: $that.payFeeOrderInfo.payerObjType,
                        });
                        $that._listFeeIntegral(_cycles);
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            /**
             *
             * accountAmount: 0.0, // 账户金额
             deductionAmount: 0.0, //抵扣金额
             redepositAmount: 0.0, //转存金额
             * 使用用户钱包余额
             */
            computeAccountRedepositDeduction: function () {
                //计算折扣金额和转存金额
                $that._doComputeAccountRedepositDeduction();
            },
            /**
             * 如果选择使用用户余额,则更新应缴金额
             *
             *  accountAmount: 0.0, // 账户金额
             viewAccountAmount: 0.0, // 账户金额
             deductionAmount: 0.0, //抵扣金额
             needDeductionAmount: false,
             redepositAmount: 0.0, //转存金额
             */
            _doComputeAccountRedepositDeduction: function () {
                let receivedAmount = $that.payFeeOrderInfo.receivedAmount; //实缴
                //计算
                let accountAmount = $that.payFeeOrderInfo.accountAmount;
                let deductionAmount = 0.0; // 抵消金额
                $that.payFeeOrderInfo.deductionAmount = deductionAmount;
                let redepositAmount = 0.0; //转存金额
                $that.payFeeOrderInfo.redepositAmount = redepositAmount;
                let totalDiscountMoney = $that.payFeeOrderInfo.totalDiscountMoney; // 优惠金额
                let totalFeePrice = $that.payFeeOrderInfo.totalFeePrice; //应缴
                //将显示账户金额实际刷成 账户金额
                $that.payFeeOrderInfo.viewAccountAmount = accountAmount;
                //计算转存 ,转存 = 实缴 + 折扣优惠 - 应缴  
                redepositAmount = parseFloat(receivedAmount) + parseFloat(totalDiscountMoney) - parseFloat(totalFeePrice);
                //转存
                if (parseFloat(redepositAmount) > 0) {
                    $that.payFeeOrderInfo.redepositAmount = redepositAmount.toFixed(2); // 计算转存
                    $that.payFeeOrderInfo.viewAccountAmount = parseFloat($that.payFeeOrderInfo.viewAccountAmount) + parseFloat($that.payFeeOrderInfo.redepositAmount);
                    return;
                }
                // 计算抵消金额 应缴 - 折扣  - 实缴 = 抵消金额  
                deductionAmount = parseFloat(totalFeePrice) - parseFloat(totalDiscountMoney) - parseFloat(receivedAmount);
                if (parseFloat(deductionAmount) > 0 && parseFloat(accountAmount) >= parseFloat(deductionAmount)) {
                    $that.payFeeOrderInfo.deductionAmount = deductionAmount.toFixed(2);
                    let viewAccountAmount = $that.payFeeOrderInfo.viewAccountAmount;
                    $that.payFeeOrderInfo.viewAccountAmount = parseFloat($that.payFeeOrderInfo.viewAccountAmount) - parseFloat($that.payFeeOrderInfo.deductionAmount);
                    if (parseFloat($that.payFeeOrderInfo.viewAccountAmount) < 0) { //账户小于0
                        $that.payFeeOrderInfo.viewAccountAmount = 0;
                        $that.payFeeOrderInfo.deductionAmount = viewAccountAmount;
                    }
                }
            },
            _viewFeeConfig: function () {
                vc.emit('viewFeeConfigData', 'showData', {
                    configId: $that.payFeeOrderInfo.configId
                })
            },
            _viewFee: function () {
                vc.emit('viewFeeData', 'showData', {
                    feeId: $that.payFeeOrderInfo.feeId
                })
            },
            _viewRoomData: function () {
                vc.emit('viewRoomData', 'showData', {
                    roomId: $that.payFeeOrderInfo.payerObjId
                })
            },
            _listFeeIntegral: function (_cycles) {
                let param = {
                    params: {
                        page: DEFAULT_PAGE,
                        row: DEFAULT_ROWS,
                        feeId: $that.payFeeOrderInfo.feeId,
                        communityId: $that.payFeeOrderInfo.communityId,
                        cycles: _cycles,
                        endTime: $that.payFeeOrderInfo.endTime,
                        amount: $that.payFeeOrderInfo.receivedAmount,
                        area: $that.payFeeOrderInfo.builtUpArea
                    }
                };
                //发送get请求
                vc.http.apiGet('/integral.computePayFeeIntegral',
                    param,
                    function (json, res) {
                        let _payFeeCouponInfo = JSON.parse(json);
                        $that.payFeeOrderInfo.integralQuantity = _payFeeCouponInfo.data;
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            }
        }
    });
})(window.vc);