<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zl  
    $Date: 2016-3-29 下午03:23:03  
    $Revision: 1.0  
    $Purpose: 开票方式维护
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="pageLink_hls250_billing_method_edit" url="${/request/@context_path}/modules/hls/HLS250/hls_billing_method_edit.lview"/>
        <script type="text/javascript"><![CDATA[
           function hls_billing_method_list_add(){
                $('hls_billing_method_list_grid').showEditorByRecord($('hls_billing_method_list_ds').create());
            }
          
           function hls_billing_method_list_clear(){
                $('hls_billing_method_list_grid').clear();
            }
            
            function hls_billing_method_list_query(){
                $('hls_billing_method_list_ds').query();
            }
            
           function hls_billing_method_list_save() {
               var result_ds = $('hls_billing_method_list_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }       
            
            function hls250_billing_method_edit(reocrd_id, billing_method) {
                new Leaf.Window({id:'hls250_billing_method_edit_window',
					url:$('pageLink_hls250_billing_method_edit').getUrl(),
					params:{
                    	billing_method:billing_method
                    },
					title:'开票方式维护',
					fullScreen:true
				});
            }
            
            function hls250_edit_url(value, record, name) {
               if (!Ext.isEmpty(value)  ) {
                   return '<a href="javascript:hls250_billing_method_edit('  + record.id +  ',\'' + record.get('billing_method') + '\');">' + value + '</a>'; 
                 
               }
               else {
                  return '';
               }
            }
            
            function hls250_billing_method_column_edit(record, name) {
           
              if (record.isNew) {
                 return 'import_textField';
                 }
               else {
                  return '';
               }
              }
            
        ]]></script>
        <a:dataSets>
            <a:dataSet id="billing_method_usage_type" lookupCode="HLS250_BILLING_METHOD_USAGE_TYPE"/>
            <!-- <a:dataSet id="hls_billing_method_list_ds" autoQuery="true" model="hls.HLS550.hls_billing_master" queryDataSet="hls560_billing_master_list_query_ds" queryUrl="${/request/@context_path}/autocrud/hls.HLS550.hls_billing_master/query" selectable="true"/> -->
            <a:dataSet id="hls_billing_method_list_ds" autoQuery="true" model="hls.HLS250.hls_billing_method" selectable="true">
                <a:fields>
                    <a:field name="billing_method" required="true"/>
                    <a:field name="usage_type_n" displayField="code_value_name" options="billing_method_usage_type" required="true" returnField="usage_type" valueField="code_value"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hls_billing_method_list_query" text="查询"/>
                <a:gridButton click="hls_billing_method_list_save" text="保存"/>
                <a:gridButton click="hls_billing_method_list_add" text="新增"/>
                <a:gridButton click="hls_billing_method_list_clear" text="移除"/>
            </a:screenTopToolbar>
            <a:grid id="hls_billing_method_list_grid" bindTarget="hls_billing_method_list_ds" marginHeight="220" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="billing_method" editor="import_textField" editorFunction="hls250_billing_method_column_edit" prompt="开票方式" renderer="hls250_edit_url" width="200"/>
                    <a:column name="description" editor="import_textField" prompt="描述" width="400"/>
                    <a:column name="usage_type_n" editor="import_comboBox" prompt="用途类型" width="200"/>
                    <a:column name="enabled_flag" editor="import_checkBox" prompt="启用标志"/>
                </a:columns>
                <a:editors>
                    <a:textField id="import_textField"/>
                    <a:checkBox id="import_checkBox"/>
                    <a:comboBox id="import_comboBox"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
