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/database/invalid-index.php

186 lines
8.0 KiB

5 years ago
<?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="$('#listTable').bootstrapTable('refresh');">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
5 years ago
<form role="form" id="searchFrm" class="form-inline" onsubmit="return search();">
<div class="form-group" 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" style="margin-bottom: 8px;margin-left:20px;">
<label for="car_man">车主</label>
<input type="text" id="car_man" name="car_man" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;margin-left:20px;">
<label for="phone">联系电话</label>
<input type="text" id="phone" name="phone" class="form-control">
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker1">初登日期</label>
<div class="input-daterange input-group" id="datepicker1">
<input type="text" class="input-sm form-control" id="register_begin" name="register_begin" value="" autocomplete="off" />
5 years ago
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="register_end" name="register_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="datepicker2">保险日期</label>
<div class="input-daterange input-group" id="datepicker2">
<input type="text" class="input-sm form-control" id="insurer1_begin" name="insurer1_begin" value="" autocomplete="off" />
5 years ago
<span class="input-group-addon">-</span>
<input type="text" class="input-sm form-control" id="insurer1_end" name="insurer1_end" value="" autocomplete="off" />
</div>
</div>
<div class="form-group" style="margin-bottom: 8px;">
<label for="invalid_id">无效理由</label>
5 years ago
<select class="form-control" id="invalid_id" name="invalid_id" style="width: 200px;">
<option value="0">请选择无效理由</option>
<?php foreach($invalid_items as $item) {
echo '<option value="'.$item->id.'">'.$item->name.'</option>';
}
?>
</select>
</div>
<button type="submit" class="btn btn-primary mb-8">搜索</button>
5 years ago
<button type="button" class="btn btn-primary btn-assign-return mb-8">勾选恢复</button>
<button type="button" class="btn btn-primary btn-assign-all mb-8">批量恢复</button>
</form>
<div class="row" style="margin-top:20px;">
<div class="col-md-12">
<table id="listTable" class="table" data-toggle="table" data-height="550">
<thead class="bg-warning">
<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="print_date">出单日期</th>
<th data-field="insurer1_date">保险日期</th>
5 years ago
<th data-field="invalid_info">无效理由</th>
<th data-field="invalid_time">无效时间</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');
5 years ago
}
function refreshList() {
$('#listTable').bootstrapTable('refresh');
5 years ago
}
function search() {
5 years ago
o = {};
var params = $("#searchFrm").serializeArray();
$.each(params, function(index) {
o[this['name']] = this['value'];
});
$('#listTable').bootstrapTable('destroy');
$('#listTable').bootstrapTable({
url: "/database/invalid-index-json",
pagination: true,
sidePagination: 'server',
multipleSelectRow: true,
queryParams: function(params) {
o['limit'] = params['limit'];
o['offset'] = params['offset'];
return o;
}
5 years ago
});
return false;
}
//固定表头
function fix(){
//table设置一定的高度
var tab=$("#listTable").attr('data-height');
$('.fixed-table-body').css({'height':tab-100});
//当浏览器窗口变化时,表头与表格不对齐解决
$('.table').bootstrapTable();
$(window).resize(function () {
$('.table').bootstrapTable('resetView');
});
}
$(function() {
search();
fix();
$('.input-daterange').datepicker({
keyboardNavigation: false,
forceParse: false,
autoclose: true
});
$('.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);
});
5 years ago
$.post('/database/invalid-a',{ids:params.join(',')},function(obj){
layer.msg(obj.msg);
5 years ago
if(obj.success) {
search();
5 years ago
}
},'json');
}, function(){
//
});
5 years ago
});
$('.btn-assign-all').click(function() {
layer.confirm('是否确认批量分配操作?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
5 years ago
$.post('/database/invalid-all-a',o,function(obj){
layer.msg(obj.msg);
5 years ago
if(obj.success) {
search();
5 years ago
}
},'json');
}, function(){
//
});
5 years ago
});
$('.btn-clear').click(function() {
o = {};
search();
5 years ago
});
});
</script>
<?php $this->endBlock(); ?>