fnd_request_program_insert.lview 8.59 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:p="uncertain.proc" trace="true">
    <a:init-procedure>
        <a:model-query autoCount="true" defaultWhereClause="program_id=${/parameter/@program_id}" fetchAll="true" model="fnd.FND5020.fnd_request_program" rootPath="fnd_request_program_list"/>
    </a:init-procedure>
    <a:view>
        <a:link id="fnd_request_program_parameter_edit_link" url="${/request/@context_path}/modules/fnd/FND5020/fnd_request_program_parameter_resource.lview"/>
        <script type="text/javascript"><![CDATA[
        
            function saveFunction(){
                var Ds=$('fnd_request_program_insert_ds');
                var gridDs=$('fnd_program_paramter_ds');
                if (Ds.validate()&&gridDs.validate()){
                    Ds.submit();
                }
            }

            function closeWindow(){
                $('fnd_request_program_create_window').close();
            }
            
            
            
            function parameterRenderer(value,record, name){
                if (value){
                    var window_id="fnd_request_program_resource_window";
                    var path=$('fnd_request_program_parameter_edit_link').getUrl()+'?parameter_id='+value;
                    return "<a href=\"javascript:editParameter('"+window_id+"','"+path+"')\">${l:HAP_EDIT}</a>";
                }else{
                    return '';
                }
            }
           
           function editParameter(window_id,path) {
                new Leaf.Window({
                    id: window_id,
                    url: path,
                    title: '数据来源',
                     height:400,
                     width:500
            
                });
            }
            
         function deleteLines(){
        		$('fnd_request_program_insert_ds').getAt(0).set('_isdelete','delete');
        		var rs = $('fnd_program_paramter_ds').getSelected();
        		for(var i = 0 ; i < rs.length ; i ++){
        			rs[i].set('__delete','true');
        		}
        		
        		$('fnd_request_program_insert_ds').submit();
        	}
         function showsuccessmessage(ds,res){
               Leaf.showMessage('${l:PROMPT}','${l:BGT_STRUCTURE.OPERATE_SUCCESS}');
               $('fnd_program_paramter_ds').query();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="parameter_type_ds" lookupCode="REQUEST_PARAMETER_TYPE"/>
            <a:dataSet id="parameter_edit_type_ds" lookupCode="REQUEST_PARAMETER_EDIT_TYPE"/>
            <a:dataSet id="fnd_request_program_insert_ds" submitUrl="${/request/@context_path}/modules/fnd/FND5020/fnd_request_parameter.lsc">
                <a:datas dataSource="/model/fnd_request_program_list"/>
                <a:events>
                    <a:event name="submitsuccess" handler="showsuccessmessage"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="fnd_program_paramter_ds" autoQuery="true" bindName="programs" bindTarget="fnd_request_program_insert_ds" queryUrl="${/request/@context_path}/autocrud/fnd.FND5020.fnd_program_parameters/query?program_id=${/parameter/@program_id}" selectable="true">
                <a:fields>
                    <a:field name="required_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="program_id" defaultValue="${/parameter/@program_id}"/>
                    <a:field name="parameter_name" required="true"/>
                    <a:field name="seq" required="true"/>
                    <a:field name="description" required="true"/>
                    <a:field name="parameter_type_desc" displayField="code_value_name" options="parameter_type_ds" required="true" returnField="parameter_type" valueField="code_value"/>
                    <a:field name="edit_type_desc" displayField="code_value_name" options="parameter_edit_type_ds" required="true" returnField="edit_type" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:tabPanel height="500" width="570">
                <a:tabs>
                    <a:tab prompt="可执行明细定义" width="110">
                        <a:screenBody>
                            <a:fieldSet column="1" labelWidth="100" title="基本信息" width="550">
                                <a:hBox>
                                    <a:label name="program_code" bindTarget="fnd_request_program_insert_ds" prompt="编码"/>
                                    <a:label name="program_name" bindTarget="fnd_request_program_insert_ds" prompt="名称"/>
                                </a:hBox>
                                <a:hBox>
                                    <a:label name="request_code" bindTarget="fnd_request_program_insert_ds" prompt="请求编码"/>
                                    <a:label name="request_name" bindTarget="fnd_request_program_insert_ds" prompt="请求名称"/>
                                </a:hBox>
                                <a:hBox>
                                    <a:label name="cycle_flag_desc" bindTarget="fnd_request_program_insert_ds" prompt="是否周期性"/>
                                    <a:label name="enable_desc" bindTarget="fnd_request_program_insert_ds" prompt="状态"/>
                                </a:hBox>
                                <a:hBox>
                                    <a:textArea name="url" bindTarget="fnd_request_program_insert_ds" height="25" prompt="链接页面" width="450"/>
                                </a:hBox>
                                <a:hBox>
                                    <a:textArea name="what" bindTarget="fnd_request_program_insert_ds" height="260" prompt="执行方法" width="450"/>
                                </a:hBox>
                            </a:fieldSet>
                        </a:screenBody>
                    </a:tab>
                    <a:tab prompt="参数定义" width="110">
                        <a:screenBody>
                            <a:grid id="edit_grid" bindTarget="fnd_program_paramter_ds" height="350" navBar="true" width="550">
                                <a:toolBar>
                                    <a:button type="add"/>
                                    <a:button click="deleteLines" icon="${/request/@context_path}/images/remove.gif" text="PROMPT.DELETE"/>
                                    <a:button type="clear"/>
                                </a:toolBar>
                                <a:columns>
                                    <a:column name="seq" editor="seq_nm" prompt="序号" width="45"/>
                                    <a:column name="parameter_name" editor="edit_grid_tf" prompt="参数名称" width="100"/>
                                    <a:column name="description" editor="edit_grid_tf" prompt="参数描述" width="120"/>
                                    <a:column name="parameter_type_desc" editor="edit_grid_comboBox" prompt="参数类型" width="65"/>
                                    <a:column name="edit_type_desc" editor="edit_grid_comboBox" prompt="编辑类型" width="65"/>
                                    <a:column name="required_flag" editor="edit_grid_checkBox" prompt="是否必须" width="55"/>
                                    <a:column name="parameter_id" align="center" prompt="参数来源" renderer="parameterRenderer" width="65"/>
                                </a:columns>
                                <a:editors>
                                    <a:numberField id="seq_nm" allowDecimals="false" allowNegative="false"/>
                                    <a:textField id="edit_grid_tf"/>
                                    <a:checkBox id="edit_grid_checkBox"/>
                                    <a:comboBox id="edit_grid_comboBox"/>
                                </a:editors>
                            </a:grid>
                            <table>
                                <tr>
                                    <td style="color:#FF0000;"><![CDATA[*起始时间为空时默认为系统时间]]></td>
                                </tr>
                            </table>
                        </a:screenBody>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
        </a:screenBody>
        <div class="win-toolbar" style="width:580px;height:40px;">
            <a:hBox style="float:right;margin-right:10px;margin-top:5px;">
                <a:button click="saveFunction" text="HAP_SAVE"/>
                <a:button click="closeWindow" text="HAP_CLOSE"/>
            </a:hBox>
        </div>
    </a:view>
</a:screen>