完成数据库管理功能开发

dev
曾超新 5 years ago
parent dfdd5364f1
commit 7499a5bfe3
  1. 10757
      frontend/controllers/DatabaseController.php
  2. 36
      frontend/views/database/a-index.php
  3. 92
      frontend/views/database/b-index-search.php
  4. 434
      frontend/views/database/b-index.php
  5. 92
      frontend/views/database/c-index-search.php
  6. 407
      frontend/views/database/c-index.php
  7. 84
      frontend/views/database/d-index-search.php
  8. 350
      frontend/views/database/d-index.php
  9. 94
      frontend/views/database/invalid-index-search.php
  10. 268
      frontend/views/database/invalid-index.php

File diff suppressed because it is too large Load Diff

@ -32,8 +32,8 @@ use \common\libs\MyLib;
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<div class="col-sm-8"> <div class="col-sm-8">
<select class="form-control"> <select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">先把无效理由</option> <option value="0">选择无效理由</option>
<?php foreach($invalid_items as $item) { <?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>'; echo '<option value="'.$item->id.'">'.$item->name.'</option>';
} }
@ -41,7 +41,7 @@ use \common\libs\MyLib;
</select> </select>
</div> </div>
<div class="col-sm-4"> <div class="col-sm-4">
<button type="button" class="btn btn-primary">无效数据</button> <button type="button" class="btn btn-primary btn-a-invalid">勾选无效数据</button>
</div> </div>
</div> </div>
</div> </div>
@ -85,9 +85,11 @@ use \common\libs\MyLib;
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>'); opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); if(row.location == 1) {
opStr.push('<i class="fa fa-trash" title="删除"></i>'); opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('</a>'); opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
}
return opStr.join(' '); return opStr.join(' ');
} }
@ -188,6 +190,28 @@ use \common\libs\MyLib;
o = {}; o = {};
search(); search();
}); });
$('.btn-a-invalid').click(function() {
layer.confirm('是否确认移动?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var invalid_id = $('#invalid_id').val();
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/a-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){
layer.msg(obj.msg);
if(obj.success) {
layer.msg('保存成功');
search();
}
},'json');
}, function(){
//
});
});
}); });
</script> </script>
<?php $this->endBlock(); ?> <?php $this->endBlock(); ?>

