Commit c8079679 authored by hujun's avatar hujun

预约看铺列表跟进

parent ce77f00c
...@@ -159,6 +159,7 @@ class Member extends Basic ...@@ -159,6 +159,7 @@ class Member extends Basic
$pwd = $this->request->param('pwd'); $pwd = $this->request->param('pwd');
$user_nick = $this->request->param('user_nick'); $user_nick = $this->request->param('user_nick');
$user_pic = $this->request->param('user_pic'); $user_pic = $this->request->param('user_pic');
$token = $this->params['token'];
if ($type == '') { if ($type == '') {
return $this->response(101, 'type is null'); return $this->response(101, 'type is null');
...@@ -175,11 +176,15 @@ class Member extends Basic ...@@ -175,11 +176,15 @@ class Member extends Basic
if (mb_strlen($pwd) < 6) { if (mb_strlen($pwd) < 6) {
return $this->response(101, '密码少于6位'); return $this->response(101, '密码少于6位');
} }
if ($this->params['token'] && $this->params['type'] != 'register') { if (empty($token) && $this->params['type'] != 'register') {
return $this->response(101, 'token is null');
}
if ($token && $this->params['type'] != 'register') {
$jwt = new JwtUntils(); $jwt = new JwtUntils();
$jwt_data = $jwt->getDecode($this->params['token']); $jwt_data = $jwt->getDecode($token);
$code = $jwt_data['data']['code']; $code = $jwt_data['data']['code'];
$jwt_phone = $jwt_data['data']['phone']; $jwt_phone = $jwt_data['data']['phone'];
...@@ -194,7 +199,7 @@ class Member extends Basic ...@@ -194,7 +199,7 @@ class Member extends Basic
return $this->response(101, '请重新获取验证码'); return $this->response(101, '请重新获取验证码');
} }
} }
$data['status'] = 101; $data['status'] = 101;
$data['data'] = array(); $data['data'] = array();
...@@ -263,23 +268,29 @@ class Member extends Basic ...@@ -263,23 +268,29 @@ class Member extends Basic
} }
break; break;
default : default :
$pwd2 = $this->request->param('pwd2');
$user_data->update_time = $date; $user_data->update_time = $date;
$user_data->user_nick = $user_nick? $user_nick : $user_data->user_nick; $user_data->user_nick = $user_nick? $user_nick : $user_data->user_nick;
$user_data->user_phone = $phone ? $phone : $user_data->user_phone; $user_data->user_phone = $phone ? $phone : $user_data->user_phone;
$user_data->user_pic = $user_pic ? $user_pic : $user_data->user_pic; $user_data->user_pic = $user_pic ? $user_pic : $user_data->user_pic;
//修改密码 //修改密码
if ($pwd == $user_data->user_pswd) { if (md5(md5($pwd2).'+123') == $user_data->user_pswd) {
$user_data->user_pswd = $pwd; $user_data->user_pswd = $pwd;
} $user_data->save();
$user_data->save(); if ($user_data->id) {
if ($user_data->id) { $data['data'] = $user_data; //编辑完返回用户信息
$data['data'] = $user_data; //编辑完返回用户信息 $data['status'] = 200;
$data['status'] = 200; $data['msg'] = '修改成功';
$data['msg'] = '修改成功'; } else {
$data['status'] = 101;
$data['msg'] = '编辑失败';
}
} else { } else {
$data['msg'] = '编辑失败'; $data['status'] = 101;
$data['msg'] = '密码错误';
} }
break; break;
} }
......
...@@ -14,6 +14,7 @@ use app\model\AdminModel; ...@@ -14,6 +14,7 @@ use app\model\AdminModel;
use app\model\FollowUp; use app\model\FollowUp;
use app\model\SubletModel; use app\model\SubletModel;
use app\model\Users; use app\model\Users;
use think\Session;
class Transfer extends Basic class Transfer extends Basic
...@@ -110,12 +111,12 @@ class Transfer extends Basic ...@@ -110,12 +111,12 @@ class Transfer extends Basic
$params = $this->request->param(); $params = $this->request->param();
$follow = new FollowUp(); $follow = new FollowUp();
$result = $follow->save([ $follow->save([
'content' => $params['content'], 'content' => $params['content'],
'sublet_id' => $params['id'], 'sublet_id' => $params['id'],
'admin_id' => 1, 'admin_id' => Session::get('userId'),
'create_time' => date('Y-m-d H:i:s') 'create_time' => date('Y-m-d H:i:s'),
'type' => $params['type']
]); ]);
if (!$follow->id) { if (!$follow->id) {
...@@ -141,7 +142,10 @@ class Transfer extends Basic ...@@ -141,7 +142,10 @@ class Transfer extends Basic
if ($params['id']) { if ($params['id']) {
$follow = new FollowUp(); $follow = new FollowUp();
$users = new AdminModel(); $users = new AdminModel();
$list = $follow->where('sublet_id' , $params['id'])->select(); $list = $follow->where([
'sublet_id' => $params['id'],
'type' => $params['type']
])->select();
foreach ($list as $k=>$v) { foreach ($list as $k=>$v) {
$data['data'][$k] = $v; $data['data'][$k] = $v;
$data['data'][$k]['admin_name'] = $users->field('name')->find()['name']; $data['data'][$k]['admin_name'] = $users->field('name')->find()['name'];
......
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2017/12/21
* Time: 14:36
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\Applies;
use app\model\AppointWatchShop;
use think\Session;
class WatchShop extends Basic
{
public function index(){
return view('watch_shop/watch_list');
}
public function getList() {
$data['status'] = 200;
$data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$where = array();
if (!empty($params['start_date'])) {
$where['create_time'] = ['> time', $params['start_date']];
}
if (!empty($params['end_date'])) {
$where['create_time'] = ['< time', $params['end_date']];
}
if (!empty($params['name'])) {
$where['appellation'] = ['like', $params['name'].'%'];
}
if (!empty($params['phone'])) {
$where['phone'] = ['like', $params['phone'].'%'];
}
if (!empty($params['house_title'])) {
$where['house_title'] = ['like', $params['house_title'].'%'];
}
$applies = new AppointWatchShop();
$data['list'] = $applies->getAppointWatchShopList($pageNo, $pageSize, '', '*', $where);
$data['total'] = $applies->getAppointWatchShopListTotal($where);
return $this->response($data['status'], $data['msg'], $data);
}
public function addApplies() {
$data['status'] = 200;
$data['msg'] = '';
$params = $this->request->param();
if ($params['id']) {
$appoint = new AppointWatchShop();
$appoint_list = $appoint->get($params['id']);
$apples = new Applies();
$apples->save([
'agent_id' => $appoint_list['agent_id'],
]);
if ($apples->id) {
} else {
}
} else {
}
}
}
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<!--</ul>--> <!--</ul>-->
<!--</li>--> <!--</li>-->
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="preview_list.html" class="active"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> 预约看铺列表</a> <a href="watch_shop.html" class="active"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> 预约看铺列表</a>
</li> </li>
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="transfer_list.html"> 委托转铺列表</a> <a href="transfer_list.html"> 委托转铺列表</a>
......
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="home" />
<!--导航star-->
<!-- Sidebar -->
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading">
预约看铺列表
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<td colspan="6">
<form action="" method="get" id="form_search">
<span class="fore-span">提交时间</span>
<input class="form-control btn4" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="datetime-local" value="">
<input class="form-control btn4" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="datetime-local" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="company_name" name="company_user_name" placeholder="客户姓名" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="mobile" name="mobile" placeholder="手机号" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="invite" name="invite" placeholder="店铺名" type="text" value="">
<span class="btn btn-default btn3" onclick="search()">搜索</span>
<span class="btn btn-default btn3" onclick="search_reset()">重置</span>
</form>
</td>
</tr>
<tr>
<th>称呼</th>
<th>客户电话</th>
<th>期待看铺时间</th>
<th>其他看铺要求</th>
<th>提交时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>刘女士</td>
<td>13545874456</td>
<td>刘丹丹</td>
<td>张大大</td>
<td>Thornton</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">
跟进
</a>
<a class="btn1 btn-warning " href="#modal-details" data-toggle="modal" onclick="show_details(2244)">
转为报备
</a>
</td>
</tr>
<tr>
<td>李楠楠</td>
<td>Jac12464313ob</td>
<td>Thornton</td>
<td>@fat</td>
<td>Thornton</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">
跟进
</a>
<a class="btn1 btn-warning " href="#modal-details" data-toggle="modal" onclick="show_details(2244)">
转为报备
</a>
</td>
</tr>
<tr>
<td>刘丹丹</td>
<td>125544352</td>
<td>the Bird</td>
<td>@twitter</td>
<td>Thornton</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">
跟进
</a>
<a class="btn1 btn-danger" href="#modal-details" data-toggle="modal" onclick="show_details(2244)">
已转为报备
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- /#page-content-wrapper -->
<div class="page-cla">
<ul class="pagination">
<li><a href="#">&laquo;</a></li>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">&raquo;</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- /#跟进模态框 -->
<div class="modal fade" id="modal-process" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabel">
跟进
</h4>
</div>
<div class="modal-body">
<div class="table-responsive table-responsive1">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>跟进内容</th>
<th>跟进人</th>
<th>跟进时间</th>
</tr>
</thead>
<tbody>
<tr>
<td>更近人</td>
<td>Mark</td>
<td>Otto</td>
</tr>
<tr>
<td>更近时间</td>
<td>Jacob</td>
<td>Thornton</td>
</tr>
</tbody>
</table>
</div>
<div class="control-group">
<label class="control-label">备注</label>
<div class="controls">
<input class="form-control" type="text" id="content1" name="content">
<p class="help-block">
</p></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="watch_shop" />
<!--导航star-->
<!-- Sidebar -->
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="col-lg-10 col-lg-offset-0">
<div class="panel panel-default">
<div class="panel-heading">
预约看铺列表
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="9">
<form id="form_search">
<span class="fore-span">提交时间</span>
<input class="form-control btn4" data-rule-phoneus="false" data-rule-required="false" id="start_date" type="datetime-local" value="">
<input class="form-control btn4" data-rule-phoneus="false" data-rule-required="false" id="end_date" type="datetime-local" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="客户姓名" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="手机号" type="text" value="">
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="店铺名" type="text" value="">
<span class="btn btn-default btn3" id="search">搜索</span>
<span class="btn btn-default btn3" id="form_search_reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">商铺名</th>
<th class="text-center">称呼</th>
<th class="text-center">客户电话</th>
<th class="text-center">期待看铺时间</th>
<th class="text-center">其他看铺要求</th>
<th class="text-center">提交时间</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody id="sublet_list" class="text-center">
</tbody>
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /#wrapper -->
<!-- /#跟进模态框 -->
<div class="modal fade" id="modal-process" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabel">
跟进
</h4>
</div>
<div class="modal-body">
<div class="table-responsive table-responsive1">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>跟进内容</th>
<th>跟进人</th>
<th>跟进时间</th>
</tr>
</thead>
<tbody id="list_follow">
</tbody>
</table>
</div>
<div class="control-group">
<label class="control-label">备注</label>
<div class="controls">
<textarea class="form-control" rows="3" id="content"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="submit_follow">
提交
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
\ No newline at end of file
...@@ -34,6 +34,8 @@ class AppointWatchShop extends Model ...@@ -34,6 +34,8 @@ class AppointWatchShop extends Model
} }
/** /**
* 预约看铺列表
*
* @param int $pageNo * @param int $pageNo
* @param int $pageSize * @param int $pageSize
* @param string $order_ * @param string $order_
...@@ -51,4 +53,15 @@ class AppointWatchShop extends Model ...@@ -51,4 +53,15 @@ class AppointWatchShop extends Model
->page($pageNo) ->page($pageNo)
->select(); ->select();
} }
/**
* 预约看铺总数
*
* @param $params
* @return int|string
*/
public function getAppointWatchShopListTotal($params)
{
return $this->where($params)->count();
}
} }
...@@ -79,6 +79,10 @@ Route::group('index', [ ...@@ -79,6 +79,10 @@ Route::group('index', [
//login //login
'login' => ['index/login/login',['method'=>'get']], 'login' => ['index/login/login',['method'=>'get']],
'loginVerify' => ['index/login/loginVerify',['method'=>'post|get']], 'loginVerify' => ['index/login/loginVerify',['method'=>'post|get']],
//watchshop 预约看铺
'watch_shop' => ['index/WatchShop/index',['method'=>'get']],
'get_watch' => ['index/WatchShop/getList',['method'=>'get']],
]); ]);
......
...@@ -66,7 +66,8 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"da ...@@ -66,7 +66,8 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"da
}, },
addFollow : function () { addFollow : function () {
var params = {}; var params = {};
params.id = id; params.type = 1;
params.id = id;
params.content = $("#content").val(); params.content = $("#content").val();
$.ajax ({ $.ajax ({
...@@ -93,16 +94,16 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"da ...@@ -93,16 +94,16 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css',"da
* @param obj * @param obj
*/ */
function edit(obj) { function edit(obj) {
var params = {}; if (!confirm('是否继续')) {
var arr = $(obj).attr ("data-id").split(','); return ;
params.id = arr[0];
params.status = arr[1];
if (params.status == 0) {
params.status = 2;
} else {
params.status = 0;
} }
var params = {};
params.id = $(obj).attr ("data-id");
$.ajax ({ $.ajax ({
url: '/index/putAway', url: '/index/putAway',
type: 'POST', type: 'POST',
...@@ -111,15 +112,7 @@ function edit(obj) { ...@@ -111,15 +112,7 @@ function edit(obj) {
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
if (data.data.status == 0) {
$(obj).html('转为上架商铺');
$(obj).attr('class','btn1 btn-danger');
$(obj).attr('data-id',arr[0] +','+0);
} else {
$(obj).html('已转为上架商铺');
$(obj).attr('class','btn1 btn-info');
$(obj).attr('data-id',arr[0] +','+data.data.status);
}
} else { } else {
alert(data.msg); alert(data.msg);
} }
...@@ -136,7 +129,7 @@ function alertFollow(obj){ ...@@ -136,7 +129,7 @@ function alertFollow(obj){
url: '/index/followList', url: '/index/followList',
type: 'GET', type: 'GET',
async: true, async: true,
data: {"id":id}, data: {"id":id,"type":1},
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data.code == 200) { if (data.code == 200) {
...@@ -151,11 +144,4 @@ function alertFollow(obj){ ...@@ -151,11 +144,4 @@ function alertFollow(obj){
} }
}); });
} }
\ No newline at end of file
/*
<tr>
<td>更近时间</td>
<td>Jacob</td>
<td>Thornton</td>
</tr>*/
define (['doT', 'text!temp/watch_template_tpl.html', 'css!style/home.css',"datetimepicker",'pagination','bootstrapJs'], function (doT, template) {
user = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
urls: '',
init: function () {
//初始化dot
$ ("body").append (template);
user.getList ();
user.event ();
},
event: function () {
$("#form_search_reset").click(function () {
document.getElementById("form_search").reset();
});
$("#search").click(function () {
user.getList(1);
});
$("#submit_follow").click(function () {
user.addFollow();
});
$('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
language: 'zh-CN',
pickTime: false
}).on('changeDate',function(){
$(this).datetimepicker('hide');
});
},
getList: function (pageNo) {
user.pageNo = pageNo;
var params = {};
params.start_date = $("#start_date").val();
params.end_date = $("#end_date").val();
params.name = $("#name").val();
params.phone = $("#phone").val();
params.shop_name = $("#shop_name").val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
$.ajax ({
url: '/index/get_watch',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('watch_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#sublet_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: user.pageSize,
onClick: function (el) {
user.getList (el.num.current);
}
});
}
});
},
addFollow : function () {
var params = {};
params.type = 2;
params.id = id;
params.content = $("#content").val();
$.ajax ({
url: '/index/addFollow',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function (data) {
if (data.code == 200) {
$ ("#modal-process").modal ('hide');
} else {
alert(data.msg);
}
}
});
}
};
return user;
});
var id;
function alertFollow(obj){
id = $(obj).attr ("data-id");
$("#content").val('');
$.ajax ({
url: '/index/followList',
type: 'GET',
async: true,
data: {"id":id,"type":2},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var str = '';
$.each(data.data, function (i,item) {
str += "<tr><td>"+item['content']+"</td><td>"+item['admin_name']+"</td><td>"+item['create_time']+"</td></tr>";
$("#list_follow").html(str);
});
} else {
alert(data.msg);
}
}
});
}
\ No newline at end of file
<script id="watch_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['house_title'] %]</td>
<td>[%= it[item]['appellation'] %]</td>
<td>[%= it[item]["phone"] %]</td>
<td>[%= it[item]["expect_time"] %]</td>
<td>[%= it[item]["other_require"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="[%= it[item]['id'] %]" onclick="alertFollow(this)">跟进</a>
<a href="#modal-details" data-toggle="modal" onclick="edit(this)" data-id="[%= it[item]['id'] %], [%= it[item]['status'] %]"
[% if (it[item]["status"] == 0){ %]
class="btn1 btn-danger">跟进</a>
[% }else{ %]
class="btn1 btn-info">转为报备</a>
[% } %]
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment