<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: hsx
    $Date: 2018年7月19日17:29:18
    $Revision: 1.0
    $Purpose:起案发起查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" dynamiccreateenabled="true" trace="true">
    <a:view>
        <a:link id="${/parameter/@layout_code}_con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="${/parameter/@layout_code}_hls_bp_master_query_link" url="${/request/@context_path}/modules/hls/HLS214N/hls_bp_master_modify.lview"/>
        <a:link id="${/parameter/@layout_code}_con632_close_link_id" url="${/request/@context_path}/modules/cont/CON632/con_collection_detail.lview"/>
        <a:link id="${/parameter/@layout_code}_con632_management_link_id" url="${/request/@context_path}/modules/cont/CON6323/con_collection_management_detail.lview"/>
        <a:link id="${/parameter/@layout_code}_confirm_car_link" model="cont.CON6323.con_collection_management_wfl" modelaction="update"/>
        <a:link id="con_collection_way_link" url="${/request/@context_path}/modules/cont/CON632/con_collection_transfer_visit.lview"/>
        <script src="${/request/@context_path}/javascripts/jquery-1.6.4.min.js" type="text/javascript"/>
        <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="${/parameter/@layout_code}_con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON1010/con_contract_modify.lview"/>
        <a:link id="contract_case1_values_sql_id" model="cont.CON1100.price_list_values_lov" modelaction="update"/>
        <a:link id="contract_case1_values_sql_id1" model="cont.CON1100.price_list_values_lov1" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            jQuery.noConflict();

            function open_contract_win_detail(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'CON301';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'QUERY';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
            }

            function open_contract_win123(ds_id, record_id) {
                var record = $(ds_id).findById(record_id);
                var param = record.data;
                param['function_code'] = 'CON1010_M';
                if(record.data.sub_price_list) {
                param['cond_para2'] = record.data.sub_price_list;}else {param['cond_para2']=12122;}
                param['case_type'] = record.data.case_type;
                if (record.data.case_status == 'APPROVING' || record.data.case_status == 'APPROVED') {
                    param['maintain_type'] = 'QUERY';
                    param['function_usage'] = 'QUERY';
                } else {
                    param['maintain_type'] = 'UPDATE';
                    param['function_usage'] = 'UPDATE';
                }
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                param['winid'] = 'con_contract_win123_id';
                param['layout_code'] = 'CONTRACT_CASE1'
                if (record.data.sub_price_list == '4'){

                    Leaf.request({
                        url: $('contract_case1_values_sql_id1').getUrl(),
                        para: {
                            param: param
                        },
                        success: function() {
                        hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}_con_contract_modify_link', ds_id);
                        },
                        scope: this
                    });
                }else{
                    Leaf.request({
                        url: $('contract_case1_values_sql_id').getUrl(),
                        para: {
                            param: param
                        },
                        success: function() {
                        hls_doc_get_layout_code('${/parameter/@layout_code}_con_contract_get_layout_code_link_id', param, '${/parameter/@layout_code}_con_contract_modify_link', ds_id);
                        },
                        scope: this
                    });
                }
            }
            //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'detail') {
                    return '<a href="javascript:open_contract_win_detail(\'' + record.ds.id + '\',\'' + record.id + '\')"> 合同明细 </a>';
                } else if (name == 'contract_number' && value) {
                    return '<a href="javascript:open_contract_win123(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                }
                return value;
            };

        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'], 'con_contract');

            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=CONTRACT&amp;function_code=CON1010"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
