prj_project_special_retail.lview 9.12 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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: ZLF  
    $Date: 2014-11-4 下午5:45:35  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure><![CDATA[
		
	]]></a:init-procedure>
    <a:view>
        <a:link id="special_retail_submit_link" model="prj.PRJ801.prj_project_special_retail_submit" modelaction="execute"/>
        <a:link id="special_retail_query_link" url="${/request/@context_path}/modules/prj/PRJ802/prj_project_special_retail_query.lview"/>
        <script type="text/javascript"><![CDATA[
    		function prj801_save() {
    		    $('prj_project_special_retail_ds').submit();
    		}
    		
    		function prj801_submit() {
    		    var record = $('prj_project_special_retail_ds').getCurrentRecord();
    		    var special_retail_id = record.get('special_retail_id');
    		    if (Leaf.isEmpty(special_retail_id)) {
    		       Leaf.showMessage('提示','请先保存!');
    		       return;
    		    }
    		    Leaf.showConfirm('提示','您确认提交吗?',function(){
    		       Leaf.request({
    		           url:$('special_retail_submit_link').getUrl(),
    		           para:{
    		               special_retail_id:record.get('special_retail_id')
    		           },
    		            success: function() {
                            Leaf.SideBar.show({
                                msg: '提交成功',
                                duration: 2000
                            });
                            Leaf.go($('special_retail_query_link').getUrl());
                        }
    		       });
    		    });
    		}
    		
    		function prj801_reset() {
    		    $('prj_project_special_retail_ds').reset();
    		}
    		
    		function submitsuccessHandler(ds,res) {
    		    var record = $('prj_project_special_retail_ds').getCurrentRecord();
    		    record.set('special_retail_id',res.result.record['special_retail_id']);
    		}
    		
    		function changeHandler(th, val, oldVal) {
                if (th == $('brand_dis_id')) {
                    $('prj_project_special_retail_ds').getCurrentRecord().set('series_dis', '');
                    $('prj_project_special_retail_ds').getCurrentRecord().set('series_id', '');
                    $('prj_project_special_retail_ds').getCurrentRecord().set('model_dis', '');
                    $('prj_project_special_retail_ds').getCurrentRecord().set('model_id', '');
                } else if (th == $('series_dis_id')) {
                    $('prj_project_special_retail_ds').getCurrentRecord().set('model_dis', '');
                    $('prj_project_special_retail_ds').getCurrentRecord().set('model_id', '');
                }
            }
            
            function updateHandler(ds, rec, name, val, oldVal) {
                if (name == 'brand_id') {
                    $('car_series_ds').setQueryParameter('brand_id', $('prj_project_special_retail_ds').getCurrentRecord().get('brand_id'));
                    $('car_series_ds').query();
                } else if (name == 'series_id') {
                    $('car_model_ds').setQueryParameter('brand_id', $('prj_project_special_retail_ds').getCurrentRecord().get('brand_id'));
                    $('car_model_ds').setQueryParameter('series_id', $('prj_project_special_retail_ds').getCurrentRecord().get('series_id'));
                    $('car_model_ds').query();
                }
            }
    	]]></script>
        <a:dataSets>
            <a:dataSet id="car_brands_ds" fetchAll="true" loadData="true" model="hls.HLS222.hls_car_brands"/>
            <a:dataSet id="car_series_ds" fetchAll="true" model="hls.HLS222.hls_car_series"/>
            <a:dataSet id="car_model_ds" fetchAll="true" model="hls.HLS222.hls_car_model"/>
            <a:dataSet id="special_category_ds" fetchAll="true" loadData="true" lookupCode="PRJ801_SPECIAL_RETAIL_CATEGORY"/>
            <a:dataSet id="special_retail_status" fetchAll="true" loadData="true" lookupCode="PRJ801_SPECIAL_RETAIL_STATUS"/>
            <a:dataSet id="prj_project_special_retail_ds" autoCreate="true" model="prj.PRJ801.prj_special_retail">
                <a:fields>
                    <a:field name="special_retail_id"/>
                    <a:field name="special_retail_number" readOnly="true"/>
                    <a:field name="user_id" readOnly="true"/>
                    <a:field name="customer_name" required="true"/>
                    <a:field name="years_of_application" required="true"/>
                    <a:field name="product_name" required="true"/>
                    <a:field name="brand_id"/>
                    <a:field name="brand_dis" displayField="brand_dis" options="car_brands_ds" required="true" returnField="brand_id" valueField="brand_id"/>
                    <a:field name="series_id"/>
                    <a:field name="series_dis" displayField="series_dis" options="car_series_ds" required="true" returnField="series_id" valueField="series_id"/>
                    <a:field name="model_id"/>
                    <a:field name="model_dis" displayField="model_dis" options="car_model_ds" required="true" returnField="model_id" valueField="model_id"/>
                    <a:field name="risk_open" required="true"/>
                    <a:field name="special_category"/>
                    <a:field name="special_category_des" displayField="code_value_name" options="special_category_ds" required="true" returnField="special_category" valueField="code_value"/>
                    <a:field name="status" defaultValue="NEW"/>
                    <a:field name="status_des" defaultValue="新建" displayField="code_value_name" options="special_retail_status" readOnly="true" required="true" returnField="status" valueField="code_value"/>
                    <a:field name="description"/>
                    <a:field name="special_content" required="true"/>
                    <a:field name="apply_reason" required="true"/>
                    <a:field name="document_category" defaultValue="CONTRACT"/>
                    <a:field name="document_type" defaultValue="SPECIAL_APPROVAL"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="updateHandler"/>
                    <a:event name="submitsuccess" handler="submitsuccessHandler"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="prj801_save" text="保存"/>
                <a:gridButton click="prj801_submit" text="提交"/>
            </a:screenTopToolbar>
            <a:form column="1" title="单据信息" width="1000">
                <a:hBox>
                    <a:textField name="special_retail_number" bindTarget="prj_project_special_retail_ds" prompt="申请编号"/>
                    <a:textField name="user_id" bindTarget="prj_project_special_retail_ds" prompt="申请人"/>
                    <a:textField name="customer_name" bindTarget="prj_project_special_retail_ds" prompt="客户名称"/>
                    <a:textField name="years_of_application" bindTarget="prj_project_special_retail_ds" prompt="申请年限"/>
                </a:hBox>
                <a:hBox>
                    <a:textField name="product_name" bindTarget="prj_project_special_retail_ds" prompt="产品名称"/>
                    <a:comboBox name="brand_dis" id="brand_dis_id" bindTarget="prj_project_special_retail_ds" prompt="品牌">
                        <a:events>
                            <a:event name="change" handler="changeHandler"/>
                        </a:events>
                    </a:comboBox>
                    <a:comboBox name="series_dis" id="series_dis_id" bindTarget="prj_project_special_retail_ds" prompt="车系">
                        <a:events>
                            <a:event name="change" handler="changeHandler"/>
                        </a:events>
                    </a:comboBox>
                    <a:comboBox name="model_dis" id="model_dis_id" bindTarget="prj_project_special_retail_ds" prompt="车型"/>
                </a:hBox>
                <a:hBox>
                    <a:textField name="risk_open" bindTarget="prj_project_special_retail_ds" prompt="风险敞口"/>
                    <a:comboBox name="special_category_des" bindTarget="prj_project_special_retail_ds" prompt="特批类型"/>
                    <a:comboBox name="status_des" bindTarget="prj_project_special_retail_ds" prompt="状态"/>
                </a:hBox>
                <a:hBox labelWidth="120">
                    <a:textField name="description" bindTarget="prj_project_special_retail_ds" prompt="其他(具体说明)" width="572"/>
                </a:hBox>
            </a:form>
            <a:hBox labelWidth="100" marginWidth="250">
                <a:textArea name="special_content" bindTarget="prj_project_special_retail_ds" height="150" prompt="特批内容" width="700"/>
            </a:hBox>
            <a:hBox labelWidth="100" marginWidth="250">
                <a:textArea name="apply_reason" bindTarget="prj_project_special_retail_ds" height="150" prompt="申请理由" width="700"/>
            </a:hBox>
        </a:screenBody>
    </a:view>
</a:screen>