483 lines
19 KiB
PHP
483 lines
19 KiB
PHP
<div class="coms-table-wrap mt10">
|
|
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
|
action="/items/goods/logs">
|
|
<div class="am-form am-form-horizontal">
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">车架号:</label>
|
|
<div class="am-para-inline w250">
|
|
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin"/>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">是否出售:</label>
|
|
<div class="am-para-inline w120">
|
|
<select title="出售" name="sold" v-model="params.sold">
|
|
<option value="">请选择</option>
|
|
<option :value="i" v-for="(v,i) in soldAry">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w80">状态:</label>
|
|
<div class="am-para-inline w120">
|
|
<select title="状态" name="status" v-model="params.status">
|
|
<option value="">选择状态</option>
|
|
<option :value="i" v-for="(v,i) in statusAry">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">车型:</label>
|
|
<div class="am-para-inline w120">
|
|
<select id="bd-auto1-id" name="brand_id" data-toggle="next-select"
|
|
data-refurl="/common/auto?pid={value}&type=2"
|
|
data-next="#bd-auto2-id">
|
|
<option value="0">选择品牌</option>
|
|
<? if ($autoList[1]) {
|
|
foreach ($autoList[1] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['brand_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<? }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select id="bd-auto2-id" name="s_id" data-toggle="next-select"
|
|
data-refurl="/common/auto?pid={value}&type=3"
|
|
data-next="#bd-auto3-id" @change="set_sery">
|
|
<option value="0">选择车系</option>
|
|
<?php if ($autoList[2]) {
|
|
foreach ($autoList[2] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['s_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select id="bd-auto3-id" name="v_id">
|
|
<option value="0">选择车型</option>
|
|
<?php if ($autoList[3]) {
|
|
foreach ($autoList[3] as $v) { ?>
|
|
<option value="<?= $v['id'] ?>" <?= $v['id'] == $params['v_id'] ? 'selected' : '' ?>
|
|
><?= $v['name'] ?></option>
|
|
<?php }
|
|
} ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select name="cor_id" v-model="params.cor_id">
|
|
<option value="">车身颜色</option>
|
|
<option :value="v.id" v-for="(v,i) in attrs_cor">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">门店:</label>
|
|
<div class="am-para-inline w120">
|
|
<select title="城市" name="city_id" v-model="params.city_id">
|
|
<option value="">选择城市</option>
|
|
<option :value="v.id" v-for="(v,i) in cityAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select title="行政区" name="county_id" v-model="params.county_id" @change="set_county">
|
|
<option value="">选择行政区</option>
|
|
<option :value="v.id" v-for="(v,i) in countyAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w120">
|
|
<select title="门店" name="biz_id" v-model="params.biz_id" @change="set_biz">
|
|
<option value="">选择门店</option>
|
|
<option :value="v.id" v-for="(v,i) in bizAry">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl" v-if="params.biz_id==-1">
|
|
<div class="am-para-inline w160">
|
|
<select title="地址" name="addr_id" v-model="params.addr_id">
|
|
<option value="">选择地址</option>
|
|
<option :value="v.id" v-for="(v,i) in addrAry">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
|
<div class="am-form-group fl ml100">
|
|
<div class="am-form-group fl ml10">
|
|
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<button type="button" id="export" class="am-btn am-btn-success am-btn-sm w100">导出</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="coms-table-bd">
|
|
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
|
|
<table class="am-table am-table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th width="3%"><span>ID</span></th>
|
|
<th width="16%"><span>门店</span></th>
|
|
<th width="20%"><span>车辆</span></th>
|
|
<th width="14%"><span>车架号</span></th>
|
|
<th width="8%"><span>入库日期</span></th>
|
|
<th width="12%"><span>最后调拨时间</span></th>
|
|
<th width="7%"><span>库存时间</span></th>
|
|
<th width="7%"><span>是否出售</span></th>
|
|
<th width="7%"><span>状态</span></th>
|
|
<th width=""><span>操作</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<template v-for="(v,i) in lists">
|
|
<tr>
|
|
<td>{{v.id}}</td>
|
|
<td>{{v.address}}</td>
|
|
<td>{{v.title}}</td>
|
|
<td><a href="javascript:void(0);" :data-modal="'/items/goods/goods/get_info?id='+v.id"
|
|
data-title="详情">{{v.vin}}</a>
|
|
</td>
|
|
<td>{{v.in_time}}</td>
|
|
<td>{{v.last_db_time}}</td>
|
|
<td>{{v.inventory_time}}</td>
|
|
<td>{{v.bill_time}}</td>
|
|
<td>{{v.status_name}}</td>
|
|
<td><a href="javascript:void(0);"
|
|
:data-open="'/items/goods/logs/get?id='+v.id+'&title='+v.title+'&biz_name='+v.biz_name"
|
|
class="am-btn am-btn-primary am-btn-xs">轨迹</a></td>
|
|
</tr>
|
|
</template>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="coms-table-ft clearfix">
|
|
<div class="coms-pagination fr mr20">
|
|
<?php page_view($pager) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$(function () {
|
|
vue_obj = new Vue({
|
|
el: '.coms-table-wrap',
|
|
data: {
|
|
params: [],
|
|
statusAry: [],//状态
|
|
soldAry: [],//出售
|
|
cityAry: [],//城市
|
|
countyAry: [],//行政区
|
|
bizAry: [],//门店
|
|
addrAry: [],//地址
|
|
lists: [],
|
|
attrs_cor: [],//车身颜色选项
|
|
},
|
|
mounted: function () {
|
|
var vm = this;
|
|
vm.lists = <?=json_encode($lists)?>;
|
|
vm.params = <?=json_encode($params)?>;
|
|
vm.statusAry = <?=json_encode($statusAry)?>;
|
|
vm.soldAry = <?=json_encode($soldAry)?>;
|
|
vm.init_citys();
|
|
vm.set_sery();
|
|
},
|
|
methods: {
|
|
init_citys: function () {
|
|
var vm = this;
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/common/area',
|
|
dataType: 'json',
|
|
data: {
|
|
id: '350',
|
|
key: 'city',
|
|
type: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.cityAry = response.data;
|
|
}
|
|
}
|
|
});
|
|
},
|
|
set_county: function () {
|
|
var that = this;
|
|
that.bizAry = that.addrAry = [];
|
|
that.params.biz_id = that.params.addr_id = '';
|
|
},
|
|
set_biz: function () {
|
|
var that = this;
|
|
that.addrAry = [];
|
|
that.params.addr_id = '';
|
|
},
|
|
set_sery: function () {
|
|
var vm = this;
|
|
var s_id = $('#bd-auto2-id').val();
|
|
if (s_id > 0) {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/attr/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
s_id: s_id,
|
|
status: 1,
|
|
type: 0
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.attrs_cor = response.data.list;
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
vm.attrs_cor = [];
|
|
vm.params.cor_id = '';
|
|
}
|
|
},
|
|
reset: function () {
|
|
var that = this;
|
|
that.params.cor_id = '';
|
|
that.params.city_id = '';
|
|
that.params.status = '';
|
|
that.params.vin = '';
|
|
that.fines = [];
|
|
$('#bd-auto1-id').val(0);
|
|
$('#bd-auto2-id').val(0);
|
|
$('#bd-auto3-id').val(0);
|
|
}
|
|
},
|
|
watch: {
|
|
'params.city_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.countyAry = [];
|
|
that.params.county_id = '';
|
|
} else {
|
|
if (nv.substring(0, 4) != that.params.county_id.substring(0, 4)) {
|
|
that.params.county_id = '';
|
|
}
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/common/area',
|
|
dataType: 'json',
|
|
data: {
|
|
id: nv,
|
|
key: 'county',
|
|
type: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.countyAry = response.data;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.county_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.bizAry = that.addrAry = [];
|
|
that.params.biz_id = that.params.addr_id = '';
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/biz/store/store/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
city_id: that.params.city_id,
|
|
county_id: that.params.county_id,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.bizAry = response.data.list;
|
|
that.bizAry.push({id: -1, title: '其它'});
|
|
var biz_id = '';
|
|
if (that.params.biz_id > 0 || that.params.biz_id == -1) {
|
|
for (var i in that.bizAry) {
|
|
if (that.params.biz_id == that.bizAry[i].id) {
|
|
biz_id = that.params.biz_id;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
that.params.biz_id = biz_id;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.biz_id': function (nv, ov) {
|
|
var that = this;
|
|
if (that.params.biz_id != -1) {
|
|
return;
|
|
}
|
|
nv = that.params.county_id;
|
|
if (nv == '') {
|
|
that.addrAry = [];
|
|
that.params.addr_id = '';
|
|
} else {
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/sys/addr/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
county_id: nv,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.addrAry = response.data.lists;
|
|
if (that.params.addr_id > 0) {
|
|
var addr_id = '';
|
|
for (var i in that.addrAry) {
|
|
if (that.params.addr_id == that.addrAry[i].id) {
|
|
addr_id = that.params.addr_id;
|
|
break;
|
|
}
|
|
}
|
|
that.params.addr_id = addr_id;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
<?php page_script($pager) ?>
|
|
|
|
$('#export').click(function () {
|
|
var count = <?=$pager['totle']?>;
|
|
if (count > 10000) {
|
|
layer.msg('单次导出数据不能超过10000');
|
|
return false;
|
|
}
|
|
var href = $.menu.parseUri(window.location.href);
|
|
var arr = href.split('?');
|
|
href = '/items/goods/logs/export?' + arr[1];
|
|
window.location.href = href;
|
|
});
|
|
|
|
$('#bd-auto1-id').change(function () {
|
|
$('#bd-auto2-id').empty();
|
|
$('#bd-auto3-id').empty();
|
|
$("#bd-auto3-id").prepend("<option value='0'>选择车型</option>");
|
|
});
|
|
$('#bd-auto2-id').change(function () {
|
|
$('#bd-auto3-id').empty();
|
|
});
|
|
});
|
|
</script>
|
|
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css">
|
|
<link rel="stylesheet" type="text/css" href="/static/css/appitem/AdminLTE.min.css">
|
|
<style>
|
|
.label-group-wrap {
|
|
margin-top: 10px;
|
|
font-size: 0;
|
|
}
|
|
|
|
.label-group {
|
|
display: inline-block;
|
|
margin-right: 4px;
|
|
margin-bottom: 16px;
|
|
font-size: 0;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.label-group-wrap .label, .label-group > .label {
|
|
font-size: 10px;
|
|
font-weight: normal;
|
|
margin-right: 1px;
|
|
white-space: normal;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.label {
|
|
font-weight: normal;
|
|
}
|
|
|
|
.label-group > span + a.label {
|
|
border-top-left-radius: 0;
|
|
border-bottom-left-radius: 0;
|
|
border-left: 1px solid #fff;
|
|
margin-left: -3px;
|
|
}
|
|
|
|
.label-group-wrap .label, .label-group > .label {
|
|
font-size: 10px;
|
|
font-weight: normal;
|
|
margin-right: 1px;
|
|
white-space: normal;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.order-on {
|
|
border-bottom: 2px solid #e61773;
|
|
height: 40px;
|
|
}
|
|
|
|
.order-none {
|
|
height: 38px;
|
|
}
|
|
|
|
.order {
|
|
width: 150px;
|
|
display: table-cell;
|
|
position: relative;
|
|
}
|
|
|
|
.order a {
|
|
display: block;
|
|
overflow: hidden;
|
|
width: 100%;
|
|
height: 30px;
|
|
line-height: 30px;
|
|
text-align: center;
|
|
color: #5e5e5e;
|
|
}
|
|
|
|
.angle_top {
|
|
content: '';
|
|
width: 0;
|
|
height: 0;
|
|
display: block;
|
|
border-style: solid;
|
|
border-width: 0 6px 6px;
|
|
border-color: transparent transparent #5e5e5e;
|
|
position: absolute;
|
|
transform: rotate(180deg);
|
|
bottom: 14px;
|
|
right: 17px;
|
|
}
|
|
|
|
.angle_bottom {
|
|
content: '';
|
|
width: 0;
|
|
height: 0;
|
|
display: block;
|
|
border-style: solid;
|
|
border-width: 0 6px 6px;
|
|
border-color: transparent transparent #5e5e5e;
|
|
position: absolute;
|
|
top: 10px;
|
|
right: 17px;
|
|
}
|
|
</style>
|