<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: DJ $Date: 2013-5-23 上午9:30:47 $Revision: 1.0 $Purpose: 更新优化 --> <a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true"> <a:init-procedure> <a:model-query autoCount="false" fetchAll="true" model="gld.gld_account_set_sub_fieldset" rootPath="fieldset"/> </a:init-procedure> <a:view> <a:link id="gld_account_company_assigned_batch_all_link" url="${/request/@context_path}/modules/gld/FND2140/gld_account_company_assigned_batch_all.lview"/> <a:link id="gld_account_company_assigned_batch_tmp_control_link" url="${/request/@context_path}/modules/gld/FND2140/gld_account_company_assigned_batch_tmp_control.lsc"/> <a:link id="gld_account_hierarchy_details_link" url="${/request/@context_path}/modules/gld/public/gld_account_hierarchy_details.lview"/> <a:link id="gld_company_accounts_link" url="${/request/@context_path}/modules/gld/FND2140/gld_company_accounts.lview"/> <a:link id="gld_account_hierarchy_tree_link_a" url="${/request/@context_path}/modules/gld/public/gld_account_hierarchy_tree.lview"/> <script type="text/javascript"><![CDATA[ function accountDetailDs_query() { $('accountDetailDs').query(); } function winOpen_appointCompany(account_id, account_set_id) { new Leaf.Window({ id: 'ggld_company_accounts_window', url: $('gld_company_accounts_link').getUrl(), params: { account_id: account_id, account_set_id: account_set_id }, title: '${l:GLD_ACCOUNTS.APPOINT_COMPANY}', height: 500, width: 500 }); } function winOpen_subAccount(account_id, account_set_id) { new Leaf.Window({ id: 'gld_account_hierarchy_details_window', url: $('gld_account_hierarchy_details_link').getUrl(), params: { account_id: account_id, account_set_id: account_set_id }, title: '${l:GLD_ACCOUNTS.SUB_ACCOUNT}', height: 500, width: 600 }); } function render_accountDetailDs_grid(value, record, name) { var account_id = record.get('account_id'); var account_set_id = record.get('account_set_id'); if (name == 'company_assign') { if (!record.isNew) { return '<a href="javascript:winOpen_appointCompany(' + account_id + ',' + account_set_id + ')">${l:GLD_ACCOUNTS.APPOINT_COMPANY}</a>'; } } if (name == 'sub_account') { if (!record.isNew && record.get('summary_flag') == 'Y') { return '<a href="javascript:winOpen_subAccount(' + account_id + ',' + account_set_id + ')">${l:GLD_ACCOUNTS.SUB_ACCOUNT}</a>'; } } } function batchAssignCompany() { var dataSet = $('accountDetailDs'); //var validate = dataSet.validate(); //获取已选中的record数据行,为Json格式。 var selectedRecords = dataSet.getJsonData(true); if (selectedRecords.length < 1) { Leaf.showMessage('${l:PROMPT_MESSAGE}', '${l:PROMPT.PLEASE_SELECT}', null, 250, 100); return false; } Leaf.request({ url: $('gld_account_company_assigned_batch_tmp_control_link').getUrl(), para: selectedRecords, success: function() { winOpen_batchAssignCompany(); }, scope: this }); } function winOpen_batchAssignCompany() { new Leaf.Window({ id: 'gld_account_company_window', url: $('gld_account_company_assigned_batch_all_link').getUrl(), params: { application_code: 'FND2140', account_set_id: '${/parameter/@account_set_id}' }, title: '${l:GLD_ACCOUNTS.SUBJECTS_DEFINED_APPOINT COMPANY}', height: 480, width: 530 }); } function accountDetailDs_grid_add() { $('accountDetailDs_grid').showEditorByRecord($('accountDetailDs').create()); } function accountDetailDs_grid_clear() { $('accountDetailDs_grid').clear(); } function accountDetailDs_grid_submit() { var result_ds = $('accountDetailDs'); if (result_ds.validate()) { result_ds.submit(); } } function accountDetailScreen_close() { $('gld_accounts').close(); } function editorFunction_accountDetailDs_grid(record, name) { if (record.isNew) { if (name == 'account_code') { return 'accountDetailDs_grid_editor_tf_upper'; } if (name == 'account_type_display') { return 'accountDetailDs_grid_editor_comb'; } if (name == 'summary_flag') { return 'accountDetailDs_grid_editor_check'; } } return ''; } function viewTree() { var account_set_id = '${/parameter/@account_set_id}'; new Leaf.Window({ id: 'tree_window_a', url: $('gld_account_hierarchy_tree_link_a').getUrl(), params: { account_set_id: '${/parameter/@account_set_id}' }, title: '${l:FND_COMPANY_HIERARCHY.VIEW_HIERARCHY}', height: 570, width: 550 }); } function accountDetailDs_update(ds, record, name, value, oldvalue) { if (name == 'account_type') { if (record.get('account_type') == 'A' || record.get('account_type') == 'C') { record.set('ref_v01', 'Y'); record.set('ref_v01_desc', '是'); } else if (record.get('account_type') == 'O' || record.get('account_type') == 'L') { record.set('ref_v01', 'N'); record.set('ref_v01_desc', '否'); }else { record.set('ref_v01', ''); record.set('ref_v01_desc', ''); } } } ]]></script> <a:dataSets> <a:dataSet id="ref_v01_ds" lookupCode="YES_NO"/> <a:dataSet id="account_type_ds" lookupCode="ACCOUNT_TYPE"/> <a:dataSet id="accountDetail_headDs" loadData="true" model="gld.gld_account_sets"> <a:fields> <a:field name="account_set_code" readOnly="true"/> <a:field name="account_set_name" readOnly="true"/> <a:field name="coa_structure_code" readOnly="true"/> <a:field name="description" readOnly="true"/> <a:field name="structure_format" readOnly="true"/> <a:field name="account_type_display" displayField="code_value_name" options="account_type_ds" returnField="account_type" valueField="code_value"/> </a:fields> </a:dataSet> <!-- 是否汇总 --> <a:dataSet id="summary_flag_options_ds" lookupCode="SUMMARY_FLAG_OPTIONS"/> <a:dataSet id="para_accountDetailDs" model="gld.FND2140.gld_accounts"> <a:fields> <a:field name="summary_flag_desc" displayField="code_value_name" options="summary_flag_options_ds" returnField="summary_flag" valueField="code_value"/> <a:field name="account_type_display" displayField="code_value_name" options="account_type_ds" returnField="account_type" valueField="code_value"/> </a:fields> </a:dataSet> <a:dataSet id="accountDetailDs" autoPageSize="true" autoQuery="true" fetchAll="false" model="gld.FND2140.gld_accounts" notification="有数据没有保存" queryDataSet="para_accountDetailDs" queryUrl="${/request/@context_path}/autocrud/gld.FND2140.gld_accounts/query?ORDER_FIELD=account_code&account_set_id=${/parameter/@account_set_id}" selectable="true" submitUrl="${/request/@context_path}/autocrud/gld.FND2140.gld_accounts_save_update/batch_update"> <a:fields> <a:field name="account_set_id" defaultValue="${/parameter/@account_set_id}"/> <a:field name="account_code" required="true"/> <a:field name="account_description" required="true"/> <a:field name="summary_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/> <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/> <a:field name="account_type_display" displayField="code_value_name" options="account_type_ds" required="true" returnField="account_type" valueField="code_value"/> <a:field name="ref_v01" required="true"/> <a:field name="ref_v01_desc" displayField="code_value_name" options="ref_v01_ds" required="true" returnField="ref_v01" valueField="code_value"/> </a:fields> <a:events> <a:event name="update" handler="accountDetailDs_update"/> </a:events> </a:dataSet> </a:dataSets> <a:screenBody> <a:screenTopToolbar> <a:gridButton click="accountDetailScreen_close" text="HLS.CLOSE"/> <a:gridButton click="accountDetailDs_grid_add" text="HLS.NEW"/> <a:gridButton click="accountDetailDs_grid_clear" text="HLS.CLEAR"/> <a:gridButton click="accountDetailDs_grid_submit" text="HLS.SAVE"/> <a:gridButton click="accountDetailDs_query" text="HLS.QUERY"/> <a:gridButton click="batchAssignCompany" text="GLD_ACCOUNTS.BATCH_ASSIGN_COMPANY"/> <a:gridButton click="viewTree" text="FND_COMPANY_HIERARCHY.VIEW_HIERARCHY"/> </a:screenTopToolbar> <a:form column="4" labelWidth="120" title="HLS.QUERY_TITLE"> <a:textField name="account_set_code" bindTarget="accountDetail_headDs"/> <a:textField name="account_set_name" bindTarget="accountDetail_headDs"/> <a:textField name="structure_format" bindTarget="accountDetail_headDs" prompt="GLD_COA_STRUCTURE.STRUCTURE_FORMAT"/> <a:textField name="coa_structure_code" bindTarget="accountDetail_headDs"/> <!-- <a:textField name="description" bindTarget="accountDetail_headDs"/> --> <a:comboBox name="account_type_display" bindTarget="para_accountDetailDs" prompt="GLD_ACCOUNTS.ACCOUNT_TYPE"/> <a:textField name="account_code" bindTarget="para_accountDetailDs" prompt="GLD_ACCOUNTS.ACCOUNT_CODE" typeCase="upper"> <a:events> <a:event name="enterdown" handler="accountDetailDs_query"/> </a:events> </a:textField> <a:textField name="account_description" bindTarget="para_accountDetailDs" prompt="GLD_ACCOUNT.ACC_DESC"> <a:events> <a:event name="enterdown" handler="accountDetailDs_query"/> </a:events> </a:textField> <a:comboBox name="summary_flag_desc" bindTarget="para_accountDetailDs" prompt="HLS.SUMMARY_FLAG"/> </a:form> <a:grid id="accountDetailDs_grid" bindTarget="accountDetailDs" marginHeight="200" marginWidth="30" navBar="true"> <a:columns> <a:column name="account_code" align="left" editorFunction="editorFunction_accountDetailDs_grid" sortable="true" width="120"/> <!-- <a:column name="account_code" align="left" editor="accountDetailDs_grid_editor_tf" sortable="true" width="120"/> --> <a:column name="account_description" editor="accountDetailDs_grid_editor_tf" width="300"/> <a:column name="account_type_display" align="center" editorFunction="editorFunction_accountDetailDs_grid" width="100"/> <a:column name="ref_v01_desc" align="center" editor="accountDetailDs_grid_editor_comb" prompt="借增贷减"/> <a:column name="ref_v02" editor="accountDetailDs_grid_editor_tf" prompt="子账标识" width="80"/> <a:column name="ref_v03" editor="accountDetailDs_grid_editor_tf" prompt="子账类型" width="80"/> <a:column name="enabled_flag" editor="accountDetailDs_grid_editor_check" width="80"/> <a:column name="summary_flag" align="center" editorFunction="editorFunction_accountDetailDs_grid" width="80"/> <a:column name="company_assign" align="center" prompt="GLD_ACCOUNTS.APPOINT_COMPANY" renderer="render_accountDetailDs_grid" width="70"/> <a:column name="sub_account" align="center" prompt="GLD_ACCOUNTS.SUB_ACCOUNT" renderer="render_accountDetailDs_grid" width="70"/> </a:columns> <a:editors> <a:textField id="accountDetailDs_grid_editor_tf_upper" typeCase="upper"/> <a:textField id="accountDetailDs_grid_editor_tf"/> <a:comboBox id="accountDetailDs_grid_editor_comb"/> <a:checkBox id="accountDetailDs_grid_editor_check"/> </a:editors> </a:grid> </a:screenBody> </a:view> </a:screen>