<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2014-8-1 下午01:54:29  
    $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="${/parameter/@layout_code}${/parameter/@pre_layout}zj_wfl_approve_history_check" url="${/request/@context_path}/modules/zjwfl/zj_wfl_approve_history_check.lview"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="car_modify_special_link" url="${/request/@context_path}/modules/prj/PRJ500N/prj_project_create.lview"/>
        <a:link id="${/parameter/@layout_code}_contract_print_link_id" url="${/request/@context_path}/modules/cont/CON301N/con_contract_print.lview"/>
        <a:link id="contract_accounting_link" url="${/request/@context_path}/modules/cont/CON505N/con_accounting_manage.lview"/>
        <script type="text/javascript"><![CDATA[
            function open_contract_win(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'] = 'UPDATE';
                param['url_title'] = '${l:CON301.CONTRACT_DETAIL}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', null);
            }
            
            function open_project_Window(record_id, ds_id) {
                var record = $(ds_id).findById(record_id);
                var param = {};
                param['company_id'] = record.get('company_id');
                param['project_id'] = record.get('project_id');
                param['function_code'] = 'PRJ502D';
                param['function_usage'] = 'QUERY';
                param['bp_class'] = record.get('bp_class');
                param['maintain_type'] = 'QUERY';
                /*  param['window_open_flag'] = 'Y';
                 param['show_history_flag'] = 'Y'; */
                param['url_title'] = '${l:HLS.PROJECT_MAITAIN}';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'car_modify_special_link', ds_id, '${/parameter/@layout_code}');
            }
            
            //超链接渲染
            window['${/parameter/@layout_code}_dynamic_link_renderer'] = function(value, record, name, config_record) {
                if (name == 'contract_number' && value) {
                    return '<a href="javascript:open_contract_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
                }
                if (name == 'project_number' && value) {
                    return '<a href="javascript:open_project_Window(\'' + record.id + '\',\'' + record.ds.id + '\')">' + value + '</a>';
                }
                return value;
            };
            
            
            //新增
            window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
                var param = {};
                param['function_code'] = 'CON505N_MODIFY';
                param['function_usage'] = 'UPDATE';
                param['maintain_type'] = 'UPDATE';
                param['url_title'] = '诉讼台账明细';
                param['dsid'] = 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds';
                param['winid'] = 'con_accounting_modify_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'contract_accounting_link', 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds');
            };
            
            //详细信息
            window['${/parameter/@layout_code}_user_button2_layout_dynamic_click'] = function() {
                var result_ds = $('CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds');
                var record = result_ds.getSelected();
                var document_status = record[0].get('document_status');
                var contract_id = record[0].get('contract_id');
                var param = record[0].data;
                if (document_status == '30') {
                    param['function_code'] = 'CON505N_QUERY';
                    param['document_id'] = contract_id;
                    param['contract_id'] = contract_id;
                    param['function_usage'] = 'QUERY';
                    param['maintain_type'] = 'QUERY';
                    param['url_title'] = '诉讼台账查看';
                    param['dsid'] = 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds';
                    param['winid'] = 'con_accounting_query_winid';
                    hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'contract_accounting_link', 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds');
                } else if (document_status == '10' || document_status == '20') {
                    param['function_code'] = 'CON505N_MODIFY';
                    param['document_id'] = contract_id;
                    param['contract_id'] = contract_id;
                    param['function_usage'] = 'UPDATE';
                    param['maintain_type'] = 'UPDATE';
                    param['url_title'] = '诉讼台账明细';
                    param['dsid'] = 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds';
                    param['winid'] = 'con_accounting_modify_winid';
                    hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'contract_accounting_link', 'CONTRACT_LEGAL_ENTRANCE_G_PROJECT_RESULT_con_accounting_manage_ds');
            
                }
            };
        ]]></script>
        <!-- <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON501"/> -->
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
