607 lines
28 KiB
PHP
607 lines
28 KiB
PHP
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
|
|
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
|
|
<div id="recom-stat"></div>
|
|
<ul class="nav nav-tabs" role="tablist">
|
|
<li role="presentation" class="<?= !strlen($params['status_pid']) ? 'active' : '' ?>">
|
|
<a href="javascript:void (0);" data-open="/receiver/orders">
|
|
全部
|
|
<?= $params['count_all'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $params['count_all'] . '</span>' : '' ?>
|
|
</a>
|
|
</li>
|
|
<? foreach ($status_arr as $v) { ?>
|
|
<li role="presentation"
|
|
class="<? if (strlen($params['status_pid']) && $params['status_pid'] == $v['id']) { ?>active<? } ?>">
|
|
<? if ($v['cate']) { ?>
|
|
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
|
|
<?= $v['name'] ?>
|
|
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
|
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<? if ($v['cate']) { ?>
|
|
<li class="<?= strlen($params['status_pid']) && !strlen($params['status']) && $params['status_pid'] == $v['id'] ? 'active' : '' ?>">
|
|
<a href="javascript:void (0);"
|
|
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
|
全部
|
|
</a>
|
|
</li>
|
|
<? } ?>
|
|
<? foreach ($v['cate'] as $v2) { ?>
|
|
<li class="<?= strlen($params['status']) && $params['status_pid'] == $v['id'] && $params['status'] == $v2['id'] ? 'active' : '' ?>">
|
|
<a href="javascript:void (0);"
|
|
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>&status=<?= $v2['id'] ?>">
|
|
<?= $v2['name'] ?>
|
|
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
|
|
</a>
|
|
</li>
|
|
<? } ?>
|
|
</ul>
|
|
<? } else { ?>
|
|
<a href="javascript:void (0);"
|
|
data-open="/receiver/orders?status_pid=<?= $v['id'] ?>">
|
|
<?= $v['name'] ?>
|
|
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
|
|
</a>
|
|
<? } ?>
|
|
</li>
|
|
<? } ?>
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="coms-table-wrap mt10">
|
|
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
|
action="/receiver/orders">
|
|
<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 w100">
|
|
<select name="search_tp" id="search_tp">
|
|
<?php foreach ($searchTpAry as $key => $value) { ?>
|
|
<option value="<?= $key ?>"
|
|
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
|
<? } ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w260">
|
|
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="am-form-group fl">
|
|
<div class="am-form-group" style="margin-bottom: 0px;"></div>
|
|
<label class="am-para-label w100">订单时间:</label>
|
|
<div class="am-form-group fl">
|
|
<div class="am-para-inline w300">
|
|
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
|
|
placeholder="订单时间范围" autocomplete="off"/>
|
|
</div>
|
|
<div class="am-para-inline" style="padding-top: 5px;">
|
|
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today">今天</a>
|
|
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
|
|
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
|
|
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day">最近30天</a>
|
|
</div>
|
|
</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 w100">
|
|
<select name="cf_title" v-model="params.cf_title">
|
|
<option value="">请选择</option>
|
|
<option :value="v" v-for="(v,i) in show_info.cfTitleAry">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">线下来源:</label>
|
|
<div class="am-form-group am-para-inline w150">
|
|
<select name="cf_clues" v-model="params.cf_clues">
|
|
<option value="">请选择</option>
|
|
<option :value="v" v-for="(v,i) in show_info.cfCluesAry">{{v}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">线上来源:</label>
|
|
<div class="am-form-group am-para-inline w120">
|
|
<select name="cfrom_id" v-model="cfrom_id">
|
|
<option value=0>请选择</option>
|
|
<template v-for="(v,i) in cfroms">
|
|
<option :value="v.id">{{v.title}}</option>
|
|
</template>
|
|
</select>
|
|
</div>
|
|
<div class="am-form-group am-para-inline w150">
|
|
<select name="cfrom_id2" v-model="cfrom_id2">
|
|
<option value=0>请选择</option>
|
|
<template v-for="(v,i) in cfroms2">
|
|
<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 w100">
|
|
<select name="payway" v-model="params.payway">
|
|
<option value="">请选择</option>
|
|
<option :value="i" v-for="(v,i) in show_info.paywayAry">{{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 name="brand_id" v-model="params.brand_id">
|
|
<option value="">选择品牌</option>
|
|
<option :value="v.id" v-for="(v,i) in brandAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w120">
|
|
<select name="s_id" v-model="params.s_id">
|
|
<option value="">选择车系</option>
|
|
<option :value="v.id" v-for="(v,i) in seryAry">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
<div class="am-para-inline w120">
|
|
<select name="v_id" v-model="params.v_id">
|
|
<option value="">选择车型</option>
|
|
<option :value="v.id" v-for="(v,i) in attrvAry">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
<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 attrcorAry">{{v.title}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">渠道经理:</label>
|
|
<div class="am-para-inline w100">
|
|
<select name="qdjl_id" v-model="params.qdjl_id">
|
|
<option value=''>请选择</option>
|
|
<option :value="v.id" v-for="(v,i) in show_info.qdjl_lists">{{v.name}}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="am-form-group fl">
|
|
<label class="am-para-label w100">门店类型:</label>
|
|
<div class="am-para-inline w100">
|
|
<select name="biz_type" v-model="params.biz_type">
|
|
<option value="">请选择</option>
|
|
<option :value="i" v-for="(v,i) in show_info.bizTypeAry">{{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 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" style="margin-bottom: 0px;"></div>
|
|
<div class="am-form-group fl" style="margin-bottom: 0px;">
|
|
<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" @click="export_out(0)" class="am-btn am-btn-success am-btn-sm w100">导出
|
|
</button>
|
|
</div>
|
|
<div class="am-form-group fl ml10">
|
|
<button type="button" @click="export_out(1)" class="am-btn am-btn-success am-btn-sm">导出保险明细
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<div class="coms-table-bd">
|
|
<div class="am-form-group fr mr10">
|
|
<span>共<?= intval($pager['totle']) ?>个订单</span>
|
|
</div>
|
|
<table class="am-table am-table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th width="14%"><span>客户</span></th>
|
|
<th width="24%"><span>车辆</span></th>
|
|
<th width="11%"><span>门店</span></th>
|
|
<th width="8%"><span>车辆平台价</span></th>
|
|
<th width="6%"><span>付款方式</span></th>
|
|
<th width="8%"><span>来源类型</span></th>
|
|
<th width="10%"><span>来源</span></th>
|
|
<th width="8%"><span>状态</span></th>
|
|
<th width="12%"><span>订单时间</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php if ($lists) {
|
|
foreach ($lists as $v) { ?>
|
|
<tr>
|
|
<td><?= $v['name'] ?></td>
|
|
<td><?= $v['car_name'] ?></td>
|
|
<td><?= $v['biz_name'] ?></td>
|
|
<td><?= $v['price'] ?></td>
|
|
<td><?= $v['payway_name'] ?></td>
|
|
<td><?= $v['cf_title'] ?></td>
|
|
<td>
|
|
<?if($v['cf_name']){?><?= $v['cf_name'] ?>(线上)<br><?}?>
|
|
<?if($v['cf_clues']){?><?= $v['cf_clues'] ?>(线下)<?}?>
|
|
</td>
|
|
<td><?= $v['status_name'] ?></td>
|
|
<td><?= $v['c_time'] ?></td>
|
|
</tr>
|
|
<?php }
|
|
} ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="coms-table-ft clearfix">
|
|
<div class="hander am-form">
|
|
</div>
|
|
<div class="coms-pagination fr mr20">
|
|
<?php page_view($pager) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
require(['laydate', 'autocomplete'], function (laydate) {
|
|
laydate.render({
|
|
elem: '#id-create-time', range: '~'
|
|
});
|
|
$('.id-day-btn').click(function () {
|
|
var type = $(this).data('date'), date = '', d_obj = new Date();
|
|
switch (type) {
|
|
case 'today':
|
|
date = d_obj.Format('yyyy-MM-dd');
|
|
date = date + ' ~ ' + date;
|
|
break;
|
|
case 'yesterday':
|
|
date = (new Date(d_obj.getTime() - 86400000)).Format('yyyy-MM-dd');
|
|
date = date + ' ~ ' + date;
|
|
break;
|
|
case '7day':
|
|
date = (new Date(d_obj.getTime() - 86400000 * 7)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
|
|
break;
|
|
case '30day':
|
|
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
|
|
break;
|
|
}
|
|
$('#id-create-time').val(date);
|
|
});
|
|
});
|
|
|
|
$(function () {
|
|
vue_obj = new Vue({
|
|
el: '.coms-table-wrap',
|
|
data: {
|
|
params: [],
|
|
searchTpAry: [],
|
|
brandAry: [],
|
|
seryAry: [],
|
|
attrvAry: [],
|
|
attrcorAry: [],//车身颜色选项
|
|
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
|
|
lists: [],
|
|
show_info: {cfTitleAry: [], qdjl_lists: []},
|
|
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
|
|
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
|
|
cfroms: [],
|
|
cfroms2: [],
|
|
},
|
|
mounted: function () {
|
|
var vm = this;
|
|
vm.lists = <?=json_encode($lists)?>;
|
|
vm.params = <?=json_encode($params)?>;
|
|
vm.show_info = <?=json_encode($show_info)?>;
|
|
vm.getCfroms();
|
|
vm.init_brands();
|
|
vm.init_citys();
|
|
},
|
|
methods: {
|
|
getCfroms: function () {
|
|
var that = this
|
|
$.get('/receiver/clues/get_cfroms', function (result) {
|
|
that.cfroms = result.data.data
|
|
});
|
|
if (that.cfrom_id > 0) {
|
|
var url = that.cfrom_id == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
|
|
$.get(url, {'id': that.cfrom_id}, function (result) {
|
|
that.cfroms2 = result.data.data
|
|
});
|
|
}
|
|
},
|
|
export_out: function (type) {
|
|
var count = <?=$pager['totle']?>;
|
|
if (count > 10000) {
|
|
layer.msg('单次导出数据不能超过10000');
|
|
return false;
|
|
}
|
|
var href = $.menu.parseUri(window.location.href);
|
|
href = href.replace("orders?", "orders/export?export_type="+type+"&");
|
|
window.location.href = href;
|
|
},
|
|
init_brands: function () {
|
|
var vm = this;
|
|
$.ajax({
|
|
url: '/auto/brand/json_lists',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {status: 1},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (data) {
|
|
if (1 == data.code) {
|
|
vm.brandAry = data.data.list;
|
|
}
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
},
|
|
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));
|
|
}
|
|
}
|
|
});
|
|
},
|
|
reset: function () {
|
|
var that = this;
|
|
$("#search_tp").val('name');
|
|
$("#title").val('');
|
|
$("#id-create-time").val('');
|
|
that.cfrom_id = 0;
|
|
that.cfrom_id2 = 0;
|
|
that.params.cf_title = '';
|
|
that.params.cf_clues = '';
|
|
that.params.payway = '';
|
|
that.params.brand_id = '';
|
|
that.params.city_id_admin = '';
|
|
that.params.qdjl_id = '';
|
|
that.params.biz_type = '';
|
|
}
|
|
},
|
|
watch: {
|
|
'cfrom_id': function (nv, ov) {
|
|
var that = this;
|
|
if (nv == '') {
|
|
that.cfrom_id2 = 0;
|
|
that.cfroms = [];
|
|
} else {
|
|
var url = nv == 24 ? '/common/material' : '/receiver/clues/get_cfroms';
|
|
$.get(url, {'id': nv}, function (result) {
|
|
that.cfroms2 = result.data.data;
|
|
if (that.cfrom_id2 > 0) {
|
|
var cfrom_id2 = '0';
|
|
for (var i in that.cfroms) {
|
|
var county = that.cfroms[i];
|
|
if (county.id == that.cfrom_id2) {
|
|
cfrom_id2 = county.id;
|
|
break;
|
|
}
|
|
}
|
|
that.cfrom_id2 = cfrom_id2;
|
|
}
|
|
});
|
|
}
|
|
},
|
|
'params.brand_id': function (nv, ov) {
|
|
var vm = this;
|
|
vm.seryAry = {};
|
|
if (nv > 0) {
|
|
$.ajax({
|
|
url: '/auto/series/json_lists',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {brand_id: nv},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (data) {
|
|
if (1 == data.code) {
|
|
var lists = data.data.list;
|
|
var seryAry = {};
|
|
for (var i in lists) {
|
|
var row = lists[i];
|
|
seryAry[row.id] = row.name;
|
|
}
|
|
vm.seryAry = lists;
|
|
if (vm.params.s_id > 0 && undefined == seryAry[vm.params.s_id]) {
|
|
vm.params.s_id = '';
|
|
}
|
|
}
|
|
},
|
|
complete: function () {
|
|
loading = 0;
|
|
layer.closeAll('loading');
|
|
}
|
|
});
|
|
} else {
|
|
vm.params.s_id = '';
|
|
}
|
|
},
|
|
'params.s_id': function (nv, ov) {
|
|
var vm = this;
|
|
if (nv > 0) {
|
|
//车身颜色
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/attr/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
s_id: nv,
|
|
status: 1,
|
|
type: 0
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.attrcorAry = response.data.list;
|
|
}
|
|
}
|
|
});
|
|
//型号
|
|
$.ajax({
|
|
type: 'post',
|
|
url: '/auto/attr/json_lists',
|
|
dataType: 'json',
|
|
data: {
|
|
s_id: nv,
|
|
status: 1,
|
|
type: 1
|
|
},
|
|
success: function (response) {
|
|
if (response.code == 1) {
|
|
vm.attrvAry = response.data.list;
|
|
}
|
|
}
|
|
});
|
|
} else {
|
|
vm.attrcorAry = [];
|
|
vm.attrvAry = [];
|
|
vm.params.cor_id = '';
|
|
vm.params.v_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) ?>
|
|
});
|
|
</script>
|