hls_auto_allocation_person.lview 7.32 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LPC  
    $Date: 
    $Revision: 1.0  
    $Purpose: 成员指派
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:view>
        <script type="text/javascript"><![CDATA[
            function allocationPersonDs_query() {
                $('allocationPersonDs').query();
            }
            
            function allocationPersonDs_grid_add() {
                $('allocationPersonDs_grid').showEditorByRecord($('allocationPersonDs').create());
            }
            
            function allocationPersonDs_grid_clear() {
                $('allocationPersonDs_grid').clear();
            }
            
            function allocationPersonDs_grid_submit() {

                var result_ds = $('allocationPersonDs');
                if (result_ds.validate()) {
                    var result_record = result_ds.getAll();
                    var next_time_count = 0;
                    for (var i = 0;i < result_record.length;i++) {
                        var next_time_flag = result_record[i].get('next_time_flag');
                        var enable_flag = result_record[i].get('enable_flag');
                        if (enable_flag == 'Y') {
                            if (next_time_flag == 'Y') {
                                next_time_count = next_time_count + 1;
                            }
                        } else if(enable_flag == 'N' && next_time_flag == 'Y'){
                            Leaf.showMessage('提示', '勾选下次分配标志的组员需要启用!');
                            return;
                        }
                    }
                    if (next_time_count > 1) {
                        Leaf.showMessage('提示', '下次分配标志只能勾选一个!');
                        return;
                    } else {
                        result_ds.submit();
                    }
            
                }
            }
            
            function allocationPersonScreen_close() {
                $('allocation_group').close();
            }
            
            function allocationPersonDs_update(ds, record, name, value, oldvalue) {
                if (name == 'next_time_flag') {
                    if (record.get('enable_flag') == 'N') {
                        if (value == 'Y') {
                            Leaf.showMessage('提示', '请先启用该组员!');
                            return;
                        }
                    }
                }
            }
            // function editorFunction_allocationPersonDs_grid(record, name) {
            // if (record.isNew) {
            // if (name == 'seq') {
            // return 'allocationPersonDs_grid_editor_tf_upper';
            // }
            // }
            // return '';
            // }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="allocationPerson_headDs" autoQuery="true" model="zjwfl.ZJWFL1111.hls_auto_allocation_group" queryUrl="${/request/@context_path}/autocrud/zjwfl.ZJWFL1111.hls_auto_allocation_group/query?group_id=${/parameter/@group_id}">
                <a:fields>
                    <a:field name="group_code" readOnly="true"/>
                    <a:field name="group_name" readOnly="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="para_allocationPersonDs">
                <a:fields>
                    <a:field name="user_name" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="HLS.USER_NAME" title="AUT106.CHOOSE_USER">
                        <a:mapping>
                            <a:map from="description" to="user_name"/>
                            <a:map from="user_id" to="user_id"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="allocationPersonDs" autoPageSize="true" autoQuery="true" fetchAll="false" model="zjwfl.ZJWFL1111.hls_auto_allocation_person" queryDataSet="para_allocationPersonDs" queryUrl="${/request/@context_path}/autocrud/zjwfl.ZJWFL1111.hls_auto_allocation_person/query?group_id=${/parameter/@group_id}" selectable="true">
                <a:fields>
                    <a:field name="group_id" defaultValue="${/parameter/@group_id}"/>
                    <a:field name="seq" required="true"/>
                    <a:field name="user_id"/>
                    <a:field name="user_name" lovGridHeight="300" lovHeight="450" lovService="basic.sys_user_for_lov" lovWidth="500" prompt="HLS.USER_NAME" required="true" title="AUT106.CHOOSE_USER">
                        <a:mapping>
                            <a:map from="description" to="user_name"/>
                            <a:map from="user_id" to="user_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="next_time_flag" checkedValue="Y" defaultValue="N" uncheckedValue="N"/>
                    <a:field name="enable_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="allocationPersonDs_update"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="allocationPersonScreen_close" text="HLS.CLOSE"/>
                <a:gridButton click="allocationPersonDs_grid_add" text="HLS.NEW"/>
                <a:gridButton click="allocationPersonDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="allocationPersonDs_grid_submit" text="HLS.SAVE"/>
                <a:gridButton click="allocationPersonDs_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" title="HLS.QUERY_TITLE">
                <a:textField name="group_code" bindTarget="allocationPerson_headDs" prompt="分组类型"/>
                <a:textField name="group_name" bindTarget="allocationPerson_headDs" prompt="分组名称"/>
                <a:lov name="user_name" bindTarget="para_allocationPersonDs" prompt="组员"/>
            </a:form>
            <a:grid id="allocationPersonDs_grid" bindTarget="allocationPersonDs" marginHeight="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="seq" align="left" editor="allocationPersonDs_grid_editor_tf" prompt="顺序" sortable="true" width="120"/>
                    <a:column name="user_name" editor="allocationPersonDs_grid_editor_lov" prompt="组员" width="300"/>
                    <a:column name="next_time_flag" editor="allocationPersonDs_grid_editor_check" prompt="下次分配标志" width="80"/>
                    <a:column name="enable_flag" editor="allocationPersonDs_grid_editor_check" prompt="启用标志" width="80"/>
                </a:columns>
                <a:editors>
                    <a:textField id="allocationPersonDs_grid_editor_tf_upper" typeCase="upper"/>
                    <a:textField id="allocationPersonDs_grid_editor_tf"/>
                    <a:comboBox id="allocationPersonDs_grid_editor_comb"/>
                    <a:checkBox id="allocationPersonDs_grid_editor_check"/>
                    <a:lov id="allocationPersonDs_grid_editor_lov"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>