csh_bank_new.lview 8.78 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:DJ
	$date:2013/05/08
	$purpose:银行定义
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query model="csh.CSH101.csh_bank_type_default_value" rootPath="default_bank_type"/>
    </a:init-procedure>
    <a:view>
        <a:link id="pageLink_bank_account" url="${/request/@context_path}/modules/csh/CSH101N/csh_bank_account_new.lview"/>
        <a:link id="pageLink_contact_person" url="${/request/@context_path}/modules/csh/CSH101/csh_bank_contact_person.lview"/>
        <script type="text/javascript"><![CDATA[
	        function bankDs_grid_query() {
	            $('bankDs').query();
	        }
	        
	        function bankDs_grid_add() {
	            $('bankDs_grid').showEditorByRecord($('bankDs').create());
	        }
	        
	        function bankBranchDs_grid_add() {
	            var bankDs=$('bankDs');
	            var record=bankDs.getCurrentRecord();
	            if(Ext.isEmpty(record))
	            {
	                return ;
	            }
	            else if(record.isNew)
	            {
	                Leaf.showMessage('${l:HLS.PROMPT}','请先保存银行,才能新增分行');
	                return ;
	            }
	        	$('bankBranchDs_grid').showEditorByRecord($('bankBranchDs').create({
	        	    bank_id:record.get('bank_id'),
	        	    bank_code:record.get('bank_code')
	        	}));
	        	
	        }
	        
	        function bankDs_grid_clear() {
	            $('bankDs_grid').clear();
	        }
	        
	        function bankBranchDs_grid_clear() {
	            $('bankBranchDs_grid').clear();
	        }
	        
	        function bankDs_grid_save() {
	            var result_ds = $('bankDs');
	            if (result_ds.validate()) {
	                result_ds.submit();
	            }
	        }
	        
			function editorFunction_bankDs_grid(record,name){
				if(record.isNew){
					if(name=='bank_type_name'){
						return 'bankDs_grid_editor_comb';
					}
					if(name=='bank_code'){
						return 'bankDs_grid_editor_tf_upper';
					}
				}
				return '';
			}
			
			function editorFunction_bankBranchDs_grid(record,name){
				if(record.isNew){
					return 'bankBranchDs_grid_editor_tf_upper';
				}
				return '';
			}
			function render_contact_person(value,record,name){
				if(!record.isNew){	
					var bank_branch_id=record.get("bank_branch_id");
					return '<a href="javascript:winOpen_contact_person(' + bank_branch_id + ')">${l:CSH101.LINK.CONTACT_PERSON}</a>';
				}
			}
			
			function winOpen_contact_person(bank_branch_id)
			{
			    new Leaf.Window({
	                id: 'csh_bank_contact_person',
	                url: $('pageLink_contact_person').getUrl(),
	                params:{
	                	bank_branch_id:bank_branch_id
	                },
	                title: '${l:CSH101.WIN_TITLE.CONTACT_PERSON}',
	                width:800,
	                height:500
	            });
			}
			
			
			function render_bank_account(value,record,name){
				if(!record.isNew){
					var bank_branch_id=record.get("bank_branch_id");
					return '<a href="javascript:winOpen_bankAccount(' + bank_branch_id + ')">${l:CSH101.LINK.BANK_ACCOUNT}</a>';
				}
			}
			
			function winOpen_bankAccount(bank_branch_id)
			{
			    new Leaf.Window({
	                id: 'csh_bank_account',
	                url: $('pageLink_bank_account').getUrl(),
	                params:{
	                	bank_branch_id:bank_branch_id
	                },
	                title: '${l:CSH101.WIN_TITLE.BANK_ACCOUNT}',
	                width:1300,
	                height:500
	            });
			}
			
		]]></script>
        <a:dataSets>
            <a:dataSet id="bank_type_ds" lookupCode="BANK_TYPE"/>
            <a:dataSet id="bankDs" autoQuery="true" fetchAll="true" model="csh.CSH101.csh_bank" selectable="true" selectionModel="single" submitUrl="csh_bank.lsc">
                <a:fields>
                    <a:field name="bank_code" required="true"/>
                    <a:field name="bank_short_name" required="true"/>
                    <a:field name="bank_type" defaultValue="${/model/default_bank_type/record/@code_value}"/>
                    <a:field name="bank_type_name" defaultValue="${/model/default_bank_type/record/@code_value_name}" displayField="code_value_name" options="bank_type_ds" required="true" returnField="bank_type" valueField="code_value"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="zero_amounts_allowed" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="bankBranchDs" bindName="branch_info" bindTarget="bankDs" fetchAll="true" model="csh.CSH101.csh_bank_branch" queryUrl="${/request/@context_path}/autocrud/csh.CSH101.csh_bank_branch/query?bank_code=${/parameter/@bank_code}" selectable="true">
                <a:fields>
                    <a:field name="bank_code"/>
                    <a:field name="bp_bank_code"/>
                    <a:field name="bank_branch_code" required="true"/>
                    <a:field name="bank_branch_name" required="true"/>
                    <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="bankDs_grid_add" text="CSH101.BUTTON.BANK_ADD"/>
                <a:gridButton click="bankDs_grid_clear" text="CSH101.BUTTON.BANK_CLEAR"/>
                <a:gridButton click="bankDs_grid_query" text="HLS.QUERY"/>
                <a:gridButton click="bankBranchDs_grid_add" text="CSH101.BUTTON.BRANCH_ADD"/>
                <a:gridButton click="bankBranchDs_grid_clear" text="CSH101.BUTTON.BRANCH_CLEAR"/>
                <a:gridButton click="bankDs_grid_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:grid id="bankDs_grid" bindTarget="bankDs" marginHeight="250" marginWidth="30">
                <a:columns>
                    <a:column name="bank_code" editorFunction="editorFunction_bankDs_grid" width="150"/>
                    <a:column name="bank_short_name" editor="bankDs_grid_editor_tf" width="200"/>
                    <a:column name="bank_full_name" editor="bankDs_grid_editor_tf" width="300"/>
                    <a:column name="bank_type_name" align="center" editorFunction="editorFunction_bankDs_grid" width="100"/>
                    <a:column name="enabled_flag" align="center" editor="bankDs_grid_editor_check" width="100"/>
                    <!-- <a:column name="zero_amounts_allowed" align="center" editor="bankDs_grid_editor_check" width="100"/> -->
                </a:columns>
                <a:editors>
                    <a:textField id="bankDs_grid_editor_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="bankDs_grid_editor_tf"/>
                    <a:comboBox id="bankDs_grid_editor_comb"/>
                    <a:checkBox id="bankDs_grid_editor_check"/>
                </a:editors>
            </a:grid>
            <a:grid id="bankBranchDs_grid" bindTarget="bankBranchDs" height="150" marginWidth="30">
                <a:columns>
                    <a:column name="bank_code"/>
                    <a:column name="bp_bank_code" editor="bankBranchDs_grid_editor_tf"/>
                    <a:column name="bank_branch_code" editor="bankBranchDs_grid_editor_tf_upper"/>
                    <a:column name="bank_branch_name" editor="bankBranchDs_grid_editor_tf" width="200"/>
                    <a:column name="contact_person" align="center" prompt="CSH101.LINK.CONTACT_PERSON" renderer="render_contact_person" width="80"/>
                    <a:column name="bank_account" align="center" prompt="CSH101.LINK.BANK_ACCOUNT" renderer="render_bank_account" width="80"/>
                    <a:column name="address" editor="bankBranchDs_grid_editor_tf" width="200"/>
                    <a:column name="contact_name" editor="bankBranchDs_grid_editor_tf"/>
                    <a:column name="e_mail_address" editor="bankBranchDs_grid_editor_tf" width="150"/>
                    <a:column name="phone" editor="bankBranchDs_grid_editor_tf"/>
                    <a:column name="enabled_flag" align="center" editor="bankBranchDs_grid_editor_check" width="60"/>
                </a:columns>
                <a:editors>
                    <a:textField id="bankBranchDs_grid_editor_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="bankBranchDs_grid_editor_tf"/>
                    <a:comboBox id="bankBranchDs_grid_editor_comb"/>
                    <a:checkBox id="bankBranchDs_grid_editor_check"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>