exp_employee_s_query.lview 10.1 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 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: jane.wang2439 $
    $Date: 2011/03/03 16:05:39 $
    $Revision: 1.1 $
    $Purpose: 员工查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <div/>
        <script type="text/javascript"><![CDATA[

            function queryEmployeeType() {
                $('exp_employees_query_result_ds1').query();
                // $('exp_employees_query_result_ds2').query();
            }
            
            function expenseCodeEdit(record, name) {
                if (record.isNew) {
                    return 'common_tf';
                }
                return '';
            }
            
            function onCompanyCommit(lov, r1, r2) {
                var company_id = r1.get('company_id');
                if (!company_id) {
                    Leaf.showMessage("${l:PROMPT}", "${l:CHOOSE_COMPANY_FIRST}");
                } else {
                    var unit = r1.getField('unit_desc');
                    unit.setLovPara('company_id', company_id);
                }
            }
            
            function onUnitCommit(lov, r1, r2) {
                var unit_id = r1.get('unit_id');
                if (!unit_id) {
                    Leaf.showMessage("${l:PROMPT}", "${l:CHOOSE_UNIT_FIRST}");
                } else {
                    var position = r1.getField('position_desc');
                    position.setLovPara('unit_id', unit_id);
                }
            }
            
            function selectChange(ds,rownum, record) {
                // 
                var employee_id = record.get('employee_id');
                var ds = $('exp_employees_query_result_ds2');
                ds.setQueryParameter('employee_id', employee_id);
                ds.query();
            }
            
            function reset() {
                $('exp_employees_query_ds').reset();
            }
            
           function exp_3050_next(){
                 history.go(1);
            }
            function exp_3050_back(){
                history.go(-1);
            }
            function exp_3050_quit(){
                location.href = $('sys_service_welcome_link').getUrl();
                parent.shMenu('show');
            }
            
            function EXP3050_onEmpHeadQueryUpdate(dataSet, record, name, value, oldValue) {
                if (name == 'company_desc') {
                    if (value == '') {
                        record.set('unit_desc', '');
                        record.set('position_desc', '');
            
                        record.set('unit_id', '');
                        record.set('position_id', '');
            
                        record.set('unit_code', '');
                        record.set('position_code', '');
            
                        record.getField('unit_desc').setReadOnly(true);
                        record.getField('position_desc').setReadOnly(true);
                    } else {
                        record.getField('unit_desc').setReadOnly(false);
                    }
                } else if (name == 'unit_desc') {
                    if (value == '') {
                        record.set('position_desc', '');
                        record.set('position_id', '');
                        record.set('position_code', '');
            
                        record.getField('position_desc').setReadOnly(true);
                    } else {
                        record.getField('position_desc').setReadOnly(false);
                    }
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="exp_employees_query_ds" autoCreate="true" model="exp.EXP3050.exp_employee_s_query">
                <a:fields>
                    <a:field name="company_desc" lovGridHeight="340" lovHeight="460" lovService="exp.EXP3050.exp_employee_s_query_company_lov" lovWidth="540" title="FND_COMPANIES.QUERY">
                        <a:mapping>
                            <a:map from="company_id" to="company_id"/>
                            <a:map from="company_code" to="company_code"/>
                            <a:map from="comp_desc" to="company_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="unit_desc" lovGridHeight="340" lovHeight="460" lovService="exp.EXP3050.exp_employee_s_query_unit_lov" lovWidth="540" readOnly="true" title="BGT_BUDGET_ITEM_MAPPING.ORG_UNIT_CODE_SEARCH">
                        <a:mapping>
                            <a:map from="unit_id" to="unit_id"/>
                            <a:map from="unit_code" to="unit_code"/>
                            <a:map from="unit_desc" to="unit_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="position_desc" lovGridHeight="340" lovHeight="460" lovService="exp.EXP3050.exp_employee_s_query_position_lov" lovWidth="540" readOnly="true" title="EXP_ORG_POSITION.QUERY">
                        <a:mapping>
                            <a:map from="position_id" to="position_id"/>
                            <a:map from="position_code" to="position_code"/>
                            <a:map from="pos_desc" to="position_desc"/>
                        </a:mapping>
                    </a:field>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="EXP3050_onEmpHeadQueryUpdate"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="exp_employees_query_result_ds1" autoQuery="true" model="exp.EXP3050.exp_employee_s_query" queryDataSet="exp_employees_query_ds"/>
            <a:dataSet id="exp_employees_query_result_ds2" bindName="head" bindTarget="exp_employees_query_result_ds1" fetchAll="true" queryUrl="${/request/@context_path}/autocrud/exp.EXP3050.exp_employee_s_query_info/query">
                <a:fields>
                    <a:field name="primary_position_flag" checkedValue="Y" uncheckedValue="N"/>
                    <a:field name="enabled_flag" checkedValue="Y" uncheckedValue="N"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <!-- <a:gridButton click="exp_3050_back" text="HLS.BACK"/>
                <a:gridButton click="exp_3050_next" text="HLS.FORWARD"/>
                <a:gridButton click="exp_3050_quit" text="HLS.EXIT"/> -->
                <a:gridButton click="queryEmployeeType" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="5" title="HAP_QUERY_TITLE">
                <a:textField name="employee_code" bindTarget="exp_employees_query_ds" prompt="EXP_EMPLOYEES_VL.EMPLOYEE_CODE" typeCase="upper" width="150">
                    <a:events>
                        <a:event name="enterdown" handler="queryEmployeeType"/>
                    </a:events>
                </a:textField>
                <a:textField name="name" bindTarget="exp_employees_query_ds" prompt="EXP_EMPLOYEES_VL.DESC" width="150">
                    <a:events>
                        <a:event name="enterdown" handler="queryEmployeeType"/>
                    </a:events>
                </a:textField>
                <a:lov name="company_desc" bindTarget="exp_employees_query_ds" prompt="FND_COMPANIES.COMPANY" width="150">
                    <a:events>
                        <a:event name="commit" handler="onCompanyCommit"/>
                    </a:events>
                </a:lov>
                <a:lov name="unit_desc" bindTarget="exp_employees_query_ds" prompt="EXP_ORG_UNIT.UNIT" width="150">
                    <a:events>
                        <a:event name="commit" handler="onUnitCommit"/>
                    </a:events>
                </a:lov>
                <a:lov name="position_desc" bindTarget="exp_employees_query_ds" prompt="EXP_ORG_POSITION.POSITIONS" width="150"/>
            </a:form>
            <a:grid id="exp_3050_grid" bindTarget="exp_employees_query_result_ds1" height="280" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="employee_code" align="left" sortable="true" width="250"/>
                    <a:column name="name" sortable="true" width="350"/>
                </a:columns>
                <a:events>
                    <a:event name="rowclick" handler="selectChange"/>
                </a:events>
            </a:grid>
            <a:grid autoFocus="false" bindTarget="exp_employees_query_result_ds2" height="150" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="company_code" align="left" prompt="FND_COMPANIES.COMPANY_CODE" sortable="true" width="80"/>
                    <a:column name="company_name" align="left" prompt="FND_COMPANIES.COMPANY_NAME" width="120"/>
                    <a:column name="unit_code" align="left" prompt="EXP_ORG_UNIT.UNIT_CODE" sortable="false" width="80"/>
                    <a:column name="unit_name" align="left" prompt="EXP_ORG_UNIT.DESC" sortable="false" width="120"/>
                    <a:column name="position_code" align="left" prompt="EXP_ORG_POSITION.POSITION_CODE" width="80"/>
                    <a:column name="position_name" align="left" prompt="EXP_EMPLOYEE_ASSIGN.POSITION_NAME" width="120"/>
                    <a:column name="job_code" align="left" prompt="EXP_EMPLOYEE_ASSIGN.JOB_CODE" width="80"/>
                    <a:column name="job_name" align="left" prompt="EXP_EMPLOYEE_ASSIGN.JOB_NAME" width="120"/>
                    <a:column name="levels_code" align="left" prompt="EXP_EMPLOYEE_ASSIGN.LEVELS_CODE" width="80"/>
                    <a:column name="levels_name" align="left" prompt="EXP_EMPLOYEE_ASSIGN.LEVELS_DESC" width="120"/>
                    <a:column name="primary_position_flag" align="left" prompt="EXP_EMPLOYEE_ASSIGN.PRIMARY_POSITION_FLAG" width="50"/>
                    <a:column name="enabled_flag" align="left" prompt="EXP_COMPANY_EMPLOYEES_V.EMPLOYEE_ENABLED_FLAG" width="50"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>