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

302 lines
14 KiB

<?php
use \common\libs\MyLib;
?>
<style>
.act_btn1{
width: 120px;
background-repeat: round;
}
</style>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<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 del(id) {
if(confirm('是否确认删除?')) {
$.post('/car/delete',{id:id},function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
}
$(function(){
$("#search-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.location.href = "/database/a-index?" + params;
});
$('#add-btn').click(function(){
edit(0);
});
$('#move-b-btn').click(function(){
var unsel_lib = $('#unsel_lib').attr('checked');
if(unsel_lib != 'checked') {
alert('请先选择未分配选项');
return;
}
if(confirm('是否确认批量分配操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/a-move-b',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#move-e-btn').click(function(){
var unsel_lib = $('#unsel_lib').attr('checked');
if(unsel_lib != 'checked') {
alert('请先选择未分配选项');
return;
}
if(confirm('是否确认批量分配操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/a-move-e',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#move-right-btn').click(function(){
var unsel_lib = $('#unsel_lib').attr('checked');
if(unsel_lib != 'checked') {
alert('请先选择未分配选项');
return;
}
if(confirm('是否确认批量分配操作?')) {
var params = $('#searchForm').serialize();
$.post('/database/a-move-clean',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#move-btn').click(function(){
if(confirm('是否确认 A->B 操作?')) {
var params = $('#listFrm').serialize();
$.post('/database/a-b',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#clean-btn').click(function(){
if(confirm('是否确认 A->清洗库 操作?')) {
var params = $('#listFrm').serialize();
$.post('/database/a-clean',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#move-a2c-btn').click(function(){
if(confirm('是否确认 A->C 操作?')) {
var params = $('#listFrm').serialize();
$.post('/database/a-c',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('#move-a2e-btn').click(function(){
if(confirm('是否确认 A->E 操作?')) {
var params = $('#listFrm').serialize();
$.post('/database/a-e',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
$('.invalid-btn').click(function(){
if(confirm('是否确认无效?')) {
var params = $('#listFrm').serialize();
var invalid_id = $('#invalid_id').val();
params = params + '&invalid_id=' + invalid_id;
$.post('/database/invalid',params,function(obj){
alert(obj.msg);
if(obj.success) {
window.location.reload();
}
},'json');
}
});
/*
$("#output-btn").click(function(){
$('#page').val(0);
var params = $('#searchForm').serialize();
window.open("/database/a-index-output?" + params);
});
*/
$('#all').click(function(){
if($(this).prop('checked')==true) {
$('.item').each(function() {
$(this).prop('checked', true);
});
} else {
$('.item').each(function () {
$(this).prop('checked',false);
});
}
});
});
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<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="engine_no" type="text" value="<?=$engine_no?>" style="width:100px;">
车架号:<input name="car_frame_no" type="text" value="<?=$car_frame_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;">
</td>
</tr>
<tr>
<td class="td_bg">
初登日期:从<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 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 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="company" type="text" value="<?=$company?>" style="width:100px;">
<!-- <input type="checkbox" name="clean_right" value="1" --=$lean_right?'checked':'清洗岗准确-->
<!-- <input type="checkbox" name="biaozhu" value="2019417" --//=$biaozhu?'checked':''--特殊数据-->
</td>
</tr>
<tr>
<td class="td_bg">
范围:
<label>
<input type="checkbox" name="b_lib" value="1" <?=$b_lib?'checked':''?>>B库
</label>
<label>
<input type="checkbox" name="c_lib" value="1" <?=$c_lib?'checked':''?>>C库
</label>
<label>
<input type="checkbox" name="d_lib" value="1" <?=$d_lib?'checked':''?>>D库
</label>
<!-- <label>-->
<!-- <input type="checkbox" name="e_lib" value="1" --/=$e_lib?'checked':''-E库-->
<!-- </label>-->
<label>
<input type="checkbox" name="invalid_lib" value="1" <?=$invalid_lib?'checked':''?>>无效库
</label>
<label>
<input type="checkbox" name="unsel_lib" id="unsel_lib" value="1" <?=$unsel_lib?'checked':''?>>未分配
</label>
<label>
<input type="checkbox" name="has_phone" value="1" <?=$has_phone==1?'checked':''?>>有电话号码
</label>
<label>
<input type="checkbox" name="no_insurerdate" value="1" <?=$no_insurerdate==1?'checked':''?>>无保险日期
</label>
<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="add-btn" name="add-btn" value="添加">
<input type="button" class="act_btn" id="move-btn" name="move-btn" value="勾选A库到B库">
<input type="button" class="act_btn" id="move-a2c-btn" name="move-a2c-btn" value="勾选A库到C库">
<!-- <input type="button" class="act_btn" id="move-a2e-btn" name="move-a2e-btn" value="勾选A库到E库">-->
<input type="button" class="act_btn" id="move-b-btn" name="move-b-btn" value="批量移到B库">
<!-- <input type="button" class="act_btn" id="move-e-btn" name="move-e-btn" value="批量移到E库">-->
<!-- <input type="button" class="act_btn" id="move-right-btn" name="move-right-btn" value="批量移到清洗库">-->
<!-- <input type="button" class="act_btn act_btn1" id="clean-btn" name="clean-btn" value="勾选A库到清洗库">-->
<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="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) {
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg"nowrap ><input class="item" type="checkbox" name="ids[]" value="<?=$item->id?>"></td>
<td align="left" class="td_bg"nowrap><?=$item->car_no?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($item->factory_model,10)?></td>
<td align="left" class="td_bg"nowrap ><?=MyLib::substr_cut($item->car_man,10)?></td>
<td align="left" class="td_bg"nowrap ><?=$item->phone?></td>
<td align="left" class="td_bg"nowrap ><?=$item->register_date?></td>
<td align="left" class="td_bg"nowrap ><?=$item->insurer1_date?></td>
<td align="left" class="td_bg"nowrap ><?=$item->company?></td>
<td align="left" class="td_bg"nowrap ><?=$item->engine_no?></td>
<td align="left" class="td_bg"nowrap ><?=$item->car_frame_no?></td>
<td align="center" class="td_bg"nowrap ><?=$item->getLocation()?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?=$item->id?>)">修改</a>]
<?php
if($item->location == 1) {
?>
[<a href="javascript:void(0);" onclick="del(<?=$item->id?>)">删除</a>]
<?php
}
?>
</td>
</tr>
<?php
}
?>
<tr >
<td height="25" colspan="12" align="center" class="td_bg"><?=$page_info?></td>
</tr>
</table>
</form>
<script>
function test() {
alert(1);
}
</script>