<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: Calvin  
    $Date: 2017年12月19日17:01:10
    $Revision: 1.0  
    $Purpose: 代扣账户维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="default_idtype_idcode_mobile_link" model="cont.CON591.default_idtype_idcode_mobile" modelaction="batch_update"/>
        <script type="text/javascript"><![CDATA[
            function exit() {
                window.location = '${/request/@context_path}/welcome.lview';
            }
            
            function query() {
                $('con_contract_result_ds').query();
            }
            
            function reset() {
                $('con_contract_query_ds').reset();
            }
            
            function save() {
                var ds = $('con_contract_result_ds');
                if (ds.getSelected().length < 1) {
                    Leaf.showMessage('提示', '至少选择一行数据进行保存！');
                    return;
                }
                $('con_contract_result_ds').submitSelected();  
            }
            
            
            function resultexport() {
                $('grid_id')._export();
            }
            
        
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=CONTRACT&amp;function_code=CON591&amp;"/>
        <a:dataSets>
            <a:dataSet id="yes_and_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="ebank_prop_ds" lookupCode="HLS211_ID_TYPE"/>
            <a:dataSet id="ebank_cmb_ds" lookupCode="DEDUCTION_CARD_TYPE"/>
            <a:dataSet id="ebank_protocol_status_ds" lookupCode="CON591_EBANK_PROTOCOL_STATUS"/>
            <a:dataSet id="con_contract_query_ds" model="cont.CON591.con_contract">
                <a:fields>
                    <a:field name="contract_number" prompt="支付表编号"/>
                    <a:field name="contract_name" prompt="支付表名称"/>
                    <a:field name="bp_id_tenant"/>
                    <a:field name="bp_id_tenant_n" lovHeight="500" lovLabelWidth="100" lovService="cont.CON591.hls_bp_master_lv" lovWidth="800" prompt="承租人" title="承租人">
                        <a:mapping>
                            <a:map from="bp_name" to="bp_id_tenant_n"/>
                            <a:map from="bp_id" to="bp_id_tenant"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="ebank_protocol_status"/>
                    <a:field name="ebank_protocol_status_n" displayField="code_value_name" options="ebank_protocol_status_ds" prompt="协议状态" returnField="ebank_protocol_status" valueField="code_value"/>
                    <a:field name="ebank_id"/>
                    <a:field name="ebank_id_n" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON591.csh_bank_lov" lovWidth="500" prompt="代扣银行" title="银行">
                        <a:mapping>
                            <a:map from="bank_id" to="ebank_id"/>
                            <a:map from="bank_code" to="ebank_id_code"/>
                            <a:map from="bank_short_name" to="ebank_id_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="ebank_account_num" prompt="代扣帐号"/>
                    <a:field name="flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="deduction_flag"/>
                    <a:field name="deduction_flag_n" displayField="code_value_name" options="yes_and_no_ds" returnField="deduction_flag" valueField="code_value"/>
                    <a:field name="send_sms_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="dd_sign_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="con_contract_result_ds" autoPageSize="true" autoQuery="true" fetchAll="false" model="cont.CON591.con_contract" queryDataSet="con_contract_query_ds" selectable="true">
                <a:fields>
                    <a:field name="contract_id"/>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                    <a:field name="project_id"/>
                    <a:field name="bp_id_tenant_n"/>
                    <a:field name="bankid"/>
                    <a:field name="bank_account_code" required="true" lovGridHeight="300" lovHeight="500" lovService="csh.CSH502.csh_payment_bank_account_lov?is_company_account=&apos;Y&apos;" lovWidth="530"  title="CSH502.CSH_PAYMENT_OBJ">
                        <a:mapping>
                            <a:map from="bank_account_code" to="bank_account_code"/>
                            <a:map from="bank_account_name" to="bank_account_name"/>
                            <a:map from="bank_account_num" to="bank_account_num"/>
                            <a:map from="bank_account_id" to="bank_account_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="ebank_id_code" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="csh.CSH601.csh_tenant_bank_for_lov" lovWidth="500" required="true" title="银行">
                        <a:mapping>
                            <a:map from="bank_id" to="bankid"/>
                            <a:map from="bank_code" to="ebank_id_code"/>
                            <a:map from="bank_short_name" to="ebank_id_n"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="acctype" required="true"/>
                    <a:field name="acctype_n" displayField="code_value_name" options="ebank_cmb_ds" required="true" returnField="acctype" valueField="code_value"/>
                    <a:field name="idtype" readOnly="true"/>
                    <a:field name="idtype_n" displayField="code_value_name" options="ebank_prop_ds" readOnly="true" returnField="idtype" valueField="code_value"/>
                    <a:field name="ebank_account_name"/>
                    <a:field name="ebank_account_num"/>
                    <a:field name="id_card_no"/>
                    <a:field name="cell_phone"/>
                    <a:field name="ebank_protocol_status_n"/>
                    <a:field name="deduction_flag"/>
                    <a:field name="deduction_flag_n" displayField="code_value_name" options="yes_and_no_ds" returnField="deduction_flag" valueField="code_value"/>
                    <a:field name="bankacctname" required="true"/>
                    <a:field name="bankacctid" required="true"/>
                </a:fields>
                <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                    <a:event name="submitsuccess" handler="query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query" text="查询"/>
                <a:gridButton click="reset" text="重置"/>
                <a:gridButton click="save" text="保存"/>
                <a:gridButton click="resultexport" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="3" labelWidth="100" marginWidth="80" title="HLS.QUERY_TITLE">
                <a:textField name="contract_number" bindTarget="con_contract_query_ds"/>
                <a:textField name="contract_name" bindTarget="con_contract_query_ds"/>
                <a:lov name="bp_id_tenant_n" bindTarget="con_contract_query_ds"/>
                <a:lov name="ebank_id_n" bindTarget="con_contract_query_ds"/>
                <a:textField name="bankacctid" bindTarget="con_contract_query_ds" prompt="代扣银行卡号"/>
                <a:comboBox name="deduction_flag_n" bindTarget="con_contract_query_ds" prompt="是否代扣"/>
                <div/>
                <div/>
                <div style="color:red;font-size:10px;text-align:left;width:100%;"><![CDATA[提示：若该笔订单无需代扣，代扣银行卡号请录入000000。若该笔订单需要代扣请务必勾选最后一列的“是否代扣”标志！]]></div>
            </a:form>
            <a:grid id="grid_id" bindTarget="con_contract_result_ds" marginHeight="230" marginWidth="80" navBar="true">
                <a:columns>
                    <a:column name="contract_number" lock="true" prompt="支付表编号" width="120"/>
                    <a:column name="contract_name" prompt="支付表名称" width="220"/>
                    <a:column name="bp_id_tenant_n" prompt="客户" width="180"/>
                    <a:column name="bank_account_code" editor="lov_id" prompt="收款银行账户" width="180"/>
                    <a:column name="ebank_id_code" editor="lov_id" prompt="代扣银行代码" width="80"/>
                    <a:column name="ebank_id_n" prompt="代扣银行名" width="80"/>
                    <a:column name="acctype_n" align="center" editor="comboBox_id" prompt="代扣账户类型" width="80"/>
                    <a:column name="bankacctname" editor="textField_id" prompt="代扣账户名" width="100"/>
                    <a:column name="bankacctid" editor="textField_id" prompt="代扣银行卡号" width="140"/>
                    <a:column name="expireddate" editor="textField_id" prompt="信用卡有效期" width="100"/>
                    <a:column name="idtype_n" align="center" editor="comboBox_id" prompt="证件类型" width="80"/>
                    <a:column name="idcode" editor="textField_id" prompt="证件号" width="140"/>
                    <a:column name="mobile" editor="textField_id" prompt="手机" width="100"/>
                    <!-- <a:column name="signing_date" prompt="支付表签约日" width="80"/> -->
                    <a:column name="deduction_flag_n" align="center" editor="comboBox_id" prompt="是否代扣" width="80"/>
                </a:columns>
                <a:editors>
                    <a:textField id="textField_id"/>
                    <a:comboBox id="comboBox_id"/>
                    <a:lov id="lov_id"/>
                    <a:checkBox id="checkBox_id"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
