<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangyu  
    $Date: 2015-6-12 下午15:52:32  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="pageLink_bpBlackListScreen_welcome" url="${/request/@context_path}/welcome.lview"/>
        <a:link id="hls218_bp_blacklist_update_link" url="${/request/@context_path}/modules/hls/HLS218/hls_bp_blacklist_update.lsc"/>
        <script type="text/javascript"><![CDATA[
            function bpBlackListScreen_forward() {
                history.go(1);
            }
            
            function bpBlackListScreen_back() {
                history.go(-1);
            }
            
            
            function bpBlackListScreen_query() {
                $('hls218_bp_list_ds').query();
            }
            
            function bpBlackListScreen_quit() {
                location.href = $('pageLink_bpBlackListScreen_welcome').getUrl();
                parent.shMenu('show');
            }
            
            function bpBlackListScreen_save() {
                var bp_data = $('hls218_bp_list_ds').getSelected();
                var param = {};
                var saveData = [];
                if (bp_data.length==0) {
                    Leaf.showMessage('提示', '请选择一条记录！');
                } else {
                    for (var i = 0;i < bp_data.length;i++) {
                        var lineData = {};
                        lineData['bp_id'] = bp_data[i].get('bp_id');
                        lineData['blacklist_flag'] = bp_data[i].get('blacklist_flag');
                        saveData.push(lineData);
                    }
                    param['details'] = saveData;
                    Leaf.request({
                        url: $('hls218_bp_blacklist_update_link').getUrl(),
                        para: {
                            param: param
                        },
                        success: function() {
                            Leaf.SideBar.show({
                                msg: '${l:HLS.SUBMIT_SUCCESS}',
                                duration: 2000
                            });
                            $('hls218_bp_list_ds').query();
                        },
                        scope: this
                    });
                }
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=BP&amp;function_code=HLS218"/>
        <a:dataSets>
            <a:dataSet id="bpClassDs" lookupCode="HLS211_BP_CLASS"/>
            <a:dataSet id="blacklist_flag_ds" lookupCode="YES_NO"/>
            <a:dataSet id="hls218_bp_info_ds" 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="basic.hls_bp_master_v_for_lov" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_code" to="bp_code_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code_to" lovGridHeight="350" lovHeight="500" lovService="basic.hls_bp_master_v_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"/>
                    <a:field name="bp_project_number" lovGridHeight="300" lovHeight="450" lovService="prj.PRJ501.prj_project_for_lov" lovWidth="600">
                        <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"/>
                    <a:field name="bp_contract_number" autoComplete="true" lovGridHeight="300" lovHeight="450" lovService="cont.CON500.con_contract_number_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="blacklist_flag_desc" displayField="code_value_name" options="blacklist_flag_ds" returnField="blacklist_flag" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="hls218_bp_list_ds" autoQuery="true" model="hls.HLS212.hls_bp_master_all_data_v" pageSize="15" queryDataSet="hls218_bp_info_ds" selectable="true">
                <a:fields>
                    <a:field name="blacklist_flag" checkedValue="Y" uncheckedValue="N"/>
                </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="bpBlackListScreen_back" text="HLS.BACK"/>
                <a:gridButton click="bpBlackListScreen_forward" text="HLS.FORWARD"/>
                <a:gridButton click="bpBlackListScreen_quit" text="HLS.EXIT"/>
                <a:gridButton click="bpBlackListScreen_query" text="HLS.QUERY"/>
                <a:gridButton click="bpBlackListScreen_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:lov name="bp_code_from" bindTarget="hls218_bp_info_ds" prompt="HLS.BP_CODE_FROM"/>
                <a:lov name="bp_code_to" bindTarget="hls218_bp_info_ds" prompt="HLS.BP_CODE_TO"/>
                <a:textField name="bp_name" bindTarget="hls218_bp_info_ds" prompt="HLS.BP_NAME"/>
                <a:textField name="extra_nam" bindTarget="hls218_bp_info_ds" prompt="HLS.SHORT_NAME"/>
                <a:lov name="bp_type" bindTarget="hls218_bp_info_ds" prompt="HLS.BP_TYPE"/>
                <a:textField name="bp_type_desc" bindTarget="hls218_bp_info_ds" prompt="HLS212.BP_TYPE_DESC"/>
                <a:lov name="bp_project_number" bindTarget="hls218_bp_info_ds" prompt="HLS.PROJECT_NUMBER"/>
                <a:textField name="bp_project_name" bindTarget="hls218_bp_info_ds" prompt="HLS.PROJECT_NAME"/>
                <a:lov name="bp_contract_number" bindTarget="hls218_bp_info_ds" prompt="HLS.CONTRACT_NUMBER"/>
                <a:textField name="bp_contract_name" bindTarget="hls218_bp_info_ds" prompt="HLS.CONTRACT_NAME"/>
                <a:comboBox name="bp_class_desc" bindTarget="hls218_bp_info_ds" prompt="HLS_BP_MASTER.BP_CLASS"/>
                <a:comboBox name="blacklist_flag_desc" bindTarget="hls218_bp_info_ds" prompt="黑名单标志"/>
            </a:form>
            <a:grid id="hls218_bp_list_ds_grid" bindTarget="hls218_bp_list_ds" marginHeight="250" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="bp_code" 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="licence_terms" prompt="执照日期" width="80"/>
                    <a:column name="blacklist_flag" editor="editor_cb" prompt="黑名单标志" width="80"/>
                </a:columns>
                <a:editors>
                    <a:checkBox id="editor_cb"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>
