ast_lease_item_maintance.lview 14.1 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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: qm  
    $Date: 2014-4-18 下午1:49:31  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application">
    <a:init-procedure/>
    <a:view>
        <a:link id="lease_item_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/>
        <a:link id="ast_confirm_license_fee_id" model="ast.AST502.ast_confirm_license_fee" modelaction="update"/>
        <script type="text/javascript"><![CDATA[
            function reset() {
                $('con_item_info_query_ds').reset();
            }
            
            function query() {
                $('ast_car_license_result_ds').removeAll();
                $('con_item_info_ds').query();
            }
            
            function save() {
                $('ast_car_license_result_ds').setSubmitParameter('item_detail_id', $('con_item_info_ds').getSelected()[0].get('item_detail_id'));
                $('ast_car_license_result_ds').submit();
            }
            
            function attachment_upload() {
                var header_id = $('con_item_info_ds').getCurrentRecord().get('contract_id');
                var url = $('lease_item_uploadFile_id').getUrl() + '?table_name=CON_CONTRACT_ITEM_DETAIL&header_id=' + header_id;
                var win = new Leaf.Window({
                    url: url,
                    title: '${l:HLS.SUPPORTING_DOCUMENT}',
                    id: 'item_detail_uploadFile_id',
                    width: 850,
                    height: 400
                });
                win.on('close', function() {});
            }
            
            function changeHandler(th, val, oldVal) {
                if (th == $('brand_dis_id')) {
                    $('con_item_info_query_ds').getCurrentRecord().set('series_dis', '');
                    $('con_item_info_query_ds').getCurrentRecord().set('series_id', '');
                    $('con_item_info_query_ds').getCurrentRecord().set('model_dis', '');
                    $('con_item_info_query_ds').getCurrentRecord().set('model_id', '');
                } else if (th == $('series_dis_id')) {
                    $('con_item_info_query_ds').getCurrentRecord().set('model_dis', '');
                    $('con_item_info_query_ds').getCurrentRecord().set('model_id', '');
                }
            }
            
            function updateHandler(ds, rec, name, val, oldVal) {
                if (name == 'brand_id') {
                    $('car_series_ds').setQueryParameter('brand_id', $('con_item_info_query_ds').getCurrentRecord().get('brand_id'));
                    $('car_series_ds').query();
                } else if (name == 'series_id') {
                    $('car_model_ds').setQueryParameter('brand_id', $('con_item_info_query_ds').getCurrentRecord().get('brand_id'));
                    $('car_model_ds').setQueryParameter('series_id', $('con_item_info_query_ds').getCurrentRecord().get('series_id'));
                    $('car_model_ds').query();
                }
            }
            
            function enterdownHandler(felid, evt) {
                $('con_item_info_ds').query();
            }
            
            function indexChangeFunction(ds, record) {
                $('ast_car_license_result_ds').setQueryParameter('item_detail_id', record.get('item_detail_id'));
                $('ast_car_license_result_ds').query();
            }
            
            function confirm_license_fee() {
                Leaf.showConfirm('确认', '您确定提交租牌费用吗?', function() {
                    var record = $('ast_car_license_result_ds').getCurrentRecord();
                    if (record.length < 1) {
                        Leaf.showMessage('提示', '请选择列!');
                        return;
                    }
                    if (Leaf.isEmpty(record.get('license_fee'))) {
                        Leaf.showMessage('提示', '租牌费用为空!');
                        return;
            
                    }
                    var ast_car_license_id = record.get('ast_car_license_id');
                    Leaf.request({
                        url: $('ast_confirm_license_fee_id').getUrl(),
                        para: {
                            ast_car_license_id: ast_car_license_id
                        },
                        success: function() {
                            Leaf.SideBar.show({
                                msg: '操作成功',
                                duration: 2000
                            });
                            $('ast_car_license_result_ds').query();
                        },
                        failure: function() {
            
                           },
                        error: function() {
            
                           },
                        scope: this
                    });
                });
            }
        ]]></script>
        <a:dataSets>
            <a:dataSet id="yes_no_ds" lookupCode="YES_NO"/>
            <a:dataSet id="car_brands_ds" fetchAll="true" loadData="true" model="ast.AST501.hls_car_brands"/>
            <a:dataSet id="car_series_ds" fetchAll="true" model="ast.AST501.hls_car_series"/>
            <a:dataSet id="car_model_ds" fetchAll="true" model="ast.AST501.hls_car_model"/>
            <a:dataSet id="con_item_info_query_ds">
                <a:fields>
                    <a:field name="gua_bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="ast.AST502.hls_bp_master_all_v?bp_category=GUARANTOR" lovWidth="520" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_name" to="gua_bp_name"/>
                            <a:map from="bp_id" to="bp_id_gua"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_id_gua"/>
                    <a:field name="contract_number"/>
                    <a:field name="item_frame_number"/>
                    <a:field name="bp_name"/>
                    <a:field name="brand_id"/>
                    <a:field name="brand_dis" displayField="brand_dis" options="car_brands_ds" returnField="brand_id" valueField="brand_id"/>
                    <a:field name="series_id"/>
                    <a:field name="series_dis" displayField="series_dis" options="car_series_ds" returnField="series_id" valueField="series_id"/>
                    <a:field name="model_id"/>
                    <a:field name="model_dis" displayField="model_dis" options="car_model_ds" returnField="model_id" valueField="model_id"/>
                    <a:field name="exist_flag"/>
                    <a:field name="exist_flag_des" displayField="code_value_name" options="yes_no_ds" prompt="是否维护" returnField="exist_flag" valueField="code_value"/>
                    <a:field name="mortgage_flag"/>
                    <a:field name="mortgage_flag_des" displayField="code_value_name" options="yes_no_ds" prompt="是否办理抵押" returnField="mortgage_flag" valueField="code_value"/>
                    <a:field name="company_authority" defaultValue="${/session/@company_id}"/>
                </a:fields>
                <a:events>
                    <a:event name="update" handler="updateHandler"/>
                </a:events>
            </a:dataSet>
            <a:dataSet id="con_item_info_ds" autoQuery="true" model="ast.AST502.con_contract_item_v" pageSize="6" queryDataSet="con_item_info_query_ds" selectable="true" selectionModel="single">
                <a:fields>
                    <a:field name="contract_number"/>
                    <a:field name="bp_name"/>
                    <a:field name="brand_dis"/>
                    <a:field name="series_dis"/>
                    <a:field name="model_dis"/>
                    <a:field name="color_of_apprearance"/>
                    <a:field name="color_of_decoration"/>
                    <a:field name="item_frame_number"/>
                    <a:field name="item_engine_number"/>
                    <!-- <a:field name="key_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                    <a:field name="registration_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                    <a:field name="purchase_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/>
                    <a:field name="insurance_flag" checkedValue="Y" defaultValue="N" readOnly="true" uncheckedValue="N"/> -->
                </a:fields>
                <a:events>
                    <a:event name="indexchange" handler="indexChangeFunction"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="query" text="查询"/>
                <a:gridButton click="reset" text="重置"/>
                <a:gridButton click="save" text="保存"/>
                <a:gridButton click="confirm_license_fee" text="提交费用"/>
            </a:screenTopToolbar>
            <a:form column="5" labelWidth="100" marginWidth="30" title="HLS.QUERY_TITLE">
                <a:textField name="contract_number" bindTarget="con_item_info_query_ds" prompt="合同号">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:textField>
                <!-- <a:textField name="license_number" bindTarget="con_item_info_query_ds" prompt="车牌号">
                            <a:events>
                                <a:event name="enterdown" handler="enterdownHandler"/>
                            </a:events>
                        </a:textField> -->
                <a:textField name="bp_name" bindTarget="con_item_info_query_ds" prompt="承租人">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:textField>
                <a:comboBox name="brand_dis" id="brand_dis_id" bindTarget="con_item_info_query_ds" prompt="品牌">
                    <a:events>
                        <a:event name="change" handler="changeHandler"/>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:comboBox>
                <a:comboBox name="series_dis" id="series_dis_id" bindTarget="con_item_info_query_ds" prompt="车系">
                    <a:events>
                        <a:event name="change" handler="changeHandler"/>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:comboBox>
                <a:comboBox name="model_dis" bindTarget="con_item_info_query_ds" prompt=" 车型">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:comboBox>
                <a:textField name="item_frame_number" bindTarget="con_item_info_query_ds" prompt="车架号">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:textField>
                <a:textField name="item_engine_number" bindTarget="con_item_info_query_ds" prompt="发动机号">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:textField>
                <a:comboBox name="exist_flag_des" bindTarget="con_item_info_query_ds" prompt="是否已维护">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:comboBox>
                <a:comboBox name="mortgage_flag_des" bindTarget="con_item_info_query_ds" prompt="是否办理抵押">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:comboBox>
                <a:lov name="gua_bp_name" bindTarget="con_item_info_query_ds" prompt="担保人">
                    <a:events>
                        <a:event name="enterdown" handler="enterdownHandler"/>
                    </a:events>
                </a:lov>
            </a:form>
            <a:grid bindTarget="con_item_info_ds" height="200" marginWidth="30" navBar="true">
                <a:columns>
                    <a:column name="contract_number" prompt="合同号" width="120"/>
                    <a:column name="bp_name" prompt="承租人" showTitle="true" width="225"/>
                    <a:column name="brand_dis" prompt="品牌" showTitle="true" width="140"/>
                    <a:column name="series_dis" prompt="车系" showTitle="true" width="140"/>
                    <a:column name="model_dis" prompt="车型" showTitle="true" width="220"/>
                    <a:column name="color_of_apprearance" prompt="外观颜色" showTitle="true" width="120"/>
                    <!-- <a:column name="color_of_decoration" prompt="内饰颜色" width="60"/> -->
                    <!-- <a:column name="license_number" prompt="车牌号" width="80"/> -->
                    <a:column name="item_frame_number" prompt="车架号" showTitle="true" width="180"/>
                    <a:column name="item_engine_number" prompt="发动机号" showTitle="true" width="150"/>
                    <!-- <a:column name="key_flag" editor="item_info_cb" prompt="钥匙" width="55"/>
                        <a:column name="registration_flag" editor="item_info_cb" prompt="登记证" width="55"/>
                        <a:column name="purchase_flag" editor="item_info_cb" prompt="购置税证" width="55"/>
                        <a:column name="insurance_flag" editor="item_info_cb" prompt="保单" width="55"/> -->
                </a:columns>
                <a:editors>
                    <a:textField id="item_info_tf"/>
                    <a:checkBox id="item_info_cb"/>
                </a:editors>
            </a:grid>
            <a:screen-include screen="modules/ast/AST502/ast_car_license.lview"/>
        </a:screenBody>
    </a:view>
</a:screen>