<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: wangwei  
    $Date: 2015-2-4 下午3:22:24  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
		
	]]></a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        //新增
        function grid_Add() {
                var ds = $('sms_send_rules_ds');
                var record = ds.create(ds.currentIndex);
                $('sms_send_rules_id').showEditorByRecord(record);
            }
            
        function query_ds(){
            $('sms_send_rules_ds').query();
        }
        
        function grid_submit(){
           var ds = $('sms_send_rules_ds');
                if (ds.validate()) {
                    ds.submit();
                }

        }
        
        function grid_delete(){
           var ds = $('sms_send_rules_ds');
                var records = ds.getSelected();
                if (records.length != 0) {
                    Leaf.showConfirm( '${l:HLS.PROMPT}', '${l:HLS030.CONFIRM_DELETE}', function () {
                        ds.remove(records);
                    });
                }
            
        }
        
		]]></script>
        <a:dataSets>
            <a:dataSet id="for_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number" fetchRemote="true" lovGridHeight="300" lovHeight="500" lovService="cont.CON749.con_contract_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_number" to="contract_number"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="sms_send_rules_ds" autoPageSize="true" autoQuery="true" model="cont.CON749.yonda_sms_send_rules" queryDataSet="for_query_ds" selectable="true">
                <a:fields>
                    <a:field name="five_day_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="today_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="over_three_day_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="tenant_name"/>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number" lovGridHeight="300" lovHeight="500" lovService="cont.CON749.con_contract_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="bp_tenant_name" to="tenant_name"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query_ds" text="查询"/>
                <a:gridButton click="grid_Add" text="新增"/>
                <a:gridButton click="grid_delete" text="删除"/>
                <a:gridButton click="grid_submit" text="保存"/>
            </a:screenTopToolbar>
            <a:form marginWidth="80" title="查询条件">
                <a:hBox>
                    <a:lov name="contract_number" bindTarget="for_query_ds" prompt="合同编号"/>
                </a:hBox>
            </a:form>
            <a:grid id="sms_send_rules_id" bindTarget="sms_send_rules_ds" marginHeight="180" marginWidth="80" navBar="true">
                <a:columns>
                    <a:column name="contract_number" editor="lov_ed" prompt="合同编号" width="150"/>
                    <a:column name="tenant_name" prompt="承租人" width="200"/>
                    <a:column name="cell_phone" editor="text_ed" prompt="客户手机号" width="120"/>
                    <a:column name="five_day_flag" editor="check_ed" prompt="取消5天前提醒" width="120"/>
                    <a:column name="today_flag" editor="check_ed" prompt="取消当天提醒" width="120"/>
                    <a:column name="over_three_day_flag" editor="check_ed" prompt="取消逾期1-3天提醒" width="120"/>
                </a:columns>
                <a:editors>
                    <a:lov id="lov_ed"/>
                    <a:textField id="text_ed"/>
                    <a:checkBox id="check_ed"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
