zj_sys_notify_template.lview 7.19 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
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="pageLink_template_maintain" url="${/request/@context_path}/modules/zjwfl/ZJWFL1090/zj_sys_notify_template_update.lview"/>
        <a:link id="pageLink_person_define" url="${/request/@context_path}/modules/zjwfl/ZJWFL1090/zj_sys_notify_template_ln.lview"/>
        <script type="text/javascript"><![CDATA[
        
            function query_notifyDs(){
                $('notifyDs').query();
            }
            
            function refresh_notifyDs(){
            	var ds = $('notifyDs');
            	ds.query(ds.currentPage);
            }
            
            function template_maintain(notify_template_id,notify_type)
            {
                var win = new Leaf.Window({
                    id : 'zj_sys_notify_template_update', 
                    url:$('pageLink_template_maintain').getUrl(),
                    params : {
                    	notify_template_id : notify_template_id,
                    	notify_type : notify_type,
                    	usage_type : 'WFL'
                    },
                    title : '模板维护',
                    height : 550,
                    width :1000
                });
                
                win.on('close',function (){
                	refresh_notifyDs();
                });
            }
            
            function person_define(notify_template_id)
            {
                new Leaf.Window({
                    id : 'zj_sys_notify_template_ln', 
                    url:$('pageLink_person_define').getUrl(),
                    params : {
                    	notify_template_id : notify_template_id
                    },
                    title : '通知人',
                    height : 450,
                    width :700
                });
            }
            
            
            function render_notifyDs_grid(value,record,name)
            {
                if(!record.isNew)
                {
                    if(name=='template_maintain')
	                {
	                    return '<a href="javascript:template_maintain(' + record.get('notify_template_id') + ',\'' + record.get('notify_type') + '\')">' + '编辑' + '</a>';
	                }
	                else if(name=='person_define')
	                {
	                    if(Ext.isEmpty(record.get('workflow_type_code')))
	                    {
	                        return '<a href="javascript:person_define(' + record.get('notify_template_id') + ')">' + '通知人' + '</a>';
	                    }
	                    return '';
	                }
                }
                return '';
            }
                
            function editorFun_notifyDs_grid(record,name)
            {
                if(record.isNew)
                {
                    if(name=='workflow_type_code')
                	{
                    	return 'notifyDs_grid_lov';
	                }
	                else if(name=='notify_template_code')
	                {
	                    return 'notifyDs_grid_tf_upper';
	                }
	                return '';
                }
                return '';
            }
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="notifyTypeDs" lookupCode="ZJ_WFL_NOTIFY_TYPE"/>
            <a:dataSet id="para_notifyDs" autoCreate="true" model="zjwfl.ZJWFL1090.zj_sys_notify_template">
                <a:fields>
                    <a:field name="usage_type" defaultValue="WFL"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="notifyDs" autoPageSize="true" autoQuery="true" fetchAll="false" model="zjwfl.ZJWFL1090.zj_sys_notify_template" queryDataSet="para_notifyDs" selectable="true">
                <a:fields>
                    <a:field name="notify_template_code" required="true"/>
                    <a:field name="notify_type_desc" displayField="code_value_name" options="notifyTypeDs" required="true" returnField="notify_type" valueField="code_value"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="workflow_type_code" lovGridHeight="300" lovHeight="450" lovLabelWidth="100" lovService="zjwfl.zj_wfl_workflow_type_lov" lovWidth="550" required="true" title="工作流类型">
                        <a:mapping>
                            <a:map from="workflow_type_id" to="workflow_type_id"/>
                            <a:map from="workflow_type_code" to="workflow_type_code"/>
                            <a:map from="workflow_type_desc" to="workflow_type_desc"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form column="2" labelWidth="100" marginWidth="30" title="SYS_PROMPT.QUERY_TITLE">
                <a:textField name="notify_template_code" bindTarget="para_notifyDs" typeCase="upper" width="200">
                    <a:events>
                        <a:event name="enterdown" handler="query_notifyDs"/>
                    </a:events>
                </a:textField>
                <a:textField name="description" bindTarget="para_notifyDs" width="200">
                    <a:events>
                        <a:event name="enterdown" handler="query_notifyDs"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:hBox>
                <a:button click="query_notifyDs" text="HAP_QUERY"/>
            </a:hBox>
            <a:grid id="notifyDs_grid" bindTarget="notifyDs" marginHeight="180" marginWidth="30" navBar="true">
                <a:toolBar>
                    <a:button type="add"/>
                    <a:button type="delete"/>
                    <a:button type="save"/>
                </a:toolBar>
                <a:columns>
                    <a:column name="workflow_type_code" autoAdjust="false" editorFunction="editorFun_notifyDs_grid" prompt="工作流类型" showTitle="true" width="200"/>
                    <a:column name="workflow_type_desc" autoAdjust="false" prompt="工作流描述" showTitle="true" width="200"/>
                    <a:column name="notify_template_code" autoAdjust="false" editorFunction="editorFun_notifyDs_grid" showTitle="true" width="250"/>
                    <a:column name="description" autoAdjust="false" editor="notifyDs_grid_tf" showTitle="true" width="350"/>
                    <a:column name="notify_type_desc" editor="notifyDs_grid_comb" width="80"/>
                    <a:column name="enabled_flag" editor="notifyDs_grid_check" width="50"/>
                    <a:column name="template_maintain" align="center" renderer="render_notifyDs_grid" width="60"/>
                </a:columns>
                <a:editors>
                    <a:textField id="notifyDs_grid_tf_upper" maxLength="30" typeCase="upper"/>
                    <a:textField id="notifyDs_grid_tf"/>
                    <a:lov id="notifyDs_grid_lov"/>
                    <a:checkBox id="notifyDs_grid_check"/>
                    <a:comboBox id="notifyDs_grid_comb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>