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
(function(vc) {
 
    vc.extends({
        data: {
            printAccountReceiptInfo: {
                communityName: '',
                arIds: '',
                amount: 0.00,
                feeReceipts: [],
                content: '',
                qrImg: '',
                feeReceipt: [],
                apply: 'N',
                receiptNum:'',
                feeTime:''
            },
            printFlag: '0'
        },
        _initMethod: function() {
            $that.printAccountReceiptInfo.arIds = vc.getParam('arIds');
            $that.printAccountReceiptInfo.communityName = vc.getCurrentCommunity().name;
 
            $that._loadReceipt();
 
            $that._loadPrintSpec();
        },
        _initEvent: function() {
 
 
        },
        methods: {
            _initPayFee: function() {
 
            },
            _loadReceipt: function() {
 
                let param = {
                    params: {
                        page: 1,
                        row: 30,
                        arIds: $that.printAccountReceiptInfo.arIds,
                        communityId: vc.getCurrentCommunity().communityId
                    }
                };
 
                //发送get请求
                vc.http.apiGet('/receipt.listAccountReceipt',
                    param,
                    function(json, res) {
                        var _feeReceiptManageInfo = JSON.parse(json);
                        let _feeReceipt = _feeReceiptManageInfo.data;
                        let _amount = 0;
                        _feeReceipt.forEach(item => {
                            _amount += parseFloat(item.receivedAmount)
                        });
                        $that.printAccountReceiptInfo.amount = _amount.toFixed(2);
                        $that.printAccountReceiptInfo.feeReceipts = _feeReceipt;
                        if(_feeReceipt && _feeReceipt.length > 0){
                            $that.printAccountReceiptInfo.receiptNum= _feeReceipt[0].arId;
                            $that.printAccountReceiptInfo.feeTime= _feeReceipt[0].createTime;
                        }
                       
                    },
                    function(errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            
            _loadPrintSpec: function() {
                var param = {
                    params: {
                        page: 1,
                        row: 1,
                        specCd: 2020,
                        communityId: vc.getCurrentCommunity().communityId
                    }
                };
 
                //发送get请求
                vc.http.apiGet('/feePrintSpec/queryFeePrintSpec',
                    param,
                    function(json, res) {
                        var _json = JSON.parse(json);
                        var _data = _json.data;
                        if (_data.length > 0) {
                            $that.printAccountReceiptInfo.content = _data[0].content;
                            $that.printAccountReceiptInfo.qrImg = _data[0].qrImg;
                            if (_data[0].printName) {
                                $that.printAccountReceiptInfo.communityName = _data[0].printName;
                            }
                        }
                    },
                    function(errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
 
            },
 
            _printPurchaseApplyDiv: function() {
 
                $that.printFlag = '1';
                console.log('console.log($that.printFlag);', $that.printFlag);
                document.getElementById("print-btn").style.display = "none"; //隐藏
 
                window.print();
                //$that.printFlag = false;
                window.opener = null;
                window.close();
            },
            _closePage: function() {
                window.opener = null;
                window.close();
            }
        }
    });
 
})(window.vc);