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/insurer/search.php

180 lines
8.8 KiB

<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>保单查询</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="refreshList();">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" id="search" class="form-inline" onsubmit="return search();">
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="username">车主</label>
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="phone">被保险人</label>
<input type="text" id="id_man" name="id_man" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="phone">电话</label>
<input type="text" id="phone" name="phone" class="form-control">
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label for="car_no">车牌</label>
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker1">提单日期</label>
<div class="input-group" id="datepicker1">
<input type="text" class="form-control" id="date_begin" name="date_begin" value="" autocomplete="off" />
<span class="input-group-addon">到</span>
<input type="text" class="form-control" id="date_end" name="date_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker2">正本日期</label>
<div class="input-group" id="datepicker2">
<input type="text" class="form-control" id="date2_begin" name="date2_begin" value="" autocomplete="off" />
<span class="input-group-addon">到</span>
<input type="text" class="form-control" id="date2_end" name="date2_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-6" style="margin-bottom: 8px;">
<label for="datepicker3">起保日期</label>
<div class="input-group" id="datepicker3">
<input type="text" class="form-control" id="date3_begin" name="date3_begin" value="" autocomplete="off" />
<span class="input-group-addon">到</span>
<input type="text" class="form-control" id="date3_end" name="date3_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">保险公司</label>
<select name="company_id" id="company_info" class="form-control">
</select>
</div>
<div class="form-group col-md-3" style="margin-bottom: 8px;">
<label class="control-label">险种类型</label>
<select name="insurance_status" id="insurance_status_info" class="form-control">
<option value="">全部</option>
<option value="1">车险</option>
<option value="2">非车险</option>
<option value="3">车险和非车险</option>
</select>
</div>
<div class="form-group col-md-12" style="margin-bottom: 8px;">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</form>
<hr>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="car_man">车主</th>
<th data-field="id_man">被保险人</th>
<th data-field="submit_date">提单日期</th>
<th data-field="send_date">送单日期</th>
<th data-field="car_no">车牌号</th>
<th data-field="car_factory_model">品牌</th>
<th data-field="total_all">共计签单</th>
<th data-field="total_real">应收</th>
<th data-field="status_txt">状态</th>
<th data-field="show_name">业务员</th>
<th data-field="company_name">保险公司</th>
<th data-field="upload_status_txt">上传状态</th>
<th data-field="lock_show_name">当前操作</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<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>
function opFormatter(value, row, index) {
var opStr = [];
if (row.insurance_status == 1 || row.insurance_status == 3) {
opStr.push('<a href="javascript:void(0);" onclick="info(' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="详情">&nbsp;详情</i>');
opStr.push('</a>');
} else if (row.insurance_status == 2) {
opStr.push('<a href="javascript:void(0);" onclick="infos(' + row.non_id + ',' + row.id + ')">');
opStr.push('<i class="fa fa-plus" title="非车险详情">&nbsp;非车险详情</i>');
opStr.push('</a>');
}
return opStr.join(' ');
}
function info(id) {
layer_show('保单信息','/insurer/info?id=' + id);
}
function infos(id,oid) {
layer_show('保单信息','/non-auto-insurance/bd-info-search?id=' + id +'&oid=' + oid);
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/insurer/search-json",
pagination: true,
showFooter: true,
sidePagination: 'server',
queryParams: function(params) {
$('#search').find(':input:not(input[type=button],input[type=submit],button)').each(function(index,item){
params[$(item).attr('name')] = $(item).val();
});
return params;
},
responseHandler: function (res) {
console.log(res);
$('.fixed-table-footer').html('<div style="height: 100%;line-height: 37px;text-align: right;padding-right: 2rem;">' +
' <label class="">净保费总和:</label>' +
' <span style="color:red;">'+ res.sum +'</span>' +
' </div>');
selectInfoInit('company',res['company_info']);
return res
}
});
return false;
}
// 品牌选项初始化
function selectInfoInit(selectName,options,default_val,data){
var html = '<option value="'+ (default_val?default_val:'') +'">---请选择---</option>';
$.each(options,function(i,item){
var val = item['code']?item['code']:item['id'];
var selected = data && data[selectName + '_id'] && data[selectName + '_id'] == val? 'selected': '';
html += '<option value="'+ val +'" '+ selected +'>'+ item.name +'</option>'
});
$('#'+ selectName + '_info').html(html);
}
$(function() {
search();
});
</script>
<?php $this->endBlock(); ?>