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
(function (vc) {
    vc.extends({
        data: {
            equipmentAccountDetail: {
                machineId: '',
                machineName: '',
                machineCode: '',
                brand: '',
                model: '',
                locationDetail: '',
                firstEnableTime: '',
                warrantyDeadline: '',
                usefulLife: '',
                importanceLevel: '',
                state: '',
                stateName: '',
                levelName: '',
                purchasePrice: '',
                netWorth: '',
                useOrgId: "",
                useOrgName: "",
                useUserId: "",
                useUserName: "",
                useUseTel: "",
                chargeOrgId: "",
                chargeOrgName: "",
                chargeOrgTel: "",
                chargeUseId: "",
                chargeUseName: "",
                remark: '',
                elogs: []
            }
        },
        _initMethod: function () {
            let machineId = vc.getParam('machineId');
            if (!vc.notNull(machineId)) {
                vc.toast('非法操作');
                vc.jumpToPage('/#/pages/property/equipmentAccount');
                return;
            }
            $that.equipmentAccountDetail.machineId = machineId;
            $that._listEquipmentDetail()
        },
        _initEvent: function () {
        },
        methods: {
            _listEquipmentDetail: function () {
                var param = {
                    params: {
                        page: 1,
                        row: 1,
                        communityId: vc.getCurrentCommunity().communityId,
                        machineId: $that.equipmentAccountDetail.machineId
                    }
                };
                //发送get请求
                vc.http.apiGet('equipmentAccount.listEquipmentAccount',
                    param,
                    function (json, res) {
                        var _equipmentAccountManageInfo = JSON.parse(json);
                        let _repairs = _equipmentAccountManageInfo.data;
                        if (_repairs.length < 1) {
                            vc.toast("数据异常");
                            vc.jumpToPage('/#/pages/property/equipmentAccount');
                            return;
                        }
                        vc.copyObject(_repairs[0], $that.equipmentAccountDetail);
                        //查询设备操作日志
                        $that._loadEquipmentLogs();
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _loadEquipmentLogs: function () {
                var param = {
                    params: {
                        page: 1,
                        row: 100,
                        communityId: vc.getCurrentCommunity().communityId,
                        machineId: $that.equipmentAccountDetail.machineId
                    }
                };
                //发送get请求
                vc.http.apiGet('equipmentOperatingLog.listEquipmentOperatingLog',
                    param,
                    function (json, res) {
                        var _repairPoolManageInfo = JSON.parse(json);
                        let _repairs = _repairPoolManageInfo.data;
                        $that.equipmentAccountDetail.elogs = _repairs;
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _goBack: function () {
                vc.goBack()
            },
            openFile: function (_photo) {
                vc.emit('viewImage', 'showImage', {
                    url: _photo.url
                });
            },
            /**
             * 新增打印功能,跳转打印页面
             */
            _printEquipmentDetail: function () {
                window.open("/print.html#/pages/property/printEquipmentAccountLabel?machineId=" + $that.equipmentAccountDetail.machineId)
            },
        }
    });
})(window.vc);