<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: LR  
    $Date: 2013-8-21 下午02:46:21  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure/>
    <a:view>
        <a:link id="hls220_prj_cdd_item_templet_hd" model="hls.HLS220.prj_cdd_item_templet_hd" modelaction="execute"/>
        <script type="text/javascript"><![CDATA[
        	function hls220_templet_copy_close() {
        	    $('hls220_prj_cdd_item_templet_hd_copy_window').close();
        	}
        	
        	function hls220_templet_copy_save() {
        	    var ds = $('hls220_templet_copy_ds');
        	    if (ds.validate()) {
        	        var record = ds.getAt(0);
        	        Leaf.request({
        	            url: $('hls220_prj_cdd_item_templet_hd').getUrl(),
        	            para: {
        	                templet_head_id: record.get('templet_head_id'),
        	                new_templet_code: record.get('new_templet_code'),
        	                new_templet_name: record.get('new_templet_name')
        	            },
        	            success: function(res) {
        	                hls220_templet_copy_close();
        	                hls220_templet_query();
        	            },
        	            scope: this
        	        });
        	    }
        	}
    	]]></script>
        <a:dataSets>
            <a:dataSet id="hls220_templet_copy_ds">
                <a:fields>
                    <a:field name="templet_code" readOnly="true"/>
                    <a:field name="templet_name" readOnly="true"/>
                    <a:field name="new_templet_name" required="true"/>
                    <a:field name="new_templet_code" required="true"/>
                    <a:field name="templet_head_id" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="hls220_templet_copy_close" text="HLS.CLOSE"/>
                <a:gridButton click="hls220_templet_copy_save" text="HLS.SAVE"/>
            </a:screenTopToolbar>
            <a:form column="2" title=" ">
                <a:textField name="templet_code" bindTarget="hls220_templet_copy_ds" prompt="HLS220.OLD_TEMPLET_CODE"/>
                <a:textField name="templet_name" bindTarget="hls220_templet_copy_ds" prompt="HLS220.OLD_TEMPLET_NAME"/>
                <a:textField name="new_templet_code" bindTarget="hls220_templet_copy_ds" prompt="HLS.TEMPLET_CODE" typeCase="upper"/>
                <a:textField name="new_templet_name" bindTarget="hls220_templet_copy_ds" prompt="HLS.TEMPLET_NAME"/>
            </a:form>
            <script type="text/javascript"><![CDATA[
                Leaf.onReady(function() {
                    var records = $('hls220_templet_result_ds').getSelected();
                    var record = new Leaf.Record({
                        templet_code: records[0].get('templet_code'),
                        templet_name: records[0].get('templet_name'),
                        templet_head_id: records[0].get('templet_head_id')
                    });
                    $('hls220_templet_copy_ds').create(record.data);
                });
            ]]></script>
        </a:screenBody>
    </a:view>
</a:screen>
