<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng
    $Date: 2017-7-24 下午8:02:13
    $Revision: 1.0
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" trace="true">
    <a:view>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
        <a:link id="sdic105_sdic_other_contract_change_link" url="${/request/@context_path}/modules/sdic/SDIC105/sdic_other_contract_change.lview"/>
        <a:link id="sdic105_sdic_other_contract_change_create_entrance_link" url="${/request/@context_path}/modules/sdic/SDIC105/sdic_other_contract_change_create_entrance.lview"/>
        <script type="text/javascript"><![CDATA[
            function sdic105_change_renderer(value, record, name) {
                return '<a href="javascript:sdic105_change_detail(' + record.id + ')">变更明细</a>';
            }
            
            function sdic105_change_detail(id) {
                var ds_id = 'sdic105_hn_other_con_change_req_ds';
                var record = $(ds_id).findById(id);
                var param = {};
                param['contract_id'] = record.get('new_contract_id');
                if (record.get('wfl_status') == 'APPROVED' || record.get('wfl_status') == 'APPROVING') {
                    param['function_code'] = 'SDIC105WFL';
                    param['function_usage'] = 'QUERY';
                } else {
                    param['function_code'] = 'SDIC105CHANGE';
                    param['function_usage'] = 'MODIFY';
                }
                // param['document_category'] = record.get('document_category');
                // param['document_type'] = record.get('document_type');
                //  param['document_type_2nd'] =record.get('document_type');
                param['url_title'] = '其他业务明细';
                param['winid'] = 'sdic105d_other_contract_detail_winid';
                hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'sdic105_sdic_other_contract_change_link', ds_id);
            
            }
            
            function sdic105_query() {
                $('sdic105_hn_other_con_change_req_ds').query();
            }
            
            function sdic105_reset() {
                $('sdic105_hn_other_con_change_req_query_ds').reset();
            }
            
            function sdic105_add() {
            
                var win = new Leaf.Window({
                    id: 'sdic105_sdic_other_contract_change_create_entrance_win',
                    params: {
                        winid: 'sdic105_sdic_other_contract_change_create_entrance_win'
                    },
                    url: $('sdic105_sdic_other_contract_change_create_entrance_link').getUrl(),
                    title: '变更申请创建',
                    width: 250,
                    height: 250,
                    draggable: false
                });
                win.on('close', function() {
                    sdic105_query();
                });
            
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sdic105_other_conract_wfl_status_ds" lookupCode="OTHER_CONRACT_WFL_STATUS"/>
            <a:dataSet id="sdic105_hn_other_con_change_req_query_ds" autoCreate="true">
                <a:fields>
                    <a:field name="wfl_status_n" displayField="code_value_name" options="sdic105_other_conract_wfl_status_ds" returnField="wfl_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="sdic105_hn_other_con_change_req_ds" autoQuery="true" model="sdic.SDIC105.hn_other_con_change_req_query" queryDataSet="sdic105_hn_other_con_change_req_query_ds"/>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="sdic105_query" text="HLS.QUERY"/>
                <a:gridButton click="sdic105_reset" text="HLS.RESET"/>
                <a:gridButton click="sdic105_add" text="HLS.NEW"/>
            </a:screenTopToolbar>
            <a:form marginWidth="20" title="查询条件">
                <a:hBox>
                    <a:textField name="contract_number" bindTarget="sdic105_hn_other_con_change_req_query_ds" prompt="合同编号"/>
                    <a:textField name="contract_name" bindTarget="sdic105_hn_other_con_change_req_query_ds" prompt="合同名称"/>
                    <a:textField name="bp_name" bindTarget="sdic105_hn_other_con_change_req_query_ds" prompt="交易对手"/>
                    <a:comboBox name="wfl_status_n" bindTarget="sdic105_hn_other_con_change_req_query_ds" prompt="申请状态"/>
                </a:hBox>
            </a:form>
            <a:grid bindTarget="sdic105_hn_other_con_change_req_ds" marginHeight="200" marginWidth="20" navBar="true">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="150"/>
                    <a:column name="contract_name" prompt="合同名称" width="150"/>
                    <a:column name="bp_name" prompt="交易对手" width="150"/>
                    <a:column name="unit_name" prompt="部门名称"/>
                    <a:column name="employee_name" prompt="项目经理"/>
                    <a:column name="wfl_status_n" prompt="申请状态"/>
                    <a:column name="req_date" prompt="申请日期" renderer="Leaf.formatDate"/>
                    <!-- <a:column name="description" prompt="申请说明" width="150"/> -->
                    <a:column name="change_req_id" align="center" prompt="明细" renderer="sdic105_change_renderer"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
