<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: shenhaozhe  
    $Date: 2017-9-27 下午3:19:31  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="prj_project_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="prj_project_modify_link" url="${/request/@context_path}/modules/prj/PRJ501N/prj_project_create_tree_n.lview"/>
        <a:link id="hn_project_vote_submit_link" model="hn.HN1100.hn_prj_approval_vote_submit" modelaction="update"/>
        <a:link id="hn010_contract_quotation_modify_link_id" url="${/request/@context_path}/modules/hn/HN010/hn_contract_quotation_detail.lview"/>
        <a:link id="hn_project_addition_vote_submit_link" model="hn.HN1100.hn_prj_addition_approval_vote_subbmit" modelaction="update"/>
        <a:link id="hn_project_virtual_con_vote_submit_link" model="hn.HN1100.hn_virtual_con_approval_vote_submit" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
              function hn1100_hn_vote_control_query(){
                  $('rpt7080_hn_contract_quotation_confirm_hd_ds').query();
              }
              
 
              function rpt7080_hn_contract_quotation_confirm_hd_ds_submitsuccess_handler(ds){
                  ds.query();
              }
              
              function open_contract_number(value,record,name){
                  
                 if (name == 'contract_number' && value) {
                   
                    return '<a href="javascript:open_contract_number_win(\'' + record.id + '\',\'' + record.ds.id +'\')">' + value + '</a>';
                }
                return value;
              }
              
              function open_contract_number_win(record_id, ds_id) {
               var record = $(ds_id).findById(record_id);
               
                var wfl_status_flag=record.get('wfl_status_flag');
                 if(wfl_status_flag == 'N'){
                    Leaf.showMessage('${l:PROMPT}', '该合同支付表确认未创建');
                    return;
                 }
                
                var param={};
                if (record.get('wfl_status')=='NEW'||record.get('wfl_status')=='REJECT'){
                      param['function_code'] = 'HN010D';
                      param['function_usage'] = 'UPDATE';
                      }else{
                       param['function_code'] = 'HN010D_WFL';
                      param['function_usage'] = 'QUERY';
                      }
                      param['quotation_id']=record.get('quotation_id');
                      param['contract_id']=record.get('contract_id');
                      param['url_title'] = '支付表确认';
                      param['winid']='hn010_contract_quotation_modify_winid';
                hls_doc_get_layout_code('prj_project_get_layout_code_link_id', param, 'hn010_contract_quotation_modify_link_id',ds_id);
                
            }
            
            
            
            function hn1100_unlock_list_window() {
                Leaf.Masker.unmask(Ext.getBody());
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="projectQueryScreen_organizationDs" loadData="true" model="basic.hls_lease_organization_for_lov"/>
            <a:dataSet id="projectQueryScreen_work_flow_typeDs" loadData="true" model="hn.HN1100.hn_prj_work_flow_type"/>
            <a:dataSet id="rpt7080_hn_contract_quotation_confirm_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="due_date_from"/>
                    <a:field name="due_date_to"/>
                    <a:field name="contract_number" lovAutoQuery="true" lovHeight="500" lovLabelWidth="120" lovService="rpt.RPT7080.hn_contract_number_query" lovWidth="500">
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="contract_name" to="contract_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="contract_name"/>
                    <a:field name="employee_id_n"/>
                    <a:field name="lease_organization_n" displayField="description" options="projectQueryScreen_organizationDs" returnField="lease_organization" valueField="lease_organization"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="rpt7080_hn_contract_quotation_confirm_hd_ds" autoPageSize="true" autoQuery="true" model="rpt.RPT7080.hn_contract_quotation_confirm" queryDataSet="rpt7080_hn_contract_quotation_confirm_query_ds" selectable="true">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="contract_name"/>
                    <a:field name="quotation_id"/>
                    <a:field name="amount" readOnly="true"/>
                    <a:field name="due_date"/>
                    <a:field name="employee_id_n"/>
                    <a:field name="employee_id_of_manager_n"/>
                    <a:field name="lease_organization_n"/>
                    <a:field name="wfl_status_flag"/>
                    <a:field name="wfl_status_n"/>
                    <a:field name="approve_user_name"/>
                </a:fields>
                <a:events>
                    <a:event name="submitsuccess" handler="rpt7080_hn_contract_quotation_confirm_hd_ds_submitsuccess_handler"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="hn1100_hn_vote_control_query" text="查询"/>
                <a:gridButton bind="rpt7080_hn_contract_quotation_confirm_grid" text="EXCEL导出" type="excel"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="20" title="查询条件">
                <a:datePicker name="due_date_from" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="支付日从"/>
                <a:datePicker name="due_date_to" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="支付日到"/>
                <a:lov name="contract_number" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="合同编号"/>
                <a:textField name="contract_name" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="合同名称"/>
                <a:textField name="employee_id_n" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="项目经理"/>
                <a:comboBox name="lease_organization_n" bindTarget="rpt7080_hn_contract_quotation_confirm_query_ds" prompt="业务部"/>
            </a:form>
            <a:grid id="rpt7080_hn_contract_quotation_confirm_grid" bindTarget="rpt7080_hn_contract_quotation_confirm_hd_ds" marginHeight="200" marginWidth="20" navBar="true">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" renderer="open_contract_number" width="180"/>
                    <a:column name="contract_name" prompt="合同名称" width="150"/>
                    <a:column name="due_date" align="center" prompt="实际支付日期" renderer="Leaf.formatDate" width="150"/>
                    <a:column name="closed_date" align="center" prompt="财务关闭日期" renderer="Leaf.formatDate" width="150"/>
                    <a:column name="amount" align="right" editor="num" prompt="融资额" renderer="Leaf.formatMoney" width="200"/>
                    <a:column name="employee_id_n" align="center" prompt="项目经理" width="150"/>
                    <a:column name="employee_id_of_manager_n" align="center" prompt="部门负责人" width="100"/>
                    <a:column name="lease_organization_n" align="center" prompt="业务部" width="80"/>
                    <a:column name="wfl_status_n" align="center" prompt="工作流状态" width="100"/>
                    <a:column name="approve_user_name" align="center" prompt="待审批人" width="100"/>
                </a:columns>
                <a:editors>
                    <a:numberField id="num" allowDecimals="true" allowFormat="true" decimalPrecision="2" readOnly="true"/>
                </a:editors>
            </a:grid>
        </a:screenBody>
        <a:screen-include screen="modules/cont/CON500/con_contract_authority_list_validate.lview?document_category=PROJECT&amp;function_code=PRJ501"/>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>