<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2015-1-4 下午12:17:07  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:c="leaf.application.action" xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="hls.HLS601.hls_document_enabled_nodes" rootPath="enabled_node_columns"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
    		function hls601_reset() {
    		    $('document_status_query_ds').reset();
    		}
    		
    		function hls601_query() {
    		    $('document_status_result_ds').query();
    		}
    		
    		function status_renderer(value,record,name) {
    		    if(value=='Y') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_ok.png"/>';
    		    } else if (value=='NEXT') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_running.png"/>';
    		    } else if (value=='-') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_no.png"/>';
    		    } else if (value=='N') {
    		        return '<img src="${/request/@context_path}/images/stop.png"/>';
    		    }
    		}
    		
    		function lable_renderer(value,record,name) {
    		    if(value=='OK') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_ok.png"/>';
    		    } else if (value=='RUNNING') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_running.png"/>';
    		    }else if (value=='NO') {
    		        return '<img src="${/request/@context_path}/images/zjwfl/zjwfl_no.png"/>';
    		    }else if (value=='STOP') {
    		        return '<img src="${/request/@context_path}/images/stop.png"/>';
    		    }
    		}
    	]]></script>
        <a:dataSets>
            <a:dataSet id="document_status_query_ds">
                <a:fields>
                    <a:field name="document_category"/>
                    <a:field name="contract_number" autoComplete="true" autoCompleteField="contract_number" lovGridHeight="300" lovHeight="450" lovService="cont.CON500.con_contract_number_lov" lovWidth="500" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_number" to="contract_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="project_number" lovGridHeight="300" lovHeight="430" lovService="cont.CON333.con_document_number_for_query" lovWidth="400" title="申请编号">
                        <a:mapping>
                            <a:map from="project_id" to="project_id"/>
                            <a:map from="project_number" to="project_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="company_authority" defaultValue="${/session/@company_id}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="document_status_result_ds" autoPageSize="true" model="hls.HLS601.hls_document_node_status_v" queryDataSet="document_status_query_ds" selectable="true"/>
            <a:dataSet id="lable_ds" autoCreate="true">
                <a:fields>
                    <a:field name="ok" defaultValue="OK"/>
                    <a:field name="running" defaultValue="RUNNING"/>
                    <a:field name="no" defaultValue="NO"/>
                    <a:field name="stop" defaultValue="STOP"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls601_reset" text="重置"/>
                <a:gridButton click="hls601_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
        </a:screenBody>
        <a:form column="3" title="查询条件">
            <a:lov name="project_number" bindTarget="document_status_query_ds" prompt="申请编号"/>
            <a:lov name="contract_number" bindTarget="document_status_query_ds" prompt="合同编号"/>
        </a:form>
        <a:grid id="document_status_result_grid" bindTarget="document_status_result_ds" marginHeight="180" marginWidth="30" navBar="true">
            <a:columns>
                <a:column name="project_number" align="center" prompt="申请编号" width="120"/>
                <a:column name="contract_number" align="center" prompt="合同编号" width="120"/>
                <a:column name="bp_name" align="center" prompt="承租人" width="120"/>
                <a:placeHolder id="dynamicLineColumn_id"/>
                <a:column name="inception_of_lease" align="center" prompt="起租日" renderer="Leaf.formatDate" width="120"/>
                <a:column name="lease_end_date" align="center" prompt="租赁终止日" renderer="Leaf.formatDate" width="120"/>
                <a:column name="lease_times" align="center" prompt="租赁期数" width="80"/>
            </a:columns>
        </a:grid>
        <a:hBox style="font-weight:900;font-size:15px;">
            <a:label name="ok" bindTarget="lable_ds" prompt="已完成" renderer="lable_renderer"/>
            <a:label name="running" bindTarget="lable_ds" prompt="下一步" renderer="lable_renderer"/>
            <a:label name="no" bindTarget="lable_ds" prompt="无需执行" renderer="lable_renderer"/>
            <a:label name="stop" bindTarget="lable_ds" prompt="未完成" renderer="lable_renderer"/>
        </a:hBox>
    </a:view>
    <a:view-config>
        <c:create-config targetId="dynamicLineColumn_id">
            <p:loop source="/model/enabled_node_columns">
                <c:process-config>
                    <a:column name="node_seq_${@node_seq}" align="center" prompt="${@node_desc}" renderer="status_renderer"/>
                </c:process-config>
            </p:loop>
        </c:create-config>
    </a:view-config>
</a:screen>