<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: chenlingfeng
    $Date: 2017-7-25 下午5:23:39
    $Revision: 1.0
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="basic.hls_sys_time_default_value" rootPath="default_value_path"/>
    </a:init-procedure>
    <a:view>
        <a:link id="sdic105_hn_other_con_change_req_create_link" model="sdic.SDIC105.hn_other_con_change_req" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
            function lock_current_window() {
                Leaf.Masker.mask($('${/parameter/@winid}').wrap, '${l:HLS.EXECUTING}');
            }
            
            function unlock_current_window() {
                Leaf.Masker.unmask($('${/parameter/@winid}').wrap);
            }
            
            function sdic105c_back() {
                $('${/parameter/@winid}').close();
            }
            
            function sdic105c_confirm() {
                if ($('sdic105_hn_other_con_change_req_create_ds').validate(true)) {
                    var record = $('sdic105_hn_other_con_change_req_create_ds').getCurrentRecord();
                    lock_current_window();
                    Leaf.request({
                        url: $('sdic105_hn_other_con_change_req_create_link').getUrl(),
                        para: {
                            contract_id: record.get('contract_id'),
                            req_date: record.get('req_date'),
                            description: record.get('description')
                        },
                        success: function(res) {
                            unlock_current_window();
            
                            var ds_id = 'sdic105_hn_other_con_change_req_ds';
                            var param = {};
                            param['contract_id'] = res.result.new_contract_id;
                            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);
                            sdic105c_back();
                        },
                        failure: function() {
                            unlock_current_window();
                        },
                        error: function() {
                            unlock_current_window();
                        },
                        scope: this
                    });
                }
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="sdic105_hn_other_con_change_req_create_ds" autoCreate="true">
                <a:fields>
                    <a:field name="contract_number" lovGridHeight="400" lovHeight="500" lovLabelWidth="100" lovService="sdic.SDIC105.sdic_other_contract_for_lov?wfl_status=APPROVED" lovWidth="500" required="true" title="其他业务">
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                            <a:map from="contract_id" to="contract_id"/>
                            <a:map from="contract_name" to="contract_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="contract_name" readOnly="true"/>
                    <a:field name="req_date" defaultValue="${/model/default_value_path/record/@now_time}" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="sdic105c_back" text="HLS.BACK"/>
                <a:gridButton click="sdic105c_confirm" text="HLS.CONFIRM"/>
            </a:screenTopToolbar>
            <a:form column="1">
                <a:lov name="contract_number" bindTarget="sdic105_hn_other_con_change_req_create_ds" prompt="合同编号"/>
                <a:textField name="contract_name" bindTarget="sdic105_hn_other_con_change_req_create_ds" prompt="合同名称"/>
                <a:datePicker name="req_date" bindTarget="sdic105_hn_other_con_change_req_create_ds" prompt="申请时间"/>
                <!--   <a:textArea name="description" bindTarget="sdic105_hn_other_con_change_req_create_ds" prompt="说明"/> -->
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>
