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
(function (vc) {
    vc.extends({
        data: {
            printPurchaseOutApplyInfo: {},
            printFlag: '0'
        },
        _initMethod: function () {
            vc.component._initprintPurchaseOutApplyDateInfo();
        },
        _initEvent: function () {
            vc.on('printPurchaseOutApply', 'openprintPurchaseOutApplyModal', function (_purchaseApplyDetailInfo) {
                $that.printPurchaseOutApplyInfo = _purchaseApplyDetailInfo;
                $('#printPurchaseOutApplyModel').modal('show');
            });
        },
        methods: {
            _initprintPurchaseOutApplyDateInfo: function () {
                let _applyOrderId = vc.getParam('applyOrderId');
                let _resOrderType = vc.getParam("resOrderType")
                var param = {
                    params: {
                        page: 1,
                        row: 1,
                        applyOrderId: _applyOrderId,
                        resOrderType: _resOrderType
                    }
                };
                //发送get请求
                vc.http.apiGet('/purchaseApply.listPurchaseApplys',
                    param,
                    function (json, res) {
                        var _purchaseApplyDetailInfo = JSON.parse(json);
                        var _purchaseApply = _purchaseApplyDetailInfo.purchaseApplys;
                        vc.component.printPurchaseOutApplyInfo = _purchaseApply[0];
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _printPurchaseOutApplyDiv: function () {
                $that.printFlag = '1';
                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);