Commit 19cca98b authored by clone's avatar clone

Merge branch '0709-v.2.3.1' into test

# Conflicts: # application/index/controller/Member.php
parents a944768f 997439f5
......@@ -154,8 +154,8 @@ class Client extends Basic
$time = date("Y-m-d H:i:s",time());//当前时间
$params = $this->request->param();
$params['type'] = 0;
$params['agent_id'] = '5775';
/*$params['type'] = 0;
$params['agent_id'] = '5741';*/
if(empty($params['agent_id'])){
......@@ -365,7 +365,7 @@ class Client extends Basic
$data['search_type'] = $search_type;
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
$data['examine_vip'] = $vip_services->vip($params['user_id']);
return $this->response("200", "success!", $data);
}
......
......@@ -115,6 +115,42 @@ class Report extends Basic
}
}
/**
* 获取报备列表 pc
*
* @return \think\Response
*/
public function reportListForPc()
{
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"];
$result = $this->service_->orderListForPc($field, $params, $pageNo, $pageSize);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
}
/**
......
......@@ -123,7 +123,7 @@ class User extends Basic
return $this->response("200", "此条件没有找到数据");
}
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
$data['examine_vip'] = $vip_services->vip($params['user_id']);
$data['user_date'] = $userList;
return $this->response("200", 'request success', $data);
}
......
......@@ -133,7 +133,6 @@ class ReportService
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$ids_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
......@@ -154,12 +153,71 @@ class ReportService
}
}
return $result;
}
return null;
}
/**
* 报备订单列表
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function orderListForPc($field, $params, $pageNo, $pageSize)
{
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel = new VerifyService();
$agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
if ($agentArr) {
$params["agent_id_s"] = array( "in", $agentArr );
$params["report_agent_id"] = $agentArr;
}
$caseHouseId = $vModel->getCaseHouseIdByAgentId($params["agent_id_s"]);
$ids = "";
if (count($caseHouseId) > 0) {
foreach ($caseHouseId as $item) {
$ids .= $item["houses_id"] . ",";
}
}
$ids = rtrim($ids, ",");
$ids = $ids ? $ids : 0;
$params["house_ids"] = $ids;
$result = $this->oReportModel->selectReportList($field, $params, $pageNo, $pageSize);
$count = $this->oReportModel->selectReportCount($field,$params);
$ids_str = "";
if (count($result) > 0) {
foreach ($result as $k => $v) {
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$ids_str .= $v["order_id"] . ",";
}
$ids_str = rtrim($ids_str, ",");
$sign_arr = $this->orderSign($ids_str);
foreach ($result as $k => $v) {
$result[$k]["sign"] = "";
foreach ($sign_arr as $value) {
if ($v["order_id"] == $value["order_id"]) {
$result[$k]["sign"] .= $this->signTitle($value["type"]) . ",";
}
}
}
$data["result"] = $result;
$data["total"] = $count[0]["total"];
return $data;
}
return null;
}
public function orderSign($ids_str)
{
......
......@@ -25,7 +25,7 @@ class VipService
$agent = new AAgents();
$fields='auth_group_id';
$auth_group_id = $agent->getAgentsById($id, $fields);
//var_dump($auth_group_id);
$auth_group = New AuthGroup();
$id= $auth_group_id;
......@@ -39,6 +39,8 @@ class VipService
$rules_arr = explode(',',$rules);
//dump($rules_arr);
if (in_array($sauth_ruel_id, $rules_arr)) {
return 0;
......
......@@ -13,7 +13,7 @@
<body style="display: none;">
<div id="app">
<main>
<section v-if="d.lookShopArr && (d.lookShopArr.isPanParty || (d.lookShopArr.residue_num>0))">
<section v-show="dataCode==200">
<table>
<tbody>
<tr>
......@@ -90,7 +90,7 @@
<div class="fl">房东:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.landlord_phone" :key="index">{{item.name+'-'+item.phone}}</li>
<li class="fl oh" v-for="(item, index) in d.landlord_phone" :key="index">{{item.name+'-'+hidePhone(item.phone)}}</li>
</ul>
</div>
</td>
......@@ -127,7 +127,8 @@
</tbody>
</table>
</section>
<section v-else>查看数量已达上限</section>
<section v-show="dataCode==102">查看数量已达上限</section>
<section v-show="dataCode!=200"></section>
</main>
</div>
<script src="/app/js/libs/require.min.js" data-js="/app/js/shop_detail_pc.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script>
......
......@@ -9,8 +9,7 @@
namespace app\index\controller;
use app\api\controller\Sublet;
//use app\api_broker\service\LookShopService;
use app\api_broker\service\LookShopService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\GHouses;
......@@ -220,10 +219,10 @@ class Houses extends Basic
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
}
// $look_shop = new LookShopService();
$look_shop = new LookShopService();
foreach ($data['data']['list'] as $k=>$v) {
$data['data']['list'][$k]["is_look"] = false;
$data['data']['list'][$k]["is_look"] = $look_shop->isLooked($this->userId, $v["id"]);;
}
return $this->response($data['status'], $data['msg'], $data['data']);
......
......@@ -255,6 +255,7 @@ class Member extends Basic{
$data['list'] = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['user_phone'] = hide_customer_phone($data['list'][$k]['user_phone']);
$data['list'][$k]['current_agent_id'] = $this->userId;
}
......
......@@ -54,7 +54,7 @@ class Remark extends Basic
}
if (!empty($this->params['customer'])) {
$where['c.user_nick'] = $this->params['customer'];
$where['c.user_name'] = $this->params['customer'];
}
if (!empty($this->params['phone'])) {
......@@ -152,6 +152,7 @@ class Remark extends Basic
$user = new Users();
$user_res = $user->useraction_search_user_res($user_id, 1);
$user_res['user_phone'] = hide_customer_phone($user_res['user_phone']);
$user_res['user_pic'] = HEADERIMGURL.$user_res['user_pic'];
$table = new AAgents();
......
......@@ -48,7 +48,8 @@ class Basic extends Controller
'index/regions',
'index/getAuth2',
'index/getDistrict',
'index/getAgentDistrictStore'
'index/getAgentDistrictStore',
'index/agentsUnBind'
);
/**
......@@ -145,8 +146,8 @@ class Basic extends Controller
}
}
//处理客方编辑客户
if (($requestPath == 'index/pcEditClient' || $requestPath == 'index/pcAddFollow') && isset($this->params['id'])) {
//处理客方编辑、跟进、公客客户
if (($requestPath == 'index/pcEditClient' || $requestPath == 'index/pcAddFollow' || $requestPath == 'index/useraction_search') && isset($this->params['id'])) {
if (empty($this->params['id'])) {
$is_auth = 1;
......@@ -154,11 +155,16 @@ class Basic extends Controller
$m_user = new Users();
$where['agent_id'] = $this->userId;
$where['id'] = $this->params['id'];
$is_ = $m_user->getUserAgentTotal($where);
$is_ = $m_user->selectUser($where, 'id,agent_id');
if ($is_['agent_id'] == 0) {
$is_auth = 1;
} else {
$is_auth = $is_ > 0 ? 1:0;
}
}
}
}
if (empty($is_auth) && $this->userId != 1) {
if($this->request->isAjax()){
......@@ -182,9 +188,14 @@ class Basic extends Controller
if(empty($this->userName) || empty($this->userId) || empty($this->lastLoginTime) ){
$this->redirect('/index/login');
}
//登录有效期为1小时
if ((time() - $this->lastLoginTime) > 7200) {
$time = time();
//登录有效期为2小时
if (($time - $this->lastLoginTime) > 7200) {
$this->redirect('/index/login');
} else {
//更新时间
Session::set("lastLoginTime", $time);
}
return ;
......
......@@ -71,7 +71,7 @@
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>-->
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_name" placeholder="跟进人姓名" type="text" value="">-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="用户姓名或电话" type="text" value="">
<input class="form-control btn4 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="跟进人姓名或电话" type="text" value="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
......
......@@ -207,6 +207,11 @@
font-weight: 600;
font-size: 36px;
}
/*客户动态*/
.followup-modal-list-area {
height: 450px;
overflow-y: scroll;
}
</style>
<!--导航star-->
......@@ -227,7 +232,7 @@
<div class="pull-right">
<ul class="bread_btn">
<li>
<a href="#modal_add_user" data-toggle="modal" class="btn btn-default add_alert"><i class="icon-plus"></i> 新增客户
<a href="#modal_add_user" data-toggle="modal" class="btn btn-default add_alert add-user-new"><i class="icon-plus"></i> 新增客户
</a>
</li>
</ul>
......@@ -418,14 +423,14 @@
<label for="inputEmail3" class="col-sm-3 control-label">姓名:</label>
<div class="col-sm-9">
<input type="text" class="form-control btn6" name="user_name" id="inputEmail3" placeholder="请输入姓名">
<span class="use-span text-danger">(必填)</span>
<!--<span class="use-span text-danger">(必填)</span>-->
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">性别:</label>
<div class="col-sm-9">
<select class="form-control btn6" id="user_sex">
<option value="0" class="successModel">请选择</option>
<option value="" class="successModel">请选择</option>
<option value="1"></option>
<option value="2"></option>
</select>
......@@ -435,7 +440,7 @@
<label class="col-sm-3 control-label">电话:</label>
<div class="col-sm-9">
<input type="number" class="form-control btn6" name="user_phone" autocomplete="off" id="set_father_id2">
<span class="use-span text-danger">(必填)</span>
<!--<span class="use-span text-danger">(必填)</span>-->
</div>
</div>
<div class="form-group">
......@@ -444,7 +449,7 @@
<div class="col-sm-9">
<select class="form-control btn6" id="industry_type2">
<option value="0">业态选择</option>
<option value="">业态选择</option>
<option>轻餐饮</option>
<option>重餐饮</option>
<option>百货零售</option>
......@@ -605,9 +610,8 @@
</td>
</tr>
<tr class="ld-Marheight">
<th class="text-center">跟进内容</th>
<th class="text-center">跟进人</th>
<th class="text-center">跟进时间</th>
<th class="text-center">客方修改记录:</th>
</tr>
</thead>
<tbody class="text-center" id="caozuo_table"></tbody>
......@@ -682,16 +686,14 @@
<label class="control-label">无效</label><input type="radio" name="user_status" value="-1">
<span class="text-danger">(必填)</span>
</div>
<div class="clear">
</div>
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed"">
<!--<thead>
<tr class="ld-Marheight">
<th class="text-center">跟进内容</th>
<th class="text-center">跟进人</th>
<th class="text-center">跟进时间</th>
</tr>
</thead>-->
<tbody class="text-center" id="caozuo_table2"></tbody>
<tbody class="text-center" id="caozuo_table2">
</tbody>
</table>
</div>
</div>
......@@ -799,8 +801,10 @@
</div>-->
<div class="clear"></div>
<span class="fore-span ld-Marheight">预计到场时间:</span>
<input class="form-control btn6 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="look_shop_date" name=" " type="datetime-local">
<!--<input class="form-control btn6 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="" name=" " type="datetime-local">-->
<!--datetime-local-->
<!--bootstrap 时间控件-->
<input type="text" value="" class="form_datetime form-control btn6 ld-Marheight" id="look_shop_date" readonly="readonly">
<div class="clear"></div>
<div class="textarea-con ld-Marheight">
......
......@@ -574,7 +574,8 @@ class AAgents extends BaseModel
*/
public function getAgentsById($id, $fields)
{
return $this->where('id', $id)->value($fields);
$return = $this->where('id', $id)->value($fields);
return $return;
}
/**
......
......@@ -242,6 +242,7 @@ class AuthGroup extends BaseModel
*/
public function getAuthGroupById($id, $fields)
{
return $this->where('id', $id)->value($fields);
$return = $this->where('id', $id)->value($fields);
return $return;
}
}
......@@ -205,6 +205,8 @@ class AuthRule extends BaseModel
*/
public function getAuthRuleByName($name, $fields)
{
return $this->where('name', $name)->value($fields);
$return = $this->where('name', $name)->value($fields);
return $return;
}
}
\ No newline at end of file
......@@ -311,6 +311,157 @@ class OReportModel extends Model
}
}
/**
* @param string $filed
* @param $params
* @return mixed
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public function selectReportCount($filed = "id", $params)
{
if (isset($params["report_agent_id"])) {
$report_agent_id = $params["report_agent_id"];
}
if (isset($params["house_ids"])) {
$house_ids = $params["house_ids"];
}
switch ($params["type"]) {
case 2:
$sql = "SELECT count(1) as total FROM
(( SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)UNION(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_march_in` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
) ) AS aaa ";
$result = $this->db->query($sql);
return $result;
case 3:
$sql = "SELECT count(1) as total FROM
(
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
UNION
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_paylog` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
) AS aaa";
$result = $this->db->query($sql);
return $result;
case 4:
$sql = "SELECT count(1) as total FROM
((
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
UNION
(
SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
RIGHT JOIN `o_bargain` `c` ON `b`.`id` = `c`.`order_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
)
) AS aaa ";
$result = $this->db->query($sql);
return $result;
default:
$sql = "SELECT count(1) as total FROM
((SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`a`.`report_agent_id` IN ($report_agent_id )
AND `a`.`status` = 0
AND `b`.`is_del` = 0)
UNION
(SELECT
$filed
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
WHERE
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
) ) as aaa";
$result = $this->db->query($sql);
//echo $this->getLastSql();
return $result;
}
}
......
......@@ -171,6 +171,9 @@ class UPhoneFollowPp extends BaseModel
{
$UPhoneFollowPp_res = db('u_phone_follow_up')
//->where('user_id',$user_id)
->field('a.*,b.vip')
->alias('a')
->join('u_users b','a.user_id = b.id', 'left')
->where('content', 'like', "%$searchdate%")
->order('create_time', 'desc')
->limit($pagesize)
......
......@@ -267,7 +267,7 @@ class Users extends Model
if (!empty($data['area_demand'])) {
$insert_data['area_demand'] = $data['area_demand'];
}
if (!empty($data['vip'])) {
if (isset($data['vip'])) {
$insert_data['vip'] = $data['vip'];
}
if ($id && $id > 0) {
......
......@@ -428,6 +428,7 @@ Route::group('broker', [
'reportList' => [ 'api_broker/Report/reportList', [ 'method' => 'get' ] ],
'reportListForPc' => [ 'api_broker/Report/reportListForPc', [ 'method' => 'get' ] ],
'orderDetail' => [ 'api_broker/OrderLog/orderDetail', [ 'method' => 'get|post' ] ],
......
......@@ -6,11 +6,11 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
el: '#app',
data: {
user_info_obj,
dataCode: '',
d: {}
},
created: function() {
var _this = this;
document.body.style.display = 'block';
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
......@@ -23,7 +23,9 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
document.body.style.display = 'block';
if(typeof _data === 'object') {
_this.dataCode = _data['code'];
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
......@@ -45,22 +47,8 @@ require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function
});
},
methods: {
dealPriceSwicth: function(t) {
let _this = this;
if(t == '1'){
return {
}
}else if(t == '2'){
return {
}
}else{
return {
}
}
hidePhone(t) {
return hideTel(t);
}
},
computed: {
......
......@@ -83,7 +83,7 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
$('#guest_stores').html('');
});
},
getList: function(pageNo) { //获取约带看记录列表
getList: function(pageNo) { //商铺跟进列表
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj.AuthToken);
house.pageNo = pageNo;
......
......@@ -89,7 +89,7 @@ define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/h
});
},
getList: function(pageNo) { //获取约带看记录列表
record.pageNo = pageNo;
record.pageNo = pageNo;//接收参数
var params = {};
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
......@@ -100,8 +100,6 @@ define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/h
// params.user_phone = $('#user_phone').val();
// params.report_agent_phone = $('#report_agent_phone').val();
// params.house_title = $('#house_title').val();
params.pageNo = record.pageNo;
params.pageSize = record.pageSize;
// var start_ = $('#create_time_start').val()+" 00:00:00";
// date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
// params.start_time =date_start.getTime()*0.001;
......@@ -114,9 +112,11 @@ define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/h
params.AuthToken = user_info_obj.AuthToken;
params.agent_id = user_info_obj.id;
params.type = 1;
params.page_no = record.pageNo;
params.page_size = record.pageSize;
$.ajax({
type: 'GET',
url: '/broker/reportList', //约带看记录 对接接口
url: '/broker/reportListForPc', //约带看记录 对接接口
data: params,
timeout: 30000,
dataType: 'json',
......@@ -125,10 +125,11 @@ define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/h
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('inspectionRecord_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data));
$("#follow_list").html(doTtmpl(data.data.result));
/*分页代码*/
console.log(data.data.total);
add_page(data.data.total, pageNo, record.pageSize, record.getList);
$(".move-block").html(' ');
// $(".move-block").html(' ');
} else {
alert(data['msg']);
......
......@@ -54,7 +54,7 @@ $(function(){
if(typeof data === 'object') {
if (data.code == 200) {
localStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
location.href = '/admin.php/index/banner';
location.href = '/admin.php/index/getHouseList';
}else {
alert(data['msg']);
};
......
......@@ -16,13 +16,33 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
user.getList();
user.event();
//时间控件初始化
/* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
//bootstrap 时间控件选择
//汉化实现
;(function($){
$.fn.datetimepicker.dates['zh-CN'] = {
days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
months: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
monthsShort: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"],
today: "今日",
suffix: [],
meridiem: ["am", "pm"],
weekStart: 1,
};
}(jQuery));
$(".form_datetime").datetimepicker({
//format: 'yyyy-mm-dd hh:ii:ss',
format: 'yyyy-mm-dd hh:ii:00',
autoclose: true,
language: 'zh-CN',
pickTime: false
}).on('changeDate',function(){
$(this).datetimepicker('hide');
});*/
minView: 0,
minuteStep: 30
//hourStep: 1
});
},
event: function() {
var _doc = $(document);
......@@ -118,12 +138,16 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
document.getElementById("add_user_form").reset();
});
// ===========================新增客户====================
//新增客户
$(document).delegate("#add_user", "click", function() { //新增客户
user.user_id = $(this).attr("data-id");
user.add_user();
});
//点击新增客户 清除id
$(document).delegate(".add-user-new", "click", function() { //新增客户
user.agent_id='';
});
// 跟进的提交按钮 点击
$(document).delegate("#edit_add", "click", function(e) {
e.preventDefault();
......@@ -140,8 +164,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
user.user_phone = $(this).attr("data-phone");
user.Caozuo();
});
$(document).on("input", "#set_father_id3", function() { //手机号搜索客方
$(document).on("input", "#set_father_id3", function() { //手机号新增搜索客方
if($("#set_father_id3").val() == '') {
user.agent_id='';
$(".user-ul").html('');
} else {
user.search_phone();
......@@ -170,14 +195,15 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}
});
$(document).on("input", "#cus_fang", function() { //手机号搜索客方2
$(document).on("input", "#cus_fang", function() { //手机号搜索客方2 编辑
if($("#cus_fang").val() == '') {
user.agent_id2='';
$(".user-ul2").html('');
} else {
user.search_phone2();
}
});
$(document).delegate(".addphone", "click", function() { //list消失
$(document).delegate(".addphone", "click", function() { //list消失新增客户 点击li事件 获取id ul消失
user.addphone(this);
});
$(document).delegate(".addphone2", "click", function() { //list2消失
......@@ -254,22 +280,19 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
_this.parent().prev().val(_this.html()).attr('data-id', _this.attr('data-id'));
_this.parent().html('').hide();
});
// ===================
},
addphone: function(obj) {
addphone: function(obj) {//新增客户 input赋值
var user_ht = $(obj).html();
$("#set_father_id3").val(user_ht);
$(".user-ul").html('');
user.agent_id = $(obj).attr("data-id");
},
addphone2: function(obj) {
var user_ht = $(obj).html();
$("#cus_fang").val(user_ht);
$(".user-ul2").html('');
user.agent_id2 = $(obj).attr("data-id");
},
//约带看 商铺名称搜索
addphone3: function(obj) {
......@@ -286,7 +309,6 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
arr_look[i]=$('.look-shop').eq(i).attr('data-id');
}
}
// if(user_info_obj.id==1){
// alert('当前用户没有权限提交约带看');
......@@ -296,18 +318,16 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
if(arr_look.length<0||arr_look.length==0){
alert('请选择约带看商铺');
return false;
}
if($("#look_shop_date").val()==''){
var look_shop_date_val = $("#look_shop_date").val();
if(look_shop_date_val==''){
alert('请选择预计到场时间');
return false;
}
var start_ = $("#look_shop_date").val()+":00";
var start_a=start_.replace('T',' ');
console.log(start_a);
date_start =new Date(Date.parse(start_a.replace(/-/g, "/")));
var start_time =date_start.getTime()*0.001;
// 2018-07-14T09:06 00:00:00
var _temp_date =new Date(look_shop_date_val+':000');//格式为2018-07-14 10:30:05:000
console.log(_temp_date);
var start_time = _temp_date.getTime();
console.log(start_time);
if(!user.isAjaxSaving){
user.isAjaxSaving = true;
$.ajax({
......@@ -347,7 +367,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}
},
search_phone: function() { //手机号
search_phone: function() { //手机号新增客户
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
......@@ -371,7 +391,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}
});
},
search_phone2: function() { //手机号
search_phone2: function() { //手机号 编辑是 客方搜索
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
......@@ -571,7 +591,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}
});
},
// ====================新增客户页面==================
// 新增客户页面
Caozuo: function() { //获取跟进详情的数据
$.ajax({
'type': 'GET',
......@@ -701,8 +721,8 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
params.id = 0;
params.user_name = $("#add_user_form input[name='user_name']").val();
params.user_phone = $("#add_user_form input[name='user_phone']").val();
params.agent_id = user.agent_id; //客方
params.sex = $("#user_sex option:selected").val();
params.agents_id = user.agent_id; //客方
params.sex = $("#user_sex").val();
params.price_demand = $("#price_type2").val();
params.area_demand = $("#area_type2").val();
params.industry_type = $("#industry_type2").val();
......@@ -713,9 +733,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
$("input[name='user_name']").focus();
return;
}
if(params.vip=='') {
alert('请选择vip');
$("#user_vip").focus();
if(params.sex == '') {
alert('请选择性别');
$("#user_sex").focus();
return;
}
if(params.user_phone == '') {
......@@ -733,6 +753,33 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
$("input[name='user_phone']").focus();
return;
}
if(params.industry_type == '') {
alert('请选择业态');
$("#industry_type2").focus();
return;
}
if(params.price_demand == '') {
alert('请选择价格');
$("#price_type2").focus();
return;
}
if(params.area_demand == '') {
alert('请选择面积');
$("#area_type2").focus();
return;
}
if($('#set_father_id3').val()== '') {
alert('请选择客方');
$("#set_father_id3").focus();
return;
}
if(params.vip=='') {
alert('请选择vip');
$("#user_vip").focus();
return;
}
$.ajax({
url: '/index/pcEditClient',
......@@ -742,8 +789,9 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
dataType: 'json',
success: function(data) {
if(data.code == 200) {
alert('提交成功');
user.getList(1);
alert('提交成功')
$("#modal_add_user").modal('hide');
// document.getElementById("add_user_form").reset();
} else {
alert(data.msg);
......@@ -789,30 +837,23 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
getGenjincon: function() {//获取客户动态
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({
// url: '/index/useraction_search',
url: 'broker/useraction_search',
url:'/broker/useraction_search',
// url: 'https://pre2.tonglianjituan.com'+'/broker/useraction_search',
type: 'GET',
async: true,
data: {
"AuthToken": user_info_obj.AuthToken,
"searchdate": 1,
"user_id": user.user_id,
"pagenum": 1,
"agent_id": user_info_obj.id
},
// AuthToken true string token
//user_id true int 客户的ID
//searchdate true int 动态关键字
//pagenum false int 页码:默认第一页
//agent_id true int 经纪人id
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
//客户动态 即跟进
var caozuo_table = "";
$.each(data['data']['user_date'], function(i, item) {
caozuo_table += '<tr><td>' + item.content + '</td><td>' + item.agentinfo + '</td><td>' + item.create_time + '</td></tr>';
caozuo_table += '<tr><td>' + item.step + '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
});
if(caozuo_table){
$("#caozuo_table2").html(caozuo_table);
......
......@@ -4,6 +4,9 @@
<td>[%= it[item]['id'] %]</td>
<td>
[% if(it[item]["user_name"] != null) { %] [%= it[item]["user_name"] %] [% } %]
[% if(it[item]["vip"] == 1) { %]
<span class="btn1 btn-danger btn-xs">vip</span>
[% } %]
</td>
<td>[%= hideTel(it[item]["user_phone"]) %]</td>
<td>[%= it[item]["create_time"] %]</td>
......@@ -26,7 +29,7 @@
[% if (it[item]['first_login_time'] != null){ %] [%= it[item]["first_login_time"] %] [% } %]
</td>
<td>
[% if((check_auth('auth_vip ') && it[item]['vip']) || (it[item]['agent_id'] == it[item]['current_agent_id']) || (check_auth('index/pcEditClient'))) { %]
[% if((check_auth('auth_vip') && it[item]['vip']) || (it[item]['agent_id'] == 0) || (it[item]['agent_id'] == it[item]['current_agent_id']) || check_auth('index/pcEditClient') ) { %]
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>
详细信息
</a>
......
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