<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: KevinCai
    $Date: 2017-4-7  上午9:01:59
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.document_category=&apos;COLL_CALL&apos; and t1.enabled_flag=&apos;Y&apos; and exists( select 1 from con_collection_group cg where cg.document_type=t1.document_type  and cg.leader_user_id=${/session/@user_id} or t1.admin_flag = &apos;Y&apos;)" model="cont.CON953.hls_document_type_for_coll" rootPath="hls_document_type_path"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
            function click_reset() {
                $('legal_query_ds').reset();
            }
            
            function click_query() {
                $('legal_result_ds').query();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="document_type_ds">
                <a:datas dataSource="/model/hls_document_type_path"/>
            </a:dataSet>
            <a:dataSet id="legal_query_ds">
                <a:fields>
                    <a:field name="created_date"/>
                    <a:field name="document_type_desc" displayField="description" options="document_type_ds" returnField="document_type" valueField="document_type"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="legal_result_ds" autoPageSize="true" autoQuery="true" model="cont.CON953.con_legal_affairs_department" queryDataSet="legal_query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="click_reset" text="重置"/>
                <a:gridButton click="click_query" text="查询"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="50" title="查询条件">
                <a:comboBox name="document_type_desc" bindTarget="legal_query_ds" prompt="组别"/>
                <a:textField name="staff_name" bindTarget="legal_query_ds" prompt="责任人"/>
                <a:datePicker name="created_date_from" bindTarget="legal_query_ds" prompt="日期从"/>
                <a:datePicker name="created_date_to" bindTarget="legal_query_ds" prompt="日期到"/>
            </a:form>
            <a:grid bindTarget="legal_result_ds" marginHeight="200" marginWidth="50" navBar="true">
                <a:columns>
                    <a:column name="contract_number" align="center" prompt="合同编号" width="120"/>
                    <a:column name="created_date" align="center" prompt="时间" renderer="Leaf.formatDate" width="120"/>
                    <a:column name="document_type_desc" align="center" prompt="组别" width="120"/>
                    <a:column name="staff_name" align="center" prompt="责任人" width="120"/>
                    <a:column name="overdue_times" align="center" prompt="逾期期数" width="120"/>
                    <a:column name="due_amount" align="right" prompt="收款金额" renderer="Leaf.formatMoney" width="120"/>
                    <a:column name="overdue_amount" align="right" prompt="逾期金额" renderer="Leaf.formatMoney" width="120"/>
                    <a:column name="collection_rate" align="right" prompt="收款率" width="120"/>
                    <a:column name="overdue_number" align="center" prompt="逾期期数（亚飞）" width="120"/>
                    <a:column name="overdue_rate" align="right" prompt="逾期率" width="120"/>
                    <a:column name="bad_amount_rate" align="right" prompt="不良率" width="120"/>
                    <a:column name="bad_amount" align="right" prompt="不良金额" renderer="Leaf.formatMoney" width="120"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
