rsc_value_assessment.lview 11.5 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: peter soong  
    $Date: 2014-08-27 16:33:57  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:s="leaf.plugin.script" xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="pageLink_bpQueryScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="hls_bp_master_dynamic_update_link_id" url="${/request/@context_path}/modules/hls/HLS213/hls_bp_master_dynamic_update.lview"/>
        <a:link id="hls_bp_master_get_layout_code_link_id" model="hls.HLS213.hls_bp_master_get_layout_code" modelaction="update"/>
        <a:link id="rsc_value_assessment_submit_link" url="${/request/@context_path}/modules/rsc/RSC504/rsc_value_assessment_create.lview"/>
        <script type="text/javascript"><![CDATA[
            function bpQueryScreen_forward() {
                history.go(1);
            }
            
            function bpQueryScreen_back() {
                history.go(-1);
            }
            
            function bpQueryScreen_query() {
                $('bpQueryDs').query();
            }
            function bpQueryScreen_reset() {
                $('para_bpQueryDs').reset();
            }
            function bpQueryScreen_quit() {
                location.href = $('pageLink_bpQueryScreen_welcome').getUrl();
                parent.shMenu('show');
            }
            
            function construct_from_to() {
                var config = ['bp_code', 'bp_code_desc', 'search_term_1', 'search_term_2'];
                var pattern = ['_from', '_to'];
                var obj = {};
                for (var i = 0,
                    j = config.length;i < j;i++) {
                    for (var m = 0,
                        n = pattern.length;m < n;m++) {
                        obj[config[i] + pattern[m]] = config[i] + pattern[n - 1 - m];
                    }
                }
                return obj;
            }
            
            function onUpdate_para_bpQueryDs(ds, record, name, value, oldvalue) {
                var from_to = construct_from_to();
                var opposite_name = from_to[name];
                if (!Ext.isEmpty(opposite_name)) {
                    var opposite_value = record.get(opposite_name);
                    if (!Ext.isEmpty(value) && Ext.isEmpty(opposite_value)) {
                        record.set(opposite_name, value);
                    }
                }
            
            }
            
            function winOpen_bpMaintainScreen(id) {
                var current_record = $('bpQueryDs').findById(id);
                var param = current_record.data;
                hls214_param_set_value(param);
            }
            
            
            
            function hls214_param_set_value(param) {
                param['function_code'] = 'HLS306';
                param['function_usage'] = 'QUERY';
                param['url_title'] = '${l:HLS212.BP_MASTER_MAINTAIN}';
                param['master_type'] = 'READONLY';
                param['master_id'] = param['bp_id'];
                hls_doc_get_layout_code('hls_bp_master_get_layout_code_link_id', param, 'hls_bp_master_dynamic_update_link_id', 'bpQueryDs');
            }
            
            function render_bpQueryDs_grid(value, record, name) {
                if (name == 'bp_code') {
                    var bp_id = record.get('bp_id');
                    if (!Ext.isEmpty(bp_id) && !Ext.isEmpty(value)) {
                        return '<a href="javascript:winOpen_bpMaintainScreen(' + record.id + ');">' + value + '</a>';
                    }
                }
                return '';
            }
            
            function bpQueryScreen_inspect_asset_create() {
                var bp_id  = $('bpQueryDs').getCurrentRecord().get('bp_id');
                new Leaf.Window({
                    id: 'rsc_value_assessment_submit_id',
                    url: $('rsc_value_assessment_submit_link').getUrl() + '?bp_id_tenant=' + bp_id,
                    title: '价值评估创建',
                    fullScreen: true
                }).on('close', bpQueryScreen_query);
            
            }
        ]]></script>
        <a:screen-include screen="modules/hls/HLS213/hls_bp_master_get_layout_code.lview"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?master_type=BP&amp;function_code=HLS214"/>
        <a:dataSets>
            <a:dataSet id="enabled_flag_ds" lookupCode="ENABLED_STATUS"/>
            <a:dataSet id="bpClassDs" lookupCode="HLS211_BP_CLASS"/>
            <a:dataSet id="para_bpQueryDs" model="hls.HLS212.hls_bp_master_all_data_v">
                <a:fields>
                    <a:field name="bp_class_desc" displayField="code_value_name" options="bpClassDs" returnField="bp_class" valueField="code_value"/>
                    <a:field name="bp_class"/>
                    <a:field name="bp_type_desc" readOnly="true"/>
                    <a:field name="bp_type" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_type_v_for_lov?enabled_flag=Y" lovWidth="500" prompt="HLS_BP_TYPE.BP_TYPE" title="HLS_BP_TYPE.BP_TYPE">
                        <a:mapping>
                            <a:map from="description" to="bp_type_desc"/>
                            <a:map from="bp_type" to="bp_type"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_from" lovGridHeight="350" lovHeight="500" lovService="rsc.RSC504.hls_bp_master_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_from"/>
                        </a:mapping>
                    </a:field>
                    <!-- lovService="basic.hls_bp_master_v_for_lov" -->
                    <a:field name="bp_code_to" lovGridHeight="350" lovHeight="500" lovService="rsc.RSC504.hls_bp_master_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_name"/>
                    <!-- lovService="prj.PRJ501.prj_project_for_lov" -->
                    <a:field name="bp_project_number" lovGridHeight="350" lovHeight="500" lovService="rsc.RSC504.prj_project_for_lov" lovWidth="500" title="项目">
                        <a:mapping>
                            <a:map from="project_id" to="bp_project_id"/>
                            <a:map from="project_number" to="bp_project_number"/>
                            <a:map from="project_name" to="bp_project_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_project_id"/>
                    <a:field name="bp_project_name"/>
                    <!-- lovService="cont.CON500.con_contract_number_lov" -->
                    <a:field name="bp_contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="rsc.RSC504.con_contract_for_lov" lovWidth="500" title="HLS.CONTRACT_NUMBER">
                        <a:mapping>
                            <a:map from="contract_id" to="bp_contract_id"/>
                            <a:map from="contract_number" to="bp_contract_number"/>
                            <a:map from="contract_name" to="bp_contract_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="enabled_flag" defaultValue="Y"/>
                    <a:field name="enabled_flag_desc" displayField="code_value_name" options="enabled_flag_ds" prompt="HLS.ENABLED_FLAG" returnField="enabled_flag" valueField="code_value"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="onUpdate_para_bpQueryDs"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="bpQueryDs" autoPageSize="true" autoQuery="true" model="rsc.RSC504.rsc_value_assess" queryDataSet="para_bpQueryDs" queryUrl="${/request/@context_path}/autocrud/rsc.RSC504.rsc_value_assess/query?entry=LEASE_BP" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="hls_bp_credit_apply_attach" defaultValue="附件"/>
                </a:fields>
                <!--   <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                </a:events> -->
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <!-- <a:gridButton click="bpQueryScreen_back" text="HLS.BACK"/>
                <a:gridButton click="bpQueryScreen_forward" text="HLS.FORWARD"/> -->
                <a:gridButton click="bpQueryScreen_inspect_asset_create" text="创建"/>
                <a:gridButton click="bpQueryScreen_query" text="HLS.QUERY"/>
                <a:gridButton click="bpQueryScreen_reset" text="HLS.RESET"/>
                <a:gridButton click="bpQueryScreen_quit" text="HLS.EXIT"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:lov name="bp_code_from" bindTarget="para_bpQueryDs" prompt="HLS.BP_CODE_FROM">
                    <a:events>
                        <a:event name="focus" handler="on_std_focus"/>
                    </a:events>
                </a:lov>
                <a:lov name="bp_code_to" bindTarget="para_bpQueryDs" prompt="HLS.BP_CODE_TO">
                    <a:events>
                        <a:event name="focus" handler="on_std_focus"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_name" bindTarget="para_bpQueryDs" prompt="HLS.BP_NAME"/>
                <a:textField name="extra_nam" bindTarget="para_bpQueryDs" prompt="HLS.SHORT_NAME"/>
                <!-- <a:lov name="bp_project_number" bindTarget="para_bpQueryDs" prompt="HLS.PROJECT_NUMBER">
                    <a:events>
                        <a:event name="focus" handler="function(object){on_std_focus(object,&apos;PROJECT&apos;)}"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_project_name" bindTarget="para_bpQueryDs" prompt="HLS.PROJECT_NAME"/>
                <a:lov name="bp_contract_number" bindTarget="para_bpQueryDs" prompt="HLS.CONTRACT_NUMBER">
                    <a:events>
                        <a:event name="focus" handler="function(object){on_std_focus(object,&apos;CONTRACT&apos;)}"/>
                    </a:events>
                </a:lov>
                <a:textField name="bp_contract_name" bindTarget="para_bpQueryDs" prompt="HLS.CONTRACT_NAME"/>
                <a:comboBox name="bp_class_desc" bindTarget="para_bpQueryDs" prompt="HLS_BP_MASTER.BP_CLASS"/> -->
            </a:form>
            <a:grid id="bpQueryDs_grid" bindTarget="bpQueryDs" marginHeight="250" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="bp_code" renderer="render_bpQueryDs_grid" width="180"/>
                    <a:column name="bp_name" width="250"/>
                    <a:column name="extra_nam" prompt="HLS.SHORT_NAME" width="150"/>
                    <a:column name="bp_class_desc" width="120"/>
                    <a:column name="bp_type_desc" width="120"/>
                    <a:column name="bp_category_desc" width="120"/>
                    <a:column name="enabled_flag_desc" width="60"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>