Merge remote-tracking branch 'origin/master'

master
zhaocheng 2 years ago
commit df0f06fdd4
  1. 291
      app/view/index/index.html
  2. 7
      app/view/public/layout.html
  3. 2
      extend/service/CarInfoHandle.php

@ -1,26 +1,45 @@
{extend name="public/layout" /} {extend name="public/layout" /}
{block name="header"} {block name="header"}
<style> <style>
.layui-table-cell { .layui-table-cell {
padding: 0 5px; padding: 0 5px;
} }
.layui-input, .layui-select, .layui-textarea {
height: 28px;
}
.layui-input-block {
height: 28px;
min-height: auto;
}
.layui-form-label {
padding: 4px 15px;
}
.layui-form-item {
margin-bottom: 4px;
}
.layui-form-mid {
padding: 0 !important;
}
.layui-table td, .layui-table th {
padding: 0 15px;
}
</style> </style>
{/block} {/block}
{block name="body"} {block name="body"}
<div class="layui-card"> <div class="layui-card">
<div class="layui-card-body layui-form"> <div class="layui-card-body layui-form" style="padding: 0 10px;">
<div class="layui-collapse"> <div class="layui-collapse">
<div class="layui-colla-item"> <div class="layui-colla-item">
<h2 class="layui-colla-title">筛选</h2> <h2 class="layui-colla-title" style="display: flex; justify-content: space-between;">
<span>筛选</span>
<div id="tool-bar">
<button type="button" class="layui-btn layui-btn-sm" id="search-btn">搜索</button>
<a href="{:url('index/index')}" class="layui-btn layui-btn-sm" id="reset-btn">重置条件</a>
<button type="button" class="layui-btn layui-btn-sm layui-btn-danger" style="display: none;" id="deletes-btn">批量删除</button>
</div>
</h2>
<div class="layui-colla-content layui-form"> <div class="layui-colla-content layui-form">
<div class="layui-row"> <div class="layui-row">
<div class="layui-form-item layui-col-md3" style="clear: none;">
<label class="layui-form-label">车牌号</label>
<div class="layui-input-block">
<input type="text" name="car_no" id="car_no" autocomplete="off" class="layui-input"
value="{$params.car_no | default=''}">
</div>
</div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md3" style="clear: none;">
<label class="layui-form-label">车架号</label> <label class="layui-form-label">车架号</label>
<div class="layui-input-block"> <div class="layui-input-block">
@ -30,66 +49,100 @@
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md3" style="clear: none;">
<label class="layui-form-label">厂牌型号</label> <label class="layui-form-label">厂牌型号</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="factory_model" id="factory_model" autocomplete="off" <input type="text" name="factory_model" id="factory_model" autocomplete="off"
class="layui-input" value="{$params.factory_model | default=''}"> class="layui-input" value="{$params.factory_model | default=''}">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">车牌号</label>
<div class="layui-input-block">
<input type="text" name="car_no" id="car_no" autocomplete="off" class="layui-input"
value="{$params.car_no | default=''}">
</div>
</div>
<div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">注册日期</label> <label class="layui-form-label">注册日期</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="register_date" id="register_date" autocomplete="off" <input type="text" name="register_date" id="register_date" autocomplete="off"
class="layui-input layui-date-elem" value="{$params.register_date | default=''}"> class="layui-input layui-date-elem" value="{$params.register_date | default=''}">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">车主姓名</label> <label class="layui-form-label">车主姓名</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="car_man" id="car_man" autocomplete="off" <input type="text" name="car_man" id="car_man" autocomplete="off"
class="layui-input" value="{$params.car_man | default=''}"> class="layui-input" value="{$params.car_man | default=''}">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md3" style="clear: none;">
<label class="layui-form-label">身份证号</label> <label class="layui-form-label">身份证号</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="car_number" id="car_number" autocomplete="off" <input type="text" name="car_number" id="car_number" autocomplete="off"
class="layui-input" value="{$params.car_number | default=''}"> class="layui-input" value="{$params.car_number | default=''}">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md3" style="clear: none;">
<label class="layui-form-label">导出文件名</label>
<div class="layui-input-block">
<input type="text" name="export_name" id="export_name" autocomplete="off"
class="layui-input" value="{$params.export_name | default=''}">
</div>
</div>
<div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">联系电话</label> <label class="layui-form-label">联系电话</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="car_phone" id="car_phone" autocomplete="off" <input type="text" name="car_phone" id="car_phone" autocomplete="off"
class="layui-input" value="{$params.car_phone | default=''}"> class="layui-input" value="{$params.car_phone | default=''}">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md3" style="clear: none;"> <div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">导出文件名</label> <label class="layui-form-label">电话检测</label>
<div class="layui-input-inline"> <div class="layui-input-block">
<input type="text" name="export_name" id="export_name" autocomplete="off" <select name="car_phone_empty">
class="layui-input" value="{$params.export_name | default=''}"> <option value="">全部</option>
<option value="yes">不为空</option>
<option value="no"></option>
<option value="2">广州</option>
<option value="3">深圳</option>
<option value="4">杭州</option>
</select>
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md6" style="clear: none;"> <div class="layui-form-item layui-col-md2" style="clear: none;">
<label class="layui-form-label">重复数据</label>
<div class="layui-input-block">
<select name="data_check">
<option value=""></option>
{if $repeat_frame_count > 0 }
<option value="car_frame_check">车架号</option>
{/if}
{if $peer_phone_count > 0 }
<option value="car_phone_check">个人电话</option>
{/if}
</select>
</div>
</div>
<div class="layui-form-item layui-col-md4" style="clear: none;">
<label class="layui-form-label">初登日期</label> <label class="layui-form-label">初登日期</label>
<div class="layui-input-inline"> <div class="layui-input-inline" style="width: 100px;">
<input type="text" name="register_date1" id="register-date1" class="layui-input layui-date-elem"> <input type="text" name="register_date1" id="register-date1" class="layui-input layui-date-elem">
</div> </div>
<div class="layui-form-mid">-</div> <div class="layui-form-mid">-</div>
<div class="layui-input-inline"> <div class="layui-input-inline" style="width: 100px;">
<input type="text" name="register_date2" id="register-date2" class="layui-input layui-date-elem"> <input type="text" name="register_date2" id="register-date2" class="layui-input layui-date-elem">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md6" style="clear: none;"> <div class="layui-form-item layui-col-md4" style="clear: none;">
<label class="layui-form-label">保险日期</label> <label class="layui-form-label">保险日期</label>
<div class="layui-input-inline"> <div class="layui-input-inline" style="width: 110px;">
<input type="text" name="insurer_month1" class="layui-input" style="display: inline-block; width: 60px;"> <input type="text" name="insurer_month1" class="layui-input" style="display: inline-block; width: 50px;" placeholder="月">
<input type="text" name="insurer_day1" class="layui-input" style="display: inline-block; width: 60px;"> <input type="text" name="insurer_day1" class="layui-input" style="display: inline-block; width: 50px;" placeholder="日">
</div> </div>
<div class="layui-form-mid">-</div> <div class="layui-form-mid">-</div>
<div class="layui-input-inline"> <div class="layui-input-inline" style="width: 110px;">
<input type="text" name="insurer_month2" class="layui-input" style="display: inline-block; width: 60px;"> <input type="text" name="insurer_month2" class="layui-input" style="display: inline-block; width: 50px;" placeholder="月">
<input type="text" name="insurer_day2" class="layui-input" style="display: inline-block; width: 60px;"> <input type="text" name="insurer_day2" class="layui-input" style="display: inline-block; width: 50px;" placeholder="日">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md4" style="clear: none;"> <div class="layui-form-item layui-col-md4" style="clear: none;">
@ -102,29 +155,9 @@
<input type="text" name="price2" class="layui-input" placeholder="万"> <input type="text" name="price2" class="layui-input" placeholder="万">
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-md4" style="clear: none;">
<label class="layui-form-label">电话检测</label>
<div class="layui-input-inline" style="width: 300px;">
<input type="radio" class="layui-input" name="car_phone_empty" value="all" title="全部" checked>
<input type="radio" class="layui-input" name="car_phone_empty" value="yes" title="不为空">
<input type="radio" class="layui-input" name="car_phone_empty" value="no" title="空">
</div>
</div>
<div class="layui-form-item layui-col-md4" style="clear: none;">
<label class="layui-form-label">重复数据</label>
<div class="layui-input-inline">
<input type="radio" class="layui-input" name="data_check" value="no" title="否" checked>
{if $repeat_frame_count > 0 }
<input type="radio" class="layui-input" name="data_check" value="car_frame_check" title="车架号">
{/if}
{if $peer_phone_count > 0 }
<input type="radio" class="layui-input" name="data_check" value="car_phone_check" title="个人电话">
{/if}
</div>
</div>
<div class="layui-form-item layui-col-md12" style="clear: none;"> <div class="layui-form-item layui-col-md12" style="clear: none;">
<label class="layui-form-label">数据状态</label> <label class="layui-form-label">数据状态</label>
<div class="layui-input-inline" style="min-width: 1100px;"> <div class="layui-input-block" style="height: auto;">
<table class="layui-table"> <table class="layui-table">
<tr> <tr>
<td colspan="3"><input type="checkbox" name="data_filter[]" value="bhx" title="已导出清洗"></td> <td colspan="3"><input type="checkbox" name="data_filter[]" value="bhx" title="已导出清洗"></td>
@ -151,11 +184,6 @@
</div> </div>
</div> </div>
</div> </div>
<div class="layui-input-block layui-text-right" id="tool-bar">
<button type="button" class="layui-btn" id="search-btn">搜索</button>
<a href="{:url('index/index')}" class="layui-btn" id="reset-btn">重置条件</a>
<button type="button" class="layui-btn layui-btn-danger" id="deletes-btn">批量删除</button>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -186,6 +214,8 @@
{{# } }} {{# } }}
</script> </script>
<script> <script>
var tableIns;
var local_storage_key = 'data_table_col_list';
$(function () { $(function () {
layui.form.on('checkbox(dataStatus)', function(data){ layui.form.on('checkbox(dataStatus)', function(data){
if(data.elem.checked){ if(data.elem.checked){
@ -216,50 +246,7 @@
} }
} }
}); });
var tableIns = layui.table.render({ tableIns = layui.table.render(tableRender(''));
id: 'carInfo',
elem: '#car-info',
title:'车辆信息',
url: '{:url("/index/carInfo/")}', //数据接口
where: getUrlParam('Object'),
toolbar: true,
height: 'full - 45',
page: true, //开启分页
limit: 20,
loading: true,
cols: [[ //表头
// {type: 'checkbox', fixed: 'left'},
{field: 'car_no', title: '车牌号', width: 100, edit: 'text', fixed: 'left'},
{field: 'car_frame_no', title: '车架号', width: 180, edit: 'text'},
{field: 'engine_no', title: '发动机号', width: 100, edit: 'text'},
{field: 'factory_model', title: '厂牌型号', width: 200, edit: 'text'},
{field: 'register_date', title: '注册日期', width: 100, edit: 'text'},
{field: 'car_man', title: '车主', width: 80, edit: 'text'},
{field: 'car_number', title: '车主证件号', width: 160, edit: 'text'},
{field: 'car_phone', title: '车主电话', width: 120, edit: 'text'},
{field: 'id_man', title: '被保险人', width: 80, edit: 'text'},
{field: 'id_number', title: '被保险人证件号', width: 160, edit: 'text'},
{field: 'id_phone', title: '被保险人电话', width: 120, edit: 'text'},
{field: 'insured_man', title: '投保人', width: 80, edit: 'text'},
{field: 'insured_number', title: '投保人证件号', width: 160, edit: 'text'},
{field: 'insured_phone', title: '投保人电话', width: 120, edit: 'text'},
{field: 'link_man_1', title: '联系人1', width: 80, edit: 'text'},
{field: 'link_phone_1', title: '联系人电话1', width: 120, edit: 'text'},
{field: 'link_man_2', title: '联系人2', width: 80, edit: 'text'},
{field: 'link_phone_2', title: '联系人电话2', width: 120, edit: 'text'},
{field: 'link_man_3', title: '联系人3', width: 80, edit: 'text'},
{field: 'link_phone_3', title: '联系人电话3', width: 120, edit: 'text'},
{field: 'purchase_price', title: '新车购置价', width: 100, edit: 'text'},
{field: 'export_bhx_name', title: '导出清洗', width: 140, edit: 'text', templet:'#BhxNameTpl'},
{field: 'export_bmc_name', title: '导出上传', width: 140, edit: 'text', templet:'#BmcNameTpl'},
{fixed: 'right', width: 100, align:'center', toolbar: '#table-bar'}
]],
done: function (res, curr, count) {
if(res.code == -1){
$('#lock-screen').css('display','flex');
}
}
});
//监听行工具事件 //监听行工具事件
layui.table.on('tool(car-info)', function(obj){ //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" layui.table.on('tool(car-info)', function(obj){ //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
@ -357,6 +344,14 @@
}, },
where: param, where: param,
}, 'data'); }, 'data');
let param_a = param;
delete param_a['car_phone_empty'];
delete param_a['car_frame_check'];
delete param_a['data_check'];
if (Object.values(param_a).filter(data => data).length > 0)
$('#deletes-btn').css('display', 'inline-block')
else
$('#deletes-btn').css('display', 'none')
}); });
$('#deletes-btn').on('click', function () { $('#deletes-btn').on('click', function () {
layer.confirm('真的删除行么', function(index){ layer.confirm('真的删除行么', function(index){
@ -380,5 +375,97 @@
}); });
}); });
} }
//表格 头部数据函数封装
function getTableCols(){
return [ //表头
{type: 'numbers', fixed: 'left'},
{field: 'car_no', title: '车牌号', width: 100, edit: 'text', fixed: 'left'},
{field: 'car_frame_no', title: '车架号', width: 180, edit: 'text'},
{field: 'engine_no', title: '发动机号', width: 100, edit: 'text'},
{field: 'factory_model', title: '厂牌型号', width: 200, edit: 'text'},
{field: 'register_date', title: '注册日期', width: 100, edit: 'text'},
{field: 'car_man', title: '车主', width: 80, edit: 'text'},
{field: 'car_number', title: '车主证件号', width: 160, edit: 'text'},
{field: 'car_phone', title: '车主电话', width: 120, edit: 'text'},
{field: 'id_man', title: '被保险人', width: 80, edit: 'text'},
{field: 'id_number', title: '被保险人证件号', width: 160, edit: 'text'},
{field: 'id_phone', title: '被保险人电话', width: 120, edit: 'text'},
{field: 'insured_man', title: '投保人', width: 80, edit: 'text'},
{field: 'insured_number', title: '投保人证件号', width: 160, edit: 'text'},
{field: 'insured_phone', title: '投保人电话', width: 120, edit: 'text'},
{field: 'link_man_1', title: '联系人1', width: 80, edit: 'text'},
{field: 'link_phone_1', title: '联系人电话1', width: 120, edit: 'text'},
{field: 'link_man_2', title: '联系人2', width: 80, edit: 'text'},
{field: 'link_phone_2', title: '联系人电话2', width: 120, edit: 'text'},
{field: 'link_man_3', title: '联系人3', width: 80, edit: 'text'},
{field: 'link_phone_3', title: '联系人电话3', width: 120, edit: 'text'},
{field: 'purchase_price', title: '新车购置价', width: 100, edit: 'text'},
{field: 'export_bhx_name', title: '导出清洗', width: 140, edit: 'text', templet:'#BhxNameTpl'},
{field: 'export_bmc_name', title: '导出上传', width: 140, edit: 'text', templet:'#BmcNameTpl'},
{fixed: 'right', width: 100, align:'center', toolbar: '#table-bar'}
];
}
//layui表格渲染,其中url param为请求的数据接口以及其参数
function tableRender(param){
var tableCols = tableSetCol(getTableCols(), local_storage_key);
var renderParam = {
id: 'carInfo',
elem: '#car-info',
title:'车辆信息',
url: '{:url("/index/carInfo/")}', //数据接口
where: getUrlParam('Object'),
toolbar: true,
height: 'full-210',
page: true, //开启分页
limit: 20,
loading: true,
cols: [tableCols],
done: function (res, curr, count) {
tableDone(this.elem, tableIns.config.cols[0], local_storage_key);
if(res.code == -1){
$('#lock-screen').css('display','flex');
}
}
};
return renderParam;
}
//layui表格渲染后,事件需要重新绑定,并记录下筛选信息于localStorage
function tableDone(elem, col, key){
elem.next().find('[lay-event="LAYTABLE_COLS"]').click(function(e) {
setTimeout(function() {
layui.$(e.currentTarget).find('.layui-form-checkbox').click(function() {
var local_config = {};
for(var i = 0; i<=col.length-1; i++){
if(typeof col[i].field !== 'undefined'){
local_config[col[i].field] = col[i].hide ;
}
}
var saveColsConfig = {
key: 'local_config',
value: local_config
};
layui.data(key, saveColsConfig);
})
}, 50);
})
}
//layuitable reload或第一次加载的时候,根据存储的local_config 确定哪些列是否选中
function tableSetCol(col, key){
//参考写法:https://fly.layui.com/jie/50966/#item-1555416248250
var config_custom= layui.data(key);
var local_config = config_custom['local_config'] || {};
if(JSON.stringify(local_config) != '{}'){
for(var i =0; i<=col.length-1; i++){
if( typeof col[i].field !== "undefined" ){
col[i].hide = local_config[col[i].field];
}
}
}
return col;
}
</script> </script>
{/block} {/block}

