<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Yimeng  
    $Date: 2015-4-1 上午10:24:11  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.instance_id = ${/parameter/@instance_id}" model="zjwfl.zj_wfl_workflow_instance" rootPath="prj_wfl_instance_path"/>
        <a:model-query model="cont.CON543.con_contract_save" rootPath="con_wfl_path"/>
        <a:model-query defaultWhereClause="t1.change_req_id = ${/parameter/@contract_id}" model="cont.CON543.get_change_status" rootPath="con_change"/>
    </a:init-procedure>
    <a:view>
        <a:link id="wfl_prj_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="wfl_prj_project_detail" url="${/request/@context_path}/modules/cont/CON543/con_contract_content_confirm.lview"/>
        <!-- <a:link id="con543_prj_secify_approver_link" url="${/request/@context_path}/modules/prj/PRJ501N/cus_hls_specify_approver.lview"/> -->
        <a:dataSets>
            <a:dataSet id="prj_wfl_info">
                <a:datas dataSource="/model/con_wfl_path"/>
            </a:dataSet>
        </a:dataSets>
        <script type="text/javascript"><![CDATA[
                var layout_code_wfl;
                function get_layout_code(){
                    return layout_code_wfl;
                }
				function prj_detail_div_load(param){
					var de = Leaf.CmpManager.get('prj_detail_div_id');
					if(de){
					    de.destroy();
					}
					de = new Leaf.DynamicElement('prj_detail_div_id');
					var url=$('wfl_prj_project_detail').getUrl();
					de.load(url,param);
				}
				//
			    var record = $('prj_wfl_info').getAt(0);
			  	var param=record.data;
			  	param['document_id'] = record.get('contract_id');
                param['function_code'] = '${/parameter/@function_code}';
                param['workflow_id'] = '${/parameter/@workflow_id}';
                param['workflow'] = '${/model/prj_wfl_instance_path/record/@workflow_code}';
                param['cond_para3'] = '${/parameter/@cond_para3}';
                param['appoint_check'] = '${/parameter/@appoint_check}';
                param['specify_code'] = '${/parameter/@specify_code}';
                param['change_req_id'] = '${/parameter/@contract_id}';
                param['reschedule_flag'] = '${/model/con_change/record/@reschedule_flag}';
                param['show_history_flag'] = '${/parameter/@show_history_flag}';
                param['winid'] = 'zj_wfl_approve_win';
				Leaf.request({
                    url: $('wfl_prj_get_layout_code_link_id').getUrl(),
                    para: param,
                    success: function(res) {
                        if (!res.result.layout_code) {
                            Leaf.showMessage('${l:PROMPT}', '${l:HLS.LAYOUT_CODE_IS_NULL}');
                            return;
                        }
                        param['layout_code'] = res.result.layout_code;
                        layout_code_wfl = res.result.layout_code;
                        param['usage_type'] = res.result.usage_type;
                        param['calc_type'] = res.result.cond_para1;
                        prj_detail_div_load(param);
               			// hls_doc_get_layout_code('wfl_prj_get_layout_code_link_id', param, 'wfl_prj_project_detail');
                    },
                    failure: function() {
                    },
                    error: function() {
                    },
                    scope: this
                });
                
		]]></script>
        <div id="prj_detail_div_id" style="margin:0px"/>
        <!-- <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> -->
    </a:view>
</a:screen>
