<?xml version="1.0" encoding="UTF-8"?>
<!--
  create by nyl  2014-12-3 
  for contract context create
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.function_code = ${/parameter/@function_code}" model="cus.CUS100.cus_default_function_name" rootPath="default_function_name"/>
    </a:init-procedure>
    <a:view>
        <a:link id="con638_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con_contract_update_link_id" url="${/request/@context_path}/modules/cont/CON301/con_contract_query_n.lview"/>
        <script type="text/javascript"><![CDATA[
        function con620n_open_contract_win(record_id, ds_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
            
                maintain_type = 'READONLY';
                param['function_code'] = 'CON301R';
                param['function_usage'] = 'MODIFY';
                param['url_title'] = '合同明细';
                url_l = 'con_contract_update_link_id';
                param['maintain_type'] = maintain_type;
            
                hls_doc_get_layout_code('con638_get_layout_code_link_id', param, 'con_contract_update_link_id', ds_id);
            }
            
          
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'contract_number') {
                    return '<a href="javascript:con620n_open_contract_win(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
                }
            
                return value;
            };
            function con610d_window_close() {
                $('${/parameter/@winid}').close();
  
            }
      
            
            function get_confirm_flag() {
                return;
            }
            
            function zjwfl_before_approve_procedure(out_type) {
                var document_id = '${/parameter/@law_id}';
                var appoint_check = '${/parameter/@appoint_check}';
                var specify_code = 'AMC_APPROVER';
                var params;
                out_type = 'no_win';
                var out_object = 'out_object';
                if (appoint_check) {
                    var document_table = 'LEG_LEGAL_LETTER_HD';
                    var title = '${/model/hls_specify_define_info/record/@description}';
                    var win = new Leaf.Window({
                        id: 'cus_prj_secify_approver_screen',
                        url: $('con543_prj_secify_approver_link').getUrl(),
                        params: {
                            document_id: document_id,
                            specify_code: specify_code
                        },
                        title: title,
                        width: 550,
                        heigh: 650
                    });
                    out_type = 'win';
                    out_object = win;
                }
                var confirm_flag = get_confirm_flag();
                params = {
                    out_type: out_type,
                    out_object: out_object,
                    confirm_flag: confirm_flag
                };
                return params;
            }
            
              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'], 'leg_legal_letter_hd');
               
                if (ds.id == ds_id) {
                    qpara['letter_hd_id'] = ${/parameter/@letter_hd_id};
                    aut_authority_list_validate_query(ds, qpara);
            
                }
            };
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>