<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: zhangxing5129  
    $Date: 2013-10-23 下午03:14:16  
    $Revision: 1.0  
    $Purpose: 项目状态查询
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:view>
        <a:link id="con_contract_query_link" url="${/request/@context_path}/modules/prj/PRJ305/con_contract_query.lview"/>
        <script type="text/javascript"><![CDATA[
            function query() {
                $('project_status_result_ds').query();
            }
            
            function reset() {
                $('project_status_query_ds').reset();
            }
            
            function open_window(project_id, project_number, project_name, approved_date) {
                var url = $('con_contract_query_link').getUrl();
                new Leaf.Window({
                    title: '${l:PRJ305.DCUMENT_DETAIL}',
                    id: 'con_contract_query_win',
                    url: url,
                    params: {
                        'project_id': project_id,
                        'project_number': project_number,
                        'project_name': project_name,
                        'approved_date': approved_date
                    },
                    fullScreen: true
                });
            }
            
            function open_con_contract_query(value, record, name) {
            
                if (record.get('project_status') == 'APPROVED') {
                    var project_id = record.get('project_id');
                    var project_number = record.get('project_number');
                    var project_name = record.get('project_name');
                    var approved_date = Leaf.formatDate(record.get('approved_date'));
                    return '<a href="javascript:open_window(' + project_id + ',\'' + project_number + '\',\'' + project_name + '\',\'' + approved_date + '\')">${l:PRJ305.DCUMENT_DETAIL}</a>';
                }
            
            }
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PROJECT&amp;function_code=PRJ305"/>
        <a:dataSets>
            <a:dataSet id="project_status_ds" lookupCode="PRJ501_PRJ_STATUS"/>
            <a:dataSet id="lease_organization_ds" autoQuery="true" fetchAll="true" model="basic.hls_lease_organization_for_lov"/>
            <a:dataSet id="lease_channel_ds" autoQuery="true" fetchAll="true" model="basic.hls_lease_channel_for_lov"/>
            <a:dataSet id="project_status_query_ds">
                <a:fields>
                    <a:field name="lease_organization_desc" displayField="description" options="lease_organization_ds" returnField="lease_organization" valueField="lease_organization"/>
                    <a:field name="lease_organization"/>
                    <a:field name="employee_name" lovGridHeight="350" lovHeight="500" lovService="prj.PRJ305.exp_employees_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="employee_id" to="employee_id"/>
                            <a:map from="employee_name" to="employee_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="lease_channel_desc" displayField="description" options="lease_channel_ds" returnField="lease_channel" valueField="lease_channel"/>
                    <a:field name="lease_channel"/>
                    <a:field name="project_status_desc" displayField="code_value_name" options="project_status_ds" returnField="project_status" valueField="code_value"/>
                    <a:field name="project_status"/>
                    <a:field name="project_number_from" lovGridHeight="350" lovHeight="500" lovService="prj.PRJ305.prj_project_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="project_number" to="project_number_from"/>
                            <a:map from="project_id" to="project_id_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="project_number_to" lovGridHeight="350" lovHeight="500" lovService="prj.PRJ305.prj_project_for_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="project_number" to="project_number_to"/>
                            <a:map from="project_id" to="project_id_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="chance_number_from" lovGridHeight="350" lovHeight="500" lovService="prj.PRJ305.prj_chance_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="chance_number" to="chance_number_from"/>
                            <a:map from="chance_id" to="chance_id_from"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="chance_number_to" lovGridHeight="350" lovHeight="500" lovService="prj.PRJ305.prj_chance_lov" lovWidth="500">
                        <a:mapping>
                            <a:map from="chance_number" to="chance_number_to"/>
                            <a:map from="chance_id" to="chance_id_to"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="finance_amount_to"/>
                    <a:field name="finance_amount_to"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="project_status_result_ds" autoPageSize="true" autoQuery="true" model="prj.PRJ305.prj_project_query" queryDataSet="project_status_query_ds">
                <a:events>
                    <a:event name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="query" text="HLS.QUERY"/>
                <a:gridButton click="reset" text="HLS.RESET"/>
            </a:screenTopToolbar>
            <a:form column="4" labelWidth="120" title="HLS.QUERY_TITLE">
                <a:comboBox name="lease_organization_desc" bindTarget="project_status_query_ds" prompt="HLS.LEASE_ORGANIZATION_NAME"/>
                <a:lov name="employee_name" bindTarget="project_status_query_ds" prompt="HLS.SALES_EMPLOYEE"/>
                <a:comboBox name="lease_channel_desc" bindTarget="project_status_query_ds" prompt="HLS.LEASE_CHANNEL_NAME"/>
                <a:comboBox name="project_status_desc" bindTarget="project_status_query_ds" prompt="HLS.PROJECT_STATUS"/>
                <a:lov name="project_number_from" bindTarget="project_status_query_ds" prompt="HLS.PROJECT_NUMBER_FROM"/>
                <a:lov name="project_number_to" bindTarget="project_status_query_ds" prompt="HLS.PROJECT_NUMBER_TO_LANG"/>
                <a:lov name="chance_number_from" bindTarget="project_status_query_ds" prompt="HLS.LEASE_CHANCE_CODE_FROM"/>
                <a:lov name="chance_number_to" bindTarget="project_status_query_ds" prompt="HLS.LEASE_CHANCE_CODE_TO"/>
                <a:numberField name="finance_amount_from" allowDecimals="true" allowFormat="true" bindTarget="project_status_query_ds" decimalPrecision="2" prompt="PRJ305.FINANCE_AMOUNT_FROM"/>
                <a:numberField name="finance_amount_to" allowDecimals="true" allowFormat="true" bindTarget="project_status_query_ds" decimalPrecision="2" prompt="PRJ305.FINANCE_AMOUNT_TO"/>
                <a:datePicker name="meeting_date_one_from" bindTarget="project_status_query_ds" prompt="第一次上会日期从"/>
                <a:datePicker name="meeting_date_one_to" bindTarget="project_status_query_ds" prompt="第一次上会日期到"/>
            </a:form>
            <a:grid bindTarget="project_status_result_ds" marginHeight="220" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="project_number" prompt="HLS.PROJECT_NUMBER"/>
                    <a:column name="project_name" prompt="HLS.PROJECT_NAME" width="200"/>
                    <a:column name="project_status_desc" prompt="PRJ305.PRJ_CURRENT_STATUS"/>
                    <a:column name="lease_organization_desc" prompt="HLS.LEASE_ORGANIZATION_NAME"/>
                    <a:column name="employee_id_desc" prompt="HLS.SALES_EMPLOYEE"/>
                    <a:column name="chance_number" prompt="HLS.LEASE_CHANCE_CODE"/>
                    <a:column name="lease_channel_desc" prompt="PRJ305.LEASE_CHANNEL"/>
                    <a:column name="lease_channel_create_date" prompt="PRJ305.LEASE_CHANNEL_CREATE_DATE" renderer="Leaf.formatDate"/>
                    <a:column name="meeting_date_one" prompt="PRJ305.MEETING_DATE_ONE" renderer="Leaf.formatDate"/>
                    <a:column name="approval_result_one" prompt="PRJ305.APPROVAL_RESULT_ONE"/>
                    <a:column name="meeting_date_two" prompt="PRJ305.MEETING_DATE_TWO" renderer="Leaf.formatDate"/>
                    <a:column name="approval_result_two" prompt="PRJ305.APPROVAL_RESULT_TWO"/>
                    <a:column name="approved_date" prompt="PRJ305.APPROVED_DATE" renderer="Leaf.formatDate"/>
                    <a:column name="finance_amount" align="right" prompt="PRJ305.FINANCE_AMOUNT" renderer="Leaf.formatMoney" width="150"/>
                    <a:column name="detail" align="center" prompt="PRJ305.DCUMENT_DETAIL" renderer="open_con_contract_query"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>