|
|
|
@ -89,7 +89,7 @@ use \common\libs\MyLib; |
|
|
|
|
<div class="container"> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">业务分组</label> |
|
|
|
|
<span class="order-info" data-name="businessGroup"></span> |
|
|
|
|
<span class="order-info" data-name="business_group_name"></span> |
|
|
|
|
</div> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">被保险人</label> |
|
|
|
@ -159,7 +159,7 @@ use \common\libs\MyLib; |
|
|
|
|
<label class="control-label">备注</label> |
|
|
|
|
<span class="order-info" data-name=""></span> |
|
|
|
|
</div> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<div class="form-group col-md-6" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">正本送单地址</label> |
|
|
|
|
<span class="order-info" data-name="receiver_addr_txt"></span> |
|
|
|
|
</div> |
|
|
|
@ -221,15 +221,34 @@ use \common\libs\MyLib; |
|
|
|
|
<label class="control-label">备注</label> |
|
|
|
|
<span class="order-info" data-name="price_remark"></span> |
|
|
|
|
</div> |
|
|
|
|
</div><hr> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="ibox float-e-margins"> |
|
|
|
|
<div class="ibox-title fixed"> |
|
|
|
|
<h5>保单文件信息</h5> |
|
|
|
|
<div class="ibox-tools"> |
|
|
|
|
<a class="btn btn-primary btn-xs edit-btn" id="business_print_btn" href="javascript:void(0);" onclick="insurer_files_print('business')"> |
|
|
|
|
<i class="fa fa-search"></i> 查看商业保单并打印 |
|
|
|
|
</a> |
|
|
|
|
<a class="btn btn-primary btn-xs edit-btn" id="compulsory_print_btn" href="javascript:void(0);" onclick="insurer_files_print('compulsory')"> |
|
|
|
|
<i class="fa fa-search"></i> 查看交强保单并打印 |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="ibox-content"> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-md-12"> |
|
|
|
|
<form method="get" class="form-horizontal"> |
|
|
|
|
<input type="hidden" name="id" class="form-control order-info"> |
|
|
|
|
<div class="form-group"> |
|
|
|
|
<label class="col-sm-4 control-label">商业保单文件</label> |
|
|
|
|
<div class="col-sm-8"> |
|
|
|
|
<div class="input-group"> |
|
|
|
|
<input type="text" name="shangye_src" class="form-control order-info" value=""> |
|
|
|
|
<a href="javascript:void(0);" class="input-group-addon" id="upload"> |
|
|
|
|
<input type="text" data-name="shangye_src" name="shangye_src" class="form-control order-info" value=""> |
|
|
|
|
<a href="javascript:void(0);" class="input-group-addon upload"> |
|
|
|
|
上传文件 |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
@ -240,8 +259,8 @@ use \common\libs\MyLib; |
|
|
|
|
<label class="col-sm-4 control-label">交强保单文件</label> |
|
|
|
|
<div class="col-sm-8"> |
|
|
|
|
<div class="input-group"> |
|
|
|
|
<input type="text" name="urlfile1" class="form-control order-info" value=""> |
|
|
|
|
<a href="javascript:void(0);" class="input-group-addon" id="upload"> |
|
|
|
|
<input type="text" data-name="jiaoqiang_src" name="jiaoqiang_src" class="form-control order-info" value=""> |
|
|
|
|
<a href="javascript:void(0);" class="input-group-addon upload"> |
|
|
|
|
上传文件 |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
@ -249,16 +268,10 @@ use \common\libs\MyLib; |
|
|
|
|
</div> |
|
|
|
|
<div class="hr-line-dashed"></div> |
|
|
|
|
<div class="form-group"> |
|
|
|
|
<div class=""> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')"> |
|
|
|
|
<div class="text-center"> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="insurer_files_save()"> |
|
|
|
|
<i class="fa fa-save"></i> 保存 |
|
|
|
|
</a> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')"> |
|
|
|
|
<i class="fa fa-search"></i> 查看商业保单并打印 |
|
|
|
|
</a> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" onclick="print_infos('insurer')"> |
|
|
|
|
<i class="fa fa-search"></i> 查看交强保单并打印 |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</form> |
|
|
|
@ -274,7 +287,7 @@ use \common\libs\MyLib; |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="col-md-6"> |
|
|
|
|
<h4 class="title">免费礼品</h4> |
|
|
|
|
<table id="gift_free_table"> |
|
|
|
|
<table id="free_gift_table"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th data-field="id">ID</th> |
|
|
|
@ -286,7 +299,7 @@ use \common\libs\MyLib; |
|
|
|
|
</div> |
|
|
|
|
<div class="col-md-6"> |
|
|
|
|
<h4 class="title">自费礼品</h4> |
|
|
|
|
<table id="gift_free_table"> |
|
|
|
|
<table id="private_gift_table"> |
|
|
|
|
<thead> |
|
|
|
|
<tr> |
|
|
|
|
<th data-field="id">ID</th> |
|
|
|
@ -310,15 +323,15 @@ use \common\libs\MyLib; |
|
|
|
|
<div class="col-md-12"> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">领款人</label> |
|
|
|
|
<span class="money-info" data-name="money_man"></span> |
|
|
|
|
<span class="order-insurer-info" data-name="money_man"></span> |
|
|
|
|
</div> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">开户行</label> |
|
|
|
|
<span class="money-info" data-name="money_bank"></span> |
|
|
|
|
<span class="order-insurer-info" data-name="money_bank"></span> |
|
|
|
|
</div> |
|
|
|
|
<div class="form-group col-md-3" style="margin-bottom: 8px;"> |
|
|
|
|
<label class="control-label">品牌</label> |
|
|
|
|
<span class="money-info" data-name="money_no"></span> |
|
|
|
|
<span class="order-insurer-info" data-name="money_no"></span> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -352,11 +365,11 @@ use \common\libs\MyLib; |
|
|
|
|
<div class="ibox-title fixed"> |
|
|
|
|
<div class="ibox-tools"> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" |
|
|
|
|
onclick="print_infos('insurer')"> |
|
|
|
|
onclick="reBack()"> |
|
|
|
|
<i class="fa fa-backward"></i> 退单 |
|
|
|
|
</a> |
|
|
|
|
<a class="btn btn-primary edit-btn" data-id="0" href="javascript:void(0);" |
|
|
|
|
onclick="print_infos('insurer')"> |
|
|
|
|
onclick="goBack()"> |
|
|
|
|
<i class="fa fa-close"></i> 关闭 |
|
|
|
|
</a> |
|
|
|
|
</div> |
|
|
|
@ -369,9 +382,28 @@ use \common\libs\MyLib; |
|
|
|
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script> |
|
|
|
|
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script> |
|
|
|
|
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script> |
|
|
|
|
<script src="/assets/js/plugins/webuploader/webuploader.min.js"></script> |
|
|
|
|
<script type="text/javascript" language="javascript"> |
|
|
|
|
var params = {}; |
|
|
|
|
$(function () { |
|
|
|
|
layui.use(['upload'], function(){ |
|
|
|
|
var upload = layui.upload; |
|
|
|
|
var uploadInst = upload.render({ |
|
|
|
|
elem: '.upload' /*绑定元素*/, |
|
|
|
|
url: '/common/upload' /*上传接口*/, |
|
|
|
|
accept: 'file', |
|
|
|
|
done: function(res){ |
|
|
|
|
//上传完毕回调 |
|
|
|
|
if(res.status == 'SUCCESS') { |
|
|
|
|
$('#file').val(res.fileUrl); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
error: function(){ |
|
|
|
|
//请求异常回调 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$('.input-date').datepicker({ |
|
|
|
|
keyboardNavigation: false, |
|
|
|
|
forceParse: false, |
|
|
|
@ -385,7 +417,6 @@ use \common\libs\MyLib; |
|
|
|
|
init(); |
|
|
|
|
} else { |
|
|
|
|
alert('数据加载错误'); |
|
|
|
|
window.history.go(-1); |
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
|
|
|
|
@ -423,182 +454,103 @@ use \common\libs\MyLib; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function init(){ |
|
|
|
|
console.log(params); |
|
|
|
|
carInfoInit(params['car_info']); |
|
|
|
|
|
|
|
|
|
if(!params['order_info']['shangye_src']){ |
|
|
|
|
$('#business_print_btn').hide(); |
|
|
|
|
} |
|
|
|
|
if(!params['order_info']['jiaoqiang_src']){ |
|
|
|
|
$('#compulsory_print_btn').hide(); |
|
|
|
|
} |
|
|
|
|
orderInfoInit(params['order_info']); |
|
|
|
|
selectInfoInit(params); |
|
|
|
|
tableInfoInit(params); |
|
|
|
|
buttonInit(params['can_cancel']); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//拨号 |
|
|
|
|
function strCall(phone) { |
|
|
|
|
parent.drtCall(phone); |
|
|
|
|
} |
|
|
|
|
//挂断 |
|
|
|
|
function strHook() { |
|
|
|
|
parent.drtHook(); |
|
|
|
|
} |
|
|
|
|
// 保存车辆信息 |
|
|
|
|
function saveCarInfo() { |
|
|
|
|
var params = $('#carFrm').serialize(); |
|
|
|
|
$.post('/car/save',params,function(obj){ |
|
|
|
|
alert(obj.msg); |
|
|
|
|
window.location.reload(); |
|
|
|
|
},'json'); |
|
|
|
|
} |
|
|
|
|
orderInsurerInfoInit(params['order_insurer_info']); |
|
|
|
|
|
|
|
|
|
// 下一条信息 |
|
|
|
|
function nextInfo(){ |
|
|
|
|
var param = 'index=' + params['next_index'] + '&type='+ params['type']; |
|
|
|
|
$.get('/track/ajax-next', param, function (obj) { |
|
|
|
|
if (obj.success) { |
|
|
|
|
if (obj.car_id > 0) { |
|
|
|
|
window.location.href = '/car/info-track?id=' + obj.car_id + '&type='+ params['type'] +'&next_index='+ params['next_index'] + '&back_params=' + encodeURIComponent(params['back_params']); |
|
|
|
|
} else { |
|
|
|
|
alert('没有记录'); |
|
|
|
|
var free_gift = [], |
|
|
|
|
private_gift = []; |
|
|
|
|
$.each(params['gift_info'],function (i,d) { |
|
|
|
|
if(d['is_free'] == 1){ |
|
|
|
|
free_gift.push(d); |
|
|
|
|
}else { |
|
|
|
|
private_gift.push(d); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
var tables = { |
|
|
|
|
'insurer_type': params['insurer_type_info'], |
|
|
|
|
'free_gift': free_gift, |
|
|
|
|
'private_gift': private_gift, |
|
|
|
|
'car_history': { |
|
|
|
|
url: '/car/ajax-history-index-json', |
|
|
|
|
queryParamsFunc: function (param) { |
|
|
|
|
param['car_id'] = params['car_info']['id']; |
|
|
|
|
param['limit'] = param['limit']; |
|
|
|
|
param['offset'] = param['offset']; |
|
|
|
|
return param; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
} |
|
|
|
|
// 返回 |
|
|
|
|
function goBack(){ |
|
|
|
|
var url = ''; |
|
|
|
|
switch (+type) { |
|
|
|
|
case 1: |
|
|
|
|
url = '/track/first?' + params['next_index'];break; |
|
|
|
|
case 2: |
|
|
|
|
url = '/track/today?' + params['next_index'];break; |
|
|
|
|
case 3: |
|
|
|
|
url = '/track/all?' + params['next_index'];break; |
|
|
|
|
} |
|
|
|
|
return window.location.href = url; |
|
|
|
|
} |
|
|
|
|
// 保险信息保存 |
|
|
|
|
function saveInsurerInfo(){ |
|
|
|
|
var params = $('#insurerFm').serialize(); |
|
|
|
|
$.post('/car/baocun', params, function (obj) { |
|
|
|
|
alert(obj.msg); |
|
|
|
|
}, 'json'); |
|
|
|
|
}; |
|
|
|
|
tableInfoInit(tables, params); |
|
|
|
|
} |
|
|
|
|
// 取消预约 |
|
|
|
|
function cancelAppointment(){ |
|
|
|
|
//这里是后来需求改了,暂时注释 |
|
|
|
|
//if(location == 6){ |
|
|
|
|
// var url = '/track/car-cancel-e'; |
|
|
|
|
//}else if(location == 3 || ptype == 3){ |
|
|
|
|
// var url = '/track/car-cancel'; |
|
|
|
|
//} |
|
|
|
|
|
|
|
|
|
var location = params['car_info']['location']; |
|
|
|
|
var ptype = $('#appointment_list').children("table").children("tbody").children("tr").eq(1).children(".ptyp").attr('data'); |
|
|
|
|
|
|
|
|
|
if (location == 3) { |
|
|
|
|
//C库数据 |
|
|
|
|
//放d |
|
|
|
|
var url = '/track/car-cancel'; |
|
|
|
|
} else if (location == 6 && ptype == 5) { |
|
|
|
|
var url = '/track/car-cancel-e'; |
|
|
|
|
} else { |
|
|
|
|
//无效 |
|
|
|
|
alert('不是目标客户,请点击无效数据按钮!'); |
|
|
|
|
return false; |
|
|
|
|
function insurer_files_print(type) { |
|
|
|
|
if(type == 'compulsory' && params['order_info']['jiaoqiang_src']){ |
|
|
|
|
window.open('/upload/files'+ params['order_info']['jiaoqiang_src']) |
|
|
|
|
} |
|
|
|
|
if (confirm('是否确认放弃?')) { |
|
|
|
|
$.post(url, {id:params['car_info']['id']}, function (obj) { |
|
|
|
|
alert(obj.msg); |
|
|
|
|
if (obj.success) { |
|
|
|
|
$('.back-btn').click(); |
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
if(type == 'compulsory' && !params['order_info']['jiaoqiang_src']){ |
|
|
|
|
alert('找不到文件,加载失败'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 预约保存 |
|
|
|
|
function appointmentSave(){ |
|
|
|
|
if (confirm('是否确认提交?')) { |
|
|
|
|
var params = $("#appointmentFrm").serialize(); |
|
|
|
|
$.post('/appointment/save', params, function (obj) { |
|
|
|
|
alert(obj.msg); |
|
|
|
|
if (obj.success) { |
|
|
|
|
$('#appointmentFrm')[0].reset(); |
|
|
|
|
$('#appointment_table').bootstrapTable('refresh'); |
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
if(type == 'business' && params['order_info']['shangye_src']){ |
|
|
|
|
window.open('/upload/files'+ params['order_info']['shangye_src']) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 无效保存 |
|
|
|
|
function appointmentInvalid(){ |
|
|
|
|
var car_id = params['car_info']['id']; |
|
|
|
|
var invalid_id = $('#invalid_id').val(); |
|
|
|
|
if (invalid_id == 0) { |
|
|
|
|
alert('必须选择无效理由!'); |
|
|
|
|
return; |
|
|
|
|
if(type == 'business' && !params['order_info']['shangye_src']){ |
|
|
|
|
alert('找不到文件,加载失败'); |
|
|
|
|
} |
|
|
|
|
if (confirm('是否无效这条数据?')) { |
|
|
|
|
$.post('/car/invalid', {car_id: car_id, invalid_id: invalid_id}, function (obj) { |
|
|
|
|
alert(obj.msg); |
|
|
|
|
if (obj.success) { |
|
|
|
|
$('#appointment-save-btn').attr('disabled', true); |
|
|
|
|
$('.save-btn').attr('disabled', true); |
|
|
|
|
$('.invalid-btn').attr('disabled', true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function insurer_files_save() { |
|
|
|
|
var param = $(this).closest('form').serialize(); |
|
|
|
|
$.post('/insurer/pdf-save',param,function(obj){ |
|
|
|
|
console.log(obj); |
|
|
|
|
if(obj.success) { |
|
|
|
|
alert('保单上传成功'); |
|
|
|
|
window.location.reload(); |
|
|
|
|
} |
|
|
|
|
},'json'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function reBack(){ |
|
|
|
|
if(confirm('请核对好出单日期,确认退回到正本?')) { |
|
|
|
|
$.post('/insurer/tuidan-save',{id:params['order_info']['id']},function(obj){ |
|
|
|
|
if(obj.success) { |
|
|
|
|
alert('退单成功'); |
|
|
|
|
} |
|
|
|
|
}, 'json'); |
|
|
|
|
},'json'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function tableInfoInit(data){ |
|
|
|
|
var tables = { |
|
|
|
|
'appointment': '/appointment/index-json', |
|
|
|
|
'insurer_order': '/car/info-track-table-json', |
|
|
|
|
'new_gift': '/car/info-track-table-json', |
|
|
|
|
'old_gift': '/car/info-track-table-json', |
|
|
|
|
'car_history': '/car/info-track-table-json', |
|
|
|
|
}; |
|
|
|
|
$.each(tables,function(name,url){ |
|
|
|
|
var $table = $('#'+ name +'_table'); |
|
|
|
|
$table.bootstrapTable('destroy'); |
|
|
|
|
$table.bootstrapTable({ |
|
|
|
|
url: url, |
|
|
|
|
pagination: true, |
|
|
|
|
sidePagination: 'server', |
|
|
|
|
queryParams: function (param) { |
|
|
|
|
if(name == 'new_gift'){ |
|
|
|
|
param['car_no'] = params['car_info']['car_no']; |
|
|
|
|
}else { |
|
|
|
|
param['car_id'] = params['car_info']['id']; |
|
|
|
|
} |
|
|
|
|
param['name'] = name; |
|
|
|
|
param['limit'] = param['limit']; |
|
|
|
|
param['offset'] = param['offset']; |
|
|
|
|
return param; |
|
|
|
|
}, |
|
|
|
|
responseHandler: function (res) { |
|
|
|
|
console.log(res); |
|
|
|
|
return res |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
function goBack(){ |
|
|
|
|
window.close(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 品牌选项初始化 |
|
|
|
|
function selectInfoInit(data){ |
|
|
|
|
var keys = [ |
|
|
|
|
'brand', |
|
|
|
|
'series', |
|
|
|
|
'displacement', |
|
|
|
|
'car_type', |
|
|
|
|
'car_use', |
|
|
|
|
'appointment_type', |
|
|
|
|
'business_group', |
|
|
|
|
'invalid', |
|
|
|
|
]; |
|
|
|
|
$.each(keys,function(index,key){ |
|
|
|
|
var html = '<option value="0">---请选择---</option>'; |
|
|
|
|
$.each(data[key + '_info'],function(i,item){ |
|
|
|
|
var val = item['code']?item['code']:item['id']; |
|
|
|
|
var selected = data['car_info'][key + '_id'] && data['car_info'][key + '_id'] == val? 'selected': ''; |
|
|
|
|
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>' |
|
|
|
|
}); |
|
|
|
|
$('#'+ key + '_info').html(html); |
|
|
|
|
function tableInfoInit(tables){ |
|
|
|
|
$.each(tables,function(name,data){ |
|
|
|
|
var $table = $('#'+ name +'_table'); |
|
|
|
|
var options = {}; |
|
|
|
|
if(typeof data == 'String'){ |
|
|
|
|
options = { |
|
|
|
|
url: data.url, |
|
|
|
|
pagination: true, |
|
|
|
|
sidePagination: 'server', |
|
|
|
|
queryParams: data.queryParamsFunc |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
options = { |
|
|
|
|
data: data |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$table.bootstrapTable('destroy'); |
|
|
|
|
$table.bootstrapTable(options); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -621,6 +573,15 @@ use \common\libs\MyLib; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function orderInsurerInfoInit(data){ |
|
|
|
|
$('.order-insurer-info:not(input)').each(function(key,item) { |
|
|
|
|
$(item).html(data[$(item).data('name')]); |
|
|
|
|
}); |
|
|
|
|
$('.order-insurer-info:input').each(function(key,item) { |
|
|
|
|
$(item).val(data[$(item).data('name')]); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function buttonInit(param) { |
|
|
|
|
if(param){ |
|
|
|
|
$('#appointment_btn').prepend('<button type="button" class="btn btn-primary" onclick="cancelAppointment()">放弃</button>'); |
|
|
|
|