<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: 凭证模板头
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure>
        <a:model-query defaultWhereClause="t1.je_template_hd_id = ${/parameter/@je_template_hd_id}" model="gld.GLD107.gld_je_template_hds" rootPath="template_head_record"/>
    </a:init-procedure>
    <a:view>
        <a:link id="bmLink_template_copy" model="gld.GLD107.gld_je_template_hds" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
        
        function tpltCopyPage_close() {
            $('gld_je_template_copy').close();
        }
        
        function tpltCopyPage_copy() {
            var ds = $('templateCopyDs');
            if(ds.validate())
            {
                Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认', function () {
                    var record = ds.getAt(0);
		            Leaf.request({
		                url: $('bmLink_template_copy').getUrl(),
		                para: {
		                	je_template_hd_id : record.get('je_template_hd_id'),
		                	to_je_template_code : record.get('to_je_template_code'),
		                	to_je_template_desc : record.get('to_je_template_desc')
		                },
		                success: function(res) {
		                    tpltCopyPage_close();
		                },
		                failure: function() {
		                },
		                error: function() {
		                },
		                scope: this
		            });
                });
            }
        }
        
        ]]></script>
        <a:dataSets>
            <a:dataSet id="templateCopyDs" model="gld.GLD107.gld_je_template_hds">
                <a:datas dataSource="/model/template_head_record"/>
                <a:fields>
                    <a:field name="je_template_code" readOnly="true"/>
                    <a:field name="je_template_desc" readOnly="true"/>
                    <a:field name="to_je_template_code" required="true"/>
                    <a:field name="to_je_template_desc" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="tpltCopyPage_close" text="HLS.CLOSE"/>
                <a:gridButton click="tpltCopyPage_copy" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" labelWidth="120" title="HAP_QUERY_TITLE">
                <a:textField name="je_template_code" bindTarget="templateCopyDs" prompt="原代码"/>
                <a:textField name="je_template_desc" bindTarget="templateCopyDs" prompt="原名称"/>
                <a:textField name="to_je_template_code" bindTarget="templateCopyDs" prompt="新代码"/>
                <a:textField name="to_je_template_desc" bindTarget="templateCopyDs" prompt="新名称"/>
            </a:form>
        </a:screenBody>
    </a:view>
</a:screen>