Files
liche/admin/views/receiver/customer/lists.php
T
2021-11-03 09:57:27 +08:00

496 lines
23 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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;">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?= !strlen($params['status']) ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/customer">全部</a>
</li>
<? foreach ($status_arr as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/customer?status=<?= $key ?>">
<?= $val ?>
</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/customer">
<input name="status" value="<?= $params['status'] ?>" type="hidden">
<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" v-model="params.search_tp">
<option :value="i" v-for="(v,i) in searchTpAry">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w220">
<input id="title" name="title" type="text" v-model="params.title"/>
</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="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" 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 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 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="level" v-model="params.level">
<option value=''>请选择</option>
<option :value="v" v-for="(v,i) in show_info.levelAry">{{v}}</option>
</select>
</div>
</div>
<? foreach ($searchTimeAry as $key => $value) { ?>
<div id="show-<?= $key ?>" style="display:<?= $params[$key] ? 'block' : 'none' ?>">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100"><?= $value ?></label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-<?= $key ?>" name="<?= $key ?>" type="text" value="<?= $params[$key] ?>"
placeholder="<?= $value ?>范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="today">今天</a>
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="yesterday">昨日</a>
<a class="mr10 id-<?= $key ?>-btn" href="javascript:void (0);" data-date="7day">最近7天</a>
<a class="mr10 id-<?= $key ?>-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" 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">
<input type="button" @click="btnTimes" value="选择筛选时间" class="am-btn am-btn-success am-btn-sm">
</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>
</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="3%">ID</th>
<th width="5%"><span>客户姓名</span></th>
<th width="5%"><span>客户电话</span></th>
<th width="5%"><span>客户等级</span></th>
<th width="6%"><span>来源类型</span></th>
<th width="8%"><span>线下来源</span></th>
<th width="8%"><span>线上来源</span></th>
<th width="8%"><span>所属门店</span></th>
<th width="5%"><span>状态</span></th>
<th width="5%"><span>销售员</span></th>
<th width="6%"><span>最后联系时间</span></th>
</tr>
</thead>
<tbody>
<template v-for="(v,i) in lists">
<tr>
<td>{{v.id}}</td>
<td>{{v.name}}</td>
<td>{{v.mobile_sub}}</td>
<td>{{v.level}}</td>
<td>{{v.cf_title}}</td>
<td>{{v.cf_clues}}</td>
<td>{{v.cf_name}}</td>
<td>{{v.biz_name}}</td>
<td>{{v.status_name}}</td>
<td>{{v.admin_name}}</td>
<td>{{v.cont_time}}</td>
</tr>
<tr>
<td colspan="11">
<div class="row">
<div class="col-md-4 align-l">
</div>
<div class="col-md-8 align-r" style="padding-right: 30px;">
<template v-if="v.cf_title=='平台分配'">
<a :data-modal="'/receiver/customer/edit_adviser?id='+v.id" data-title="改派"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">改派</a>
<a href="javascript:void (0);" data-ajax="post"
data-action="/receiver/customer/del" :data-params-id="v.id"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">取消派单</a>
</template>
<a :data-modal="'/common/bind_mobile?id='+v.id+'&type=customer'"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="获取手机号">拨打电话</a>
<a :data-modal="'/common/show_sms?id='+v.id+'&type=customer'"
href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs"
data-title="发送短信">短信</a>
<a href="javascript:void(0);" :data-open="'/receiver/customer/get?id='+v.id"
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
</div>
</td>
</tr>
</template>
</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 id="times-modal" style="display: none;">
<div class="modal-body">
<label class="checkall" style="margin-left: 30px;">
<input id="times_checkbox" type="checkbox" data-check-target=".order-times"> 全选</label>
<div style="margin-left: 40px;">
<?php foreach ($searchTimeAry as $key => $value) { ?>
<label class="am-checkbox" style="padding-bottom: 8px;">
<input type="checkbox" class="order-times" <?= $params[$key] ? 'checked' : '' ?>
value='<?= $key ?>'><?= $value ?></label>
<? } ?>
</div>
</div>
</div>
</div>
<script>
require(['laydate', 'autocomplete'], function (laydate) {
<? foreach ($searchTimeAry as $key => $value) { ?>
laydate.render({
elem: '#id-<?=$key?>', range: '~'
});
$('.id-<?=$key?>-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-<?=$key?>').val(date);
});
<?}?>
});
var vue_obj;
$(function () {
vue_obj = new Vue({
el: '.coms-table-wrap',
data: {
params: [],
searchTpAry: [],
lists: [],
qdjl_lists: [],
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
cfroms: [],
cfroms2: [],
admins: {cityAry: [], countyAry: [], bizAry: [], list: []},
show_info: {levelAry: [], cfCluesAry: []},
},
mounted: function () {
var vm = this;
vm.params = <?=json_encode($params)?>;
vm.searchTpAry = <?=json_encode($searchTpAry)?>;
vm.lists = <?=json_encode($lists)?>;
vm.qdjl_lists = <?=json_encode($qdjl_lists)?>;
vm.show_info = <?=json_encode($show_info)?>;
this.getCfroms();
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
});
}
},
btnTimes: function () {
layer.open({
type: 1,
area: ['25%'], //宽高
content: $('#times-modal'),
title: '选择筛选时间',
shade: false,
btn: ['确定', '取消'],
yes: function (index) {
layer.close(index);
$(".order-times").map(function () {
var id = this.value;
if (this.checked) {
$('#show-' + id).show();
} else {
$('#id-' + id).val('');
$('#show-' + id).hide();
}
});
}
});
},
saveEdit: function () {
$("form").submit();
},
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;
that.params.search_tp = 'mobile';
that.params.title = '';
that.cfrom_id = 0;
that.cfrom_id2 = 0;
that.params.city_id_admin = '';
that.params.cf_clues = '';
that.params.cf_title = '';
$('#cf_time').val('');
$(".order-times").map(function () {
var id = this.value;
this.checked = false;
$('#id-' + id).val('');
$('#show-' + id).hide();
});
$("#times_checkbox").prop("checked", false);
}
},
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.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>