@ -1,9 +1,14 @@
{include file="public/header" /} {include file="public/header" /}
<!-- Core stylesheets --> <!-- Core stylesheets -->
<style>
html,body {
height: 100%;
}
</style>
{block name="header"}{/block} {block name="header"}{/block}
</head> </head>
<body class="layui-layout-body"> <body class="layui-layout-body">
<div class="layui-layout layui-layout-admin"> <div class="layui-layout layui-layout-admin" style="height: calc(100% - 50px);">
<div class="layui-header"> <div class="layui-header">
<div class="layui-logo">车辆数据处理</div> <div class="layui-logo">车辆数据处理</div>
<ul class="layui-nav layui-layout-left"> <ul class="layui-nav layui-layout-left">

@ -493,7 +493,7 @@ class CarInfoHandle
if ($is_update_failed > 0) { if ($is_update_failed > 0) {
CarInfoT::where('is_export_failed', $is_update_failed) CarInfoT::where('is_export_failed', $is_update_failed)
->update(['is_export_failed' => 0, 'is_update_bhx' => Db::raw('is_update_bhx - 1')]); ->update(['is_export_failed' => 0, 'is_update_bhx' => Db::raw('is_update_bhx - 1')]);
} else if ($car_info && $car_info->is_update_bhx <= 0) { } else {
CarInfoT::where('is_update_bhx', 0) CarInfoT::where('is_update_bhx', 0)
->where('is_export_bhx', $car_info->is_export_bhx) ->where('is_export_bhx', $car_info->is_export_bhx)
->update(['is_update_bhx' => -1]); ->update(['is_update_bhx' => -1]);

Loading…
Cancel
Save