<?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="con1340_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 execution_change_query() {
            $('execution_change_grid_ds').query();
        }

        function execution_change_reset(){
            $('execution_change_form_ds').reset();
        }

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

        function aut_authority_list_validate_query(ds, qpara) {
            qpara['authority_flag'] = 'Y';
            qpara['contract_ref_content_flag'] = 'Y';
            qpara['trx_category'] = 'CONTRACT';
            qpara['trx_id'] = 't1.contract_id';

        }

        ]]></script>
        <a:dataSet id="con1290_lease_channel_ds">
            <a:datas dataSource="/model/con1340_lease_list"/>
        </a:dataSet>
        <a:dataSet id="business_type_ds">
            <a:datas dataSource="/model/business_type_path"/>
        </a:dataSet>
        <a:dataSets>
            <a:dataSet id="execution_change_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:fields>
            </a:dataSet>
            <a:dataSet id="execution_change_grid_ds"
                       model="cont.CON1340.con_execution_change"
                       queryDataSet="execution_change_form_ds" selectable="true" selectionModel="single">
                <a:events>
                    <a:event  name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="execution_change_query" text="查询"/>
                <a:gridButton click="execution_change_reset" text="重置"/>
                <a:gridButton click="execution_change_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:textField name="change_req_number" bindTarget="execution_change_form_ds" prompt="申请编号"/>
                <a:textField name="contract_number" bindTarget="execution_change_form_ds" prompt="合同号"/>
                <a:textField name="extra_nam" bindTarget="execution_change_form_ds" prompt="代理商简称" />
                <a:textField name="bp_agent_name" bindTarget="execution_change_form_ds" prompt="代理商名称" />
                <a:datePicker name="req_date_from" bindTarget="execution_change_form_ds" prompt="处理日期从"/>
                <a:datePicker name="req_date_to" bindTarget="execution_change_form_ds" prompt="处理日期到"/>
            </a:form>
            <a:grid id="source_to_grid" bindTarget="execution_change_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column name="change_req_number" prompt="变更申请编号" width="130"/>
                    <a:column name="req_date" prompt="处理日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="deal_way"  prompt="处理方法" width="100" />
                    <a:column name="contract_number"  prompt="合同编号" width="100"/>
                    <a:column name="before_bp_name"  prompt="变更前客户名称" width="100"/>
                    <a:column name="after_bp_name"  prompt="变更后客户名称" width="100" />
                    <a:column name="lease_channel_n"  prompt="商业模式" width="100"/>
                    <a:column name="business_type_n"  prompt="租赁类型" width="100"/>
                    <a:column name="bp_agent_name"  prompt="代理商名称" width="100"/>
                    <a:column name="extra_nam"  prompt="代理商简称" width="100"/>
                    <a:column name="journal_num"  prompt="变更凭证凭证号" width="150"/>
                    <a:column name="journal_date"  prompt="变更凭证凭日期" width="150" renderer="Leaf.formatDate"/>
                    <a:column name="service_charge_journal_num"  prompt="手续费核销凭证" width="150"/>
                    <a:column name="service_charge_journal_date"  prompt="手续凭证日期" width="150" renderer="Leaf.formatDate"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
