<?xml version="1.0" encoding="UTF-8"?>
<!--
    $Author: gaoyang 
    $Date: 2015-4-13 下午05:06:40  
    $Revision: 1.0  
    $Purpose: 
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" xmlns:t="http://www.leaf-framework.org/touch">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="app.app_quote.hls_app_quote_query_detail" rootPath="quotation_detail_information_path"/>
    </a:init-procedure>
    <a:view template="touch">
        <script src="${/request/@context_path}/resource/leaf.ui.touch/default/base/iscroll.js" type="text/javascript"/>
        <script type="text/javascript"><![CDATA[
            function back() {
                location.href = '${/request/@context_path}/modules/touch/dashboard.lview';
            }
            
            function success(data) {
                if (data.success == true) {
                    window.location.href = '${/request/@context_path}/modules/touch/login.lview';
                }
            }
            
            function pre_step() {
                location.href = '${/request/@context_path}/modules/app/calculate.lview';
            }
            var sc = new iScroll('wrapper'); //false;
            
            function callback() {
                if (!sc) {
                    sc = new iScroll('wrapper');
                } else {
                    sc.refresh();
                }
            }
            
            
            //初始化数据
            
            function init_data() {
                Touch.get('quotation_detail_information_query').request(function(data) {
                    if (data.success) {
                        var record = data.result.record;
                        var car_info = record.car_info;
                        var arr_car_info = $('#car_info');
                        if (car_info != undefined) {
                            arr_car_info[0].value = car_info;
                        }
            
                        var loan_scheme = record.loan_scheme;
                        var arr_loan_scheme = $('#loan_scheme');
                        if (loan_scheme != undefined) {
                            arr_loan_scheme[0].value = loan_scheme;
                        }
            
                        var total_finance = record.total_finance;
                        var arr_total_finance = $('#total_finance');
                        if (total_finance != undefined) {
                            arr_total_finance[0].value = total_finance;
                        }
            
                        var downpayment = record.downpayment;
                        var arr_downpayment = $('#downpayment');
                        if (downpayment != undefined) {
                            arr_downpayment[0].value = downpayment;
                        }
            
                        var downpayment_ratio = record.downpayment_ratio;
                        var arr_downpayment_ratio = $('#downpayment_ratio');
                        if (downpayment_ratio != undefined) {
                            arr_downpayment_ratio[0].value = downpayment_ratio;
                        }
            
                        var deposit = record.deposit;
                        var arr_deposit = $('#deposit');
                        if (deposit != undefined) {
                            arr_deposit[0].value = deposit;
                        }
            
                        var deposit_ratio = record.deposit_ratio;
                        var arr_deposit_ratio = $('#deposit_ratio');
                        if (deposit_ratio != undefined) {
                            arr_deposit_ratio[0].value = deposit_ratio;
                        }
            
                        var fee = record.fee;
                        var arr_fee = $('#fee');
                        if (fee != undefined) {
                            arr_fee[0].value = fee;
                        }
            
                        var loan_balance = record.loan_balance;
                        var arr_loan_balance = $('#loan_balance');
                        if (loan_balance != undefined) {
                            arr_loan_balance[0].value = loan_balance;
                        }
            
                        var monthly_payment = record.monthly_payment;
                        var arr_monthly_payment = $('#monthly_payment');
                        if (monthly_payment != undefined) {
                            arr_monthly_payment[0].value = monthly_payment;
                        }
            
                        var final_balance = record.final_balance;
                        var arr_final_balance = $('#final_balance');
                        if (final_balance != undefined) {
                            arr_final_balance[0].value = final_balance;
                        }
                    } else {
                        alert('获取数据失败');
                    }
                }, function() {
                    alert('获取数据失败');
                });
            }
            document.addEventListener('touchmove', function(e) {
                e.preventDefault();
            }, false);
        ]]></script>
        <style media="all" type="text/css"><![CDATA[
            body,ul,li {
                padding:0;
                margin:0;
                border:0;
                background-color:#F4EEE9;
            }
            ul,li {
                list-style: none;
            }
            li {
                position: relative;
                border-bottom: #DBD7D2 1px solid;
                border-top: 1px solid #FCFAF9;
            }
            .cd tr {
                height:24px;
            }
            body {
                font-size:12px;
                -webkit-user-select:none;
                -webkit-text-size-adjust:none;
                font-family:helvetica;
            }
            a:link,a:visited{
                text-decoration:none;
                color:black;                    
            } 
            .ei{
                text-align:left;
                font-size:14px;
            }
            .name {
                font-size:20px;
                font-weight:700;
            }
            #header {
                position:absolute; z-index:0;
                top:0; left:0;
                width:100%;
                height:40px;
                background-color:#d51875;
                background:url(${/request/@context_path}/images/touch/bgtop.gif) repeat-x;
                padding:0;
                color:#eee;
                font-size:20px;
                text-align:center;
            }
            #wrapper {
                padding:2px;
                margin-top:38px;
            }
            #scroller {
                position:absolute; z-index:1;
            /*  -webkit-touch-callout:none;*/
                -webkit-tap-highlight-color:rgba(0,0,0,0);
                width:100%;
                padding:0;
            }
            .label  {
                line-height:2em;
                font-size:1.5em;
                height:2em;
            }
            .info {
                line-height:2em;
                font-size:1.5em;
                height:2em;
            }
                
        ]]></style>
        <center>
            <t:ajax id="quotation_detail_information_query" url="${/request/@context_path}/autocrud/app.app_quote.hls_app_quote_query_detail/query">
                <t:parameters>
                    <t:parameter name="chance_id" dataType="java.lang.String" value="${/parameter/@chance_id}"/>
                </t:parameters>
            </t:ajax>
            <div id="all">
                <div id="header">
                    <span style="margin-top:2px;float:right;margin-top:5px;font-size:16px;height:30px;width:70px;margin-right:5px;"/>
                    <span style="line-height:40px;font-size:20px;font-weight:700"><![CDATA[商机报价]]></span>
                    <t:button className="gray" style="margin-top:2px;float:left;margin-top:5px;font-size:16px;height:30px;width:70px;margin-right:5px;margin-left:2px;" text="重新报价">
                        <t:events>
                            <t:event name="click" handler="pre_step"/>
                        </t:events>
                    </t:button>
                </div>
                <div id="wrapper">
                    <div style="width:100%;background:#fff;min-height:100%;font-size:12px;">
                        <table cellspacing="0" style="width:100%">
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[车辆信息]]></span>
                                        </div>
                                        <input name="car_info" id="car_info" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[贷款方案]]></span>
                                        </div>
                                        <input name="loan_scheme" id="loan_scheme" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[融资总额]]></span>
                                        </div>
                                        <input name="total_finance" id="total_finance" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[首付金额]]></span>
                                        </div>
                                        <input name="downpayment" id="downpayment" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[首付比例]]></span>
                                        </div>
                                        <input name="downpayment_ratio" id="downpayment_ratio" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[保证金]]></span>
                                        </div>
                                        <input name="deposit" id="deposit" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[保证金比例]]></span>
                                        </div>
                                        <input name="deposit_ratio" id="deposit_ratio" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[手续费]]></span>
                                        </div>
                                        <input name="fee" id="fee" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[贷款余额]]></span>
                                        </div>
                                        <input name="loan_balance" id="loan_balance" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[月供]]></span>
                                        </div>
                                        <input name="monthly_payment" id="monthly_payment" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div style="background-color: #e8e8e8; padding: 0px 8px;-webkit-border-radius: 4px;border:1px solid #333;font-size:1.5em;height:1.5em;line-height:1.5em;">
                                        <div style="float:left;width:35%;">
                                            <span><![CDATA[尾款余额]]></span>
                                        </div>
                                        <input name="final_balance" id="final_balance" disabled="true" style="float:right;border:0px;outline:0px;margin:0px;padding:0px;height:100%;font-size:1em;line-height:1em;background:none;width:65%;text-align:center" type="text"/>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </center>
        <script type="text/javascript"><![CDATA[
		    init_data();
		]]></script>
    </a:view>
</a:screen>