<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyu 
    $Date: 2016-2-29 下午15:22:23  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="con_contract_change_link" url="${/request/@context_path}/modules/cont/CON731/hls_con_contract_change_detail.lview"/>
        <script type="text/javascript"><![CDATA[
            function change_detail_render(value, record, name) {
                if (record.get('contract_id')) {
                    return '<a href="javascript:open_change_detail(' + record.id + ')">' + '单据' + '</a>';
                }
            }
            
            function open_change_detail(id) {
                var record = $('con560_change_detail_result_ds').findById(id);
                var param = record.data;
                param['change_req_id'] = record.get('change_req_id');
                param['contract_id'] = record.get('change_req_id');
                var ccr_type =record.get('ccr_type');
                if (ccr_type == 'CONTRACT_ALT') {
                    param['function_code'] = 'CON731C_WFL_H';
                } else if (ccr_type == 'GUATANTEE_ALT') {
                    param['function_code'] = 'CON731G_WFL_H';
                } else if (ccr_type == 'RENT_PLAN_ALT') {
                    param['function_code'] = 'CON731R_WFL_H';
                } else if (ccr_type == 'LESSEES_ALT') {
                    param['function_code'] = 'CON731D_WFL_H';
                } else if (ccr_type == 'LEASE_ALT') {
                    param['function_code'] = 'CON731L_WFL_H';
                }
                //param['function_code'] = 'CON732_UNIVERSAL';
                param['function_usage'] = 'QUERY';
                param['maintain_type'] = 'READONLY';
                // param['layout_debugger_flag'] = 'Y';
                param['url_title'] = '变更申请';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_change_link');
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
            <a:dataSet id="con560_change_detail_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_id" defaultValue="${/parameter/@contract_id}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con560_change_detail_result_ds" autoQuery="true" model="cont.CON561.sdic_con_contract_change_detail_wfl" queryDataSet="con560_change_detail_query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
            </a:screenTopToolbar>
            <a:form/>
            <a:grid id="con560_change_detail_grid_id" bindTarget="con560_change_detail_result_ds" height="300" navBar="true" showRowNumber="true" width="800">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="120"/>
                    <a:column name="document_info" prompt="单据信息" width="260"/>
                    <a:column name="req_date" prompt="变更日期" renderer="Leaf.formatDate" width="100"/>
                    <a:column name="ccr_type_n" prompt="变更类型" width="120"/>
                    <a:column name="change_detail" prompt="单据" renderer="change_detail_render" width="80"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
