<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: ouyangzhaochang2663 $ $Date: 2010/11/15 07:47:05 $ $Revision: 1.2 $ $Purpose: 日历定义-规则 --> <a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true"> <a:init-procedure><![CDATA[ ]]></a:init-procedure> <a:view> <a:link id="hn1060_hn_calendar_rules_req_submit_link" model="hn.HN1060.hn_calendar_rules_req" modelaction="execute"/> <script type="text/javascript"><![CDATA[ function ruleCreatePage_close() { $('${/parameter/@winid}').close(); } function ruleCreateDs_grid_save() { var ds = $('ruleCreateDs'); if (ds.validate()) { ds.submit(); } } function editorFun_ruleCreateDs_grid(record, name) { if (name == 'year') { if (record.get('rule_type') != 'FIXED HOLIDAY') { record.getField('year').setRequired(true); return 'ruleCreateDs_grid_nf'; } else { record.getField('year').setRequired(false); record.set('year', ''); return ''; } } return ''; } function monthValidator(record, name, value) { if (value < 1 || value > 12) { return '${l:FND_CALENDAR_RULES.MONTH_WRONG}'; } return true; } function dayValidator(record, name, value) { if (value < 1 || value > 31) { return '${l:FND_CALENDAR_RULES.DAY_EWRONG}'; } return true; } function ruleCreateDs_grid_add() { $('ruleCreateDs_grid').showEditorByRecord($('ruleCreateDs').create()); } function ruleCreateDs_grid_clear() { $('ruleCreateDs_grid').clear(); } function hn1060_hn_calendar_rules_req_submit_link() { Leaf.request({ url: $('hn1060_hn_calendar_rules_req_submit_link').getUrl(), para: { request_id: '${/parameter/@request_id}' }, success: function(res) { ruleCreatePage_close(); }, failure: function() {}, error: function() {}, scope: this }); } ]]></script> <a:dataSets> <a:dataSet id="rule_type_ds" lookupCode="CALENDAR_RULE_TYPE"/> <a:dataSet id="ruleCreatePage_calendarDs" loadData="true" model="fnd.FND1060.fnd_calendar"> <a:fields> <a:field name="calendar_code" readOnly="true"/> <a:field name="description" readOnly="true"/> <a:field name="start_date" readOnly="true"/> <a:field name="end_date" readOnly="true"/> </a:fields> </a:dataSet> <a:dataSet id="ruleCreateDs" autoPageSize="true" autoQuery="true" model="hn.HN1060.hn_calendar_rules_req_ln" queryUrl="${/request/@context_path}/autocrud/hn.HN1060.hn_calendar_rules_req_ln/query?request_id=${/parameter/@request_id}" selectable="true"> <a:fields> <a:field name="request_id" defaultValue="${/parameter/@request_id}"/> <a:field name="rule_type_display" displayField="code_value_name" options="rule_type_ds" required="true" returnField="rule_type" valueField="code_value"/> <a:field name="year"/> <a:field name="month" required="true" validator="monthValidator"/> <a:field name="day" required="true" validator="dayValidator"/> <a:field name="description" required="true"/> </a:fields> </a:dataSet> </a:dataSets> <a:screenBody> <a:screenTopToolbar> <a:gridButton click="ruleCreatePage_close" text="HLS.CLOSE"/> <a:gridButton click="ruleCreateDs_grid_add" text="HLS.NEW"/> <a:gridButton click="ruleCreateDs_grid_save" text="HLS.SAVE"/> <a:gridButton bind="ruleCreateDs_grid" type="delete"/> <a:gridButton click="hn1060_hn_calendar_rules_req_submit_link" text="提交审批"/> </a:screenTopToolbar> <a:fieldSet column="2" title="FND_CALENDAR_RULES.CALENDAR_RULE_DEFINE"> <a:textField name="calendar_code" bindTarget="ruleCreatePage_calendarDs"/> <a:textField name="description" bindTarget="ruleCreatePage_calendarDs"/> <a:datePicker name="start_date" bindTarget="ruleCreatePage_calendarDs"/> <a:datePicker name="end_date" bindTarget="ruleCreatePage_calendarDs"/> </a:fieldSet> <a:grid id="ruleCreateDs_grid" bindTarget="ruleCreateDs" marginHeight="300" marginWidth="300" navBar="true"> <a:columns> <a:column name="rule_type_display" editor="ruleCreateDs_grid_comb" sortable="true"/> <a:column name="year" align="right" editorFunction="editorFun_ruleCreateDs_grid" sortable="true"/> <a:column name="month" align="right" editor="ruleCreateDs_grid_nf" sortable="true"/> <a:column name="day" align="right" editor="ruleCreateDs_grid_nf" sortable="true"/> <a:column name="description" editor="ruleCreateDs_grid_tf" sortable="true" width="150"/> </a:columns> <a:editors> <a:comboBox id="ruleCreateDs_grid_comb"/> <a:numberField id="ruleCreateDs_grid_nf" allowDecimals="false" allowNegative="false"/> <a:textField id="ruleCreateDs_grid_tf"/> </a:editors> </a:grid> </a:screenBody> </a:view> </a:screen>