ins_insurance_create.lview 4.12 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author:   
    $Date: 2014-8-4 下午01:58:31  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="hls_bp_master_create_link_id" model="ins.INS100.hls_bp_master_create" modelaction="batch_update"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="pageLink_bpQueryScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="pageLink_insurance_relation_matain" url="${/request/@context_path}/modules/ins/INS101/ins_insurance_relation_n.lview"/>
        <script type="text/javascript"><![CDATA[
            function lock_current_window() {
                Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            }
            
            function unlock_current_window() {
                Leaf.Masker.unmask(Ext.getBody());
            }
            
            function ins100_open_bp_modify_win(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'INS101N';
                param['function_usage'] = 'MODIFY';
                param['url_title'] = '保险公司关系维护';
                param['bp_id'] = param['bp_id'];
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'pageLink_insurance_relation_matain', ds_id);
            
            
            }
            
            function save() {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
                var records = $(ds_id).getAll();
            
                var datas = [];
                for (var i = 0;i < records.length;i++) {
            
                    var data = records[i].data;
                    if (!data['bp_id']) {
                        data['_status'] = 'insert';
                    } else {
                        data['_status'] = 'update';
                    }
                    datas.push(data);
                }
                lock_current_window();
                Leaf.request({
                    url: $('hls_bp_master_create_link_id').getUrl(),
                    para: datas,
                    success: function() {
                        unlock_current_window();
                        $(ds_id).query();
                    },
                    failure: function() {
                        unlock_current_window();
                    },
                    error: function() {
                        unlock_current_window();
                    },
                    scope: this
                });
            
            }
            
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'insurance_relationship' && record.data['enabled_flag'] == 'Y') {
                    return '<a href="javascript:ins100_open_bp_modify_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + '关系维护' + '</a>';
                }
                return '';
            };
            
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                save();
            };
            
            
            
            window['${/parameter/@layout_code}_on_layout_dynamic_grid_query'] = function(ds, qpara, bp_seq) {
                var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'hls_bp_master');
                /*
                 if (ds == $(ds_id)) {
                 aut_authority_list_validate_query(ds, qpara);
                 } */
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=BP&amp;function_code=INS100"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>