zhangjiaqing
3 天以前 f5f65e6a9a49709c451dc2efd253970b5ae41f69
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
/**
 入驻小区
 **/
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    vc.extends({
        data: {
            adminFeeConfigInfo: {
                feeConfigs: [],
                total: 0,
                records: 1,
                moreCondition: false,
                feeName: '',
                paymentCds: [],
                billTypes: [],
                isDefaults: [],
                curPage: DEFAULT_PAGE,
                conditions: {
                    configId: '',
                    feeFlag: '',
                    billType: '',
                    feeName: '',
                    feeTypeCd: '',
                    isDefault: 'F',
                    paymentCd: '',
                    deductFrom: ''
                }
            }
        },
        _initMethod: function () {
            vc.emit('communityFeeTypeTree', 'initCommunityFeeTypeTree',{
                callName:'adminFeeConfig'
            });
            $that._listAdminFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS);
            //关联字典表费用类型
            
            //关联字典表付费类型
            vc.getDict('pay_fee_config', 'payment_cd', function (_data) {
                $that.adminFeeConfigInfo.paymentCds = _data;
            });
            //关联字典表费用项
            vc.getDict('pay_fee_config', 'is_default', function (_data) {
                $that.adminFeeConfigInfo.isDefaults = _data;
            })
        },
        _initEvent: function () {
            vc.on('adminFeeConfig', 'selectCommunity', function (_param) {
                $that.adminFeeConfigInfo.conditions.communityId = _param.communityId;
                $that.adminFeeConfigInfo.conditions.feeTypeCd = '';
                $that.adminFeeConfigInfo.conditions.feeFlag = '';
                $that._listAdminFeeConfigs(DEFAULT_PAGE,DEFAULT_ROWS);
            });
            vc.on('adminFeeConfig', 'selectFeeTypeCd', function (_param) {
                $that.adminFeeConfigInfo.conditions.communityId = _param.communityId;
                $that.adminFeeConfigInfo.conditions.feeTypeCd = _param.feeTypeCd;
                $that.adminFeeConfigInfo.conditions.feeFlag = '';
                $that._listAdminFeeConfigs(DEFAULT_PAGE,DEFAULT_ROWS);
 
            });
            vc.on('adminFeeConfig', 'selectFeeFlag', function (_param) {
                $that.adminFeeConfigInfo.conditions.communityId = _param.communityId;
                $that.adminFeeConfigInfo.conditions.feeTypeCd = _param.feeTypeCd;
                $that.adminFeeConfigInfo.conditions.feeFlag = _param.feeFlag;
                $that._listAdminFeeConfigs(DEFAULT_PAGE,DEFAULT_ROWS);
            });
            vc.on('adminFeeConfig', 'listFeeConfig',
                function (_param) {
                    $that._listAdminFeeConfigs($that.adminFeeConfigInfo.curPage, DEFAULT_ROWS);
                });
            vc.on('pagination', 'page_event',
                function (_currentPage) {
                    $that.adminFeeConfigInfo.curPage = _currentPage;
                    $that._listAdminFeeConfigs(_currentPage, DEFAULT_ROWS);
                });
        },
        methods: {
            //查询方法
            _listAdminFeeConfigs: function (_page, _rows) {
                $that.adminFeeConfigInfo.conditions.page = _page;
                $that.adminFeeConfigInfo.conditions.row = _rows;
                let param = {
                    params: $that.adminFeeConfigInfo.conditions
                };
                //发送get请求
                vc.http.apiGet('/feeConfig.queryAdminFeeConfigs',
                    param,
                    function (json, res) {
                        let _json = JSON.parse(json);
                        $that.adminFeeConfigInfo.total = _json.total;
                        $that.adminFeeConfigInfo.records = _json.records;
                        $that.adminFeeConfigInfo.feeConfigs = _json.feeConfigs;
                        vc.emit('pagination', 'init', {
                            total: $that.adminFeeConfigInfo.records,
                            dataCount: $that.adminFeeConfigInfo.total,
                            currentPage: _page
                        });
                    },
                    function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            //重置方法
            _resetListFeeConfigs: function () {
                $that.adminFeeConfigInfo.conditions.configId = '';
                $that.adminFeeConfigInfo.conditions.feeName = '';
                $that.adminFeeConfigInfo.conditions.feeTypeCd = '';
                $that.adminFeeConfigInfo.conditions.feeFlag = '';
                $that.adminFeeConfigInfo.conditions.paymentCd = '';
                $that.adminFeeConfigInfo.conditions.billType = '';
                $that.adminFeeConfigInfo.conditions.isDefault = '';
                $that.adminFeeConfigInfo.conditions.deductFrom = '';
                $that._listAdminFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS);
            },
           
            //查询
            _queryFeeConfigMethod: function () {
                $that._listAdminFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            //重置
            _resetFeeConfigMethod: function () {
                $that._resetListFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _moreCondition: function () {
                if ($that.adminFeeConfigInfo.moreCondition) {
                    $that.adminFeeConfigInfo.moreCondition = false;
                } else {
                    $that.adminFeeConfigInfo.moreCondition = true;
                }
            },
            _settingConfigDiscount: function (_feeConfig) {
                vc.jumpToPage('/#/pages/property/payFeeConfigDiscountManage?configId=' + _feeConfig.configId + "&feeName=" + _feeConfig.feeName);
            },
            swatchFeeTypeCd: function (item) {
                $that.adminFeeConfigInfo.conditions.feeTypeCd = item.statusCd;
                $that._listAdminFeeConfigs(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _openFeeConfigDetail: function (_feeConfig) {
                window.open('/#/pages/fee/feeConfigDetail?configId=' + _feeConfig.configId)
            }
        }
    });
})(window.vc);