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
/**
 权限组
 **/
(function (vc) {
 
    vc.extends({
        data: {
            parkingAreaTextInfo: {
                communityId: vc.getCurrentCommunity().communityId,
                paId: '',
                texts: []
            }
        },
 
        _initMethod: function () {
            $that.parkingAreaTextInfo.paId = vc.getParam('paId');
            $that._initTexts();
            $that._listParkAreaTexts();
        },
        _initEvent: function () {
 
        },
        methods: {
 
            /**
             * 初始化
             * 类型:1001 月租车进场,2002 月租车出场,3003 月租车到期,4004 临时车进场 5005 临时车出场 6006 临时车未缴费
             */
            _initTexts: function () {
 
                let _texts = [];
                //与租车进场
                _texts.push({
                    typeCd: '1001',
                    typeName: '月租车进场',
                });
                _texts.push({
                    typeCd: '2002',
                    typeName: '月租车出场',
                });
                _texts.push({
                    typeCd: '3003',
                    typeName: '月租车到期',
                });
                _texts.push({
                    typeCd: '4004',
                    typeName: '临时车进场',
                });
                _texts.push({
                    typeCd: '5005',
                    typeName: '临时车出场',
                });
                _texts.push({
                    typeCd: '6006',
                    typeName: '临时车未缴费',
                });
 
                _texts.forEach(item => {
                    item.voice = "";
                    item.text1 = "";
                    item.text2 = "";
                    item.text3 = "";
                    item.text4 = "";
                });
                $that.parkingAreaTextInfo.texts = _texts;
            },
            _listParkAreaTexts: function () {
                var param = {
                    params: {
                        paId: $that.parkingAreaTextInfo.paId,
                        row: 10,
                        page: 1
                    }
                };
                //发送get请求
                vc.http.apiGet('/parkingAreaText.listParkingAreaText', param,
                    function (json, res) {
                        var _parkingAreaTexts = JSON.parse(json);
                        _parkingAreaTexts = _parkingAreaTexts.data;
                        if (_parkingAreaTexts.lenth < 1) {
                            return;
                        }
                        _parkingAreaTexts.forEach(text => {
                            $that.parkingAreaTextInfo.texts.forEach(item => {
                                if (text.typeCd == item.typeCd) {
                                    vc.copyObject(text, item);
                                }
                            })
                        })
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    });
            },
            _saveParkingAreaText: function (_item) {
 
                if (!_item.voice) {
                    vc.toast('语音不能为空');
                    return;
                }
                _item.communityId = vc.getCurrentCommunity().communityId;
                _item.paId = $that.parkingAreaTextInfo.paId;
                vc.http.apiPost(
                    '/parkingAreaText.saveParkingAreaText',
                    JSON.stringify(_item),
                    {
                        emulateJSON: true
                    },
                    function (json, res) {
                        let _json = JSON.parse(json);
                        console.log(_json)
                        vc.toast(_json.msg);
 
 
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
 
                        vc.toast(errInfo);
 
                    });
 
            }
        }
    });
 
})(window.vc);