sch_task_maintain.lview 6.77 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: taskMaintainPage
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="pageLink_taskPage_parameter_maintain" url="${/request/@context_path}/modules/sch/SCH102/sch_task_parameter_maintain.lview"/>
        <a:link id="pageLink_taskPage_authorize_assign" url="${/request/@context_path}/modules/sch/SCH102/sch_task_authorize_assign.lview"/>
        <script type="text/javascript"><![CDATA[
        
        function taskPage_query() {
            $('taskPage_taskDs').query();
        }
        
        function taskPage_add() {
            $('taskPage_taskDs_grid').showEditorByRecord($('taskPage_taskDs').create());
        }
        
        function taskPage_remove() {
            $('taskPage_taskDs_grid').remove();
        }
        
        function taskPage_save() {
            var ds = $('taskPage_taskDs');
            if (ds.validate()) {
                ds.submit();
            }
        }
        
        function editFunction_taskPage_taskDs_grid(record,name)
        {
            if(!record.isNew){
            	return '';
            }
            
            if(name=='procedure_name')
            {
    	        return 'taskPage_taskDs_grid_tf';
            }
            else if(name=='task_code')
            {
                return 'taskPage_taskDs_grid_tf_upper';
            }
            else if(name=='programe_type_desc')
            {
                return 'taskPage_taskDs_grid_comb';
            }
            
            return '';
    	    
        }
        
        function winOpen_taskPage_parameter_maintain(task_code)
        {
            new Leaf.Window({
                id: 'sch_task_parameter_maintain',
                url: $('pageLink_taskPage_parameter_maintain').getUrl(),
                params:{
                	task_code:task_code
                },
                title: '${l:SCH102.WIN_TITLE.PARAMETER_MAINTAIN}',
                width:1100,
                height:550
            });
        }
        
        function winOpen_taskPage_authorize_assign(task_code)
        {
            new Leaf.Window({
                id: 'sch_task_authorize_assign',
                url: $('pageLink_taskPage_authorize_assign').getUrl(),
                params:{
                	task_code:task_code
                },
                title: '${l:SCH102.WIN_TITLE.AUTHORIZE_ASSIGN}',
                width:720,
                height:400
            });
        }
        
        function render_taskPage_taskDs_grid(value, record, name)
        {
            if(!record.isNew){
                if(name=='parameter_maintain')
                {
	            	return '<a href="javascript:winOpen_taskPage_parameter_maintain(\'' + record.get('task_code') + '\');">' + '${l:SCH102.LINK.PARAMETER_MAINTAIN}' + '</a>';
                }
                if(name=='authorize_assign')
                {
                    return '<a href="javascript:winOpen_taskPage_authorize_assign(\'' + record.get('task_code') + '\');">' + '${l:SCH102.LINK.AUTHORIZE_ASSIGN}' + '</a>';
                }
                return '';
	            
            }
            return '';
        }
        
        
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="taskPage_programeTypeDs" lookupCode="SCH_TASK_PROGRAME_TYPE"/>
            <a:dataSet id="taskPage_taskParaDs" autoCreate="true" model="sch.SCH102.sch_task">
                <a:fields>
                    <a:field name="task_code"/>
                    <a:field name="task_name"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="taskPage_taskDs" autoPageSize="true" autoQuery="true" model="sch.SCH102.sch_task" queryDataSet="taskPage_taskParaDs" selectable="true">
                <a:fields>
                    <a:field name="task_code" required="true"/>
                    <a:field name="task_name" required="true"/>
                    <a:field name="procedure_name" required="true"/>
                    <a:field name="programe_type_desc" displayField="code_value_name" options="taskPage_programeTypeDs" prompt="SCH102.SCH_TASK.PROGRAME_TYPE" required="true" returnField="programe_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="taskPage_query" text="HLS.QUERY"/>
                <a:gridButton click="taskPage_add" text="HLS.NEW"/>
                <a:gridButton click="taskPage_remove" text="HLS.REMOVE"/>
                <a:gridButton click="taskPage_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" title="HAP_QUERY_TITLE">
                <a:textField name="task_code" bindTarget="taskPage_taskParaDs" typeCase="upper"/>
                <a:textField name="task_name" bindTarget="taskPage_taskParaDs"/>
            </a:form>
            <a:grid id="taskPage_taskDs_grid" bindTarget="taskPage_taskDs" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="task_code" autoAdjust="false" editorFunction="editFunction_taskPage_taskDs_grid" showTitle="true" width="250"/>
                    <a:column name="task_name" autoAdjust="false" editor="taskPage_taskDs_grid_tf" showTitle="true" width="200"/>
                    <a:column name="description" autoAdjust="false" editor="taskPage_taskDs_grid_tf" showTitle="true" width="250"/>
                    <a:column name="programe_type_desc" editorFunction="editFunction_taskPage_taskDs_grid" width="60"/>
                    <a:column name="procedure_name" autoAdjust="false" editorFunction="editFunction_taskPage_taskDs_grid" showTitle="true" width="250"/>
                    <a:column name="enabled_flag" editor="taskPage_taskDs_grid_check" width="60"/>
                    <a:column name="parameter_maintain" align="center" prompt="SCH102.WIN_TITLE.PARAMETER_MAINTAIN" renderer="render_taskPage_taskDs_grid" width="60"/>
                    <a:column name="authorize_assign" align="center" prompt="SCH102.WIN_TITLE.AUTHORIZE_ASSIGN" renderer="render_taskPage_taskDs_grid" width="60"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="taskPage_taskDs_grid_check"/>
                    <a:textField id="taskPage_taskDs_grid_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="taskPage_taskDs_grid_tf"/>
                    <a:comboBox id="taskPage_taskDs_grid_comb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>