@ -0,0 +1,92 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-sm-1">车牌</label>
<div class="col-sm-3">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-sm-1">车主</label>
<div class="col-sm-3">
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<label class="control-label col-sm-1">联系电话</label>
<div class="col-sm-3">
<input type="text" id="phone" name="phone" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">初登日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="register_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险公司</label>
<div class="col-sm-3">
<input type="text" id="company" name="company" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">状态</label>
<div class="col-sm-3">
<select name="status" class="form-control">
<option value="0">全部</option>
<option value="1">未分配</option>
<option value="2">已分配</option>
</select>
</div>
<label class="control-label col-sm-1">业务员</label>
<div class="col-sm-3">
<input type="text" id="username" name="username" class="form-control">
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-5">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
parent.o = o;
parent.refreshList();
layer_close();
}
$(function () {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,238 +1,212 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <?php $this->endBlock(); ?>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
//编辑
function edit(id) {
var params = $('#searchForm').serialize();
window.location.href = '/car/edit?id=' + id + '&back_params=' + encodeURIComponent(params);
}
$(function(){ <div class="wrapper wrapper-content animated fadeInRight">
$("#search-btn").click(function(){ <div class="ibox float-e-margins">
$('#page').val(0); <div class="ibox-title">
var params = $('#searchForm').serialize(); <h5>B库</h5>
window.location.href = "/database/b-index?" + params; <div class="ibox-tools">
}); <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="searchDlg()">
$('#all-assign-btn').click(function(){ <i class="fa fa-search"></i> 搜索
if(confirm('是否确认批量分配操作?')) { </a>
var params = $('#searchForm').serialize(); <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
$.post('/database/b-all-assign',params,function(obj){ <i class="fa fa-refresh"></i> 刷新
alert(obj.msg); </a>
if(obj.success) { </div>
window.location.reload(); </div>
} <div class="ibox-content">
},'json'); <form role="form" class="form-inline" onsubmit="return search();">
} <div class="form-group">
}); <select class="form-control" id="user_id" name="user_id">
$('.invalid-btn').click(function(){ <option value="0">请选择业务员</option>
if(confirm('是否确认无效?')) { <?php foreach($user_items as $item) {
var params = $('#listFrm').serialize(); echo '<option value="'.$item->id.'">'.$item->getShowName().'</option>';
var invalid_id = $('#invalid_id').val(); }
params = params + '&invalid_id=' + invalid_id; ?>
$.post('/database/invalid',params,function(obj){ </select>
alert(obj.msg); <button type="button" class="btn btn-primary btn-assign">勾选分配</button>
if(obj.success) { <button type="button" class="btn btn-primary btn-assign-return">勾选收回</button>
window.location.reload(); <label class="form-control-static">分配给业务员</label>
} <input type="text" name="assign_users" id="assign_users" class="form-control">
},'json'); <label class="form-control-static">每个业务员分配</label>
} <input type="text" name="assign_count" id="assign_count" class="form-control">
}); <label class="form-control-static">条记录</label>
$('#assign-btn').click(function(){ <button type="button" class="btn btn-primary btn-assign-all">批量分配</button>
if(confirm('是否确认分配操作?')) { <button type="button" class="btn btn-primary btn-assign-all-return">批量收回</button>
var params = $('#listFrm').serialize(); <button type="button" class="btn btn-danger btn-clear">清空搜索条件</button>
var user_id = $('#user_id').val(); <select class="form-control" id="invalid_id" name="invalid_id">
params = params + '&user_id=' + user_id; <option value="0">请选择无效理由</option>
$.post('/database/b-assign',params,function(obj){ <?php foreach($invalid_items as $item) {
alert(obj.msg); echo '<option value="'.$item->id.'">'.$item->name.'</option>';
if(obj.success) { }
window.location.reload(); ?>
} </select>
},'json'); <button type="button" class="btn btn-primary btn-a-invalid">勾选无效数据</button>
} </div>
}); </form>
$('#return-btn').click(function(){ <div class="row">
if(confirm('是否确认收回操作?')) { <div class="col-md-12">
var params = $('#listFrm').serialize(); <table id="listTable">
$.post('/database/b-return',params,function(obj){ <thead>
alert(obj.msg); <tr>
if(obj.success) { <th data-field="state" data-checkbox="true"></th>
window.location.reload(); <th width="50" data-field="id">ID</th>
} <th data-field="car_no">车牌</th>
},'json'); <th data-field="factory_model">车型</th>
} <th data-field="car_man">车主</th>
}); <th data-field="phone">联系电话</th>
$('#move-btn').click(function(){ <th data-field="register_date">初登日期</th>
if(confirm('是否确认 B->C 操作?')) { <th data-field="insurer1_date">保险日期</th>
var params = $('#listFrm').serialize(); <th data-field="company">保险公司</th>
$.post('/database/b-c',params,function(obj){ <th data-field="engine_no">发动机号</th>
alert(obj.msg); <th data-field="car_frame_no">车架号</th>
if(obj.success) { <th data-field="op_user">业务员</th>
window.location.reload(); </tr>
} </thead>
},'json'); </table>
} </div>
}); </div>
$('#all').click(function(){ </div>
if($(this).prop('checked')==true) { </div>
$('input:checkbox').each(function() { </div>
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
});
$('#return-all-btn').click(function(){
var status = $('.status').val();
if(status!=1){
alert('请先选择未分配选项');
return;
}
if(confirm('是否确认收回操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/b-return-all-a',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
}); <?php $this->beginBlock('footer_js'); ?>
</script> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<form id="searchForm"> <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<input type="hidden" id="page" name="page" value="<?=$page?>"> <script>
<tr> var o = {};
<td class="td_bg"> function searchDlg() {
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width:100px;"> title = '综合搜索';
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width:100px;"> layer_show(title, '/database/b-search');
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width:100px;"> }
初登日期:从<input class="act_date" name="register_begin" type="text" value="<?=$register_begin?>" onclick="WdatePicker()"><input class="act_date" name="register_end" type="text" value="<?=$register_end?>" onclick="WdatePicker()">截止
保险公司:<input name="company" type="text" value="<?=$company?>" style="width:100px;">
</td>
</tr>
<style>
/*.day_date{*/
/*width: 10px;*/
/*}*/
</style>
<tr>
<td class="td_bg">
<!-- 保险日期:从<input class="act_date" name="insurer1_begin" type="text" value="--><?//=$insurer1_begin?><!--" onclick="WdatePicker()">至<input class="act_date" name="insurer1_end" type="text" value="--><?//=$insurer1_end?><!--" onclick="WdatePicker()">截止-->
保险日期:
<input name="insurer1_date" class="day_date" type="text" value="<?=$insurer1_month?>" style="width:30px;" placeholder="月份"> function refreshList() {
<input name="insurer1_day" class="day_date" type="text" value="<?=$insurer1_day?>" style="width:30px;" placeholder="天数"> $('#listTable').bootstrapTable('refresh');
<input name="insurer1_date1" class="day_date" type="text" value="<?=$insurer1_month1?>" style="width:30px;" placeholder="月份">
<input name="insurer1_day1" class="day_date" type="text" value="<?=$insurer1_day1?>" style="width:30px;" placeholder="天数">
分配状态:<select name="status" class="status">
<option value="0">全部</option>
<option value="1" <?=$status==1?'selected':''?>>未分配</option>
<option value="2" <?=$status==2?'selected':''?>>已分配</option>
</select>
工号:<input name="username" type="text" value="<?=$username?>" style="width:50px;">
排序:<select name="sort_key">
<option value="car_t.register_date" <?=$sort_key=='car_t.register_date'?'selected':''?>>初登日期</option>
<option value="car_t.insurer1_date" <?=$sort_key=='car_t.insurer1_date'?'selected':''?>>保险日期</option>
<option value="MONTH(car_t.insurer1_date),DAY(car_t.insurer1_date),RAND()" <?=$sort_key=='MONTH(car_t.insurer1_date),DAY(car_t.insurer1_date),RAND()'?'selected':''?>>保险月份日期</option>
</select>
<select name="sort_value">
<option value="ASC" <?=$sort_value=='ASC'?'selected':''?>>顺序</option>
<option value="DESC" <?=$sort_value=='DESC'?'selected':''?>>倒序</option>
</select>
<!-- <input type="checkbox" name="clean_right" value="1" --><?//=$clean_right?'checked':''?><!--清洗岗准确-->
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
</td>
</tr>
<tr>
<td class="td_bg">
业务员:<select name="user_id" id="user_id">
<option value="0">请选择</option>
<?php
foreach($user_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $user_id)
echo ' selected ';
echo '>'.$item->getShowName().'</option>';
}
?>
</select>
<input type="button" class="act_btn" id="assign-btn" name="assign-btn" value="勾选分配">
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="勾选收回">
<input type="button" class="act_btn" id="return-all-btn" name="return-all-btn" value="批量收回">
分配给业务员 <input id="assign_users" name="assign_users" type="text" value="" style="width:100px;">
每个业务员分配 <input id="assign_count" name="assign_count" type="text" value="" style="width:50px;"> 条记录
<input type="button" class="act_btn" id="all-assign-btn" name="all-assign-btn" value="批量分配">
</td>
</tr>
<tr>
<td class="td_bg">
<select name="invalid_id" id="invalid_id">
<option value="0">请选择无效理由</option>
<?php
foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<input type=button class="ACT_btn invalid-btn" name="invalid-btn" value=" 无效数据 "/>
</td>
</tr>
</form>
</table>
<form id="listFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车牌</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车型</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车主</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>联系电话</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>初登日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险公司</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>发动机号</td>
<td width="96" align="center" align="center" class="bg_tr" nowrap>车架号</td>
<td width="50" align="center" align="center" class="bg_tr" nowrap>业务员</td>
</tr>
<?php
foreach($items as $index => $item) {
$car_info = $item->car;
// if(!$car_info) {
//// $item->delete();
//// die;
// continue;
// }
//
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input type="checkbox" name="ids[]" value="<?=$car_info->id?>"></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_no?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($car_info->factory_model,10)?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($car_info->car_man,10)?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->phone?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->register_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->insurer1_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->company?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->engine_no?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_frame_no?></td>
<td align="left" class="td_bg"nowrap ><?=$item->user?$item->user->getShowName():''?></td>
</tr>
<?php
} }
?>
<tr > function search() {
<td height="25" colspan="11" align="center" class="td_bg"><?=$page_info?></td> $('#listTable').bootstrapTable('destroy');
</tr> $('#listTable').bootstrapTable({
</table> url: "/database/b-index-json",
</form> pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
});
}
$(function() {
search();
$('.btn-assign').click(function(){
layer.confirm('是否确认分配操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var user_id = $('#user_id').val();
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/b-assign',{ids:params.join(','),user_id:user_id},function(obj){
layer.msg(obj.msg);
if(obj.success) {
search();
}
},'json');
}, function(){
//
});
});
$('.btn-assign-return').click(function() {
layer.confirm('是否确认收回操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/b-return',{ids:params.join(',')},function(obj){
layer.msg(obj.msg);
if(obj.success) {
search();
}
},'json');
}, function(){
//
});
});
$('.btn-assign-all').click(function() {
layer.confirm('是否确认批量分配操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
o.assign_users = $('#assign_users').val();
o.assign_count = $('#assign_count').val();
$.post('/database/b-all-assign',o,function(obj){
layer.msg(obj.msg);
if(obj.success) {
search();
}
},'json');
}, function(){
//
});
});
$('.btn-assign-all-return').click(function() {
layer.confirm('是否确认批量收回操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
$.post('/database/b-return-all-a',o,function(obj){
layer.msg(obj.msg);
if(obj.success) {
search();
}
},'json');
}, function(){
//
});
});
$('.btn-clear').click(function() {
o = {};
search();
});
$('.btn-a-invalid').click(function() {
layer.confirm('是否确认移动?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var invalid_id = $('#invalid_id').val();
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/b-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){
layer.msg(obj.msg);
if(obj.success) {
layer.msg('保存成功');
search();
}
},'json');
}, function(){
//
});
});
});
</script>
<?php $this->endBlock(); ?>

