981 lines
43 KiB
PHP
981 lines
43 KiB
PHP
<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>
|
|
<div class="coms-table-wrap mt10">
|
|
<form class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
|
action="/items/goods/goods">
|
|
<input title="排序字段" type="hidden" name="order" id="order" v-model="params.order"/>
|
|
<input title="排序方向" type="hidden" name="sort" id="sort" v-model="params.sort"/>
|
|
<input title="是否已售" type="hidden" name="sold" v-model="params.sold">
|
|
<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 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">
|
|
<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 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 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>
|
|
<div class="am-form-group">
|
|
<label class="am-para-label w100">车架号:</label>
|
|
<div class="am-para-inline w200">
|
|
<input type="text" name="vin" placeholder="车架号关键字" v-model="params.vin"/>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group">
|
|
<label class="am-para-label w100">销售员:</label>
|
|
<div class="am-para-inline w120">
|
|
<select title="城市" name="city_id_admin" v-model="params.city_id_admin">
|
|
<option value="">选择城市</option>
|
|
<option :value="v.id" v-for="(v,i) in admins.cityAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w120">
|
|
<select title="行政区" name="county_id_admin" v-model="params.county_id_admin">
|
|
<option value="">选择行政区</option>
|
|
<option :value="v.id" v-for="(v,i) in admins.countyAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w120">
|
|
<select name="biz_id_admin" v-model="params.biz_id_admin">
|
|
<option value="">门店</option>
|
|
<template v-for="(v,i) in admins.bizAry">
|
|
<option :value="v.id">{{v.title}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w120">
|
|
<select name="admin_id" v-model="params.admin_id">
|
|
<option value="">销售员</option>
|
|
<template v-for="(v,i) in admins.list">
|
|
<option :value="v.id">{{v.title}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">状态:</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">
|
|
<label class="am-para-label w100">是否精品:</label>
|
|
<div class="am-para-inline w120">
|
|
<select name="is_fine" v-model="params.is_fine">
|
|
<option value="">全部</option>
|
|
<option value="0">否</option>
|
|
<option value="1">是</option>
|
|
</select>
|
|
</div>
|
|
</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 ml20">
|
|
<button type="button" data-open="/items/goods/goods/get"
|
|
class="am-btn am-btn-success am-btn-sm w100">新增
|
|
</button>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
|
|
<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="5%">
|
|
<span :class="'order'+('id'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('id')">
|
|
<span class="mr10">ID</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'id'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'id'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="25%">
|
|
<span :class="'order'+('brand_id'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('brand_id')">
|
|
<span class="mr10">车辆</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'brand_id'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'brand_id'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="15%">
|
|
<span :class="'order'+('vin'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('vin')">
|
|
<span>车架号</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'vin'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'vin'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="10%">
|
|
<span :class="'order'+('uname'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('uname')">
|
|
<span>客户姓名</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'uname'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'uname'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="10%">
|
|
<span :class="'order'+('mobile'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('mobile')">
|
|
<span>客户电话</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'mobile'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'mobile'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="15%">
|
|
<span :class="'order'+('admin_id'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('admin_id')">
|
|
<span>销售员</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'admin_id'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'admin_id'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width="10%">
|
|
<span :class="'order'+('sold_time'==params.order?' order-on':' order-none')">
|
|
<a href="javascript:void(0)" @click="set_order('sold_time')">
|
|
<span>销售日期</span>
|
|
<i class="angle_top" v-if="'desc'==params.sort||'sold_time'!=params.order"></i>
|
|
<i class="angle_bottom" v-if="'asc'==params.sort||'sold_time'!=params.order"></i>
|
|
</a>
|
|
</span>
|
|
</th>
|
|
<th width=""><span>操作</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<template v-for="(v,i) in lists">
|
|
<tr>
|
|
<td>{{v.id}}</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.uname}}</td>
|
|
<td>{{v.mobile}}</td>
|
|
<td>{{v.admin_name}}</td>
|
|
<td>{{v.sold_time}}</td>
|
|
<td><a href="javascript:void(0);"
|
|
:data-open="'/items/goods/logs/get?id='+v.id+'&title='+v.title"
|
|
class="am-btn am-btn-primary am-btn-xs">轨迹</a>
|
|
<a href="javascript:void(0);"
|
|
:data-open="'/items/goods/goods/get?id='+v.id"
|
|
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 id="goods-modal" style="display: none;padding: 10px">
|
|
<div class="modal-body">
|
|
<div class="text-center">
|
|
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
|
|
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
|
|
<div class="form-group-action">
|
|
<a href="/temp/goods.xlsx?0819" target="_blank" class="btn btn-default">查看模板</a>
|
|
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
|
|
<form id="import-form">
|
|
<input type="file" id="goods-file" name="file" accept=".xls,.xlsx"
|
|
style="left:-9999px;position:absolute;" onchange="load_goods()">
|
|
</form>
|
|
<span>上传Excel文件</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="fine-modal" style="display: none;">
|
|
<div class="modal-body">
|
|
<table width="100%">
|
|
<tr>
|
|
<td width="20%">ID</td>
|
|
<td width="35%" style="font-weight: bold;padding-left: 8px;">精品</td>
|
|
<td width="40%" style="padding-right: 8px;"><label class="sr-only" for="search">搜精品</label>
|
|
<div class="input-group input-group-sm">
|
|
<input type="text" class="form-control" style="font-size: 1.2rem;font-weight: bold;"
|
|
v-model='modal_fine.title' placeholder="精品关键字">
|
|
<div class="input-group-btn">
|
|
<button type="button" @click='get_fines(0);' class="btn btn-default">搜</button>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div style="border-bottom: 1px solid #ddd;height: 1px;margin-top: 8px;"></div>
|
|
<table class="table table-middle">
|
|
<colgroup>
|
|
<col width="15%"/>
|
|
<col width="45%"/>
|
|
<col width="20%"/>
|
|
</colgroup>
|
|
<tbody>
|
|
<tr v-for="(v,i) in modal_fine.lists">
|
|
<td>{{v.id}}</td>
|
|
<td>{{v.title}}</td>
|
|
<td class="text-right">
|
|
<a v-if="v.checked==0 || !v.checked" href="javascript:void(0);" @click="set_fine(i,1)"
|
|
class="btn btn-primary btn-sm">选择</a>
|
|
<a v-else-if="v.checked==1" href="javascript:void(0);" @click="set_fine(i,0)"
|
|
class="btn btn-default btn-sm">移除</a>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="clearfix">
|
|
<span class="pull-left text-muted">第{{modal_fine.page}}页(每页{{modal_fine.size}}条,共{{modal_fine.total}}条)</span>
|
|
<nav class="pull-right" aria-label="Page navigation">
|
|
<ul class="pagination pagination-sm">
|
|
<li v-if="modal_fine.page>1">
|
|
<a href="javascript:void(0);" @click="get_fines(-1);" aria-label="上一页">
|
|
<span class="glyphicon glyphicon-menu-left"></span>
|
|
</a>
|
|
</li>
|
|
<li v-if="modal_fine.next>0">
|
|
<a href="javascript:void(0);" @click="get_fines(1);" aria-label="下一页">
|
|
<span class="glyphicon glyphicon-menu-right"></span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function load_goods() {
|
|
var file = $("#goods-file");
|
|
if (file.val() == '') {
|
|
layer.msg('文件是空的');
|
|
return 0;
|
|
}
|
|
var loading = layer.load(1, {
|
|
shade: [0.1, '#fff'] //0.1透明度的白色背景
|
|
});
|
|
|
|
var options = {
|
|
url: "/items/goods/goods/add_excel",
|
|
type: "post",
|
|
dataType: "json",
|
|
data: {},
|
|
success: function (res) {
|
|
if (res['code']) {
|
|
layer.msg(res.msg, {
|
|
icon: 1,
|
|
time: 2000
|
|
}, function () {
|
|
location.reload();
|
|
});
|
|
} else {
|
|
layer.msg(res.msg, {icon: 2});
|
|
}
|
|
},
|
|
complete: function () {
|
|
file.val('');
|
|
layer.closeAll('loading');
|
|
}
|
|
};
|
|
$("#import-form").ajaxSubmit(options);
|
|
}
|
|
|
|
$(function () {
|
|
vue_obj = new Vue({
|
|
el: '.coms-table-wrap',
|
|
data: {
|
|
params: [],
|
|
statusAry: [],//状态
|
|
cityAry: [],//城市
|
|
countyAry: [],//行政区
|
|
bizAry: [],//门店
|
|
addrAry: [],//地址
|
|
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
|
fines: [],//搜索条件精品列表
|
|
fine_ids: [],//列表所有选中的精品列表
|
|
lists: [],
|
|
attrs_cor: [],//车身颜色选项
|
|
modal_fine: {title: '', lists: [], selected: [], page: 1, size: 10, total: 0}
|
|
},
|
|
mounted: function () {
|
|
var vm = this;
|
|
vm.lists = <?=json_encode($lists)?>;
|
|
vm.params = <?=json_encode($params)?>;
|
|
vm.statusAry = <?=json_encode($statusAry)?>;
|
|
vm.fine_ids = <?=json_encode($fine_ids)?>;
|
|
vm.init_citys();
|
|
vm.init_fines();
|
|
vm.init_fines_lists();
|
|
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;
|
|
vm.admins.cityAry = JSON.parse(JSON.stringify(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 = '';
|
|
},
|
|
init_fines: function () {
|
|
var vm = this;
|
|
if (vm.params.fine_ids.length > 0) {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/fine/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
id: vm.params.fine_ids,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.fines = response.data.list;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
init_fines_lists: function () {//初始化列表中精品
|
|
var vm = this;
|
|
if (vm.fine_ids.length > 0) {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/fine/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
id: vm.fine_ids.join(','),
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
var fines = response.data.list;
|
|
var map_fine = {};
|
|
for (var i in fines) {
|
|
var fine = fines[i];
|
|
map_fine[fine.id] = fine;
|
|
}
|
|
for (i in vm.lists) {
|
|
var goods = vm.lists[i];
|
|
var auto_fine = '';
|
|
for (var j in goods.fine_ids) {
|
|
var fine_id = goods.fine_ids[j];
|
|
fine = map_fine[fine_id];
|
|
if (undefined != fine) {
|
|
auto_fine += fine.title + " ";
|
|
}
|
|
}
|
|
goods.auto_fine = auto_fine;
|
|
}
|
|
vm.$forceUpdate();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
fine_modal: function () {
|
|
//选择门店
|
|
var vm = this;
|
|
var selects = JSON.parse(JSON.stringify(vm.fines));
|
|
vm.modal_fine = {title: '', lists: [], selected: selects, page: 1, size: 10, total: 0, next: 0};
|
|
vm.get_fines();
|
|
layer.open({
|
|
type: 1,
|
|
area: ['50%', '80%'], //宽高
|
|
content: $('#fine-modal'),
|
|
title: '选取精品',
|
|
shade: false,
|
|
btn: ['选好了'],
|
|
yes: function (index) {
|
|
layer.close(index);
|
|
vm.fines = JSON.parse(JSON.stringify(vm.modal_fine.selected));
|
|
var fine_ids = '';
|
|
for (var i in vm.fines) {
|
|
var fine = vm.fines[i];
|
|
if ('' == fine_ids) {
|
|
fine_ids = fine.id;
|
|
} else {
|
|
fine_ids += ',' + fine.id
|
|
}
|
|
}
|
|
vm.params.fine_ids = fine_ids;
|
|
}
|
|
});
|
|
},
|
|
get_fines: function (page) {
|
|
var vm = this;
|
|
if (0 == page) {
|
|
vm.modal_fine.page = 1;
|
|
vm.modal_fine.total = 0;
|
|
vm.modal_fine.next = 0;
|
|
} else if (1 == page) {
|
|
vm.modal_fine.page += 1;
|
|
} else if (-1 == page) {
|
|
vm.modal_fine.page -= 1;
|
|
}
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/fine/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
page: vm.modal_fine.page,
|
|
size: vm.modal_fine.size,
|
|
status: 1,
|
|
title: vm.modal_fine.title
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.modal_fine.lists = response.data.list;
|
|
vm.modal_fine.total = response.data.total;
|
|
if (vm.modal_fine.page * vm.modal_fine.size < vm.modal_fine.total) {
|
|
vm.modal_fine.next = 1;
|
|
} else {
|
|
vm.modal_fine.next = 0;
|
|
}
|
|
for (var i in vm.modal_fine.lists) {
|
|
var fine = vm.modal_fine.lists[i];
|
|
fine.checked = 0;
|
|
for (var j in vm.modal_fine.selected) {
|
|
var selected = vm.modal_fine.selected[j];
|
|
if (fine.id == selected.id) {
|
|
fine.checked = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
},
|
|
set_fine: function (index, checked) {
|
|
var vm = this;
|
|
var fine = vm.modal_fine.lists[index];
|
|
fine.checked = checked;
|
|
if (checked == 1) {
|
|
var selected = {id: fine.id, title: fine.title};
|
|
vm.modal_fine.selected.push(selected);
|
|
} else {
|
|
for (var i in vm.modal_fine.selected) {
|
|
selected = vm.modal_fine.selected[i];
|
|
if (fine.id == selected.id) {
|
|
vm.modal_fine.selected.splice(i, 1);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
vm.$forceUpdate();
|
|
},
|
|
rm_fine: function (index) {
|
|
var vm = this;
|
|
vm.fines.splice(index, 1);
|
|
var fine_ids = '';
|
|
for (var i in vm.fines) {
|
|
var fine = vm.fines[i];
|
|
if ('' == fine_ids) {
|
|
fine_ids = fine.id;
|
|
} else {
|
|
fine_ids += ',' + fine.id
|
|
}
|
|
}
|
|
vm.params.fine_ids = fine_ids;
|
|
},
|
|
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 = '';
|
|
}
|
|
},
|
|
set_order: function (order) {
|
|
var vm = this;
|
|
var sort = vm.params.sort;
|
|
if (vm.params.order == order) {
|
|
if (vm.params.sort == 'desc') {
|
|
sort = 'asc';
|
|
} else {
|
|
sort = 'desc';
|
|
}
|
|
} else {
|
|
vm.params.order = order;
|
|
sort = 'desc';
|
|
}
|
|
|
|
vm.params.order = order;
|
|
vm.params.sort = sort;
|
|
$('#sort').val(sort);
|
|
$('#order').val(order);
|
|
$('.form-search').submit();
|
|
},
|
|
reset: function () {
|
|
var that = this;
|
|
that.params.cor_id = '';
|
|
that.params.city_id = '';
|
|
that.params.status = '';
|
|
that.params.vin = '';
|
|
that.params.fine_ids = '';
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.city_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.countyAry = [];
|
|
that.params.county_id_admin = '';
|
|
} else {
|
|
if (nv.substring(0, 4) != that.params.county_id_admin.substring(0, 4)) {
|
|
that.params.county_id_admin = '';
|
|
}
|
|
$.ajax({
|
|
type: 'get',
|
|
url: '/common/area',
|
|
dataType: 'json',
|
|
data: {
|
|
id: nv,
|
|
key: 'county',
|
|
type: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.countyAry = response.data;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.county_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.bizAry = [];
|
|
that.params.biz_id_admin = '';
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/biz/store/store/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
city_id: that.params.city_id_admin,
|
|
county_id: that.params.county_id_admin,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.bizAry = response.data.list;
|
|
if (that.params.biz_id_admin > 0) {
|
|
var biz_id = '';
|
|
for (var i in that.admins.bizAry) {
|
|
if (that.params.biz_id_admin == that.admins.bizAry[i].id) {
|
|
biz_id = that.params.biz_id_admin;
|
|
break;
|
|
}
|
|
}
|
|
that.params.biz_id_admin = biz_id;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.biz_id_admin': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.admins.list = [];
|
|
that.params.admin_id = '';
|
|
} else {
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/app/licheb/member/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
biz_id: nv,
|
|
status: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
that.admins.list = response.data.list;
|
|
if (that.params.admin_id > 0) {
|
|
var admin_id = '';
|
|
for (var i in that.admins.list) {
|
|
if (that.params.admin_id == that.admins.list[i].id) {
|
|
admin_id = that.params.admin_id;
|
|
break;
|
|
}
|
|
}
|
|
that.params.admin_id = admin_id;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
<?php page_script($pager) ?>
|
|
|
|
$("#import").click(function () {
|
|
$("#goods-file").val('');
|
|
layer.open({
|
|
type: 1,
|
|
area: ['40%'], //宽高
|
|
content: $('#goods-modal'),
|
|
title: '导入线索',
|
|
shade: false,
|
|
btn: ['完成'],
|
|
yes: function (index) {
|
|
layer.close(index);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
$('#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/goods/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>
|