hls700_bp_master_credit.lview 8.57 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhuxianfei
    $Date: 2017年11月23日 下午1:34:27  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="hls700_credit_hd_update_link" model="hls.HLS700.hls700_bp_master_credit_limit" modelaction="batch_update"/>
        <a:link id="bp_credit_modify_link" url="${/request/@context_path}/modules/hls/HLS700/hls700_bp_master_credit_modify.lview"/>
        <a:link id="bp_credit_details_link" url="${/request/@context_path}/modules/hls/HLS700/hls700_bp_master_credit_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function hls700_credit_add() {
                $('hls700_credit_grid_ds').showEditorByRecord($('hls700_credit_result_ds').create());
            
            }
            
            
            function hls700_credit_query() {
                $('hls700_credit_result_ds').query();
            
            }
            
            function hls700_credit_reset() {
                $('hls700_credit_query_ds').reset();
            }
            
            function hls700_grid_update(bp_credit_hd_id) {
                if (!bp_credit_hd_id) {
                    Leaf.showMessage('提示', '请先保存!');
                    return;
                }
            
                var win = new Leaf.Window({
                    id: 'bp_credit_modify_window',
                    url: $('bp_credit_modify_link').getUrl(),
                    params: {
                        bp_credit_hd_id: bp_credit_hd_id,
                        winId: 'bp_credit_modify_window'
                    },
                    title: '授信额度分配页面',
                    fullScreen: true
                });
                win.on('close', function() {
                    $('hls700_credit_result_ds').query();
                });
            }
            
            function hls700_credit_detail_render(value, record, name) {
                return '<a href="javascript:hls700_grid_update(' + record.get('bp_credit_hd_id') + ')">分配</a>';
            }
            
            
            function hls700_credit_save() {
                var ds = $('hls700_credit_result_ds');
                var records = ds.getAll();
                var param;
                var param_list = [];
                for (var i = 0;i < records.length;i++) {
                    param = {
                        'bp_credit_hd_id': records[i].get('bp_credit_hd_id'),
                        'bp_id': records[i].get('bp_id'),
                        '_status': 'update'
                    };
                    param_list.push(param);
                }
            
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
                Leaf.request({
                    url: $('hls700_credit_hd_update_link').getUrl(),
                    para: param_list,
                    success: function(res) {
                        Leaf.Masker.unmask(Ext.getBody());
                        Leaf.SideBar.show({
                            msg: '保存成功',
                            duration: 2000
                        });
                        $('hls700_credit_result_ds').query();
                    },
                    failure: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function() {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
            
            
            }
            
            function hls700_credit_detail() {
                var record = $('hls700_credit_result_ds').getSelected();
                var bp_credit_hd_id = record[0].get('bp_credit_hd_id');
                var bp_id = record[0].get('bp_id');
                var bp_name = record[0].get('bp_name');
                var win = new Leaf.Window({
                    id: 'bp_credit_details_window',
                    url: $('bp_credit_details_link').getUrl(),
                    params: {
                        bp_credit_hd_id: bp_credit_hd_id,
                        bp_id:bp_id,
                        bp_name:bp_name,
                        winId: 'bp_credit_details_window'
                    },
                    title: '授信额度界面',
                    fullScreen: true
                });
                win.on('close', function() {
                    $('hls700_credit_result_ds').query();
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="hls700_bp_credit_ds" lookupCode="BP_CATEGORY"/>
            <a:dataSet id="hls700_credit_query_ds">
                <a:fields>
                    <a:field name="bp_code" lovHeight="500" lovService="hls.HLS700.hls700_bp_master_lov?bp_category=TENANT" lovWidth="700" title="商业伙伴选择">
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="bp_code" to="bp_code"/>
                            <a:map from="bp_name" to="bp_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_category_n" displayField="code_value_name" options="hls700_bp_credit_ds" returnField="invoice_kind" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls700_credit_result_ds" autoPageSize="true" autoQuery="true" model="hls.HLS700.hls700_bp_master_credit_limit" queryDataSet="hls700_credit_query_ds" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="bp_code" lovHeight="500" lovService="hls.HLS700.hls700_bp_master_lov" lovWidth="700" required="true" title="商业伙伴选择">
                        <a:mapping>
                            <a:map from="bp_id" to="bp_id"/>
                            <a:map from="bp_code" to="bp_code"/>
                            <a:map from="bp_name" to="bp_name"/>
                            <a:map from="bp_category_n" to="bp_category_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="credit_total_amount"/>
                    <a:field name="open_amount"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls700_credit_query" text="HLS.QUERY"/>
                <a:gridButton click="hls700_credit_reset" text="HLS.RESET"/>
                <a:gridButton click="hls700_credit_add" text="HLS.NEW"/>
                <a:gridButton click="hls700_credit_save" text="HLS.SAVE"/>
                <a:gridButton click="hls700_credit_detail" text="授信详情"/>
            </a:screenTopToolbar>
            <a:form column="3" labelWidth="150" title="HAP_QUERY_TITLE">
                <a:lov name="bp_code" bindTarget="hls700_credit_query_ds" prompt="商业伙伴编码"/>
                <a:textField name="bp_name" bindTarget="hls700_credit_query_ds" prompt="商业伙伴名称"/>
                <a:comboBox name="bp_category_n" bindTarget="hls700_credit_query_ds" prompt="商业伙伴类型"/>
            </a:form>
            <a:grid id="hls700_credit_grid_ds" bindTarget="hls700_credit_result_ds" marginHeight="230" marginWidth="50" navBar="true">
                <a:columns>
                    <a:column name="bp_code" editor="creditDs_grid_editor_lov" prompt="商业伙伴编码"/>
                    <a:column name="bp_name" prompt="商业伙伴名称" width="280"/>
                    <a:column name="bp_category_n" prompt="商业伙伴类型"/>
                    <a:column name="credit_total_amount" align="right" prompt="授信总额度" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="open_amount" align="right" prompt="开额额度" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="used_amount" align="right" prompt="已使用额度" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="last_amount" align="right" prompt="剩余额度" renderer="Leaf.formatMoney" width="150"/>
                    <a:column align="center" prompt="额度分配" renderer="hls700_credit_detail_render" width="105"/>
                </a:columns>
                <a:editors>
                    <a:lov id="creditDs_grid_editor_lov"/>
                    <a:currencyField id="creditDs_grid_editor_tx"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>