@ -0,0 +1,92 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-sm-1">车牌</label>
<div class="col-sm-3">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-sm-1">车主</label>
<div class="col-sm-3">
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<label class="control-label col-sm-1">联系电话</label>
<div class="col-sm-3">
<input type="text" id="phone" name="phone" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">出单日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="print_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="print_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险公司</label>
<div class="col-sm-3">
<input type="text" id="company" name="company" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">状态</label>
<div class="col-sm-3">
<select name="status" class="form-control">
<option value="0">全部</option>
<option value="1">未分配</option>
<option value="2">已分配</option>
</select>
</div>
<label class="control-label col-sm-1">业务员</label>
<div class="col-sm-3">
<input type="text" id="username" name="username" class="form-control">
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-5">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
parent.o = o;
parent.refreshList();
layer_close();
}
$(function () {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,252 +1,209 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <?php $this->endBlock(); ?>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/database/c-index?" + params;
});
$('#all-assign-btn').click(function(){
if(confirm('是否确认批量分配操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/c-all-assign',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
//数据平移
$('#assign-other-btn').click(function () {
if(confirm('是否确认平移?')) {
var params = $('#listFrm').serialize();
var user_id = $('#user_id').val();
params = params + '&user_id=' + user_id;
$.post('/appointment/assign-cpei',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-title">
<h5>C库</h5>
<div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="searchDlg()">
<i class="fa fa-search"></i> 搜索
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group">
<button type="button" class="btn btn-primary btn-c-d">勾选C-&gt;D</button>
<select class="form-control" id="user_id" name="user_id">
<option value="0">请选择业务员</option>
<?php foreach($user_items as $item) {
echo '<option value="'.$item->id.'">'.$item->getShowName().'</option>';
}
?>
</select>
<button type="button" class="btn btn-primary btn-assign">勾选分配</button>
<button type="button" class="btn btn-primary btn-assign-return">勾选收回</button>
<label class="form-control-static">分配给业务员</label>
<input type="text" name="assign_users" id="assign_users" class="form-control">
<label class="form-control-static">每个业务员分配</label>
<input type="text" name="assign_count" id="assign_count" class="form-control">
<label class="form-control-static">条记录</label>
<button type="button" class="btn btn-primary btn-assign-all">批量分配</button>
<button type="button" class="btn btn-danger btn-clear">清空搜索条件</button>
<select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<button type="button" class="btn btn-primary btn-a-invalid">勾选无效数据</button>
</div>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th width="50" data-field="id">ID</th>
<th data-field="car_no">车牌</th>
<th data-field="factory_model">车型</th>
<th data-field="car_man">车主</th>
<th data-field="phone">联系电话</th>
<th data-field="register_date">初登日期</th>
<th data-field="print_date">出单日期</th>
<th data-field="insurer1_date">保险日期</th>
<th data-field="company">保险公司</th>
<th data-field="op_user">业务员</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
$('.invalid-btn').click(function(){
if(confirm('是否确认无效?')) { <?php $this->beginBlock('footer_js'); ?>
var params = $('#listFrm').serialize(); <script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
var invalid_id = $('#invalid_id').val(); <script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
params = params + '&invalid_id=' + invalid_id; <script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
$.post('/database/invalid',params,function(obj){ <script>
alert(obj.msg); var o = {};
if(obj.success) { function searchDlg() {
window.location.reload(); title = '综合搜索';
} layer_show(title, '/database/c-search');
},'json'); }
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/database/c-index-json",
pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
} }
}); });
$('#move-d-btn').click(function(){ }
if(confirm('是否确认批量移动D库操作?')) {
var params = $('#searchForm').serialize(); $(function() {
$.post('/database/c-move-d',params,function(obj){ search();
alert(obj.msg);
if(obj.success) { $('.btn-c-d').click(function() {
window.location.reload(); var rows = $('#listTable').bootstrapTable('getSelections');
} var params = [];
},'json'); rows.forEach(function(item,index,array){
} params.push(item.id);
});
$.post('/database/c-d', {ids:params.join(',')}, function(data) {
parent.layer.msg(data.msg);
if(data.success == true) {
refreshList();
}
},'json');
}); });
$('#assign-btn').click(function(){ $('.btn-assign').click(function(){
if(confirm('是否确认跟踪分配操作?')) { layer.confirm('是否确认分配操作?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var user_id = $('#user_id').val(); var user_id = $('#user_id').val();
params = params + '&user_id=' + user_id; var rows = $('#listTable').bootstrapTable('getSelections');
$.post('/database/c-assign',params,function(obj){ var params = [];
alert(obj.msg); rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/c-assign',{ids:params.join(','),user_id:user_id},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#return-btn').click(function(){ $('.btn-assign-return').click(function() {
if(confirm('是否确认收回操作?')) { layer.confirm('是否确认收回操作?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/c-return',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/c-return',{ids:params.join(',')},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#move-btn').click(function(){ $('.btn-assign-all').click(function() {
if(confirm('是否确认从C库移到D库操作?')) { layer.confirm('是否确认批量分配操作?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/c-d',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
o.assign_users = $('#assign_users').val();
o.assign_count = $('#assign_count').val();
$.post('/database/c-all-assign',o,function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
});
$('.btn-clear').click(function() {
o = {};
search();
}); });
$('#move-btn-e').click(function(){ $('.btn-a-invalid').click(function() {
if(confirm('是否确认从C库移到e库操作?')) { layer.confirm('是否确认移动?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/c-e',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
var invalid_id = $('#invalid_id').val();
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/c-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); layer.msg('保存成功');
search();
} }
},'json'); },'json');
} }, function(){
}); //
$('#all').click(function(){ });
if($(this).prop('checked')==true) {
$('input:checkbox').each(function() {
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
}); });
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width: 100px;">
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width: 100px;">
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width: 100px;">
出单日期:从<input class="act_date" name="print_begin" type="text" value="<?=$print_begin?>" onclick="WdatePicker()"><input class="act_date" name="print_end" type="text" value="<?=$print_end?>" onclick="WdatePicker()">截止
保险公司:<input name="company" type="text" value="<?=$company?>" style="width: 100px;">
</td>
</tr>
<tr>
<td class="td_bg">
<!-- 保险日期:从<input class="act_date" name="insurer1_begin" type="text" value="--><?//=$insurer1_begin?><!--" onclick="WdatePicker()">至<input class="act_date" name="insurer1_end" type="text" value="--><?//=$insurer1_end?><!--" onclick="WdatePicker()">截止-->
保险日期:
<input name="insurer1_month" class="day_date" type="text" value="<?=$insurer1_month?>" style="width:30px;" placeholder="月份">
<input name="insurer1_day" class="day_date" type="text" value="<?=$insurer1_day?>" style="width:30px;" placeholder="天数">
<input name="insurer1_month1" class="day_date" type="text" value="<?=$insurer1_month1?>" style="width:30px;" placeholder="月份">
<input name="insurer1_day1" class="day_date" type="text" value="<?=$insurer1_day1?>" style="width:30px;" placeholder="天数">
状态:<select name="status">
<option value="0">全部</option>
<option value="1" <?=$status==1?'selected':''?>>未分配</option>
<option value="2" <?=$status==2?'selected':''?>>已分配</option>
</select>
工号:<input name="username" type="text" value="<?=$username?>" style="width: 100px;">
新保座席:<input name="user1" type="text" value="<?=$user1?>" style="width:100px;">
排序:<select name="sort_key">
<option value="car_t.print_date" <?=$sort_key=='car_t.print_date'?'selected':''?>>出单日期</option>
<option value="car_t.insurer1_date" <?=$sort_key=='car_t.insurer1_date'?'selected':''?>>保险日期</option>
</select>
<select name="sort_value">
<option value="ASC" <?=$sort_value=='ASC'?'selected':''?>>顺序</option>
<option value="DESC" <?=$sort_value=='DESC'?'selected':''?>>倒序</option>
</select>
<!-- <input type="checkbox" name="clean_right" value="1" --><?//=$clean_right?'checked':''?><!--清洗岗准确-->
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
</td>
</tr>
<tr>
<td class="td_bg">
<input type="button" class="act_btn" id="move-d-btn" name="move-d-btn" value="批量移到D库">
分配给业务员 <input id="assign_users" name="assign_users" type="text" value="" style="width:100px;">
每个业务员分配 <input id="assign_count" name="assign_count" type="text" value="" style="width:50px;"> 条记录
<input type="button" class="act_btn" id="all-assign-btn" name="all-assign-btn" value="批量分配">
<input type="button" class="act_btn" id="assign-other-btn" name="assign-other-btn" value="批量平移到">
</td>
</tr>
<tr>
<td class="td_bg">
<select name="user_id" id="user_id">
<option value="0">请选择</option>
<?php
foreach($user_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $user_id)
echo ' selected ';
echo '>'.$item->getShowName().'</option>';
}
?>
</select>
<input type="button" class="act_btn" id="assign-btn" name="assign-btn" value="勾选分配">
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="勾选收回">
<input type="button" class="act_btn" id="move-btn" name="move-btn" value="勾选移到D库">
<!-- <input type="button" class="act_btn" id="move-btn-e" name="move-btn" value="勾选移到E库">-->
<select name="invalid_id" id="invalid_id">
<option value="0">请选择无效理由</option>
<?php
foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<input type=button class="ACT_btn invalid-btn" name="invalid-btn" value=" 无效数据 "/>
</td>
</tr>
</form>
</table>
<form id="listFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车牌</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车型</td>
<td width="150" align="center" align="center" class="bg_tr" nowrap>车主</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>联系电话</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>初登日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>出单日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险公司</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>新保座席</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>原客服代表</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>续保座席</td>
<td width="50" align="center" align="center" class="bg_tr" nowrap>当前业务员</td>
</tr>
<?php
foreach($items as $index => $item) {
$car_info = $item->car;
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input type="checkbox" name="ids[]" value="<?=$item->id?>"></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_no?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->factory_model?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_man?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->phone?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->register_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->print_date=='1970-01-01'?'':$car_info->print_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->insurer1_date!=''?$car_info->insurer1_date:$car_info->insurer2_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->company?>
<?php if($item->dif>0):?>
(外区)
<?php endif;?>
</td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user1?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user2?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user3?></td>
<td align="left" class="td_bg"nowrap ><?=$item->user?$item->user->getShowName():''?></td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="13" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
</form>

@ -0,0 +1,84 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-sm-1">车牌</label>
<div class="col-sm-3">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-sm-1">车主</label>
<div class="col-sm-3">
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<label class="control-label col-sm-1">联系电话</label>
<div class="col-sm-3">
<input type="text" id="phone" name="phone" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">保险日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险公司</label>
<div class="col-sm-3">
<input type="text" id="company" name="company" class="form-control">
</div>
<label class="control-label col-sm-1">状态</label>
<div class="col-sm-3">
<select name="status" class="form-control">
<option value="0">全部</option>
<option value="1">未分配</option>
<option value="2">已分配</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">业务员</label>
<div class="col-sm-3">
<input type="text" id="username" name="username" class="form-control">
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-5">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
parent.o = o;
parent.refreshList();
layer_close();
}
$(function () {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,205 +1,195 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <?php $this->endBlock(); ?>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript"> <div class="wrapper wrapper-content animated fadeInRight">
$(function(){ <div class="ibox float-e-margins">
$("#search-btn").click(function(){ <div class="ibox-title">
$('#page').val(0); <h5>D库</h5>
var params = $('#searchForm').serialize(); <div class="ibox-tools">
window.location.href = "/database/d-index?" + params; <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="searchDlg()">
}); <i class="fa fa-search"></i> 搜索
$('#all-assign-btn').click(function(){ </a>
if(confirm('是否确认批量分配操作?')) { <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
var params = $('#searchForm').serialize(); <i class="fa fa-refresh"></i> 刷新
$.post('/database/d-all-assign',params,function(obj){ </a>
alert(obj.msg); </div>
if(obj.success) { </div>
window.location.reload(); <div class="ibox-content">
} <form role="form" class="form-inline" onsubmit="return search();">
},'json'); <div class="form-group">
<select class="form-control" id="user_id" name="user_id">
<option value="0">请选择业务员</option>
<?php foreach($user_items as $item) {
echo '<option value="'.$item->id.'">'.$item->getShowName().'</option>';
}
?>
</select>
<button type="button" class="btn btn-primary btn-assign">勾选分配</button>
<button type="button" class="btn btn-primary btn-assign-return">勾选收回</button>
<label class="form-control-static">分配给业务员</label>
<input type="text" name="assign_users" id="assign_users" class="form-control">
<label class="form-control-static">每个业务员分配</label>
<input type="text" name="assign_count" id="assign_count" class="form-control">
<label class="form-control-static">条记录</label>
<button type="button" class="btn btn-primary btn-assign-all">批量分配</button>
<button type="button" class="btn btn-danger btn-clear">清空搜索条件</button>
<select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<button type="button" class="btn btn-primary btn-a-invalid">勾选无效数据</button>
</div>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th width="50" data-field="id">ID</th>
<th data-field="car_no">车牌</th>
<th data-field="factory_model">车型</th>
<th data-field="car_man">车主</th>
<th data-field="phone">联系电话</th>
<th data-field="register_date">初登日期</th>
<th data-field="print_date">出单日期</th>
<th data-field="insurer1_date">保险日期</th>
<th data-field="company">保险公司</th>
<th data-field="op_user">业务员</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>
var o = {};
function searchDlg() {
title = '综合搜索';
layer_show(title, '/database/d-search');
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
}
function search() {
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/database/d-index-json",
pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
} }
}); });
$('#assign-btn').click(function(){ }
if(confirm('是否确认续保分配操作?')) {
var params = $('#listFrm').serialize(); $(function() {
search();
$('.btn-assign').click(function(){
layer.confirm('是否确认分配操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var user_id = $('#user_id').val(); var user_id = $('#user_id').val();
params = params + '&user_id=' + user_id; var rows = $('#listTable').bootstrapTable('getSelections');
$.post('/database/d-assign',params,function(obj){ var params = [];
alert(obj.msg); rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/d-assign',{ids:params.join(','),user_id:user_id},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#return-btn').click(function(){ $('.btn-assign-return').click(function() {
if(confirm('是否确认收回操作?')) { layer.confirm('是否确认收回操作?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/d-return',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/d-return',{ids:params.join(',')},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#move-btn').click(function(){ $('.btn-assign-all').click(function() {
if(confirm('是否确认 D->C 操作?')) { layer.confirm('是否确认批量分配操作?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/d-c',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
o.assign_users = $('#assign_users').val();
o.assign_count = $('#assign_count').val();
$.post('/database/d-all-assign',o,function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
});
$('.btn-clear').click(function() {
o = {};
search();
}); });
$('.invalid-btn').click(function(){ $('.btn-a-invalid').click(function() {
if(confirm('是否确认无效?')) { layer.confirm('是否确认移动?', {
var params = $('#listFrm').serialize(); btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var invalid_id = $('#invalid_id').val(); var invalid_id = $('#invalid_id').val();
params = params + '&invalid_id=' + invalid_id; var rows = $('#listTable').bootstrapTable('getSelections');
$.post('/database/invalid',params,function(obj){ var params = [];
alert(obj.msg); rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/d-invalid',{ids:params.join(','), invalid_id:invalid_id},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); layer.msg('保存成功');
search();
} }
},'json'); },'json');
} }, function(){
}); //
$('#all').click(function(){ });
if($(this).prop('checked')==true) {
$('input:checkbox').each(function() {
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
}); });
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width:100px;">
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width:100px;">
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width:100px;">
保险日期:
<!-- 从<input class="act_date" name="insurer1_begin" type="text" value="--><?//=$insurer1_begin?><!--" onclick="WdatePicker()">至<input class="act_date" name="insurer1_end" type="text" value="--><?//=$insurer1_end?><!--" onclick="WdatePicker()">截止-->
<input name="insurer1_month" class="day_date" type="text" value="<?=$insurer1_month?>" style="width:30px;" placeholder="月份">
<input name="insurer1_day" class="day_date" type="text" value="<?=$insurer1_day?>" style="width:30px;" placeholder="天数">
<input name="insurer1_month1" class="day_date" type="text" value="<?=$insurer1_month1?>" style="width:30px;" placeholder="月份">
<input name="insurer1_day1" class="day_date" type="text" value="<?=$insurer1_day1?>" style="width:30px;" placeholder="天数">
保险公司:<input name="company" type="text" value="<?=$company?>" style="width:100px;">
</td>
</tr>
<tr>
<td class="td_bg">
状态:<select name="status">
<option value="0">全部</option>
<option value="1" <?=$status==1?'selected':''?>>未分配</option>
<option value="2" <?=$status==2?'selected':''?>>已分配</option>
</select>
工号:<input name="username" type="text" value="<?=$username?>" style="width:100px;">
旧业务员:<input name="old_user" type="text" value="<?=$old_user?>" style="width:100px;">
新保座席:<input name="user1" type="text" value="<?=$user1?>" style="width:100px;">
续保座席:<input name="user2" type="text" value="<?=$user2?>" style="width:100px;">
排序:<select name="sort_key">
<option value="car_t.register_date" <?=$sort_key=='car_t.register_date'?'selected':''?>>初登日期</option>
<option value="car_t.print_date" <?=$sort_key=='car_t.print_date'?'selected':''?>>出单日期</option>
<option value="car_t.insurer1_date" <?=$sort_key=='car_t.insurer1_date'?'selected':''?>>商业日期</option>
</select>
<select name="sort_value">
<option value="ASC" <?=$sort_value=='ASC'?'selected':''?>>顺序</option>
<option value="DESC" <?=$sort_value=='DESC'?'selected':''?>>倒序</option>
</select>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
</td>
</tr>
<tr>
<td class="td_bg">
分配给业务员 <input id="assign_users" name="assign_users" type="text" value="" style="width:100px;">
每个业务员分配 <input id="assign_count" name="assign_count" type="text" value="" style="width:50px;"> 条记录
<input type="button" class="act_btn" id="all-assign-btn" name="all-assign-btn" value="批量分配">
</td>
</tr>
<tr>
<td class="td_bg">
<select name="user_id" id="user_id">
<option value="0">请选择</option>
<?php
foreach($user_items as $item) {
echo '<option value="'.$item->id.'"';
if($item->id == $user_id)
echo ' selected ';
echo '>'.$item->getShowName().'</option>';
}
?>
</select>
<input type="button" class="act_btn" id="assign-btn" name="assign-btn" value="勾选分配">
<input type="button" class="act_btn" id="return-btn" name="return-btn" value="勾选收回">
<select name="invalid_id" id="invalid_id">
<option value="0">请选择无效理由</option>
<?php
foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<input type=button class="ACT_btn invalid-btn" name="invalid-btn" value=" 无效数据 "/>
</td>
</tr>
</form>
</table>
<form id="listFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车牌</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车型</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>车主</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>联系电话</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>保险公司</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>旧业务员</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>新保座席</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>原客服代表</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>续保座席</td>
<td width="50" align="center" align="center" class="bg_tr" nowrap>当前业务员</td>
</tr>
<?php
foreach($items as $index => $item) {
$car_info = $item->car;
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input type="checkbox" name="ids[]" value="<?=$car_info->id?>"></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_no?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->factory_model?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->car_man?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->phone?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->insurer1_date?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->company?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->old_user?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user1?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user2?></td>
<td align="left" class="td_bg"nowrap ><?=$car_info->op_user3?></td>
<td align="left" class="td_bg"nowrap ><?=$item->user?$item->user->getShowName():''?></td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="12" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
</form>

@ -0,0 +1,94 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<form role="form" class="form-horizontal" id="searchFrm" onsubmit="return search();">
<div class="form-group">
<label class="control-label col-sm-1">车牌</label>
<div class="col-sm-3">
<input type="text" id="car_no" name="car_no" class="form-control">
</div>
<label class="control-label col-sm-1">车主</label>
<div class="col-sm-3">
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<label class="control-label col-sm-1">联系电话</label>
<div class="col-sm-3">
<input type="text" id="phone" name="phone" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">初登日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="register_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="register_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险日期</label>
<div class="col-sm-3">
<div class="input-daterange input-group" id="datepicker">
<input type="text" class="input-sm form-control" name="insurer1_begin" value="" autocomplete="off" />
<span class="input-group-addon"></span>
<input type="text" class="input-sm form-control" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<label class="control-label col-sm-1">保险公司</label>
<div class="col-sm-3">
<input type="text" id="company" name="company" class="form-control">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1">无效理由</label>
<div class="col-sm-3">
<select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<label class="control-label col-sm-1">操作者</label>
<div class="col-sm-3">
<input type="text" id="username" name="username" class="form-control">
</div>
</div>
<div class="form-group">
<div class="col-sm-3 col-sm-offset-5">
<button type="submit" class="btn btn-primary">搜索</button>
</div>
</div>
</form>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
function search() {
var o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
parent.o = o;
parent.refreshList();
layer_close();
}
$(function () {
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,165 +1,139 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <?php $this->endBlock(); ?>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript"> <div class="wrapper wrapper-content animated fadeInRight">
//编辑 <div class="ibox float-e-margins">
function edit(id) { <div class="ibox-title">
var params = $('#searchForm').serialize(); <h5>无效库</h5>
window.location.href = '/car/edit?id=' + id + '&back_params=' + encodeURIComponent(params); <div class="ibox-tools">
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="searchDlg()">
<i class="fa fa-search"></i> 搜索
</a>
<a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<form role="form" class="form-inline" onsubmit="return search();">
<div class="form-group">
<button type="button" class="btn btn-primary btn-assign-return">勾选恢复</button>
<button type="button" class="btn btn-primary btn-assign-all">批量恢复</button>
<button type="button" class="btn btn-danger btn-clear">清空搜索条件</button>
<select class="form-control" id="invalid_id" name="invalid_id">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
<button type="button" class="btn btn-primary btn-a-invalid">勾选无效数据</button>
</div>
</form>
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th data-field="state" data-checkbox="true"></th>
<th width="50" data-field="id">ID</th>
<th data-field="car_no">车牌</th>
<th data-field="factory_model">车型</th>
<th data-field="car_man">车主</th>
<th data-field="phone">联系电话</th>
<th data-field="register_date">初登日期</th>
<th data-field="print_date">出单日期</th>
<th data-field="insurer1_date">保险日期</th>
<th data-field="company">保险公司</th>
<th data-field="op_user">业务员</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>
var o = {};
function searchDlg() {
title = '综合搜索';
layer_show(title, '/database/invalid-search');
} }
//删除
function del(id) { function refreshList() {
if(confirm('是否确认删除?')) { $('#listTable').bootstrapTable('refresh');
$.post('/car/delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
} }
$(function(){ function search() {
$("#search-btn").click(function(){ $('#listTable').bootstrapTable('destroy');
$('#page').val(0); $('#listTable').bootstrapTable({
var params = $('#searchForm').serialize(); url: "/database/invalid-index-json",
window.location.href = "/database/invalid-index?" + params; pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
}); });
$('#move-btn').click(function(){ }
if(confirm('是否确认恢复操作?')) {
var params = $('#listFrm').serialize(); $(function() {
$.post('/database/invalid-a',params,function(obj){ search();
alert(obj.msg);
$('.btn-assign-return').click(function() {
layer.confirm('是否确认收回操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var rows = $('#listTable').bootstrapTable('getSelections');
var params = [];
rows.forEach(function(item,index,array){
params.push(item.id);
});
$.post('/database/d-return',{ids:params.join(',')},function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#all-move-btn').click(function(){ $('.btn-assign-all').click(function() {
if(confirm('是否确认恢复操作?')) { layer.confirm('是否确认批量分配操作?', {
var params = $('#searchForm').serialize(); btn: ['确认','取消'], //按钮
$.post('/database/invalid-all-a',params,function(obj){ shade: false //不显示遮罩
alert(obj.msg); }, function(){
o.assign_users = $('#assign_users').val();
o.assign_count = $('#assign_count').val();
$.post('/database/d-all-assign',o,function(obj){
layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
window.location.reload(); search();
} }
},'json'); },'json');
} }, function(){
//
});
}); });
$('#all').click(function(){ $('.btn-clear').click(function() {
if($(this).prop('checked')==true) { o = {};
$('input:checkbox').each(function() { search();
$(this).prop('checked', true);
});
} else {
$('input:checkbox').each(function () {
$(this).prop('checked',false);
});
}
}); });
}); });
</script> </script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> <?php $this->endBlock(); ?>
<form id="searchForm">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<tr>
<td class="td_bg">
车牌:<input name="car_no" type="text" value="<?=$car_no?>" style="width:100px;">
车主:<input name="car_man" type="text" value="<?=$car_man?>" style="width:100px;">
联系电话:<input name="phone" type="text" value="<?=$phone?>" style="width:100px;">
初登日期:从<input class="act_date" name="register_begin" type="text" value="<?=$register_begin?>" onclick="WdatePicker()"><input class="act_date" name="register_end" type="text" value="<?=$register_end?>" onclick="WdatePicker()">截止
新保座席:<input name="user1" type="text" value="<?=$user1?>" style="width:100px;">
</td>
</tr>
<tr>
<td class="td_bg">
保险日期:从<input class="act_date" name="insurer1_begin" type="text" value="<?=$insurer1_begin?>" onclick="WdatePicker()"><input class="act_date" name="insurer1_end" type="text" value="<?=$insurer1_end?>" onclick="WdatePicker()">截止
<!-- 保险日期:-->
<!-- <input name="insurer1_month" class="day_date" type="text" value="--><?//=$insurer1_month?><!--" style="width:30px;" placeholder="月份">月-->
<!-- <input name="insurer1_day" class="day_date" type="text" value="--><?//=$insurer1_day?><!--" style="width:30px;" placeholder="天数">日-->
<!---->
<!-- <input name="insurer1_month1" class="day_date" type="text" value="--><?//=$insurer1_month1?><!--" style="width:30px;" placeholder="月份">月-->
<!-- <input name="insurer1_day1" class="day_date" type="text" value="--><?//=$insurer1_day1?><!--" style="width:30px;" placeholder="天数">日-->
无效理由:<select name="invalid_id">
<option value="0"></option>
<?php
foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'"';
if($invalid_id == $item->id)
echo ' selected ';
echo '>'.$item->name.'</option>';
}
?>
</select>
操作者:<input name="username" type="text" value="<?=$username?>" style="width:100px;">
排序:<select name="sort_key">
<option value="car_t.register_date" <?=$sort_key=='car_t.register_date'?'selected':''?>>初登日期</option>
<option value="car_invalid_t.created_at" <?=$sort_key=='car_invalid_t.created_at'?'selected':''?>>无效时间</option>
</select>
<select name="sort_value">
<option value="ASC" <?=$sort_value=='ASC'?'selected':''?>>顺序</option>
<option value="DESC" <?=$sort_value=='DESC'?'selected':''?>>倒序</option>
</select>
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索">
</td>
</tr>
<tr>
<td class="td_bg">
<input type="button" class="act_btn" id="move-btn" name="move-btn" value="勾选恢复">
<input type="button" class="act_btn" id="all-move-btn" name="all-move-btn" value="批量恢复">
</td>
</tr>
</form>
</table>
<form id="listFrm">
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<tr>
<td align="center" width="24" align="center" class="bg_tr"><input type="checkbox" id="all"></td>
<td width="78" align="center" align="center" class="bg_tr">车牌</td>
<td width="78" align="center" align="center" class="bg_tr">车型</td>
<td width="78" align="center" align="center" class="bg_tr">车主</td>
<td width="78" align="center" align="center" class="bg_tr">联系电话</td>
<td width="78" align="center" align="center" class="bg_tr">初登日期</td>
<td width="78" align="center" align="center" class="bg_tr">保险日期</td>
<td width="78" align="center" align="center" class="bg_tr" nowrap>新保座席</td>
<td width="96" align="center" align="center" class="bg_tr">无效理由</td>
<td width="96" align="center" align="center" class="bg_tr">无效时间</td>
<td width="78" align="center" align="center" class="bg_tr">操作者</td>
</tr>
<?php
foreach($items as $index => $item) {
$fact=$item->car;
$fac=$fact['factory_model'];
$carms=$fact['car_man'];
$phones=$fact['phone'];
$regs=$fact['register_date'];
$insurs=$fact['insurer1_date'];
$opes=$fact['op_user1'];
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input type="checkbox" name="ids[]" value="<?=$item->id?>"></td>
<td align="left" class="td_bg"nowrap ><?=$item->car?$item->car->car_no:''?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($fac,20)?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($carms,20)?></td>
<td align="left" class="td_bg"nowrap ><?=$phones?></td>
<td align="left" class="td_bg"nowrap ><?=$regs?></td>
<td align="left" class="td_bg"nowrap ><?=$insurs?></td>
<td align="left" class="td_bg"nowrap ><?=$opes?></td>
<td align="left" class="td_bg"nowrap ><?=$item->invalid?$item->invalid->getPath():''?></td>
<td align="left" class="td_bg"nowrap ><?=$item->created_at?></td>
<td align="left" class="td_bg"nowrap ><?=$item->user?$item->user->getShowName():''?></td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="11" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
</form>

Loading…
Cancel
Save