|
@@ -2,7 +2,7 @@
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
- <title>客户报备</title>
|
|
|
+ <title>潜客跟踪</title>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport"
|
|
@@ -46,6 +46,21 @@
|
|
|
background-color: #f2f2f2;
|
|
|
color: #000;
|
|
|
}
|
|
|
+
|
|
|
+ .tableContent{
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex-direction: row;
|
|
|
+ }
|
|
|
+ .demo-class .layui-layer-btn0{
|
|
|
+ background-color: #009688 !important;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ .demo-class .layui-layer-btn1{
|
|
|
+ background-color: red;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
</style>
|
|
|
|
|
|
</head>
|
|
@@ -59,28 +74,30 @@
|
|
|
<div class="LAY-btns" style="margin-bottom: 10px;">
|
|
|
<div style="float: left">
|
|
|
<button class="layui-btn" id="customer_add"><i
|
|
|
- class="layui-icon layui-icon-add-circle"></i>添加
|
|
|
+ class="layui-icon layui-icon-add-circle"></i>跟踪报告
|
|
|
</button>
|
|
|
- <!--<button class="layui-nav">
|
|
|
+ <button class="layui-btn" id="customer_order"><i
|
|
|
+ class="layui-icon layui-icon-add-circle"></i>预约量房
|
|
|
+ </button>
|
|
|
+ <button class="layui-nav">
|
|
|
<div class="layui-nav-item">
|
|
|
- <a href="javascript:;" style="color:#fff;">导入</a>
|
|
|
+ <a href="javascript:;" style="color:#fff;">导出</a>
|
|
|
<dl class="layui-nav-child">
|
|
|
- <dd><a href="#" id="btn_import">执行导入</a></dd>
|
|
|
- <dd><a href="#" id="btn_download">下载模板</a></dd>
|
|
|
+ <dd><a href="#" id="btn_list">列表</a></dd>
|
|
|
+ <dd><a href="#" id="btn_detail">明细</a></dd>
|
|
|
</dl>
|
|
|
</div>
|
|
|
- </button>-->
|
|
|
+ </button>
|
|
|
</div>
|
|
|
- <form class="layui-form" lay-filter="query-form-element1">
|
|
|
+ <form class="layui-form" lay-filter="query-form-element">
|
|
|
<div class="seach_items">
|
|
|
- <button class="layui-btn" lay-submit lay-filter="query-form-element1"><i
|
|
|
+ <button class="layui-btn" lay-submit lay-filter="query-form-element"><i
|
|
|
class="layui-icon layui-icon-search"></i>查询
|
|
|
</button>
|
|
|
</div>
|
|
|
<div class="seach_items">
|
|
|
- <select name="source" id="id_source" style="width: 40px;">
|
|
|
- <option value="">请选择来源</option>
|
|
|
- </select>
|
|
|
+ <input type="text" name="tel" autocomplete="off" class="layui-input"
|
|
|
+ placeholder="电话"/>
|
|
|
</div>
|
|
|
<div class="seach_items">
|
|
|
<input type="text" name="name" autocomplete="off" class="layui-input"
|
|
@@ -89,16 +106,20 @@
|
|
|
</form>
|
|
|
<div style="clear: both;"></div>
|
|
|
</div>
|
|
|
- <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
|
|
|
|
|
|
- <script type="text/html" id="customer-operate-bar">
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="customer_edit"
|
|
|
- >修改</a>
|
|
|
+ <div class="tableContent">
|
|
|
+ <div style="width: 405px">
|
|
|
+ <table class="layui-hide" id="customer_log" lay-filter="customer-operate-log"></table>
|
|
|
+ </div>
|
|
|
+ <div style="width: calc(100% - 450px)">
|
|
|
+ <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script type="text/html" id="customer-operate-bar">
|
|
|
<div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="customer_del"
|
|
|
- >删除</a>
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="customer_search"
|
|
|
+ >查看</a>
|
|
|
</div>
|
|
|
</script>
|
|
|
</div>
|
|
@@ -112,29 +133,45 @@
|
|
|
base: '../../../layuiadmin/' //静态资源所在路径
|
|
|
}).extend({
|
|
|
index: 'lib/index' //主入口模块
|
|
|
- }).use(['index', 'table', 'form', 'upload'], function () {
|
|
|
+ }).use(['index', 'table', 'form',], function () {
|
|
|
var $ = layui.$;
|
|
|
var table = layui.table
|
|
|
, form = layui.form
|
|
|
- , upload = layui.upload
|
|
|
, admin = layui.admin;
|
|
|
|
|
|
+ table.render({
|
|
|
+ elem: '#customer_log'
|
|
|
+ , url: '/api/customer.json'
|
|
|
+ , cols: [[
|
|
|
+ {field: 'stage', title: '阶段', width: 100}
|
|
|
+ , {field: 'total_count', title: "总人数", width: 100, sort: true}
|
|
|
+ , {field: 'today_count', title: '今日', width: 100, sort: true}
|
|
|
+ , {field: 'exceed_count', title: '逾期', width: 100, sort: true}
|
|
|
+ ]]
|
|
|
+ });
|
|
|
+
|
|
|
table.render({
|
|
|
elem: '#customer_datagrid'
|
|
|
- , url: '/customer/report_customer/'
|
|
|
+ , url: '/api/dataTable.json'
|
|
|
, cols: [[
|
|
|
- {field: 'name', title: '姓名', width: 200}
|
|
|
+ {field: 'name', title: '姓名', width: 110}
|
|
|
, {field: 'gender_text', title: "性别", width: 70}
|
|
|
- , {field: 'tel', title: '电话', width: 150}
|
|
|
- , {field: 'village', title: '小区', width: 200}
|
|
|
+ , {field: 'tel', title: '电话', width: 120}
|
|
|
+ , {field: 'village', title: '小区', width: 150}
|
|
|
, {field: 'address', title: '地址', width: 200}
|
|
|
, {field: 'source_text', title: '来源', width: 100}
|
|
|
- , {field: 'project_text', title: '项目', width: 200}
|
|
|
, {field: 'notes', title: '备注', width: 200}
|
|
|
- , {field: 'report_status_text', title: '报备状态', width: 200}
|
|
|
- , {field: 'check_user', title: '审核人', width: 100}
|
|
|
- , {field: 'check_time', title: '审核时间', width: 150}
|
|
|
- , {width: 150, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
|
|
|
+ , {field: 'follow_user', title: '跟踪人', width: 100}
|
|
|
+ , {field: 'last_follow', title: '最后跟踪', width: 150}
|
|
|
+ , {field: 'follow_status', title: '跟踪情况', width: 200}
|
|
|
+ , {field: 'follow_count', title: '跟踪次数', width: 100}
|
|
|
+ , {field: 'enter_count', title: '进店次数', width: 100}
|
|
|
+ , {field: 'last_enter', title: '最后进店时间', width: 150}
|
|
|
+ , {field: 'rank', title: '级别', width: 100}
|
|
|
+ , {field: 'status', title: '状态', width: 100}
|
|
|
+ , {field: 'create_time', title: '建档时间', width: 150}
|
|
|
+ , {field: 'create_user', title: '建档人', width: 150}
|
|
|
+ , {width: 80, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
|
|
|
]]
|
|
|
, page: true
|
|
|
, height: 'full-108'
|
|
@@ -157,72 +194,67 @@
|
|
|
$('#btn_download').on('click', function () {
|
|
|
layui.view.download("/static/xls/设备信息导入模板.xlsx");
|
|
|
});
|
|
|
- upload.render({
|
|
|
- elem: '#btn_import'
|
|
|
- , url: '/tenant/customer/import/'
|
|
|
- , accept: 'file'
|
|
|
- , acceptMime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
|
|
- , exts: 'xlsx'
|
|
|
- , field: 'excel_file'
|
|
|
- , done: function (res) {
|
|
|
- if (res.code == 0) {
|
|
|
- table.reload('customer_datagrid', {});
|
|
|
- } else {
|
|
|
- layer.msg(res.msg);
|
|
|
+ //导出列表
|
|
|
+ var _params1 = {};
|
|
|
+ $('#btn_list').on('click', function () {
|
|
|
+ $.get({
|
|
|
+ url: '/order/?export=true',
|
|
|
+ dataType: 'json',
|
|
|
+ data: _params1,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.code === 1) {
|
|
|
+ layer.msg(res.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ table.exportFile('datagrid', res,)
|
|
|
}
|
|
|
- }
|
|
|
- , error: function () {
|
|
|
- layer.msg('导入失败');
|
|
|
- }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ //导出明细
|
|
|
+ var _params2 = {};
|
|
|
+ $('#btn_detail').on('click', function () {
|
|
|
+ $.get({
|
|
|
+ url: '/order/?export=true',
|
|
|
+ dataType: 'json',
|
|
|
+ data: _params2,
|
|
|
+ success: function (res) {
|
|
|
+ if (res.code === 1) {
|
|
|
+ layer.msg(res.msg);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ table.exportFile('datagrid', res,)
|
|
|
+ }
|
|
|
+ })
|
|
|
});
|
|
|
//监听工具条
|
|
|
table.on('tool(customer-operate)', function (obj) {
|
|
|
var data = obj.data;
|
|
|
- if (obj.event === 'customer_del') {
|
|
|
- layer.confirm('确定要删除吗?', function (index) {
|
|
|
+ if (obj.event === 'customer_search') {
|
|
|
+ table.editdata = data;
|
|
|
+ layer.open({
|
|
|
+ skin: 'demo-class',
|
|
|
+ type: 2,
|
|
|
+ title: '查看客户详情',
|
|
|
+ area: ['45%', '90%'],
|
|
|
+ btn: ['跟踪报告', '更新进度', '取消'],
|
|
|
+ yes: function (index, dom) {
|
|
|
+ //跟踪报告
|
|
|
layer.close(index);
|
|
|
- admin.req({
|
|
|
- url: '/customer/report_customer/' + data.id + '/'
|
|
|
- , type: 'delete'
|
|
|
- , done: function (res) {
|
|
|
- if(res.code === 0){
|
|
|
- layer.msg('删除成功!', {icon: 1})
|
|
|
- }
|
|
|
- table.reload('customer_datagrid', {});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else if (obj.event === 'customer_edit') {
|
|
|
- if(data.report_status !== 0){
|
|
|
- layer.msg("只有待审核才允许修改");
|
|
|
- return
|
|
|
- }
|
|
|
- table.editdata = data;
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '修改',
|
|
|
- shadeClose: false,
|
|
|
- area: ['45%', '80%'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (res) {
|
|
|
- if(res.code === 0){
|
|
|
- layer.msg('修改成功!', {icon: 1})
|
|
|
- }
|
|
|
- layer.close(index);
|
|
|
- table.reload('customer_datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'edit.html?id=' + data.id
|
|
|
- });
|
|
|
+ },
|
|
|
+ btn2: function (index, layero) {
|
|
|
+ //更新进度
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ btn3: function (index, layero) {
|
|
|
+ //取消
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ content: 'detail.html'
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- form.on('submit(query-form-element1)', function (data) {
|
|
|
+ form.on('submit(query-form-element)', function (data) {
|
|
|
table.reload('customer_datagrid', {
|
|
|
where: data.field
|
|
|
, page: {curr: 1}
|
|
@@ -234,8 +266,31 @@
|
|
|
$('#customer_add').on('click', function () {
|
|
|
layer.open({
|
|
|
type: 2,
|
|
|
- title: '添加',
|
|
|
- area: ['45%', '80%'],
|
|
|
+ title: '添加跟踪报告',
|
|
|
+ area: ['45%', '70%'],
|
|
|
+ btn: ['保存', '取消'],
|
|
|
+ yes: function (index, dom) {
|
|
|
+ layui.onSubmitChild = function (res) {
|
|
|
+ if(res.code === 0){
|
|
|
+ layer.msg('添加成功!', {icon: 1})
|
|
|
+ }
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('customer_datagrid', {});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
+ },
|
|
|
+ btn2: function (index, layero) {
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ content: 'add_report.html'
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#customer_order').on('click', function () {
|
|
|
+ layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: '预约量房',
|
|
|
+ area: ['45%', '65%'],
|
|
|
btn: ['保存', '取消'],
|
|
|
yes: function (index, dom) {
|
|
|
layui.onSubmitChild = function (res) {
|
|
@@ -250,7 +305,7 @@
|
|
|
btn2: function (index, layero) {
|
|
|
layer.close(index);//关闭当前按钮
|
|
|
},
|
|
|
- content: 'edit.html'
|
|
|
+ content: 'order.html'
|
|
|
});
|
|
|
});
|
|
|
});
|