You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/frontend/views/non-auto-insurance/info.php

758 lines
47 KiB

5 years ago
<?php
use \common\libs\MyLib;
use \common\models\PriceT;
$my = $this->context->my;
?>
<link href="/css/tabs.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript" src="/js/common2.js"></script>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<tr>
<td height="22" colspan="2" class="td_bg">
<table width="100%" align="center" height="120" border="0" cellpadding="0" cellspacing="0" id="mainTable">
<tr>
<td height="120" valign="top" class="td_bg">
<!--预约信息-->
<table>
<tbody>
<tr>
<TD height="30" align="center" class=tab-on id=navcell onclick=open_up(1) name="navcell">▼非车险信息</TD>
</tr>
</tbody>
</table>
<TABLE id=tb1 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb">
<TR>
<TD vAlign=top>
<form id="myform">
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="bg_tr">被保险人姓名</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->insurant_name?>" name="insurant_name"/></td>
<td width="100" height="25" class="bg_tr">证件号</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->insurant_number?>" name="insurant_number"/></td>
<td width="100" height="25" class="bg_tr">电话</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->insurant_phone?>" name="insurant_phone"/></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">投保人姓名</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->policy_holder_name?>" name="policy_holder_name"/></td>
<td width="100" height="25" class="bg_tr">证件号</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->policy_holder_number?>" name="policy_holder_number"/></td>
<td width="100" height="25" class="bg_tr">电话</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->policy_holder_phone?>" name="policy_holder_phone"/></td>
</tr>
<tr>
<td width="100" height="25" class="bg_tr">受益人姓名</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->beneficiary_name?>" name="beneficiary_name"/></td>
<td width="100" height="25" class="bg_tr">证件号</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->beneficiary_number?>" name="beneficiary_number"/></td>
<td width="100" height="25" class="bg_tr">电话</td>
<td height="25" class="td_bg"><input type="text" value="<?=$info->beneficiary_phone?>" name="beneficiary_phone"/></td>
</tr>
<tr>
<td height="22" colspan="6" align="center" class="td_bg">
<input type=button class="ACT_btn baocun" name="next-btn" value=" 保存 "/>
<input type="button" class="ACT_btn back-btn" name="Submit3" value=" 返回 ">
</td>
</tr>
</table>
</form>
</TD>
</TR>
</TABLE>
<!--保单信息-->
<!-- <table>-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <TD height="30" align="center" class=tab-off id=navcell onclick=open_up(2) name="navcell">▲保单信息</TD>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<TABLE id=tb2 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<form id="orderFrm">
<table width="98%" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<!-- <td width="10px;">&nbsp;</td>-->
<!-- <td width="55%" valign="top">-->
<!-- <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">-->
<!-- <tr>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 商业总净保费</td>-->
<!-- <td class="td_bg"><input name="total1_clear" id="total1_clear" type="text" value="--><?//=$order_info->total1_clear?><!--" style="width:100px;"></td>-->
<!-- <td class="bg_tr">商业含税总保费</td>-->
<!-- <td class="td_bg"><input name="total1" id="total1" type="text" onblur="calb()" value="--><?//=$order_info->total1?><!--" style="width:100px;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 交强总净保费</td>-->
<!-- <td class="td_bg"><input name="total2_clear" id="total2_clear" type="text" value="--><?//=$order_info->total2_clear?><!--" style="width:100px;"></td>-->
<!-- <td class="bg_tr">交强含税总保费</td>-->
<!-- <td class="td_bg"><input name="total2" id="total2" type="text" onblur="calb()" value="--><?//=$order_info->total2?><!--" style="width:100px;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 折扣后商业净保费</td>-->
<!-- <td class="td_bg"><input name="total1_real" id="total1_real" type="text" value="--><?//=$order_info->total1_real?><!--" style="width:100px;"></td>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 车船税</td>-->
<!-- <td class="td_bg"><input name="total3" id="total3" type="text" value="--><?//=$order_info->total3?><!--" style="width:100px;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">减免金额</td>-->
<!-- <td class="td_bg"><input name="total1_dis" id="total1_dis" type="text" value="--><?//=$order_info->total1_dis?><!--" style="width:100px;"></td>-->
<!-- <td class="bg_tr">共计签单</td>-->
<!-- <td class="td_bg"><input name="total_all" id="total_all" type="text" value="--><?//=$order_info->total_all?><!--" style="width:100px;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">商业折扣率</td>-->
<!-- <td class="td_bg"><input name="total1_percent" id="total1_percent" type="text" value="--><?//=$order_info->total1_percent?><!--" style="width:100px;"></td>-->
<!-- <td class="bg_tr">应收</td>-->
<!-- <td class="td_bg"><input name="total_real" id="total_real" type="text" value="--><?//=$order_info->total_real?><!--" style="width:100px;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">备注</td>-->
<!-- <td colspan="3" class="td_bg"><input name="price_remark" id="price_remark" type="text" value="--><?//=$order_info->price_remark?><!--" style="width:80%;"></td>-->
<!-- </tr>-->
<!-- </table>-->
<!-- <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table">-->
<!-- <tr class="tdbg2">-->
<!-- <td colspan="4" class="bg_tr">短信</td>-->
<!-- </tr>-->
<!-- <tbody>-->
<!-- <tr class="tdbg2">-->
<!-- <td width="85" class="bg_tr">手机号码</td>-->
<!-- <td colspan="3" class="td_bg">-->
<!-- <input type="text" id="sms-tel" name="sms-tel" value="--><?//=$order_info->link_phone==''?$car_info->phone:$order_info->link_phone?><!--">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr class="tdbg2">-->
<!-- <td width="85" class="bg_tr">短信内容</td>-->
<!-- <td colspan="3" class="td_bg">-->
<!-- <textarea id="sms-msg" name="sms-msg" style="width: 350px; height: 50px;"></textarea>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr class="tdbg2">-->
<!-- <td width="85" class="bg_tr"></td>-->
<!-- <td colspan="3" class="td_bg">-->
<!-- <input class="act_btn sms-make-btn" type="button" value="生成短信内容">-->
<!-- <!--input class="act_btn sms-send-btn" type="button" value="发送短信"-->-->
<!-- </td>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<!-- </td>-->
</tr>
</table>
<!-- <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table" style="table-layout: fixed;">-->
<!-- <input type="hidden" name="order_id" value="--><?//=$order_info->id?><!--">-->
<!-- <input type="hidden" name="car_id" id="car_id" value="--><?//=$order_info->car_id?><!--">-->
<!-- <tr>-->
<!-- <td width="100" height="25" class="bg_tr">车牌号</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input name="car_no" type="text" value="--><?//=$car_info->car_no?><!--" style="width:100px;"/>-->
<!-- </td>-->
<!-- <td width="100" height="25" class="bg_tr">初登日期</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input class="act_date" name="register_date" type="text" value="--><?//=$car_info->register_date?><!--" onclick="WdatePicker()"/>-->
<!-- </td>-->
<!-- <td class="bg_tr">电子邮件</td>-->
<!-- <td class="td_bg">-->
<!-- <input type="text" id="email" name="email" value="--><?//=$order_info->email?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 成功理由</td>-->
<!-- <td class="td_bg">-->
<!-- <select name="success_id" id="success_id">-->
<!-- <option value="0">---请选择---</option>-->
<!-- --><?php
// foreach($success_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($order_info->success_id == $item->id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td width="100" height="25" class="bg_tr">车主</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input type="text" id="car_man" name="car_man" value="--><?//=$car_info->car_man?><!--" style="width:100px;" >-->
<!-- </td>-->
<!-- <td width="100" height="25" class="bg_tr">证件号码</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input type="text" name="car_man_number" id="car_man_number" value="--><?//=$car_info->car_man_number?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td width="100" height="25" class="bg_tr">微信号</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input type="text" name="car_man_weixin" id="car_man_weixin" value="--><?//=$car_info->weixin?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td width="60" height="25" class="bg_tr"><span style="color:#ff0000">*</span>座位数</td>-->
<!-- <td height="25" class="td_bg">-->
<!-- <input name="seats" id="seats" type="text" value="--><?//=$car_info->seats?><!--" style="width:50px;"/>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">被保险人</td>-->
<!-- <td class="td_bg">-->
<!-- <input type="text" id="id_man" name="id_man" value="--><?//=$order_info->id_man?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td class="bg_tr">证件号码</td>-->
<!-- <td class="td_bg">-->
<!-- <input type="text" id="id_number" name="id_number" value="--><?//=$order_info->id_number?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td width="60" class="bg_tr">联系人</td>-->
<!-- <td class="td_bg">-->
<!-- <input type="text" id="link_man" name="link_man" value="--><?//=$order_info->link_man?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- <td width="60" class="bg_tr">联系电话</td>-->
<!-- <td class="td_bg">-->
<!-- <input type="text" id="link_phone" name="link_phone" value="--><?//=$order_info->link_phone?><!--" style="width:100px;">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr" nowrap><span style="color:#ff0000">*</span> 商业起保日期</td>-->
<!-- <td class="td_bg">-->
<!-- <input class="act_date" type="text" id="insurer1_begin_date" name="insurer1_begin_date" value="--><?//=$order_info->insurer1_begin_date?><!--" onClick="WdatePicker()">-->
<!-- </td>-->
<!-- <td class="bg_tr" nowrap><span style="color:#ff0000">*</span> 交强起保日期</td>-->
<!-- <td class="td_bg">-->
<!-- <input class="act_date" type="text" id="insurer2_begin_date" name="insurer2_begin_date" value="--><?//=$order_info->insurer2_begin_date?><!--" onClick="WdatePicker()">-->
<!-- </td>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span>支付方式</td>-->
<!-- <td class="td_bg">-->
<!-- <select name="shoufei_id" id="shoufei_id">-->
<!-- <option value="">---收费方式---</option>-->
<!-- <option value="1" --><?php //if($order_info->shoufei_id ==1) echo ' selected '; ?><!-->---上门收费---</option>-->
<!-- <option value="2" --><?php // if($order_info->shoufei_id ==2) echo ' selected '; ?><!-->---在线支付---</option>-->
<!-- <option value="3" --><?php // if($order_info->shoufei_id ==3) echo ' selected '; ?><!-->---客户自上门---</option>-->
<!-- </select>-->
<!-- <select name="pay_type_id" id="pay_type_id">-->
<!-- <option value="">---付款方式---</option>-->
<!-- --><?php
// foreach($pay_type_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->pay_type_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span>保险公司</td>-->
<!-- <td class="td_bg">-->
<!-- <select name="company2_id" id="company2_id" style="width:100px;">-->
<!-- <option value="0">---请选择---</option>-->
<!-- --><?php
// foreach($insurer_company2_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->company2_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">送单范围</td>-->
<!-- <td colspan="5" class="td_bg">-->
<!-- <select name="direction1_id">-->
<!-- <option value="0"></option>-->
<!-- --><?php
// foreach($direction_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->direction1_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- <select name="range1_id">-->
<!-- <option value="0"></option>-->
<!-- --><?php
// foreach($range_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->range1_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- <select name="city1_id">-->
<!-- <option value="0"></option>-->
<!-- --><?php
// foreach($city_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->city1_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- <select name="district1_id">-->
<!-- <option value="0"></option>-->
<!-- --><?php
// foreach($district_items as $item) {
// echo '<option value="'.$item->id.'"';
// if($item->id == $order_info->district1_id)
// echo ' selected ';
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- <td class="bg_tr">送单日期</td>-->
<!-- <td class="td_bg">-->
<!-- <input class="act_date" type="text" id="send_date" name="send_date" value="--><?//=$order_info->send_date?><!--" onClick="WdatePicker()">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 送单地址</td>-->
<!-- <td colspan="3" class="td_bg">-->
<!-- <input type="text" id="send_address1" name="send_address1" value="--><?//=$order_info->send_address1?><!--" style="width: 80%;">-->
<!-- </td>-->
<!-- <td class="bg_tr"><span style="color:#ff0000">*</span> 正本送单地址</td>-->
<!-- <td colspan="3" class="td_bg">-->
<!-- <input type="text" id="send_address2" name="send_address2" value="--><?//=$order_info->send_address2?><!--" style="width: 80%;">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">领款人</td>-->
<!-- <td class="td_bg"><input name="money_man" id="money_man" type="text" value="--><?//=$order_info->caiwu?$order_info->caiwu->money_man:''?><!--" style="width:120px;"></td>-->
<!-- <td class="bg_tr">开户行</td>-->
<!-- <td class="td_bg"><input name="money_bank" id="money_bank" type="text" value="--><?//=$order_info->caiwu?$order_info->caiwu->money_bank:''?><!--" style="width:120px;"></td>-->
<!-- <td class="bg_tr">银行账号</td>-->
<!-- <td class="td_bg" colspan="3"><input name="money_no" id="money_no" type="text" value="--><?//=$order_info->caiwu?$order_info->caiwu->money_no:''?><!--" style="width: 80%;"></td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">备注</td>-->
<!-- <td colspan="7" class="td_bg">-->
<!-- <input type="text" id="order_remark" name="order_remark" value="--><?//=$order_info->remark?><!--" style="width: 80%;">-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td class="bg_tr">业务分组</td>-->
<!-- <td colspan="7" class="td_bg">-->
<!-- <select name="business_group_id">-->
<!-- <option value="0">请选择</option>-->
<!-- --><?php
// foreach ($business_group as $index => $item){
// echo '<option value="'.$item->id.'"';
// if($order_info->business_group_id > 0) {
// if($order_info->business_group_id == $item->id)
// echo ' selected ';
// } else {
// if($order_info->user && $order_info->user->business_group_id > 0) {
// if($order_info->user->business_group_id == $item->id)
// echo ' selected ';
// }
// }
// echo '>'.$item->name.'</option>';
// }
// ?>
<!-- </select>-->
<!-- </td>-->
<!-- </tr>-->
<!-- </table>-->
</form>
</TD>
</TR>
<tr>
<td align="center">
<input type=button class="ACT_btn save-btn" name=Submit1 value=" 保存 "/>
<input type=button class="ACT_btn submit-btn" name=Submit2 value=" 提交 "/>
<input type=button class="ACT_btn next-btn" name=Submit5 value=" 下一个 "/>
</td>
</tr>
</TABLE>
<!--操作记录-->
<!-- <table>-->
<!-- <tbody>-->
<!-- <tr>-->
<!-- <TD height="30" align="center" class=tab-off id=navcell onclick=open_up(3) name="navcell">▲操作记录</TD>-->
<!-- </tr>-->
<!-- </tbody>-->
<!-- </table>-->
<TABLE id=tb3 cellSpacing=1 cellPadding=0 width="100%" border=0 name="tb" class="hide-table">
<TR>
<TD vAlign=top>
<div id="car_history_list"></div>
</TD>
</TR>
<tr>
<td align="center">
<input type=button class="ACT_btn next-btn" name=Submit5 value=" 下一个 "/>
<input type="button" class="ACT_btn back-btn" name="Submit3" value=" 返回 ">
</td>
</tr>
</TABLE>
<!--历史保单-->
</td>
</tr>
</table>
</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
//报价计算
function calc() {
var total1_clear = Number($('#total1_clear').val());
var total1 = Number($('#total1').val());
var total2_clear = Number($('#total2_clear').val());
var total2 = Number($('#total2').val());
var total3 = Number($('#total3').val());
var total1_real = Number($('#total1_real').val());
var total1_dis = Number($('#total1_dis').val());
var total1_percent = Number($('#total1_percent').val());
var total_all = Number($('#total_all').val());
var total_real = Number($('#total_real').val());
total1 = 1.06 * total1_clear;
total2 = 1.06 * total2_clear;
total_all = total1 + total2 + total3;
total1_dis = total1_clear - total1_real;
total_real = total_all - total1_dis;
total1_percent = parseFloat(total1_real/total1_clear);
$('#total1').val(total1.toFixed(2));
$('#total2').val(total2.toFixed(2));
$('#total1_dis').val(total1_dis.toFixed(2));
$('#total1_percent').val(total1_percent.toFixed(2));
$('#total_all').val(total_all.toFixed(2));
$('#total_real').val(total_real.toFixed(2));
}
//保单处理
function SaveOrder(status_id) {
var pay_type_id = $("#pay_type_id").val();
var shoufei_id = $("#shoufei_id").val();
var money_man = $("#money_man").val();
var money_no = $("#money_no").val();
var money_bank = $("#money_bank").val();
var total1_clear = $('#total1_clear').val();
var total2_clear = $('#total2_clear').val();
var total3 = $('#total3').val();
var seats = $('#seats').val();
var total1_real = $('#total1_real').val();
var insurer1_begin_date = $('#insurer1_begin_date').val();
var insurer2_begin_date = $('#insurer2_begin_date').val();
var send_address1 = $('#send_address1').val();
var send_address2 = $('#send_address2').val();
var seats = Number($('#seats').val());
var company2_id = $("#company2_id").val();
if(status_id == 2){
if(isNull(shoufei_id)){
alert('收费方式必填项!');
return false;
}
// if(shoufei_id==2){
// if(isNull(money_man)){
// alert('选择在线支付,领款人必填项!');
// return false;
// }
// if(isNull(money_no)){
// alert('选择在线支付,银行账号必填项!');
// return false;
// }
// if(isNull(money_bank)){
// alert('选择在线支付,开户行必填项!');
// return false;
// }
//
// }
if(isNull(pay_type_id)){
alert('付款方式必填项!');
return false;
}
if(isNull(total1_clear)){
alert('商业总净保费必填项!');
return false;
}
if(isNull(total2_clear)){
alert('交强总净保费必填项!');
return false;
}
if(isNull(total1_real)){
alert('折扣后商业净保费必填项!');
return false;
}
if(isNull(total3)){
alert('车船税必填项!');
return false;
}
if(isNull(insurer1_begin_date)){
alert('商业起保日期必填项!');
return false;
}
if(isNull(insurer2_begin_date)){
alert('交强起保日期必填项!');
return false;
}
if(isNull(send_address1)){
alert('送单地址必填项!');
return false;
}
if(isNull(send_address2)){
alert('正本送单地址必填项!');
return false;
}
if(isNull(seats)){
alert('座位数必填项!');
return false;
}
if(company2_id == 0){
alert('保险公司必填项!');
return false;
}
}
var param = $('#orderFrm').serialize();
param = param + '&' + $('#companyGiftFrm').serialize();
param = param + '&status_id=' + status_id;
$.post('/car/order-save',param,function(obj){
if(obj.success) {
if(status_id > 1)
$('.back-btn').click();
else
alert(obj.msg);
} else {
alert(obj.msg);
}
},'json');
}
//判断是否填写了选项
function isNull(data){
if(data == "" || data == undefined || data == null){
return true;
}else{
return false;
}
}
$(function(){
$('#scheme_id').change(function(){
var id=$(this).val();
$.post('/scheme/chaxun',{id:id},function(obj){
if(obj.success) {
$('.baoer').html(obj.info.baoer);
$('.feiyong').html(obj.info.baofei);
}else{
$('.baoer').html('');
$('.feiyong').html('');
}
},'json');
});
//无效按钮
// $('.invalid-btn').click(function(){
// var car_id = $('#car_id').val();
// var invalid_id = $('#invalid_id').val();
//// var invalid_id = $('#invalid_id').val();
// if(invalid_id == 0) {
// alert('必须选择无效理由!');
// return;
// }
// if(invalid_id ==25 ||invalid_id ==26 ||invalid_id ==27 ){
// $('.xchide').show()
//// alert('请更新保险日期')
//// $(".baocun").click()
//
// return
// }
// if(confirm('是否无效这条数据?')) {
//
// $.post('/car/invalid-a',{car_id:car_id,invalid_id:invalid_id},function(obj){
// alert(obj.msg);
// if(obj.success) {
// $('.xchide').hide()
// $('#appointment-save-btn').attr('disabled',true);
// $('.save-btn').attr('disabled',true);
// $('.invalid-btn').attr('disabled',true);
// next_index = next_index - 1;
// if(next_index < 0) next_index = 0;
// }
// },'json');
//
//
// }
//
// });
// $('.qux').click(function(){
// $('.xchide').hide()
// })
// $('.queding').click(function(){
// var ac1=$('.ac1').val();
// var ac2=$('.ac2').val();
// var ac3=$('.cpys').val();
// var car_id = $('#car_id').val();
// var invalid_id = $('#invalid_id').val();
// if(ac1==''|| ac2=='' || ac3==''){
// alert('请填写保险日期和保险公司')
// return false;
// }else{
// if(confirm('是否无效这条数据?')) {
//
// $.post('/car/invalid-a',{car_id:car_id,invalid_id:invalid_id,ac1:ac1,ac2:ac2,ac3:ac3},function(obj){
// alert(obj.msg);
// if(obj.success) {
// $('.xchide').hide()
// $('#appointment-save-btn').attr('disabled',true);
// $('.save-btn').attr('disabled',true);
// $('.invalid-btn').attr('disabled',true);
// next_index = next_index - 1;
// if(next_index < 0) next_index = 0;
// }
// },'json');
//
//
// }
// }
//
// })
//操作历史
// gotoPage('/car/ajax-history-index?car_id=<?//=$car_info->id?>//&page=1&t='+Math.random(),'car_history_list');
//添加自费礼品
//添加联系人
// $('.add-linkman-btn').click(function(){
// if(confirm('是否确认提交?')) {
// var params = $("#linkmanFrm").serialize();
// $.post('/car/linkman-save',params,function(obj){
// alert(obj.msg);
// if(obj.success) {
// $('#linkmanFrm')[0].reset();
// gotoPage('/car/ajax-linkman-index?car_id=<?//=$car_info->id?>//&t='+Math.random(),'linkman_list');
// }
// },'json');
// }
// });
$('#total1_clear').blur(function(){
calc();
});
$('#total2_clear').blur(function(){
calc();
});
$('#total3').blur(function(){
calc();
});
$('#total1_dis').blur(function(){
calc();
});
$('#total1_real').blur(function(){
calc();
});
//保存
$('.save-btn').click(function(){
SaveOrder(1);
});
//提交
$('.submit-btn').click(function(){
if(confirm('是否提交此保单?')) {
SaveOrder(2);
}
});
//返回
//返回按钮
$('.back-btn').click(function(){
window.location.href='/non-auto-insurance/index?<?=$back_params?>';
});
//下一个
//保存
$(".baocun").click(function(){
var params = $('#myform').serialize();
// var cmpy=$('.ccompany').val()
// if(cmpy==''){
// alert('请填写保险公司和更新保险日期')
// $('.ccompany').css('border','1px solid red').focus();
// return
// }
$.post('/non-auto-insurance/save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('.back-btn').click();
}
},'json');
});
//判断礼品
$('#total1_clear').change(function(){
var txtObj = $('input[name="types[1]"]');
var txtValue = Number(txtObj.val());
var money = Number($(this).val());
$('.gifts').each(function() {
var obj = $(this);
var min = obj.attr('min');
var max = obj.attr('max');
var damage = obj.attr('is_damage');
if(damage>0) {
if(txtValue>0) {
obj.removeAttr('disabled');
} else {
obj.val(0);
obj.attr('disabled',true);
return;
}
}
if(min > 0) {
if(min > money) {
obj.val(0);
obj.attr('disabled',true);
} else {
obj.removeAttr('disabled');
}
}
if(max > 0) {
if(max < money) {
obj.val(0);
obj.attr('disabled',true);
} else if(min>0 && min<=money){
obj.removeAttr('disabled');
}
}
});
});
$('input[name="types[1]"]').change(function(){
$('#total1_clear').change();
});
$('#total1_clear').change();
});
</script>