prj_project_number_update.lview 3.87 KB
Newer Older
Spencer Chang's avatar
Spencer Chang committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: DJ  
    $Date: 2013-2-26 下午2:37:49  
    $Revision: 1.0  
    $Purpose: projectNoScreen
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure><![CDATA[
    ]]></a:init-procedure>
    <a:view>
        <a:link id="bmLink_updateProjectNumber" model="prj.PRJ501.prj_project_number" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
	        function projectNoScreen_close()
	        {
	            $('prj_project_number_update').close();
	        }
	        
	        function projectNoScreen_setProjectId(project_id)
	        {
	            $('projectNoUpdateDs').getAt(0).set('project_id',project_id);
	        }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="projectNoUpdateDs" autoCreate="true" model="prj.PRJ501.prj_project">
                <a:fields>
                    <a:field name="project_id" defaultValue="${/parameter/@project_id}"/>
                    <a:field name="project_no" defaultValue="${/parameter/@project_no}" required="true"/>
                </a:fields>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:form title=" ">
                <a:textField name="project_no" bindTarget="projectNoUpdateDs"/>
            </a:form>
            <a:switch test="/parameter/@project_no">
                <a:case value="">
                    <script type="text/javascript"><![CDATA[
				        function projectNoScreen_save()
				        {
				            mask_projectNoScreen();
				            
				            var ds=$('projectNoUpdateDs');
				            if(!ds.validate()){
				                unmask_projectNoScreen();
				                return;
				            }
				            
				            projectMaintainScreen_updateProjectNo(ds.getAt(0).get('project_no'));
				    		projectMaintainScreen_save(false);
				        }
                	]]></script>
                    <a:hBox>
                        <a:button click="projectNoScreen_save" text="HLS.SAVE"/>
                        <a:button click="projectNoScreen_close" text="HLS.CLOSE"/>
                    </a:hBox>
                </a:case>
                <a:case value="*">
                    <script type="text/javascript"><![CDATA[
				        function projectNoScreen_updateProjectNumber()
				        {
				            mask_projectNoScreen();
				            var record=$('projectNoUpdateDs').getAt(0);
				            
				            Leaf.request({
				                url: $('bmLink_updateProjectNumber').getUrl(),
				                para: {
				                	project_id:record.get('project_id'),
				                	project_no:record.get('project_no')
				                },
				                success: function(res) {
				                    var record=$('projectNoUpdateDs').getAt(0);
				                    record.set('project_no',res['result']['project_no']);
				                    projectMaintainScreen_updateProjectNo(record.get('project_no'));
				                    Leaf.showMessage('${l:HLS.PROMPT}','${l:PRJ501.SAVE_SUCCESS_PROJECT_CODE}'+record.get('project_no'));
				                    unmask_projectNoScreen();
				                    projectNoScreen_close();
				                },
				                failure: function() {
				                    unmask_projectNoScreen();
				                },
				                error: function() {
				                    unmask_projectNoScreen();
				                },
				                scope: this
				            });
				        }
                	]]></script>
                    <a:hBox>
                        <a:button click="projectNoScreen_updateProjectNumber" text="修改项目编号"/>
                        <a:button click="projectNoScreen_close" text="HLS.CLOSE"/>
                    </a:hBox>
                </a:case>
            </a:switch>
        </a:screenBody>
    </a:view>
</a:screen>