fnd_uom_precision.lview 6.04 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ouyangzhaochang2663 $
    $Date: 2010/11/22 01:49:40 $
    $Revision: 1.3 $
    $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="sys_service_welcome_link" url="${/request/@context_path}/welcome.lview"/>
        <script type="text/javascript"><![CDATA[
            function queryUomPrecision() {
                $('fnd_uom_precision_result_ds').query();
            }
            
            function resetUomPrecision() {
                $('fnd_uom_precision_query_ds').reset();
            }
            
            function fnd_1050_grid_add() {
                $('fnd_uom_precision_grid').showEditorByRecord($('fnd_uom_precision_result_ds').create());
            }
            
            function fnd_1050_grid_clear() {
                $('fnd_uom_precision_grid').clear();
            }
            
            function fnd_1050_grid_remove() {
                $('fnd_uom_precision_grid').remove();
            }
            
            function fnd_1050_grid_submit() {
                var result_ds = $('fnd_uom_precision_result_ds');
                if (result_ds.validate()) {
                    result_ds.submit();
                }
            }
            
            function fnd_1050_next() {
                history.go(1);
            }
            
            function fnd_1050_back() {
                history.go(-1);
            }
            
            function fnd_1050_quit() {
                location.href = $('sys_service_welcome_link').getUrl();
            }
            
            function changePrecision(com, value, oldValue) {
                if (value < oldValue) {
                    Leaf.showInfoMessage('${l:PROMPT}', '${l:FND_UOM_PRECISION.MESSAGE_INFO}', function() {
                        com.setValue(oldValue);
                    }, 250, 100);
                }
            }
            
            function validatePrecision(record, name, value) {
                if (value < record.get('precision_old')) {
                    return '${l:FND_UOM_PRECISION.CHECK1}';
                } else {
                    return true;
                }
            }
            
            function submitSuccess() {
                queryUomPrecision();
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="fnd_uom_precision_query_ds" autoCreate="true" model="fnd.FND1050.fnd_uom_precision">
                <a:fields>
                    <a:field name="uom_code"/>
                    <a:field name="uom_name"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="fnd_uom_precision_result_ds" autoQuery="true" model="fnd.FND1050.fnd_uom_precision" pageSize="15" queryDataSet="fnd_uom_precision_query_ds" selectable="true">
                <a:fields>
                    <a:field name="uom_code" lovGridHeight="300" lovHeight="460" lovService="fnd.FND1050.fnd_uom_codes_precision_lov" lovWidth="500" required="true" title="FND_UOM_CODES.UOM_CODE">
                        <a:mapping>
                            <a:map from="uom_code" to="uom_code"/>
                            <a:map from="uom_name" to="uom_name"/>
                            <a:map from="description_id" to="description_id"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="precision" required="true" validator="validatePrecision"/>
                    <a:field name="precision_old"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="submitSuccess"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="fnd_1050_back" text="HLS.BACK"/>
                <a:gridButton click="fnd_1050_next" text="HLS.FORWARD"/>
                <a:gridButton click="fnd_1050_quit" text="HLS.EXIT"/>
                <a:gridButton click="fnd_1050_grid_add" text="HLS.NEW"/>
                <a:gridButton click="fnd_1050_grid_clear" text="HLS.CLEAR"/>
                <a:gridButton click="fnd_1050_grid_remove" text="HLS.REMOVE"/>
                <a:gridButton click="fnd_1050_grid_submit" text="HLS.SAVE"/>
                <a:gridButton click="queryUomPrecision" text="HLS.QUERY"/>
            </a:screenTopToolbar>
            <a:form column="2" labelWidth="100" title="HLS.QUERY_TITLE">
                <a:textField name="uom_code" bindTarget="fnd_uom_precision_query_ds" prompt="FND_UOM_CODES.UOM_CODE" typeCase="UPPER">
                    <a:events>
                        <a:event name="enterdown" handler="queryUomPrecision"/>
                    </a:events>
                </a:textField>
                <a:textField name="uom_name" bindTarget="fnd_uom_precision_query_ds" prompt="FND_UOM_CODES.DESCRIPTION">
                    <a:events>
                        <a:event name="enterdown" handler="queryUomPrecision"/>
                    </a:events>
                </a:textField>
            </a:form>
            <a:grid id="fnd_uom_precision_grid" bindTarget="fnd_uom_precision_result_ds" marginHeight="180" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="uom_code" align="center" editor="fnd_uom_code_lov" sortable="true" width="150"/>
                    <a:column name="uom_name" align="left" prompt="FND_UOM_CODES.DESCRIPTION" sortable="true" width="200"/>
                    <a:column name="precision" align="right" editor="fnd_uom_precision_number" sortable="true" width="200"/>
                </a:columns>
                <a:editors>
                    <a:lov id="fnd_uom_code_lov"/>
                    <a:numberField id="fnd_uom_precision_number" allowDecimals="false" allowNegative="false"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
        <script type="text/javascript"><![CDATA[
        ]]></script>
    </a:view>
</a:screen>