<?xml version="1.0" encoding="UTF-8"?>

<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
<a:init-procedure>
    <a:model-query fetchAll="true" model="basic.hls_lease_channel_for_lov" rootPath="con1290_lease_list"/>
    <a:model-query defaultWhereClause="t1.business_type in (&apos;LEASE&apos;,&apos;LEASEBACK&apos;)" fetchAll="true" model="basic.hls_business_type_for_lov" rootPath="business_type_path"/>
</a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        function contract_list_query() {
            $('contract_list_grid_ds').query();
        }

        function contract_list_reset(){
            $('contract_list_form_ds').reset();
        }

        function contract_list_export() {
            $('source_to_grid')._export();
        }


        ]]></script>
        <a:dataSet id="contract_status_ds" lookupCode="CON500_CONTRACT_STATUS"/>
        <a:dataSet id="con1290_lease_channel_ds">
            <a:datas dataSource="/model/con1290_lease_list"/>
        </a:dataSet>
        <a:dataSet id="business_type_ds">
            <a:datas dataSource="/model/business_type_path"/>
        </a:dataSet>
        <a:dataSets>
            <a:dataSet id="contract_list_form_ds">
                <a:fields>
                    <a:field name="lease_channel_n" displayField="description" options="con1290_lease_channel_ds"
                             returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="lease_channel" />
                    <a:field name="business_type_n" displayField="description" options="business_type_ds" returnField="business_type" valueField="business_type"/>
                    <a:field name="business_type" />
                    <a:field name="contract_status_n" displayField="code_value_name" options="contract_status_ds" returnField="contract_status" valueField="code_value"/>
                    <a:field name="__async__"  defaultValue="Y" prompt="异步导出"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="contract_list_grid_ds"
                       model="cont.CON1290.con_contract_list"
                       queryDataSet="contract_list_form_ds"  selectable="true" selectionModel="single">
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="contract_list_query" text="查询"/>
                <a:gridButton click="contract_list_reset" text="重置"/>
                <a:gridButton click="contract_list_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:textField name="contract_number" bindTarget="contract_list_form_ds" prompt="合同编号"/>
                <a:textField name="bp_agent_name" bindTarget="contract_list_form_ds" prompt="代理商名称"/>
                <a:textField name="extra_nam" bindTarget="contract_list_form_ds" prompt="代理商简称"/>
                <a:comboBox name="lease_channel_n" bindTarget="contract_list_form_ds" prompt="商业模式" />
                <a:comboBox name="business_type_n" bindTarget="contract_list_form_ds" prompt="业务类型" />
                <a:comboBox name="contract_status_n" bindTarget="contract_list_form_ds" prompt="合同状态" />
                <a:datePicker name="lease_execution_date_from" bindTarget="contract_list_form_ds" prompt="执行日期从" />
                <a:datePicker name="lease_execution_date_to" bindTarget="contract_list_form_ds" prompt="执行日期到" />
            </a:form>
            <a:grid id="source_to_grid" bindTarget="contract_list_grid_ds" navBar="true" height="600" marginWidth="100">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="130"/>
                    <a:column name="lease_channel_n" prompt="商业模式" width="100"/>
                    <a:column name="business_type_n"  prompt="业务类型" width="100" />
                    <a:column name="lease_execution_date"  prompt="执行日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="bp_code"  prompt="客户编号" width="100" />
                    <a:column name="bp_name"  prompt="客户名称" width="100" />
                    <a:column name="bp_agent_code"  prompt="代理商编号" width="100" />
                    <a:column name="bp_agent_name"  prompt="代理商名称" width="100" />
                    <a:column name="extra_nam"  prompt="代理商简称" width="100" />
                    <a:column name="billing_way_n"  prompt="开票方式" width="100" />
                    <a:column name="contract_status_n"  prompt="合同状态" width="100"/>
                    <a:column name="lease_end_date"  prompt="期满日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="et_date"  prompt="实际期满日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="pattern"  prompt="机型" width="100"/>
                    <a:column name="machine_number"  prompt="机号" width="100"/>
                    <a:column name="lease_term_month"  prompt="租赁期限（月）" width="100"/>
                    <a:column name="termination_date"  prompt="中途偿还基准日期" width="100" renderer="Leaf.formatDate"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
