Files
liche/admin/views/app/licheb/userslog/lists.php
T
2022-05-07 15:16:07 +08:00

296 lines
13 KiB
PHP

<table width="100%">
<tr>
<? foreach ($menus as $key => $value) { ?>
<td class="my-panel text-center">
<?= $value['title'] ?><br><?= $value['value'] ?><?= $value['tag'] ?>
</td>
<? } ?>
</tr>
</table>
<div class="coms-table-wrap mt10">
<form id="vue-app" class=" form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="app/licheb/userslog">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w80">顾问名字:</label>
<div class="am-para-inline w200">
<input type="text" name="uname" placeholder="顾问名字关键字" v-model="params.uname"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w80">门店:</label>
<div class="am-para-inline w120">
<select title="类型" name="type" v-model="params.type">
<option value="">选择类型</option>
<option :value="i" v-for="(v,i) in typeAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<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 w200">
<select title="门店" name="biz_id" v-model="params.biz_id">
<option value="">选择门店</option>
<option :value="v.id" v-for="(v,i) in bizAry">{{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 w80">日期:</label>
<div class="am-form-group fl">
<div class="am-para-inline w250">
<input id="id-time" name="time" type="text" value="<?= $params['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="yesterday"
data-source="id-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl ml30">
<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="fl"></div>
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="17%"><span>门店</span></th>
<th width="10%"><span>顾问</span></th>
<th width="20%"><span>客户数</span></th>
<th width="13%"><span>进店人数/进店次数</span></th>
<th width="9%"><span>跟进数</span></th>
<th width="9%"><span>订单数</span></th>
<th width="9%"><span>战败数</span></th>
<th width="9%"><span>开票数</span></th>
<th width="9%"><span>新增企微</span></th>
<th width="9%"><span>删除企微</span></th>
<th width="10%"><span>日期</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['biz_name'] ?></td>
<td><?= $v['uname'] ?></td>
<td><?= $v['customers'] ?></td>
<td><?= $v['c_num'] ?>/<?= $v['a_num'] ?></td>
<td><?= $v['follows'] ?></td>
<td><?= $v['orders'] ?></td>
<td><?= $v['defeats'] ?></td>
<td><?= $v['bills'] ?></td>
<td><?= $v['qy_adds'] ?></td>
<td><?= $v['qy_dels'] ?></td>
<td><?= $v['log_date'] ?></td>
</tr>
<? }
} ?>
</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-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-time';
var beginDate = '';
var endDate = '';
switch (type) {
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: {},
typeAry: [],//城市
cityAry: [],//城市
countyAry: [],//行政区
bizAry: [],//门店
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.typeAry = <?=json_encode($typeAry)?>;
vm.init_citys();
},
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.params.biz_id = that.params.addr_id = '';
},
reset: function () {
var that = this;
that.params.city_id = '';
that.params.uname = '';
that.params.type = '';
$('#id-time').val('');
}
},
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.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;
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;
}
}
});
}
},
}
});
<?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 = '/app/licheb/userslog/export?' + arr[1];
window.location.href = href;
});
});
</script>
<style>
.my-panel {
padding: 10px;
border: 1px solid #ddd;
}
.my-panel span {
font-size: 20px;
}
</style>