prj_project_bp_parameter.lview 6.56 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
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-9-11 上午11:08:20  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.project_id=${/parameter/@project_id}" model="prj.PRJ501.prj_project_v" rootPath="prj501_prj_project_record_path"/>
        <a:model-query fetchAll="true" model="prj.PRJ501.prj_project_bp_parament_count" rootPath="bp_parament_count_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="prj501_project_bp_count_parameter_link" url="${/request/@context_path}/modules/prj/PRJ501/prj_project_bp_count_parameter.lview"/>
        <script type="text/javascript"><![CDATA[
            function prj501_project_bp_parameter_close() {
                $('projectQueryScreen_mainDs').query();
                $('prj_project_bp_parameter_window').close();
            }
            
            function projectQueryScreen_project_parameter_update() {
                var record = $('projectQueryScreen_mainDs').getCurrentRecord();
                new Leaf.Window({
                    id: 'prj501_project_bp_count_parameter_window',
                    url: $('prj501_project_bp_count_parameter_link').getUrl(),
                    params: {
                        project_id: record.get('project_id')
                    },
                    title: '${l:HLS.PROJECT_PARAMETER_UPDATE}',
                    width: 400,
                    height: 250
                });
            }
            
            function prj_project_bp_count_parameter_save() {
                $('prj501_prj_project_record_ds').submit();
            }
            
            function prj501_project_bp_parameter_remove(ds) {
                $('prj501_prj_project_record_ds').query();
            }
            
            function prj501_prj_project_record_onUpdate(ds, record, name, value, oldVlaue) {
                if (!Leaf.isEmpty(value)) {
                    var number_of_tenant = '${/model/prj501_prj_project_record_path/record/@number_of_tenant}';
                    var number_of_guarantor = '${/model/prj501_prj_project_record_path/record/@number_of_guarantor}';
                    var number_of_actual_controller = '${/model/prj501_prj_project_record_path/record/@number_of_actual_controller}';
                    if (name == 'number_of_tenant' && value < number_of_tenant) {
                        setTimeout(function() {
                            record.set('number_of_tenant', number_of_tenant);
                        }, 5);
                    } else if (name == 'number_of_guarantor' && value < number_of_guarantor) {
                        setTimeout(function() {
                            record.set('number_of_guarantor', number_of_guarantor);
                        }, 5);
                    } else if (name == 'number_of_actual_controller' && value < number_of_actual_controller) {
                        setTimeout(function() {
                            record.set('number_of_actual_controller', number_of_actual_controller);
                        }, 5);
                    }
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="prj501_project_bp_parameter_query_ds">
                <a:fields>
                    <a:field name="project_id" defaultValue="${/parameter/@project_id}"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="prj501_prj_project_record_ds" autoQuery="true" model="prj.PRJ501.prj_project_v" queryDataSet="prj501_project_bp_parameter_query_ds">
                <a:fields>
                    <a:field name="number_of_tenant" required="true"/>
                    <a:field name="number_of_guarantor" required="true"/>
                    <a:field name="number_of_actual_controller" required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="prj501_project_bp_parameter_ds" autoPageSize="true" autoQuery="true" model="prj.PRJ501.prj_project_bp_parameter" queryDataSet="prj501_project_bp_parameter_query_ds" selectable="true">
                <a:events>
                    <a:event name="remove" handler="prj501_project_bp_parameter_remove"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="prj501_project_bp_parameter_close" text="HLS.CLOSE" width="80"/>
                <a:gridButton bind="prj501_project_bp_parameter_grid" type="delete" width="80"/>
                <a:toolbarButton click="prj_project_bp_count_parameter_save" text="HLS.SAVE" width="80"/>
            </a:screenTopToolbar>
            <a:form row="1">
                <a:spinner name="number_of_tenant" bindTarget="prj501_prj_project_record_ds" min="${/model/bp_parament_count_path/record/@number_of_tenant}" prompt="HLS.NUMBER_OF_TENANT" step="1" width="80"/>
                <a:spinner name="number_of_guarantor" bindTarget="prj501_prj_project_record_ds" min="${/model/bp_parament_count_path/record/@number_of_guarantor}" prompt="HLS.NUMBER_OF_QUARANTOR" step="1" width="80"/>
                <a:spinner name="number_of_actual_controller" bindTarget="prj501_prj_project_record_ds" min="${/model/bp_parament_count_path/record/@number_of_actual_controller}" prompt="HLS.NUMBER_OF_ACTUAL_CONTROLLER" step="1" width="80"/>
                <!-- <a:numberField name="number_of_tenant" allowDecimals="false" allowNegative="false" bindTarget="prj501_prj_project_record_ds" prompt="HLS.NUMBER_OF_TENANT" width="80"/>
                <a:numberField name="number_of_guarantor" allowDecimals="false" allowNegative="false" bindTarget="prj501_prj_project_record_ds" prompt="HLS.NUMBER_OF_QUARANTOR" width="80"/>
                <a:numberField name="number_of_actual_controller" allowDecimals="false" allowNegative="false" bindTarget="prj501_prj_project_record_ds" prompt="HLS.NUMBER_OF_ACTUAL_CONTROLLER" width="80"/> -->
            </a:form>
            <a:grid id="prj501_project_bp_parameter_grid" bindTarget="prj501_project_bp_parameter_ds" height="400" navBar="true" width="600">
                <a:columns>
                    <a:column name="bp_name" prompt="HLS.BP_NAME" width="200"/>
                    <a:column name="bp_category_desc" prompt="HLS.BP_CATEGORY" width="130"/>
                    <a:column name="bp_type_desc" prompt="HLS.BP_TYPE" width="130"/>
                    <a:column name="contract_seq" prompt="HLS.CONTRACT_SEQ" width="80"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>