fnd_coding_rule_objects.lview 12.6 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 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: peter soong $
    $Date: 2014-07-31 10:09:47 $
    $Revision: 1.0 $
    $Purpose:  编码规则分配
    
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:link id="pageLink_objectScreen_rule_info" url="${/request/@context_path}/modules/fnd/FND1910/fnd_coding_rules.lview"/>
        <a:link id="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
            function fnd_1910_next() {
                history.go(1);
            }
            
            function fnd_1910_back() {
                history.go(-1);
            }
            
            function fnd_1910_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
                parent.shMenu('show');
            }
            
            function objectDs_grid_add() {
                $('objectDs_grid').showEditorByRecord($('objectDs').create());
            }
            
            function objectDs_grid_clear() {
                $('objectDs_grid').clear();
            }
            
            
            
            function objectDs_query() {
                $('objectDs').query();
            }
            
            function resetCodingRuleObject() {
                $('para_objectDs').reset();
            }
            
            function render_objectDs_grid(value, record, name) {
                if (name == 'rule_info') {
                    if (!record.isNew) {
                        return '<a href="javascript:winOpen_rule_info(' + record.get('coding_rule_object_id') + ')">${l:FND1910.LINK.RULE_INFO}</a>';
                    }
                }
            }
            
            function winOpen_rule_info(coding_rule_object_id) {
                new Leaf.Window({
                    id: 'fnd_coding_rules_window',
                    url: $('pageLink_objectScreen_rule_info').getUrl(),
                    params: {
                        coding_rule_object_id: coding_rule_object_id
                    },
                    title: '${l:FND1910.WIN_TITLE.RULE_INFO}',
                    height: 580,
                    width: 750
                });
            }
            
            function editorFunction_objectDs_grid(record, name) {
                if (record.isNew) {
                    if (name == 'document_type_desc') {
                        var document_category = record.get('document_category');
                        if (Ext.isEmpty(document_category)) {
                            return '';
                        } else {
                            record.getField('document_type_desc').setLovPara('document_category', document_category);
                            return 'objectDs_grid_editor_lov';
                        }
            
                    }
                    if (name == 'company_code' || name == 'operation_unit_name') {
                        return 'objectDs_grid_editor_lov';
                    }
                    if (name == 'document_category_desc') {
                        return 'objectDs_grid_editor_comb';
                    }
            
            
                }
                return '';
            
            
            
            }
            
            function priorityEdit(record, name) {
            
                if (record.isNew) {
                    return 'objectDs_grid_editor_nf';
                }
                return '';
            }
            
            function onUpdate_objectDs(ds, record, name, value, oldValue) {
                if (name == 'document_category_desc') {
                    record.set('document_type', '');
                    record.set('document_type_desc', '');
                }
            }
            
            function objectDs_grid_submit() {
                var result_ds = $('objectDs');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            /*  function on_beforetriggerclick(lov) {
             var record = $('hls_ebank_log_query').getCurrentRecord();
             var bp_id = record.get('bp_id');
             record.getField('accnbr').setLovPara('bp_id', bp_id);
             } */
            
            function initLov(value, record, name) {
                var document_category = record.get('document_category');
                record.getField('coding_rule_desc').setLovPara('document_category', document_category);
                return value;
            
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="documentCategoryDs" loadData="true" model="fnd.FND1910.fnd_code_rule_doc_category_v"/>
            <a:dataSet id="para_objectDs" model="fnd.FND1910.fnd_coding_rule_objects_query">
                <a:fields>
                    <a:field name="operation_unit_name" lovGridHeight="300" lovHeight="450" lovLabelWidth="100" lovService="fnd.FND1910.fnd_operation_units_lov?ORDER_FIELD=operation_unit_code" lovWidth="550" title="HLS.OPERATION_UNIT">
                        <a:mapping>
                            <a:map from="operation_unit_id" to="operation_unit_id"/>
                            <a:map from="description" to="operation_unit_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="company_short_name" lovGridHeight="300" lovHeight="450" lovService="fnd.FND1910.fnd_coding_rule_objects_company_lov?ORDER_FIELD=company_code" lovWidth="500" title="HLS.COMPANY_SHORT_NAME">
                        <a:mapping>
                            <a:map from="company_id" to="company_id"/>
                            <a:map from="company_short_name" to="company_short_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="document_category_desc" displayField="description" options="documentCategoryDs" returnField="document_category" valueField="document_category"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="objectDs" autoQuery="true" fetchAll="false" model="fnd.FND1910.fnd_coding_rule_objects_query" pageSize="15" queryDataSet="para_objectDs" queryUrl="${/request/@context_path}/autocrud/fnd.FND1910.fnd_coding_rule_objects_query/query?ORDER_FIELD=document_category_dec,priority" selectable="true" submitUrl="${/request/@context_path}/autocrud/fnd.FND1910.fnd_coding_rule_objects_save_update/batch_update">
                <a:fields>
                    <a:field name="document_category_desc" displayField="description" options="documentCategoryDs" required="true" returnField="document_category" valueField="document_category"/>
                    <a:field name="enabled_flag" checkedValue="Y" defaultValue="Y" uncheckedValue="N"/>
                    <a:field name="document_type_desc" lovGridHeight="300" lovHeight="450" lovLabelWidth="100" lovService="fnd.FND1910.fnd_code_rule_doc_type_v" lovWidth="600" title="HLS.DOCUMENT_TYPE_DESC">
                        <a:mapping>
                            <a:map from="document_type" to="document_type"/>
                            <a:map from="description" to="document_type_desc"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="company_code" lovGridHeight="300" lovHeight="450" lovService="fnd.FND1910.fnd_coding_rule_objects_company_lov?ORDER_FIELD=company_code" lovWidth="500" title="HLS.COMPANY_SHORT_NAME">
                        <a:mapping>
                            <a:map from="company_id" to="company_id"/>
                            <a:map from="company_code" to="company_code"/>
                            <a:map from="company_short_name" to="company_short_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="operation_unit_name" lovGridHeight="300" lovHeight="450" lovLabelWidth="100" lovService="fnd.FND1910.fnd_operation_units_lov?ORDER_FIELD=operation_unit_code" lovWidth="550" title="HLS.OPERATION_UNIT">
                        <a:mapping>
                            <a:map from="operation_unit_id" to="operation_unit_id"/>
                            <a:map from="operation_unit_code" to="operation_unit_code"/>
                            <a:map from="description" to="operation_unit_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="priority" defaultValue="1" required="true"/>
                    <a:field name="coding_rule_desc" lovGridHeight="300" lovHeight="450" lovLabelWidth="100" lovService="fnd.FND1911.fnd_code_rule_v" lovWidth="600" title="编码规则分配">
                        <a:mapping>
                            <a:map from="description" to="coding_rule_desc"/>
                            <a:map from="coding_rule_id" to="coding_rule_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="coding_rules_id"/>
                    <a:field name="priority"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="onUpdate_objectDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="fnd_1910_back" text="HLS.BACK"/>
                <a:gridButton click="fnd_1910_next" text="HLS.FORWARD"/>
                <a:gridButton click="fnd_1910_quit" text="HLS.EXIT"/>
                <a:gridButton click="objectDs_grid_add" text="HLS.NEW"/>
                <a:gridButton click="objectDs_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="objectDs_grid_submit" text="HLS.SAVE"/>
                <a:gridButton click="objectDs_query" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="90" title="HAP_QUERY_TITLE">
                <a:comboBox name="document_category_desc" bindTarget="para_objectDs">
                    <a:events>
                        <a:event name="enterdown" handler="objectDs_query"/>
                    </a:events>
                </a:comboBox>
                <a:textField name="document_type_desc" bindTarget="para_objectDs">
                    <a:events>
                        <a:event name="enterdown" handler="objectDs_query"/>
                    </a:events>
                </a:textField>
                <a:lov name="company_short_name" bindTarget="para_objectDs">
                    <a:events>
                        <a:event name="enterdown" handler="objectDs_query"/>
                    </a:events>
                </a:lov>
                <a:lov name="operation_unit_name" bindTarget="para_objectDs">
                    <a:events>
                        <a:event name="enterdown" handler="objectDs_query"/>
                    </a:events>
                </a:lov>
            </a:form>
            <a:grid id="objectDs_grid" bindTarget="objectDs" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="document_category_desc" align="left" editorFunction="editorFunction_objectDs_grid" width="150"/>
                    <a:column name="document_type_desc" align="left" editorFunction="editorFunction_objectDs_grid" width="150"/>
                    <a:column name="company_code" align="left" editorFunction="editorFunction_objectDs_grid" width="150"/>
                    <a:column name="company_short_name" align="left" width="150"/>
                    <a:column name="operation_unit_name" align="left" editorFunction="editorFunction_objectDs_grid" width="150"/>
                    <a:column name="priority" align="right" editor="objectDs_grid_editor_nf" width="50"/>
                    <a:column name="enabled_flag" editor="objectDs_grid_editor_check" sortable="true" width="50"/>
                    <!-- <a:column name="rule_info" align="center" prompt="FND1910.WIN_TITLE.RULE_INFO" renderer="render_objectDs_grid"/> -->
                    <a:column name="coding_rule_desc" align="center" editor="objectDs_grid_editor_lov" prompt="编码规则" renderer="initLov"/>
                </a:columns>
                <a:editors>
                    <a:comboBox id="objectDs_grid_editor_comb"/>
                    <a:lov id="objectDs_grid_editor_lov"/>
                    <a:textField id="objectDs_grid_editor_tf"/>
                    <a:numberField id="objectDs_grid_editor_nf" allowDecimals="false" allowNegative="false"/>
                    <a:checkBox id="objectDs_grid_editor_check"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>