Commit 3275c20e authored by clone's avatar clone

Merge branch '0709-v.2.3.1' into test

# Conflicts: # application/index/controller/Member.php # public/resource/template/user_template_tpl.html
parents f5de51a8 170b65b2
......@@ -16,6 +16,7 @@ use app\api_broker\extend\Basic;
use app\api_broker\service\OrderLogService;
use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\ACollectUser;
use app\model\GOperatingRecords;
use app\model\NoteLog;
use app\model\UPhoneFollowPp;
......@@ -415,6 +416,8 @@ class Broker extends Basic
}
}
/**
* 客户动态展示加搜索加客户详情
*
......@@ -476,6 +479,18 @@ class Broker extends Basic
$data['user_date'] = $orderLog->selectListByUserId($user_id, '');
$data['user_history'] = $records_result;
$data['agent_path'] = AGENTHEADERIMGURL;
//是否被收藏
$data["is_collect"] = 2;
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["agent_id"];
$get_params['user_id'] = $params["user_id"];
$collect_house = new ACollectUser();
$res = $collect_house->getCollectUser($field,$get_params);
if($res && ($res[0]['status'] == 1)){//如果存在
$data["is_collect"] = 1;
}
return $this->response("200", "success!", $data);
}
......
......@@ -9,14 +9,10 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\CallPhoneService;
use app\api_broker\untils\PlsDemo;
use app\api_broker\untils\RongDemo;
use app\extra\RedisExt;
use app\model\AAgentsPhone;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\SecretReport;
use think\Log;
class CellPhone extends Basic
{
......@@ -29,145 +25,22 @@ class CellPhone extends Basic
* 解绑之后有延迟(15s)
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bindAXB()
{
header('Access-Control-Allow-Origin:*');
if (empty($this->params['phone_a']) || empty($this->params['phone_b'])) {
$this->code = 101;
$this->msg = 'phone_a or phone_b is null';
return $this->response(101, '参数错误,请联系运营人员!');
}
$phone_a = $this->params['phone_a'];//经纪人手机号
$phone_b = $this->params['phone_b'];//客户手机号
$record = true; //是否录音
$redis = RedisExt::getRedis();
$is_privacy = $redis->get('s_is_privacy');
//0不使用隐私号码 1阿里云 2容联云
if ($is_privacy == 0) {
$this->data = [ 'phone' => $phone_b ];
$m_report = new SecretReport();
$report_data['phone_no'] = $phone_a;
$report_data['secret_no'] = $phone_b;
$report_data['peer_no'] = $phone_b;
$report_data['call_type'] = 1;
$report_data['record_down'] = 3;
$m_report->editData($report_data); //记录不使用隐号拨打记录
return $this->response($this->code, $this->msg, $this->data);
}
$bind = new BindingPhone();
$where['a.status'] = 1;
$where['a.phone_a'] = $phone_a;
$where['a.phone_b'] = $phone_b;
$where['a.type'] = $is_privacy;
$phone_x = $bind->getPhoneX('b.phone_x', $where); //已经绑定的返回隐私号码
if (!empty($phone_x['phone_x'])) {
$this->data = [ 'phone' => $phone_x['phone_x'] ];
$this->msg = '已绑定,返回隐私号码。';
return $this->response($this->code, $this->msg, $this->data); //绑定过了,返回隐号
}
$call = new CallPhoneService();
$result = $call->bindAXB($this->params['phone_a'], $this->params['phone_b']);
$day_num = $redis->get('s_day_num');
$release = 1; //是否释放
if (empty($day_num)) {
$time = _EXPIRATION;
if ($result['status'] == 'success') {
$this->msg = $result['msg'];
$this->data['phone'] = $result['phone'];
} else {
if (empty($this->params['landlord'])) {
$time = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
} else {
$day_num = $redis->get('s_landlord_phone_day');
if ($day_num == 0) {
$time = date('Y-m-d H:i:s', time() + 5);
$release = 0;
} else {
$time = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
}
}
}
if ($is_privacy == 1) {
/*阿里云*/
try {
$result = PlsDemo::bindAxb($phone_a, $phone_b, $time, $record);
} catch (\Exception $e) {
return $this->response(101, '参数异常,无法呼叫,请联系运营人员!');
}
if ($result->Code == 'OK') {
//记录绑定
$bind->recordBindPhone($result->SecretBindDTO->SecretNo, $phone_a, $phone_b, $record, $time, $result, '', $is_privacy, $release);
$this->msg = '绑定成功。';
$this->data = [ 'phone' => $result->SecretBindDTO->SecretNo ];
} elseif ($result->Code == 'isv.NO_AVAILABLE_NUMBER') {
$this->code = 101;
$this->msg = '号码使用完,请联系运营人员。';
$this->data = [];
} else {
$this->code = 101;
$this->msg = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
$this->data = [];
}
} else {
/*容联云*/
$Rong = new RongDemo();
$record2 = empty($this->params['record']) ? 'true' : 'false'; /* 是否录音(容联云规定string类型)*/
$aliYunPhone = new AliYunPhone();
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
/*绑定成功*/
if ($result['statusCode'] == '000000') {
$bind->recordBindPhone($phone_x['phone_x'], $phone_a, $phone_b, $record, $time, 0, $result['data']['mappingId'], $is_privacy, $release); //记录绑定
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
//尝试5次再绑定
for ($i = 0; $i < 5; $i++) {
$phone_x = $aliYunPhone->getAliYunPhone($phone_a, $phone_b, $is_privacy, $phone_x_arr); //获取未绑定隐号
$result = $Rong->setNumber($phone_a, $phone_b, $phone_x['phone_x'], $phone_x['area'], $time, $record2);
if ($result['statusCode'] == '000000') {
$bind->recordBindPhone($phone_x['phone_x'], $phone_a, $phone_b, $record, $time, 0, $result['data']['mappingId'], $is_privacy, $release); //记录绑定
$this->msg = '绑定成功';
$this->data = [ 'phone' => $phone_x['phone_x'] ];
return $this->response($this->code, $this->msg, $this->data);
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
}
}
//绑定失败返回错误信息
$this->code = 101;
$this->msg = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
}
$this->msg = $result['msg'];
$this->code = 101;
}
Log::write(json_encode($result), 'AliYunBindAxb'); //记录日志
return $this->response($this->code, $this->msg, $this->data);
}
......@@ -214,58 +87,16 @@ class CellPhone extends Basic
public function agentsUnBind()
{
header('Access-Control-Allow-Origin:*');
$phone_x = $this->params['phone_x'];
$phone_a = $this->params['phone_a'];
$phone_b = $this->params['phone_b'];
if (empty($phone_x) || empty($phone_a) || empty($phone_b)) {
$this->code = 101;
$this->msg = '解除关系参数错误,请联系运营人员!';
return $this->response($this->code, $this->msg);
}
$phone = new BindingPhone();
$redis = RedisExt::getRedis();
$is_privacy = $redis->get('s_is_privacy');
$is_privacy = $is_privacy != '0' ? $is_privacy : 0;
if ($is_privacy == 1) {
/*阿里云*/
$subsId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'subsId');
if ($subsId) {
$result = PlsDemo::unbindSubscription($subsId, $phone_x);/*解绑*/
if ($result->Message == 'OK') {
$phone->unBind($phone_x, $phone_a, $phone_b);
} else {
$this->code = 101;
$this->msg = '解除绑定关系失败,请联系运营!';
}
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
}
} elseif ($is_privacy == 2) {
/*容联云*/
$mappingId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'mappingId');
$Rong = new RongDemo();
if ($mappingId) {
$result = $Rong->releaseNumber($mappingId);/*解绑*/
if ($result['statusCode'] == '000000') {
$phone->unBind($phone_x, $phone_a, $phone_b);
} else {
$this->code = 101;
$this->msg = '解除绑定关系失败,请联系运营!';
}
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
}
$call = new CallPhoneService();
$result = $call->agentsUnBind($this->params['phone_a'], $this->params['phone_b']);
if ($result['status'] == 'success') {
$this->msg = $result['msg'];
$this->data['phone'] = $result['phone'];
} else {
$this->code = 200;
$this->msg = '没有号码绑定关系,请忽略!。';
$this->msg = $result['msg'];
$this->code = 101;
}
return $this->response($this->code, $this->msg);
......
......@@ -8,6 +8,9 @@ use app\model\AAgents;
use app\model\ULabels;
use app\model\Users;
use app\model\UPhoneFollowPp;
use app\model\AuthGroup;
use app\model\AuthRule;
use app\api_broker\service\VipService;
/**
* Created by PhpStorm.
......@@ -150,6 +153,11 @@ class Client extends Basic
$data['msg'] = '';
$time = date("Y-m-d H:i:s",time());//当前时间
$params = $this->request->param();
$params['type'] = 0;
$params['agent_id'] = '5775';
if(empty($params['agent_id'])){
return $this->response(100,'参数不全');
}
......@@ -160,7 +168,7 @@ class Client extends Basic
//条件
//time_minute_diff 时间差(分)48小时内增加的【拥有经纪人】的客户为--受保护客户
$field = ['id as user_id','user_name','user_phone','agent_id','referrer_id','create_time',"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff"];
$field = ['id as user_id','user_name','user_phone','agent_id','referrer_id','create_time',"TIMESTAMPDIFF(MINUTE,create_time,'{$time}')as time_minute_diff",'vip'];
$where = " agent_id in({$params['agent_id']}) and user_status={$type}";
if(!empty($params['search'])){
......@@ -176,11 +184,17 @@ class Client extends Basic
$total = $table->getMyUserCount($where);
$data['total'] = ceil($total / $pageSize);
$data['page'] = $pageNo;
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
return $this->response(200,'成功',$data);
}
/**搜索客户跟进
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
......@@ -349,6 +363,9 @@ class Client extends Basic
$data['pagenum'] = $pagenum;
$data['total'] = $total;
$data['search_type'] = $search_type;
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
return $this->response("200", "success!", $data);
}
......
......@@ -9,6 +9,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\model\ACollectHouse;
use think\Request;
......@@ -95,25 +96,48 @@ class CollectHouse extends Basic
return $this->response("101", "请求参数错误");
}
$field = 'CollectUser.id,';
$field .= 'Houses.internal_title,';
$field .= 'Houses.market_area,';
$field .= 'Houses.rent_type,';
$field .= 'Houses.rent_price,';
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
/**
* id : 4
* title : vvvv
* business_district_id : 0
* status : 1
* industry_type : 百货零售,其他
* shop_area_start : 6
* shop_area_end : 7
* shop_type : 0
* shop_sign : 办公室配套,5A景区游客量大,超高佣金,居民区十字路口
* rent_type : 2
* rent_price : 11
* is_look : true
*/
$field = 'CollectUser.id as collect_user_id,';
$field .= 'Houses.id,';
$field .= 'Houses.internal_title as title,';
$field .= 'Houses.business_district_id,';
$field .= 'Houses.status,';
$field .= 'Houses.industry_type,';
$field .= 'Houses.shop_area_start,';
$field .= 'Houses.shop_area_end,';
$field .= 'Houses.shop_sign';
$field .= 'Houses.shop_type,';
$field .= 'Houses.shop_sign,';
$field .= 'Houses.rent_type,';
$field .= 'Houses.rent_price';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectHouse->getCollectList($field,$get_params);
$get_params['CollectUser.status'] = 1;
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$look_shop_service = new LookShopService();
foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]);
$res[$key]["is_look"] = $isLook;
}
//dump($res);
if ($res) {
return $this->response("200", "成功",$res);
} else {
return $this->response("101", "失败");
}
return $this->response("200", "成功",$res);
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\model\ACollectUser;
use think\Request;
......@@ -34,6 +35,7 @@ class CollectUser extends Basic
*/
public function addCollectUser()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
......@@ -96,20 +98,26 @@ class CollectUser extends Basic
if (!isset($params["agents_id"])) {
return $this->response("101", "请求参数错误");
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = 'CollectUser.id,';
$field .= 'CollectUser.status,';
$field .= 'Users.id AS user_id,';
$field .= 'Users.user_nick,';
$field .= 'Users.user_name,';
$field .= 'Users.user_phone,';
$field .= 'Users.agent_id,';
$field .= 'Users.user_status,';
$field .= 'Users.industry_type,';
$field .= 'Users.price_demand,';
$field .= 'Users.vip,';
$field .= 'Users.area_demand';
$get_params['agents_id'] = $params["agents_id"];
$res = $this->aCollectUser->getCollectList($field,$get_params);
$get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1;
$res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params);
foreach($res as $k=>$v)
{
$label = [];
......@@ -121,14 +129,16 @@ class CollectUser extends Basic
if($v['user_status'] != -1){
$res[$k]['label'] = implode(',',$label);
}
}
//dump($res);
if ($res) {
return $this->response("200", "成功",$res);
} else {
return $this->response("101", "失败");
}
$data['user_date']=$res;
//dump($res);
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agents_id']);
return $this->response("200", "成功",$data);
}
}
\ No newline at end of file
......@@ -659,6 +659,7 @@ class OrderLog extends Basic
*/
public function getListByHouseId()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"house_id"=>1
......
......@@ -102,7 +102,8 @@ class Report extends Basic
$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";
$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_->orderList($field, $params, $pageNo, $pageSize);
......@@ -131,7 +132,7 @@ class Report extends Basic
if (!isset($params["agent_id"])) {
return $this->response("101", "请求参数错误");
}
if(isset($params["house_id"])){
if (isset($params["house_id"])) {
$agent_id = $params["agent_id"];
$house_id = $params["house_id"];
......
......@@ -5,6 +5,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\VerifyService;
use app\model\ACollectHouse;
use app\model\AttentionModel;
use app\model\GHouses;
use app\model\GHousesFollowUp;
......@@ -13,6 +14,7 @@ use app\model\OBargainModel;
use app\model\Regions;
use think\Log;
/**
* Created by PhpStorm.
* User : zw
......@@ -45,6 +47,8 @@ class Shop extends Basic
*/
public function getShopList()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
"site_area" => 4, //来源 1c首页 2c搜索 3b首页 4b搜索 5b报备
// "title" => "vv", //1,2 external_title ,3,4internal_title
......@@ -66,8 +70,6 @@ class Shop extends Basic
"pageNo" => 1,
"pageSize" => 15
);*/
$params = $this->params;
$conditions = [];
if (empty($params['site_area'])) {
return $this->response("101", "请求来源不能为空");
......@@ -226,8 +228,7 @@ class Shop extends Basic
header('Access-Control-Allow-Origin:*');
/* $params = array(
"id" => 3084,
"site_area" => 3, //1.c端 3.b端
"site_area" => 1, //1.c端 3.b端
"site_area" => 3, //1.c端 3.b端 4.pc端
//"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$params = $this->params;
......@@ -249,12 +250,22 @@ class Shop extends Basic
b.auditorium,b.tiny_brochure_url,b.start_business_date,b.fee_rule";
$conditions['a.status'] = array( "eq", 1 );
$conditions['a.is_show'] = array( 'eq', 0 ); //c端只显示公开楼盘
} else {
} else if ($params['site_area'] == 3) {
$field = "a.id,a.internal_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.internal_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone";
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone
";
$conditions['a.status'] = array( "neq", 3 );
} else {
$field = "a.id,a.internal_title,a.internal_address,a.external_title,a.external_address,
a.city,a.disc,a.business_district_id,a.status,a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,
a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.rent_price,a.management_fee,a.slotting_fee,
a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,a.is_show,a.is_exclusive_type,
b.enter_num,b.internal_item_advantage as item_advantage, b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,a.upload_id,b.fee_rule,b.landlord_remark,a.create_time,b.landlord_phone
,a.update_time,b.agent_start_time,b.agent_end_time,b.internal_item_advantage,b.external_item_advantage";
$conditions['a.status'] = array( "neq", 3 );
}
......@@ -287,7 +298,7 @@ class Shop extends Basic
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);
$result["plan_images"] = [];
if ($params['site_area'] == 3) {
if ($params['site_area'] == 3 || $params["site_area"] == 4) {
$result['landlord_phone'] = json_decode($result['landlord_phone'], true);
$result['create_time'] = date('Y-m-d', strtotime($result['create_time']));
}
......@@ -316,7 +327,7 @@ class Shop extends Basic
// 计数开始
if ($params["site_area"] == 3 && $result) {
if ($params["site_area"] == 3 || $params["site_area"] == 4 && $result) {
$lookShopArr = $this->lookShopService_->countLookShopNum((int)$this->agentId, (int)$params["id"]);
//判断看铺数量是否上限
if ($lookShopArr) {
......@@ -329,6 +340,20 @@ class Shop extends Basic
}
}
//是否被收藏
$result["is_collect"] = 2;
if ($params['site_area'] == 3) {
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["user_id"];
$get_params['house_id'] = $params["id"];
$collect_house = new ACollectHouse();
$res = $collect_house->getCollectHouse($field,$get_params);
if($res && ($res[0]['status'] == 1)){//如果存在
$result["is_collect"] = 1;
}
}
return $this->response("200", 'request success', $result);
}
......@@ -483,6 +508,7 @@ class Shop extends Basic
*/
public function addShopFollowUp()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"house_id" => 1,
......
......@@ -3,6 +3,7 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VipService;
use app\model\Users;
use think\Request;
......@@ -72,7 +73,7 @@ class User extends Basic
"pageSize" => 15,
"status" => -1,
);*/
$field = "id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand";
$field = "id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip";
$conditions = [];
......@@ -121,8 +122,10 @@ class User extends Basic
if (empty($userList)) {
return $this->response("200", "此条件没有找到数据");
}
return $this->response("200", 'request success', ["user_date"=>$userList]);
$vip_services = new VipService();
$data['examine_vip'] = $vip_services->vip($params['agent_id']);
$data['user_date'] = $userList;
return $this->response("200", 'request success', $data);
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/7/9
* Time: 16:28
*/
namespace app\api_broker\service;
use app\api_broker\untils\PlsDemo;
use app\api_broker\untils\RongDemo;
use app\extra\RedisExt;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\SecretReport;
use think\Log;
class CallPhoneService
{
private $phone_a = '';
private $phone_b = '';
private $phone_x = '';
private $expiry_date = '';
private $record = true;
private $release = 1;
private $subs_id = '';
private $request_id = '';
private $mapping_id = '';
private $is_privacy = 0; //0直接拨打号码1阿里云隐私号码2容联云隐私号码
/**
* 绑定AXB手机号
* 绑定手机号
* 解绑之后有延迟(15s)
*
* @param $phone_a
* @param $phone_b
* @param bool $record
* @return mixed
*/
public function bindAXB($phone_a, $phone_b, $record = true)
{
$result['status'] = 'failed';
if (empty($phone_a) || empty($phone_b)) {
$result['msg'] = '参数错误,请联系运营人员!';
return $result;
}
if ((strlen($phone_a) != 11) || (strlen($phone_b) != 11)) {
$result['msg'] = '号码格式错误,请重新填写!';
return $result;
}
$call_phone = [];
$this->phone_a = $phone_a;//经纪人手机号
$this->phone_b = $phone_b;//客户手机号
$this->record = $record; //是否录音
try {
$redis = RedisExt::getRedis();
$this->is_privacy = $redis->get('s_is_privacy');
//0不使用隐私号码 1阿里云 2容联云
if ($this->is_privacy == 0) {
$this->originalPhone();
$result['status'] = 'success';
$result['phone'] = $phone_b;
return $result;
}
$bind = new BindingPhone();
$where['a.status'] = 1;
$where['a.phone_a'] = $phone_a;
$where['a.phone_b'] = $phone_b;
$where['a.type'] = $this->is_privacy;
$phone_x = $bind->getPhoneX('b.phone_x', $where); //已经绑定的返回隐私号码
if (!empty($phone_x['phone_x'])) {
$result['status'] = 'success';
$result['phone'] = $phone_x['phone_x'];
$result['msg'] = '已绑定,返回隐私号码。';
return $result; //绑定过了,返回隐号
}
$day_num = $redis->get('s_day_num');
$this->release = 1; //是否释放
if (empty($day_num)) {
$this->expiry_date = _EXPIRATION;
} else {
if (empty($this->params['landlord'])) {
$this->expiry_date = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
} else {
$day_num = $redis->get('s_landlord_phone_day');
if ($day_num == 0) {
$this->expiry_date = date('Y-m-d H:i:s', time() + 5);
$this->release = 0;
} else {
$this->expiry_date = date('Y-m-d H:i:s', strtotime("+{$day_num} day"));
}
}
}
if ($this->is_privacy == 1) {
/*阿里云*/
$call_phone = $this->aliYunBind();
if ($call_phone['status'] == 'success') {
$result['status'] = 'success';
$result['phone'] = $call_phone['phone'];
$result['msg'] = $call_phone['msg'];
$type = 'AliYunBindAxb';
} else {
$result['msg'] = $call_phone['msg'];
}
} elseif ($this->is_privacy == 2) {
$call_phone = $this->yunTongXun();
if ($call_phone['status'] == 'success') {
$result['status'] = 'success';
$result['phone'] = $call_phone['phone'];
$result['msg'] = $call_phone['msg'];
$type = 'YunTongXunBindAxb';
} else {
$result['msg'] = $call_phone['msg'];
}
}
if ($result['status'] == 'success')
$bind->recordBindPhone($call_phone['phone'], $phone_a, $phone_b, $record, $this->expiry_date, $this->subs_id, $this->request_id, $this->mapping_id, $this->is_privacy, $this->release);
Log::write(json_encode($result), $type); //记录日志
} catch (\Exception $e) {
$data['status'] = 'failed';
$data['msg'] = $e->getMessage();
}
return $result;
}
/**
* 解除绑定关系
*
* @param $phone_a
* @param $phone_b
* @param $phone_x
* @return mixed
*/
public function agentsUnBind($phone_a, $phone_b, $phone_x)
{
$data['status'] = 'success';
$data['msg'] = '';
if (empty($phone_x) || empty($phone_a) || empty($phone_b)) {
$data['status'] = 'failed';
$data['msg'] = '解除关系参数错误,请联系运营人员!';
return $data;
}
$phone = new BindingPhone();
$redis = RedisExt::getRedis();
$is_privacy = $redis->get('s_is_privacy');
$is_privacy = $is_privacy != '0' ? $is_privacy : 0;
try {
if ($is_privacy == 1) {
/*阿里云*/
$subsId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'subsId');
if ($subsId) {
$result = PlsDemo::unbindSubscription($subsId, $phone_x);/*解绑*/
if ($result->Message == 'OK') {
$phone->unBind($phone_x, $phone_a, $phone_b);
} else {
$data['status'] = 'failed';
$data['msg'] = '解除绑定关系失败,请联系运营!';
}
} else {
$data['msg'] = '没有号码绑定关系,请忽略!';
}
} elseif ($is_privacy == 2) {
/*容联云*/
$mappingId = $phone->getSubsId($phone_x, $phone_a, $phone_b, 1, 'mappingId');
$yun_tong_xun = new RongDemo();
if ($mappingId) {
$result = $yun_tong_xun->releaseNumber($mappingId);/*解绑*/
if ($result['statusCode'] == '000000') {
$phone->unBind($phone_x, $phone_a, $phone_b);
} else {
$data['status'] = 'failed';
$data['msg'] = '解除绑定关系失败,请联系运营!';
}
} else {
$data['msg'] = '没有号码绑定关系,请忽略!。';
}
} else {
$data['msg'] = '没有号码绑定关系,请忽略!。';
}
} catch (\Exception $e) {
$data['status'] = 'failed';
$data['msg'] = $e->getMessage();
}
return $data;
}
/**
* @return mixed|\SimpleXMLElement
*/
public function aliYunBind()
{
$data['status'] = 'failed';
try {
$result = PlsDemo::bindAxb($this->phone_a, $this->phone_b, $this->expiry_date, $this->record);
if ($result->Code == 'OK') {
$data['status'] = 'success';
$data['msg'] = '绑定成功。';
$data['phone'] = $result->SecretBindDTO->SecretNo;
$this->subs_id = $result->SecretBindDTO->SubsId;
$this->request_id = $result->RequestId;
} elseif ($result->Code == 'isv.NO_AVAILABLE_NUMBER') {
$data['msg'] = '号码使用完,请联系运营人员。';
} else {
$data['msg'] = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
}
} catch (\Exception $e) {
$data['msg'] = '参数异常,无法呼叫,请联系运营人员!';
}
return $data;
}
/**
* 容联云
*
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function yunTongXun()
{
$yun_tong_xun = new RongDemo();
if ($this->record) {
$record = 'true';
} else {
$record = 'false';
}
$aliYunPhone = new AliYunPhone();
$phone_x = $aliYunPhone->getAliYunPhone($this->phone_a, $this->phone_b, $this->is_privacy); //获取未绑定隐号
$result = $yun_tong_xun->setNumber($this->phone_a, $this->phone_b, $phone_x['phone_x'], $phone_x['area'], $this->expiry_date, $record);
/*绑定成功*/
if ($result['statusCode'] == '000000') {
$data['status'] = 'success';
$data['msg'] = '绑定成功。';
$data['phone'] = $phone_x['phone_x'];
$this->mapping_id = $result['data']['mappingId'];
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
//尝试5次再绑定
for ($i = 0; $i < 5; $i++) {
$phone_x = $aliYunPhone->getAliYunPhone($this->phone_a, $this->phone_b, $this->is_privacy, $phone_x_arr); //获取未绑定隐号
$result = $yun_tong_xun->setNumber($this->phone_a, $this->phone_b, $phone_x['phone_x'], $phone_x['area'], $this->expiry_date, $record);
if ($result['statusCode'] == '000000') {
$data['status'] = 'success';
$data['msg'] = '绑定成功。';
$data['phone'] = $phone_x['phone_x'];
$this->mapping_id = $result['data']['mappingId'];
break;
} else {
$phone_x_arr[] = $phone_x['phone_x']; //剔除绑定失败的中间号
}
}
//绑定失败返回错误信息
$data['status'] = 'failed';
$data['msg'] = '拨号失败,15秒再试,再无法拨号请联系请联系运营人员!';
}
return $data;
}
/**
* 直接拨打号码记录
*
* @return false|int
*/
private function originalPhone()
{
$m_report = new SecretReport();
$report_data['phone_no'] = $this->phone_a;
$report_data['secret_no'] = $this->phone_b;
$report_data['peer_no'] = $this->phone_b;
$report_data['call_type'] = 1;
$report_data['record_down'] = 3;
return $m_report->editData($report_data); //记录不使用隐号拨打记录
}
}
\ No newline at end of file
<?php
namespace app\api_broker\service;
use app\model\AAgents;
use app\model\AuthGroup;
use app\model\AuthRule;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018-07-10
* Time: 17:09:38
*/
class VipService
{
/**
* 是否具有查看vip客户权限
*
*/
public function vip($id)
{
//$id= 5743;
$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;
$fields='rules';
$rules = $auth_group->getAuthGroupById($id, $fields);
$auth_group = New AuthRule();
$name= 'auth_vip';
$fields='id';
$sauth_ruel_id = $auth_group->getAuthRuleByName($name, $fields);
$rules_arr = explode(',',$rules);
if (in_array($sauth_ruel_id, $rules_arr)) {
return 0;
} else {
return 1;
}
}
}
\ No newline at end of file
......@@ -177,6 +177,11 @@ class Index
{
return view('index/bargaininfo_detail_pc');
}
public function shop_detail_pc()
{
return view('index/shop_detail_pc');
}
public function customerinfo_details_new()
{
......
......@@ -102,8 +102,9 @@
</div>
<div class="bottom-btn-area">
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/but_genjin_new.png" /></a>
<a href="javascript:;" id="mark_btn" data-ismark="0"><img src="/app/images/icon_collection@2x.png" /></a>
<a href="javascript:;" id="baobei_btn"><img src="/app/images/img_look01@2x.png" /></a>
<a href="javascript:;" id="genjin_btn"><img src="/app/images/img_followup01@2x.png" /></a>
</div>
<div id="genjin_modal">
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>同联商业</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
</head>
<body style="display: none;">
<div id="app">
<main>
<section v-if="d.lookShopArr && (d.lookShopArr.isPanParty || (d.lookShopArr.residue_num>0))">
<table>
<tbody>
<tr>
<td>商铺编号:{{d.id}}</td>
<td>商铺类型:{{d.shop_type?'街铺':'商场'}}</td>
<td>是否对客户展示:{{d.is_show?'否':'是'}}</td>
<td>是否独家:{{d.is_exclusive_type?'是':'否'}}</td>
</tr>
<tr>
<td>{{dealPrice}}</td>
<td>{{d.shop_type?'转让费':'进场费'}}:{{d.slotting_fee}}元</td>
<td>物业管理费:{{d.management_fee}}元/月</td>
<td></td>
</tr>
<tr>
<td>商铺面积:{{dealArea}}</td>
<td>项目总面积:{{d.market_area}}</td>
<td>剩余铺数:{{d.residue_num}}</td>
<td>总铺数:{{d.total}}</td>
</tr>
<tr>
<td>业态:{{d.industry_type}}</td>
<td>已入驻:{{d.enter_num}}</td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2">对内商铺名称:{{d.internal_title}}</td>
<td colspan="2">对内商铺地址:{{d.province}}{{d.city+d.disc+d.internal_address}}</td>
</tr>
<tr>
<td colspan="2">交通:{{d.traffic}}</td>
<td colspan="2">签约规则:{{d.sign_rule}}</td>
</tr>
<tr>
<td colspan="2">对内项目优势:{{d.internal_item_advantage}}</td>
<td colspan="2">标签:{{d.shop_sign}}</td>
</tr>
<tr>
<td>营业时间:{{d.do_business_date}}</td>
<td>招商时间:{{d.opening_date}}</td>
<td>开业时间:{{d.start_business_date}}</td>
<td>煤气:{{d.is_has_gas?'没有':'有'}}</td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr>
<td colspan="4" class="oh">
<div class="fl">详情页面轮播图:</div>
<div class="fl">
<ul class="oh img-list">
<li class="fl oh" v-for="(item, index) in d.images" :key="index" :data-id="item.id"><img class="fl" :src="d.api_path+item.img_name" /></li>
</ul>
</div>
</td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr v-if="!d.is_show">
<td colspan="2">对外商铺名称:{{d.external_title}}</td>
<td colspan="2">对外商铺地址:{{d.province}}{{d.city+d.disc+d.external_address}}</td>
</tr>
<tr v-if="!d.is_show">
<td colspan="2">对外项目优势:{{d.external_item_advantage}}</td>
<td colspan="2"></td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr>
<td colspan="4">
<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>
</ul>
</div>
</td>
</tr>
<tr>
<td colspan="4">房东备注:{{d.landlord_remark}}</td>
</tr>
<tr>
<td colspan="4">
<div class="fl">盘方:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.id">{{item.name+'-'+item.phone}}</li>
</ul>
</div>
</td>
</tr>
<tr v-if="false">
<td colspan="4">
<div class="fl">案场权限人:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.phone">{{item.name+'-'+item.phone}}</li>
</ul>
</div>
</td>
</tr>
<tr>
<td>上传时间:{{d.create_time}}</td>
<td>最后编辑时间:{{d.update_time}}</td>
<td v-if="d.is_exclusive_type">独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}</td>
<td v-if="d.is_exclusive_type"><!--独家方:{{d.exclusive_name}}--></td>
</tr>
</tbody>
</table>
</section>
<section v-else>查看数量已达上限</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>
</body>
</html>
\ No newline at end of file
......@@ -8,19 +8,18 @@
namespace app\index\controller;
use app\api_broker\service\CallPhoneService;
use app\api_broker\service\PushMessageService;
use app\index\extend\Basic;
use app\api_broker\untils\PlsDemo;
use app\model\AliYunPhone;
use app\model\BindingPhone;
use app\model\SecretReport;
use think\Db;
use app\model\Users;
class CellPhone extends Basic
{
protected $code = 200;
protected $data = [];
protected $msg = "";
protected $msg = "";
/**
* 总记录列表、搜索
......@@ -30,55 +29,56 @@ class CellPhone extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function callLog() {
public function callLog()
{
if ($this->request->isAjax()) {
$result['code'] = 200;
$result['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$result['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$report = new SecretReport();
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,user_status,a.id,a.create_time,type';
$where = [];
$field = 'agents_id,users_id,call_type,call_time,time,voice_file,user_status,a.id,a.create_time,type';
$where = [];
if (!empty($this->params['start_date'])) {
$where['a.call_time'] = ['> time', $this->params['start_date'] . ' 00:00:00'];
$where['a.call_time'] = [ '> time', $this->params['start_date'] . ' 00:00:00' ];
}
if (!empty($this->params['end_date'])) {
$where['a.call_time'] = ['< time', $this->params['end_date']. ' 23:59:59'];
$where['a.call_time'] = [ '< time', $this->params['end_date'] . ' 23:59:59' ];
}
if (!empty($this->params['start_date']) && !empty($this->params['end_date'])) {
$where['a.call_time'] = ['between', [$this->params['start_date'] . ' 00:00:00',$this->params['end_date'] . ' 23:59:59']];
$where['a.call_time'] = [ 'between', [ $this->params['start_date'] . ' 00:00:00', $this->params['end_date'] . ' 23:59:59' ] ];
}
if (!empty($this->params['call_name'])) {
$where['name'] = ['LIKE', $this->params['call_name'] . '%'];
$where['name'] = [ 'LIKE', $this->params['call_name'] . '%' ];
}
if (!empty($this->params['call_phone'])) {
$where['phone_no'] = ['LIKE', $this->params['call_phone'] . '%'];
$where['phone_no'] = [ 'LIKE', $this->params['call_phone'] . '%' ];
}
if (!empty($this->params['client_phone'])) {
$where['c.user_phone'] = ['LIKE', $this->params['client_phone'] . '%'];
$where['c.user_phone'] = [ 'LIKE', $this->params['client_phone'] . '%' ];
}
if (!empty($this->params['user_nick'])) {
$where['c.user_nick'] = ['LIKE', '%'.$this->params['user_nick'] . '%'];
$where['c.user_nick'] = [ 'LIKE', '%' . $this->params['user_nick'] . '%' ];
}
if (!empty($this->params['call_type'])) {
$where['a.type'] = $this->params['call_type'];
}
$data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['list'] = $report->getCallList($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallListTotal($where);
return $this->response($result['code'], $result['msg'], $data);
} else {
return view('cell_phone/index');
}
}
}
/**
......@@ -89,39 +89,123 @@ class CellPhone extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function callCollectList() {
public function callCollectList()
{
if ($this->request->isAjax()) {
$result['code'] = 200;
$result['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$result['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$report = new SecretReport();
$field = 'a.id,b.phone,sum(time) as time,agents_id,call_type,release_time,start_time';
$where = [];
$field = 'a.id,b.phone,sum(time) as time,agents_id,call_type,release_time,start_time';
$where = [];
if (!empty($this->params['start_date'])) {
$where['create_time'] = ['> time', $this->params['start_date']];
$where['create_time'] = [ '> time', $this->params['start_date'] ];
}
if (!empty($this->params['end_date'])) {
$where['create_time'] = ['< time', $this->params['end_date']];
$where['create_time'] = [ '< time', $this->params['end_date'] ];
}
if (!empty($this->params['agents_name'])) {
$where['realName'] = ['LIKE', $this->params['agents_name'] . '%'];
$where['realName'] = [ 'LIKE', $this->params['agents_name'] . '%' ];
}
if (!empty($this->params['phone'])) {
$where['phone'] = ['LIKE', $this->params['phone'] . '%'];
$where['phone'] = [ 'LIKE', $this->params['phone'] . '%' ];
}
$data['list'] = $report->getCallCollect($pageNo, $pageSize, 'id desc', $field, $where);
$data['list'] = $report->getCallCollect($pageNo, $pageSize, 'id desc', $field, $where);
$data['total'] = $report->getCallCollectTotal($where);
return $this->response($result['code'], $result['msg'], $data);
} else {
return view('cell_phone/agentIndex');
}
}
}
/**
* 绑定手机号
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bindAXB()
{
if (empty($this->params['user_id'])) {
return $this->response(101, '客户id为空');
}
if (empty($this->params['phone_b'])) {
$m_user = new Users();
$user_phone = $m_user->selectUser($this->params['user_id'], 'user_phone');
if (empty($user_phone['user_phone'])) {
return $this->response(101, '没有用户信息');
}
$phone_b = $user_phone['user_phone'];
} else {
$phone_b = $this->params['phone_b'];
}
$call_phone = new CallPhoneService();
$data = $call_phone->bindAXB($this->params['phone_a'], $phone_b);
$result['msg'] = '';
if ($data['status'] == 'success') {
$push = new PushMessageService();
$push->pushMessageById($this->userId, '客户详情', '后台拨打电话推送客户详情', 'user_info', $this->params['user_id']);
$result['code'] = 200;
$result['data']['phone'] = $data['phone'];
} else {
$result['status'] = 101;
$result['msg'] = $data['msg'];
}
return $this->response($result['code'], $result['msg'], $result);
}
/**
* 解除绑定关系
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function agentsUnBind()
{
if (empty($this->params['user_id'])) {
return $this->response(101, '客户id为空');
}
if (empty($this->params['phone_b'])) {
$m_user = new Users();
$user_phone = $m_user->selectUser($this->params['user_id'], 'user_phone');
if (empty($user_phone['user_phone'])) {
return $this->response(101, '没有用户信息');
}
$phone_b = $user_phone['user_phone'];
} else {
$phone_b = $this->params['phone_b'];
}
$call_phone = new CallPhoneService();
$data = $call_phone->agentsUnBind($this->params['phone_a'], $phone_b, $this->params['phone_x']);
$result['msg'] = '';
if ($data['status'] == 'success') {
$result['code'] = 200;
$result['msg'] = '释放成功';
} else {
$result['status'] = 101;
$result['msg'] = $data['msg'];
}
return $this->response($result['code'], $result['msg']);
}
}
\ No newline at end of file
......@@ -81,7 +81,7 @@ class Collection extends Basic
}
if (empty($this->params['excel'])) {
$field = 'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source';
$field = 'a.id,a.father_id,a.order_id,a.create_time,c.user_name,c.user_phone,a.money,a.real_money,a.pay_type,a.house_number,a.type,d.internal_title,d.internal_address,a.source,a.transaction_fee';
$data['data']['list'] = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['data']['total'] = $order->getAddPayLogOrderListLmitTotal($where);
$data['data']['money_total'] = $order->getMoneyTotal(); //总额
......@@ -91,13 +91,13 @@ class Collection extends Basic
} else {
$pageNo = 1;
$pageSize = 50000; //最多5万条数据
$field = 'a.create_time,c.user_name,c.user_phone,e.name,e.phone,f.store_name,g.district_name,a.money,a.real_money,a.type,a.pay_type,d.internal_address,a.house_number,a.source';
$field = 'a.create_time,c.user_name,c.user_phone,e.name,e.phone,f.store_name,g.district_name,a.money,a.real_money,a.transaction_fee,a.type,a.pay_type,d.internal_address,a.house_number,a.source';
$data = $order->getAddPayLogOrderListLmit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data = $this->numberTransitionString($data);
$export = new ExportExcelUntil();
$title = [ '收款时间', '客户姓名', '客户手机号', '约带看人姓名', '约带看人手机号', '约带看人所属门店', '约带看人所属部门', '收款金额(元)', '实付金额(元)', '入账类型','入账方式','商铺地址','商铺号' ];
$title = [ '收款时间', '客户姓名', '客户手机号', '约带看人姓名', '约带看人手机号', '约带看人所属门店', '约带看人所属部门', '收款金额(元)', '实付金额(元)', '手续费(元)', '入账类型','入账方式','商铺地址','商铺号' ];
$export->exportTable('收款记录', $data, 9, '收款记录', $title);
}
......@@ -108,18 +108,27 @@ class Collection extends Basic
public function addRealMoney(){
$params = $this->params;
/* $params = array(
/*$params = array(
"collection_id" => 1,
"real_money" => 123,
"real_money" => 77,
"transaction_fee" => 100,
);*/
if(!isset($params["collection_id"]) || $params["collection_id"] <= 0){
return $this->response("101","请求参数错误");
}
if(!isset($params["real_money"]) || $params["real_money"] <= 0){
if((!isset($params["real_money"]) || $params["real_money"] <= 0) and (!isset($params["transaction_fee"]) || $params["transaction_fee"] <= 0)){
return $this->response("101","请求参数错误");
}
$where_["id"] = $params["collection_id"];
$where_["real_money"] = $params["real_money"];
if(isset($params["real_money"])){
$where_["real_money"] = $params["real_money"];
}
if(isset($params["transaction_fee"])){
$where_["transaction_fee"] = $params["transaction_fee"];
}
$order = new OPayLogModel();
$id = $order->updatePayLog($where_);
if($id > 0 ){
......
......@@ -65,7 +65,7 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$check_status = $this->params['check_status'];
$fields = 'a.id,a.create_time,a.trade_type,b.user_phone,b.user_name,d.internal_title,d.internal_address,
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number';
a.commission,a.practical_fee,a.scale_fee,a.order_no,a.order_id,content,house_number,a.is_open';
$where['a.father_id'] = 0;
// $where['c.is_del'] = 0;
$where['a.status'] = 11;
......@@ -238,7 +238,7 @@ class Finance extends Basic
}
if (empty($this->params['estimated_receipt_date'])) {
return $this->response(101,'预计收款时间为空');
return $this->response(101, '预计收款时间为空');
}
//应收总佣金
......@@ -289,7 +289,7 @@ class Finance extends Basic
if (empty($item['fee']) || empty($item['operation_date'])) {
$update_real_arr[$i]['id'] = $item['fee_id'];
$update_real_arr[$i]['is_del'] = 1;
$log_data[$i] = '[删除实收佣金:'.$item['fee'].',收佣日期'.$item['operation_date'].']'; //
$log_data[$i] = '[删除实收佣金:' . $item['fee'] . ',收佣日期' . $item['operation_date'] . ']'; //
$i++;
} elseif ($item["fee_id"] > 0) {
$update_real_arr[$i]['id'] = $item['fee_id'];
......@@ -304,7 +304,7 @@ class Finance extends Basic
$add_real_arr[$j]['operation_id'] = $this->userId;
$add_real_arr[$j]['money'] = $item['fee'];
$add_real_arr[$j]['income_time'] = $item['operation_date'];
$log_data[$j] = '[新增实收佣金:'.$item['fee'].',收佣日期'.$item['operation_date'].']';
$log_data[$j] = '[新增实收佣金:' . $item['fee'] . ',收佣日期' . $item['operation_date'] . ']';
$j++;
}
}
......@@ -383,10 +383,11 @@ class Finance extends Basic
$data['code'] = 101;
$data['msg'] = 'Id is null.';
} else {
$m_comm = new OBargainModel();
$fields = 'a.id,a.role,a.agent_id,a.scale,a.scale_fee';
$where[0] = [ 'EXP', "a.id = {$this->params['id']} or a.father_id = {$this->params['id']}" ];
$data['data'] = $m_comm->getBargainPartial(1, 100, 'a.id desc', $fields, $where);
$m_comm = new OBargainModel();
$fields = 'a.id,a.role,a.agent_id,a.scale,a.scale_fee,a.father_id';
$where[0] = [ 'EXP', "a.id = {$this->params['id']} or a.father_id = {$this->params['id']}" ];
$where['a.status'] = [ '<>', 30 ];
$data['data'] = $m_comm->getBargainPartial(1, 100, 'a.id desc', $fields, $where);
}
return $this->response($data['code'], $data['msg'], $data['data']);
......@@ -1328,4 +1329,30 @@ class Finance extends Basic
$m_bargain = new OBargainLogModel();
return $m_bargain->addLog($insert_data);
}
/**
* 删除分佣方
*
* @return \think\Response
*/
public function delPartialCommission()
{
if (empty($this->params['partial_id']))
return $this->response(101, '参数错误');
$partial_id = $this->params['partial_id'];
$m_partial = new OBargainModel();
$data['status'] = 30;
$num = $m_partial->updateBargainById($partial_id, $data);
if ($num > 0) {
$result['code'] = 200;
$result['msg'] = '删除成功';
} else {
$result['code'] = 101;
$result['msg'] = '删除失败';
}
return $this->response($result['code'], $result['msg']);
}
}
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/3/13
* Time: 15:48
*/
namespace app\index\controller;
use app\index\extend\Basic;
class HouseFollowUp extends Basic{
//在controller里新增的php文件名
public function followUpList(){
//followUpList 方法
if (!$this->request->isAjax()) {
return view('houses/HouseFollowUp');
//找到view下的 houses 文件夹下的 HouseFollowUp的html 文件
}
}
}
\ No newline at end of file
......@@ -10,6 +10,7 @@ namespace app\index\controller;
use app\api\controller\Sublet;
//use app\api_broker\service\LookShopService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\GHouses;
......@@ -218,6 +219,13 @@ class Houses extends Basic
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'a.id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
}
// $look_shop = new LookShopService();
foreach ($data['data']['list'] as $k=>$v) {
$data['data']['list'][$k]["is_look"] = false;
}
return $this->response($data['status'], $data['msg'], $data['data']);
} else {
return view('houseList');
......
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* User: liu yin ping
* Date: 2018/3/13
* Time: 15:48
*/
use app\index\extend\Basic;
class InspectionRecord extends Basic
{
public function inspectionRecordList()
{
if (!$this->request->isAjax()) {
return view('inspection/inspectionRecord');
}
}
}
\ No newline at end of file
......@@ -2,6 +2,7 @@
namespace app\index\controller;
use app\api\untils\JwtUntils;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\AuthRule;
......@@ -105,11 +106,19 @@ class Login extends Basic
$list = $list->toArray();//转化arr
}
$jwt = new JwtUntils();
$jwt_data['id'] = $list['id'];
$jwt_data['name'] = $list['name'];
$jwt_data['phone'] = $list['phone'];
$jwt_data['level'] = $list['level'];
$list['AuthToken'] = $jwt->createToken($jwt_data);
Session::set("userName",$list["name"]);
Session::set("userId",$list["id"]);
Session::set("lastLoginTime",time());
Session::set("user_info",$list);
$this->operating_records($list["id"],1,'后台登陆'); //记录操作日志
if($this->request->isAjax()) {
return $this->response('200', '登录成功', $list);
}else {
......
......@@ -253,6 +253,11 @@ class Member extends Basic{
try {
$data['list'] = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['current_agent_id'] = $this->userId;
}
$data['total'] = $this->user->getUserAgentTotal($where, $type);
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取客户失败!请联系运营。');
......@@ -266,76 +271,6 @@ class Member extends Basic{
return $return;
}
/**
* 新增或编辑用户
*
* @return \think\Response
* @throws \think\exception\DbException
*/
public function user_add() {
$params = $this->request->param();
$status = 101;
$data = '';
if (empty($params['id'])) {
$user_data = $this->user->get(['user_phone'=> $params['user_phone']]);
} else {
$user_data = $this->user->get($params['id']);
}
$date = date('Y-m-d H:i:s');
if (!check_phone($params['user_phone'])) {
return $this->response($status, '手机号错误');
}
if (empty($user_data) && $params['type'] == 'add') {
$insert_data['sex'] = $params['sex'];
$insert_data['user_name'] = $params['user_name'];
$insert_data['user_phone'] = $params['user_phone'];
$insert_data['user_pswd'] = md5(md5($params['pwd']).'+123');
$insert_data['status'] = -1;
$insert_data['create_time'] = $date;
$insert_data['source'] = $date;
$insert_data['agent_id'] = $params['agent_id']; //客方
$insert_data['industry_type'] = $params['industry_type']; //业态
$insert_data['price_demand'] = $params['price_demand']; //价格需求 元
$insert_data['area_demand'] = $params['area_demand']; //价格需求 元面积要求
$this->user->save($insert_data);
if ($this->user->id) {
$status = 200;
$data = ['id'=>$this->user->id];
$msg = '添加用户成功';
} else {
$msg = '新增用户失败';
}
} else {
if (!empty($user_data) && $params['type'] == 'edit'){
$insert_data['sex'] = $params['sex'];
$user_data->user_nick = $params['realname'] ? $params['realname'] : $user_data->user_nick;
$user_data->user_phone = $params['user_phone'] ? $params['user_phone'] : $user_data->user_phone;
$user_data->user_pswd = $params['pwd'] != $user_data->user_pswd ? md5(md5($params['pwd']).'+123') : $user_data->user_pswd;
$user_data->status = $params['status'] ? $params['status'] : $user_data->status;
$user_data->update_time = $date;
$user_data->save();
if ($user_data->id) {
$status = 200;
$data = ['id'=>$user_data->id];
$msg = '编辑用户成功';
} else {
$msg = '编辑用户失败';
}
} else {
$msg = '该用户已存在';
$status = 101;
}
}
return $this->response($status, $msg, $data);
}
/**
* 添加跟进
*
......@@ -375,24 +310,8 @@ class Member extends Basic{
$data = [];
if ($this->request->isPost()) {
//编辑用户
if (isset($this->params['id'])) {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
if (empty($user_data)) {
return $this->response(101, '没有用户信息');
} else {
//是否修改客方
if ($this->params['agents_id'] != $user_data['agent_id']) {
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '修改为' . $agent_data['name'] . '-' . $agent_data['phone'];
} else {
$remark = '用户编辑';
}
$data['start'] = $this->user->edit($this->params, $this->params['id']); //新增或编辑
}
} else {
if (empty($this->params['id'])) {
//新增用户
$where['user_phone'] = $this->params['user_phone'];
$num = $this->user->all_user_count($where);
......@@ -403,12 +322,27 @@ class Member extends Basic{
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '新增为' . $agent_data['name'] . '-' . $agent_data['phone'];
$result = $this->user->edit($this->params, $this->params['id']); //新增或编辑
if ($result == -1) {
return $this->response(101, '该用户已经存在!');
}
$this->params['id'] = $result;
} else {
$user_data = $this->user->getUserById('id,agent_id', $this->params['id']);
if (empty($user_data)) {
return $this->response(101, '没有用户信息');
} else {
//是否修改客方
if ($this->params['agents_id'] != $user_data['agent_id']) {
$agent = new AAgents();
$agent_data = $agent->getAgentInfo('name,phone', $this->params['agents_id']);
$remark = '修改为' . $agent_data['name'] . '-' . $agent_data['phone'];
} else {
$remark = '用户编辑';
}
$data['start'] = $this->user->edit($this->params, $this->params['id']); //新增或编辑
}
}
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']);
......
......@@ -76,18 +76,16 @@ class Remark extends Basic
}
//跟进人门店
if (!empty($this->params['remark_store'])) {
$where['f.district_name'] = ['NOT NULL'];
$where['e.store_name'] = ['like', "%{$this->params['remark_store']}%"];
if (!empty($this->params['remark_store_id'])) {
$where['b.store_id'] = $this->params['remark_store_id'];
}
//跟进人部门
if (!empty($this->params['remark_district'])) {
$where['e.store_name'] = ['NOT NULL'];
$where['f.district_name'] = ['like', "%{$this->params['remark_district']}%"];
if (!empty($this->params['remark_district_id'])) {
$where['b.district_id'] = $this->params['remark_district_id'];
}
$field = 'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_nick,c.user_phone,a.user_status';
$field = 'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_name,c.user_phone,a.user_status';
$data['data']['list'] = $u_phone_follow->getFollowList($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['data']['total'] = $u_phone_follow->getFollowTotal($where);
return $this->response(200,'成功',$data);
......
......@@ -12,6 +12,7 @@ namespace app\index\extend;
use app\model\AAgents;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\model\Users;
use think\Controller;
use think\Request;
use think\Response;
......@@ -128,15 +129,34 @@ class Basic extends Controller
$is_auth = $agents->agentsAuth($auth_id, $this->userId);
$is_auth = empty($is_auth['id']) ? 0:1;
//处理盘方编辑商铺
if ($is_auth == 0) {
//处理盘方编辑商铺
if ($requestPath == 'index/houseEdit' && isset($this->params['id'])) {
$agent = new GHousesToAgents();
$where['houses_id'] = $this->params['id'];
$where['type'] = 2;
$where['agents_id'] = $this->userId;
$is_ = $agent->getTotal($where);
$is_auth = $is_ > 0 ? 1:0;
if (empty($this->params['id'])) {
$is_auth = 1;
} else {
$agent = new GHousesToAgents();
$where['houses_id'] = $this->params['id'];
$where['type'] = 2;
$where['agents_id'] = $this->userId;
$is_ = $agent->getTotal($where);
$is_auth = $is_ > 0 ? 1:0;
}
}
//处理客方编辑客户
if (($requestPath == 'index/pcEditClient' || $requestPath == 'index/pcAddFollow') && isset($this->params['id'])) {
if (empty($this->params['id'])) {
$is_auth = 1;
} else {
$m_user = new Users();
$where['agent_id'] = $this->userId;
$where['id'] = $this->params['id'];
$is_ = $m_user->getUserAgentTotal($where);
$is_auth = $is_ > 0 ? 1:0;
}
}
}
......
......@@ -231,7 +231,7 @@
×
</button>
<h4 class="modal-title">
角色设置
绑定手机
</h4>
</div>
<div class="modal-body">
......
......@@ -38,7 +38,8 @@
<form class="form form-inline" method="get" action="/admin.php/admin/user/index.html">
<div class="form-group">
<div class="input-group search-form">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/部分url/名称">
<input type="text" name="search" class="form-control" value="" placeholder="请输入ID/部分url/名称" onkeydown="if(event.keyCode==13){event.keyCode=0;event.returnValue=false;}">
<!--<input class="form-control btn6 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="请输入ID/部分url/名称" type="text" value="" name="search">-->
<span class="input-group-btn">
<button id="search" type="button" class="btn btn-success search-btn"><i class="glyphicon glyphicon-search"></i></button>
</span>
......
......@@ -39,7 +39,7 @@
<form class="form form-inline" method="get" action="/admin.php/admin/user/index.html">
<div class="form-group">
<div class="input-group search-form">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/用户名/昵称">
<input type="text" name="search" class="form-control search-input pull-right" value="" placeholder="请输入ID/用户名/昵称" onkeydown="if(event.keyCode==13){event.keyCode=0;event.returnValue=false;}">
<span class="input-group-btn">
<button id="search" type="button" class="btn btn-success search-btn"><i class="glyphicon glyphicon-search"></i></button>
</span>
......
......@@ -2,9 +2,7 @@
<input type="hidden" class="page-load" id="getCollection" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
......@@ -35,7 +33,6 @@
.img-pre-ul {
padding-left: 0;
overflow: hidden;
/*width: 100%;*/
}
/*图片上传相关样式*/
......@@ -239,7 +236,7 @@
<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>
......@@ -296,6 +293,9 @@
<div class="modal-body" id="del_msg">
实付金额:<input type="number" id='real_money' />
</div>
<div class="modal-body" id="del_msg">
手续费:&nbsp;&nbsp;&nbsp;<input type="number" id='real_money2' />
</div>
</div>
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
......
......@@ -49,6 +49,7 @@
</tr>
<tr class="maintable-tr-bar">
<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>
......@@ -171,6 +172,7 @@
<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="maid_new_table_list">
......
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="houseFollowUp" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
#follow_up_con{
width: 32%!important;
}
</style>
<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 breadcrumb">
<li>
<a href="javascript:;">商铺跟进列表</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">跟进时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="houseID" placeholder="商铺ID" type="text" value="">-->
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="商铺名称" type="text" value="">-->
<input class="form-control btn4 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="follow_up_con" placeholder="跟进内容" type="text" value="">
<!--<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">跟进人所在部门</option>
</select>
<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="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="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">商铺ID</th>
<th class="text-center">商铺名称</th>
<!--<th class="text-center">操作</th>-->
</tr>
</thead>
<tbody class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--时间轴-->
......@@ -15,6 +15,7 @@
<div class="form-group">
<label for="shangpuType">商铺类型</label>
<select class="form-control" name="shangpuType" id="shangpuType" data-alert="请选择商铺类型">
<option value="">请选择</option>
<option value="0">商场</option>
<option value="1">街铺</option>
</select>
......@@ -194,7 +195,7 @@
<label for="">进场费</label>
<div class="input-group">
<input type="number" class="form-control input-100-width" id="jinchangPrice" placeholder="请输入" data-alert="请填写进场费!">
<div class="input-group-addon">/月</div>
<div class="input-group-addon"></div>
</div>
</div>
</li>
......
......@@ -58,94 +58,74 @@
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="9">
<form id="form_search">
<select class="form-control btn2" id="is_carefully_chosen">
<option value="-1"">是否显示在首页</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2" id="is_show">
<option value="-1">C端是否显示</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2" id="shop_type">
<option value="-1">商铺类型</option>
<option value="0">商场</option>
<option value="1">街铺</option>
</select>
<select class="form-control btn2" id="leased">
<option value="-1">商铺状态</option>
<option value="0">已租</option>
<option value="1">待租</option>
</select>
<select class="form-control btn2" id="rent_price">
<option value="-1">月租金</option>
<option value="1">10000以下</option>
<option value="2" >10000-30000</option>
<option value="3">30000以上</option>
</select>
<select class="form-control btn2" id="is_exclusive_type">
<option value="-1">是否独家</option>
<option value="1"></option>
<option value="0"></option>
</select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="internal_title" placeholder="商铺名称" type="text" value="">
<div class="row">
</div>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="业态" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="盘方" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="id" placeholder="店铺编号" type="text" value="">
<span class="fore-span ld-Marheight">上传时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<!-- 批量修改客方 -->
<a href="#modal_modify_user" data-toggle="modal" class="btn btn-info btn3 margin-top-ld"><i class="icon-plus"></i>
批量修改盘方</a>
</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">C端是否显示</th>
<th class="text-center">上传时间</th>
<th class="text-center">状态</th>
<th class="text-center">盘方</th>
<th class="text-center">操作</th>
</tr>
<tr>
<td colspan="9">
<form id="form_search">
<select class="form-control btn2" id="is_carefully_chosen">
<option value="-1"">是否显示在首页</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2" id="is_show">
<option value="-1">C端是否显示</option>
<option value="0"></option>
<option value="1"></option>
</select>
<select class="form-control btn2" id="shop_type">
<option value="-1">商铺类型</option>
<option value="0">商场</option>
<option value="1">街铺</option>
</select>
<select class="form-control btn2" id="leased">
<option value="-1">商铺状态</option>
<option value="0">已租</option>
<option value="1">待租</option>
</select>
<select class="form-control btn2" id="rent_price">
<option value="-1">月租金</option>
<option value="1">10000以下</option>
<option value="2" >10000-30000</option>
<option value="3">30000以上</option>
</select>
<select class="form-control btn2" id="is_exclusive_type">
<option value="-1">是否独家</option>
<option value="1"></option>
<option value="0"></option>
</select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="internal_title" placeholder="商铺名称" type="text" value="">
<div class="row">
</div>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="industry_type" placeholder="业态" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish" placeholder="盘方" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="id" placeholder="店铺编号" type="text" value="">
<span class="fore-span ld-Marheight">上传时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<span class="btn btn-default btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-default btn3 ld-Marheight" id="reset">重置</span>
<!-- 批量修改客方 -->
<a href="#modal_modify_user" data-toggle="modal" class="btn btn-info btn3 margin-top-ld"><i class="icon-plus"></i>
批量修改盘方</a>
</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">C端是否显示</th>
<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="business_list">
<!--<tr>-->
<!--<td>212</td>-->
<!--<td>商场</td>-->
<!--<td>长兴</td>-->
<!--<td>1000</td>-->
<!--<td>是</td>-->
<!--<td>2018-01-16 17:02:00</td>-->
<!--<td>已租</td>-->
<!--<td>张娜张-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies">修改</a>-->
<!--</td>-->
<!--<td>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">编辑</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">推荐至首页</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">设置案场权限人</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">是否独家</a>-->
<!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="77" onclick="alertFollow(this)">操作记录</a>-->
<!--<a data-toggle="modal" data-id="77" href="#modal-watch" class="btn1 btn-danger add_applies" onclick="delete_house(4720)">删除</a>-->
<!--</td>-->
<!--</tr>-->
<tbody class="text-center" id="business_list"></tbody>
</table>
</div>
......@@ -341,4 +321,64 @@
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!-- #查看-->
<div class="modal fade" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<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" >
商铺详情
</h4>
</div>
<div class="modal-body modal-body-one">
<iframe class="iframe-shop-detail"></iframe>
</div>
</div>
</div>
</div>
<div class="modal fade" id="modal_followup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<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" >
跟进
</h4>
</div>
<div class="modal-body modal-body-one">
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed">
<tbody class="text-center" id="modal_followup_table_list">
<tr>
<td>电话跟进:测试测试测试测试测试测试测试测试测试测试测试测试</td>
<td>刘丹丹</td>
<td>2017-09-05 15:22:33</td>
</tr>
<tr>
<td colspan="3">2017-09-05 15:22:33</td>
</tr>
</tbody>
</table>
</div>
<div class="followup-modal-comment-area">
<textarea></textarea>
</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="modal_followup_submit_btn">
提交
</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
{layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="inspectionRecord" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
</style>
<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 breadcrumb">
<li>
<a href="javascript:;">约带看记录</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<!--同步app-->
<!--<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">约带看时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">约带看人所在部门</option>
</select>
<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 btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="商铺名称" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="report_agent_phone" placeholder="客户手机号" type="text" value="">
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="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 class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--时间轴-->
<!--时间轴-->
<div class="modal fade" id="modal-time" 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">
×
</button>
<h4 class="modal-title">
时间轴
</h4>
</div>
<div class="modal-body" class="iframe-div-parent">
<iframe class="iframe-time-line"></iframe>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -10,7 +10,7 @@
.user-ul {
width: 100%;
height: auto;
padding-bottom: 15px;
/*padding-bottom: 15px;*/
float: left;
position: relative;
left: -40px;
......@@ -21,16 +21,16 @@
line-height: 30px;
}
.user-ul2 {
.user-ul2,.look-shop-ul {
width: 100%;
height: auto;
padding-bottom: 15px;
padding-bottom: 6px;
float: left;
position: relative;
left: -40px;
}
.user-ul2 li {
.user-ul2 li,.look-shop-ul li {
list-style: none;
line-height: 30px;
}
......@@ -95,6 +95,118 @@
.bottom{
margin-top: 30px;
}
/*客户列表商 约带看*/
.detail-modal-bargaininfo-main-left {
float: left;
width: 340px;
line-height: 36px;
}
#bargaininfo_is_open,
#bargaininfo_type {
width: 100px !important;
display: inline-block;
}
#bargaininfo_expect_payback_time {
height: 32px;
}
.detail-modal-bargaininfo-main-right {
line-height: 36px;
width: 700px;
}
#bargaininfo_yetai {
width: 150px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
#bargaininfo_chengjiao_price,
#bargaininfo_total_commission {
width: 120px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
.detail-modal-bargaininfo-form {
line-height: 48px;
width: 620px;
margin: 0 auto;
}
.detail-modal-bargaininfo-commission-inputpar {
width: 100%;
overflow: hidden;
clear: both;
}
.detail-modal-bargaininfo-commission-sec,
.addtax-modal-tax-commission-sec {
overflow: hidden;
}
.detail-modal-bargaininfo-commission-sec>label,
.addtax-modal-tax-commission-sec>label {
float: left;
}
.detail-modal-bargaininfo-commission-sec>label:nth-of-type(2),
.addtax-modal-tax-commission-sec>label:nth-of-type(2) {
margin-left: 50px;
}
.detail-modal-bargaininfo-commission-sec>div,
.addtax-modal-tax-commission-sec>div {
float: left;
width: 380px;
}
.detail-modal-bargaininfo-commission-sec>mark,
.addtax-modal-tax-commission-sec>mark {
float: left;
overflow: hidden;
background-color: transparent;
padding-top: 5px;
padding-left: 10px;
}
.detail-modal-bargaininfo-commission-sec>mark>img,
.addtax-modal-tax-commission-sec>mark>img {
float: left;
width: 20px;
}
#bargaininfo_commission_add_btn {
width: 100%;
margin-bottom: 20px;
}
#bargaininfo_commission_add_btn>img {
display: block;
margin: 0 auto;
}
.opacity-0{
opacity: 0;
}
#user_call{
height: 20px;
width: 30px;
border-radius: 3px;
line-height: 20px;
margin-top: 22px;
font-size: 10px;
text-align: center;
cursor:pointer
}
#phone_title2{
font-weight: 600;
font-size: 36px;
}
</style>
<!--导航star-->
......@@ -262,6 +374,7 @@
<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>
......@@ -378,7 +491,18 @@
</ul>
</div>
</div>
<div class="form-group">
<label for="inputEmail3" class="col-sm-3 control-label">VIP客户:</label>
<div class="col-sm-9">
<select class="form-control btn6" id="user_vip">
<option value='' class="successModel">请选择</option>
<option value="1"></option>
<option value="0"></option>
</select>
<span class="fore-span">(有权限的人才能看到VIP客户)</span>
</div>
</div>
</form>
</div>
......@@ -415,6 +539,14 @@
<form id="form1">
<span class="fore-span ld-Marheight">产生类型:</span>
<span class="fore-span ld-Marheight" id="source_type"></span>
<!--是否vip-->
<!--<label for="inputEmail3" class="col-sm-3 control-label">VIP客户:</label>-->
<span class="fore-span ld-Marheight">VIP客户:</span>
<select class="form-control btn4 ld-Marheight" id="user_vip2">
<option value='' class="successModel">请选择</option>
<option value="1"></option>
<option value="0"></option>
</select>
<div class="clear"></div>
<span class="fore-span ld-Marheight">客户编号:</span>
<span class="fore-span ld-Marheight" id="cus_id"></span>
......@@ -445,6 +577,7 @@
<span class="fore-span ld-Marheight">电话:</span>
<span class="fore-span ld-Marheight" id="cus_phone"></span>
<a class="fore-span btn-primary ld-Marheight" id="user_call" href="#modal-call" data-toggle="modal">拨打</a>
<div class="clear"></div>
<span class="fore-span ld-Marheight">创建时间:</span>
......@@ -456,6 +589,10 @@
<div class="clear"></div>
<span class="fore-span ld-Marheight">注册时间:</span>
<span class="fore-span ld-Marheight" id="registration_time"></span>
<div class="clear"></div>
<span class="fore-span ld-Marheight">第一次登陆时间:</span>
<span class="fore-span ld-Marheight" id="firstlogin_time"></span>
<div class="row"></div>
<div class="form-group">
<span class="fore-span ">客方:</span>
......@@ -473,7 +610,7 @@
<th class="text-center">跟进时间</th>
</tr>
</thead>
<tbody class="text-center" id="caozuo_table">
<tbody class="text-center" id="caozuo_table"></tbody>
</table>
......@@ -545,6 +682,18 @@
<label class="control-label">无效</label><input type="radio" name="user_status" value="-1">
<span class="text-danger">(必填)</span>
</div>
<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>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
......@@ -597,4 +746,120 @@
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!--约带看-->
<div class="modal fade" id="modal-takeLook" 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">
×
</button>
<h4 class="modal-title">
约带看
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover table-condensed" id=" ">
<thead>
<tr>
<td>
<form id="form1">
<span class="fore-span ld-Marheight">姓名:</span>
<span class="fore-span ld-Marheight" id="take_look_name"></span>
<div class="clear"></div>
<span class="fore-span ld-Marheight">电话:</span>
<span class="fore-span ld-Marheight" id="take_look_phone"></span>
<div class="clear"></div>
<span class="fore-span ld-Marheight">客户编号:</span>
<span class="fore-span ld-Marheight" id="take_look_id"></span>
<div class="clear"></div>
<div class="detail-modal-bargaininfo-commission-inputpar">
<div class="detail-modal-bargaininfo-commission-addarea">
<div class="form-group detail-modal-bargaininfo-commission-sec">
<span class="fore-span ld-Marheight">约带看商铺:</span>
<div class=" ">
<!--选择式-->
<input type="text" class="form-control ld-Marheight look-shop" name=" " autocomplete="off" placeholder="请输入商铺名称、商铺编号、商铺地址关键词">
<ul class="look-shop-ul"></ul>
<!--下拉列表-->
</div>
<!--<mark href="javascript:;" class="detail-modal-bargaininfo-commission-cancel-pic"><img src="/resource/image/search_gb.png" /></mark>-->
</div>
</div>
<div id="bargaininfo_commission_add_btn">
<img src="/resource/image/jia2@2x.png" />
</div>
</div>
<!--<div class="form-group">
<span class="fore-span ld-Marheight">约带看商铺:</span>
<input type="text" class="form-control btn6 ld-Marheight" name=" " autocomplete="off" id="look_shop" placeholder="请输入商铺名称、商铺编号、商铺地址关键词">
<ul class="look-shop-ul"></ul>
</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">
<!--datetime-local-->
<div class="clear"></div>
<div class="textarea-con ld-Marheight">
<span class="fore-span">备注:</span>
<textarea name="" rows="5" cols="50" id="note_look"></textarea>
</div>
</form>
</td>
</tr>
</thead>
<tbody class="text-center" id="caozuo_table">
</table>
</div>
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>-->
<button type="button" class="btn btn-primary save-look">
<!--data-dismiss="modal"-->
保存
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<!--拨打手机号-->
<div class="modal fade" id="modal-call" 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">
请使用
<span id="phone_title">
</span>
的手机拨打该虚拟号
</h4>
</div>
<div class="modal-body">
<div class="modal-body">
<input type="hidden" value="" id="delete_id" />
<span id="phone_title2">
</span>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="unbind_call">没打通
</button>
<button type="button" class="btn btn-primary" id="" data-dismiss="modal">
已拨打
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -47,8 +47,14 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_name" placeholder="跟进人姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_phone" placeholder="跟进人手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_store" placeholder="跟进人所在门店" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_district" placeholder="跟进人所在部门" type="text" value="">
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_store" placeholder="跟进人所在门店" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="remark_district" placeholder="跟进人所在部门" type="text" value="">-->
<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">跟进人所在部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search_t">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
......@@ -51,13 +51,15 @@ class ACollectHouse extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('g_houses Houses', 'CollectUser.house_id = Houses.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
......@@ -49,13 +49,15 @@ class ACollectUser extends Model
* 查询收藏数据
* 朱伟 2018-07-04
*/
public function getCollectList($field,$params)
public function getCollectList($pageNo,$pageSize,$field,$params)
{
$result = Db::table($this->table)
->field($field)
->alias('CollectUser')
->join('u_users Users', 'CollectUser.user_id = Users.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
//dump($this->getLastSql());
return $result;
......
......@@ -232,4 +232,16 @@ class AuthGroup extends BaseModel
return $this->where($where)
->value($key);
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public function getAuthGroupById($id, $fields)
{
return $this->where('id', $id)->value($fields);
}
}
......@@ -195,4 +195,16 @@ class AuthRule extends BaseModel
->where($where)
->find();
}
/**
* 根据id获取单个字段值
*
* @param $id
* @param $fields
* @return mixed
*/
public function getAuthRuleByName($name, $fields)
{
return $this->where('name', $name)->value($fields);
}
}
\ No newline at end of file
......@@ -150,16 +150,17 @@ class BindingPhone extends BaseModel
* @param $phone_b
* @param $record
* @param $time
* @param $result
* @param string $mappingId
* @param $subs_id
* @param $request_id
* @param string $mapping_id
* @param int $type
* @param int $status 绑定状态
* @param int $status
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function recordBindPhone($phone_x, $phone_a, $phone_b, $record, $time, $result, $mappingId = '', $type = 1, $status = 1)
public function recordBindPhone($phone_x, $phone_a, $phone_b, $record, $time, $subs_id, $request_id, $mapping_id = '', $type = 1, $status = 1)
{
$m_ali_phone = new AliYunPhone();
$phone_id = $m_ali_phone->field('id,bind_num')->where('phone_x', $phone_x)->find();
......@@ -168,9 +169,9 @@ class BindingPhone extends BaseModel
$insert_data['phone_a'] = $phone_a;
$insert_data['phone_b'] = $phone_b;
$insert_data['subsId'] = $result->SecretBindDTO->SubsId;
$insert_data['requestId'] = $result->RequestId;
$insert_data['mappingId'] = $mappingId;
$insert_data['subsId'] = $subs_id;
$insert_data['requestId'] = $request_id;
$insert_data['mappingId'] = $mapping_id;
$insert_data['record'] = $record;
$insert_data['aliYun_phone_id'] = $phone_id['id'];
$insert_data['expiry_date'] = $time;
......
......@@ -180,6 +180,7 @@ class GHouses extends BaseModel
->page($pageNo)
->select();
$house_id = array();
$house_ext = new GHousesExt();
foreach ($data as $k => $v) {
$house_id[$k] = $v['id'];
$v->create_time = date('Y-m-d', strtotime($v->create_time));
......
......@@ -217,8 +217,6 @@ class UPhoneFollowPp extends BaseModel
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->join('u_labels d','d.id = a.labels_id', 'left')
->join('a_store e', 'b.store_id = e.id', 'left')
->join('a_district f', 'b.district_id= f.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
......@@ -237,8 +235,6 @@ class UPhoneFollowPp extends BaseModel
return $this->alias('a')
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->join('a_store e', 'b.store_id = e.id', 'left')
->join('a_district f', 'b.district_id= f.id', 'left')
->where($params)
->count();
}
......
......@@ -267,6 +267,9 @@ class Users extends Model
if (!empty($data['area_demand'])) {
$insert_data['area_demand'] = $data['area_demand'];
}
if (!empty($data['vip'])) {
$insert_data['vip'] = $data['vip'];
}
if ($id && $id > 0) {
//修改
$insert_data['update_time'] = date('Y-m-d H:i:s');
......@@ -351,7 +354,7 @@ class Users extends Model
public function useraction_search_user_res($user_id, int $referrer = 0)
{
$field = 'id as user_id,agent_id,sex,user_nick,user_name,user_pic,user_status,user_phone,create_time,
referrer_source,referrer_id,registration_time,industry_type,price_demand,area_demand,source';
referrer_source,referrer_id,registration_time,industry_type,price_demand,area_demand,source,vip,first_login_time';
$data = db('u_users')
->where('id', $user_id)
->field($field)
......@@ -497,7 +500,7 @@ class Users extends Model
//->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
->limit($pagesize)
->page($pagenum)
->field('id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand')
->field('id as user_id,sex,user_name,user_phone,user_status,agent_id,create_time,industry_type,price_demand,area_demand,vip')
->select();
}
......
......@@ -45,6 +45,7 @@ Route::group('app_broker', [
'daily_achieve_ywy' => [ 'app_broker/index/daily_achieve_ywy', [ 'method' => 'get' ] ],
'customerinfo_genjin' => [ 'app_broker/index/customerinfo_genjin', [ 'method' => 'get' ] ],
'timeline_pc' => [ 'app_broker/index/timeline_pc', [ 'method' => 'get' ] ],
'shop_detail_pc' => [ 'app_broker/index/shop_detail_pc', [ 'method' => 'get' ] ],
'bargaininfo_detail_pc' => [ 'app_broker/index/bargaininfo_detail_pc', [ 'method' => 'get' ] ],
'customerinfo_customer_add' => [ 'app_broker/index/customerinfo_customer_add', [ 'method' => 'get' ] ],
'customerinfo_details_new' => [ 'app_broker/index/customerinfo_details_new', [ 'method' => 'get' ] ],
......@@ -73,7 +74,6 @@ Route::group('index', [
//user列表
'users_list' => [ 'index/member/getUserList', [ 'method' => 'get' ] ],
'user_add' => [ 'index/member/user_add', [ 'method' => 'post' ] ],
'del_user' => [ 'index/member/delUser', [ 'method' => 'post' ] ],
'pcAddFollow' => [ 'index/member/pcAddFollow', [ 'method' => 'post' ] ],
'pcEditClient' => [ 'index/member/pcEditClient', [ 'method' => 'post | get' ] ],
......@@ -227,11 +227,12 @@ Route::group('index', [
'getTallAgeList' => [ 'index/Finance/getTallAgeList', [ 'method' => 'GET' ] ], //税费承担明细表
'getCommissionTotalList' => [ 'index/Finance/getCommissionTotalList', [ 'method' => 'GET' ] ], //分佣提成汇总表
'getCollection' => [ 'index/Collection/getCollection', [ 'method' => 'post|get' ] ],//收款记录
'addRealMoney' => [ 'index/Collection/addRealMoney', [ 'method' => 'post' ] ],//新增实收
'addRealMoney' => [ 'index/Collection/addRealMoney', [ 'method' => 'post|get' ] ],//新增实收
'visitShop' => [ 'index/Supervise/visitShop', [ 'method' => 'get' ] ],//门店拜访
'carryOut' => [ 'index/Supervise/carryOut', [ 'method' => 'get' ] ],//监督执行
'toReportListOne' => [ 'index/Finance/toReportListOne', [ 'method' => 'POST' ] ], //回到一级审核
'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单
'delPartialCommission' => [ 'index/Finance/delPartialCommission', [ 'method' => 'POST' ] ], //删除分佣方
'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存
'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片
'receiptImgList' => [ 'index/Collection/receiptImgList', [ 'method' => 'post|get' ] ],//收款列表-收款图片列表
......@@ -259,6 +260,11 @@ Route::group('index', [
'new_text' => [ 'index/news/newText', [ 'method' => 'GET' ] ], //删除商学院文章
'agentEvaluateNumAndFraction' => [ 'index/agent/agentEvaluateNumAndFraction', [ 'method' => 'POST|GET' ] ],//经纪人列表计算-评价次数和分数 朱伟 2018-07-03
'uploadImg' => [ 'index/UploadImg/uploadImg', [ 'method' => 'POST' ] ],//全局图片上传
'followUpList' => [ 'index/HouseFollowUp/followUpList', [ 'method' => 'GET' ] ],//商铺跟进liu
'inspectionRecordList' => [ 'index/InspectionRecord/inspectionRecordList', [ 'method' => 'GET' ] ],//约带看记录liu
]);
......@@ -400,7 +406,8 @@ Route::group('broker', [
'labelEdit' => [ 'api_broker/label/index', [ 'method' => 'get|post' ] ], //编辑标签
'getLabelsList' => [ 'api_broker/label/getLabelsList', [ 'method' => 'get' ] ], //标签列表
'add_phone_follow_up' => [ 'api_broker/broker/add_phone_follow_up', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'useraction_search' => [ 'api_broker/broker/useraction_search', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'useraction_search' => [ 'api_broker/broker/useraction_search', [ 'method' => 'get|post' ] ],//客户电话跟进
'vip' => [ 'api_broker/broker/vip', [ 'method' => 'get|post' ] ],
'userStateSearch' => [ 'api_broker/broker/userStateSearch', [ 'method' => 'get|post' ] ],//新增-客户电话跟进
'user_search' => [ 'api_broker/broker/user_search', [ 'method' => 'get|post' ] ],//客户搜索
'bindAXB' => [ 'api_broker/CellPhone/bindAXB', [ 'method' => 'post' ] ],//隐私号码
......
......@@ -300,24 +300,30 @@ span.dot-block>mark{
overflow: hidden;
position: fixed;
width: 7.5rem;
box-sizing: border-box;
padding: .1rem .2rem;
left: 0;
bottom: .1rem;
bottom: 0;
display: flex;
justify-content: space-between;
background-color: white;
box-shadow: 0 -.03rem .1rem rgba(0, 0, 0, .1);
}
.bottom-btn-area>a{
overflow: hidden;
flex: 1;
}
.bottom-btn-area>a:nth-of-type(1){
float: left;
margin-left: 1.04rem;
flex: 1.28rem 0 0;
}
.bottom-btn-area>a:nth-of-type(2){
float: right;
margin-right: 1.04rem;
.bottom-btn-area>a:nth-of-type(2),
.bottom-btn-area>a:nth-of-type(3){
flex: 2.6rem 0 0;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-btn-area>a>img{
float: left;
width: 2.24rem;
height: 1.6rem;
width: 100%;
}
/*跟进模态框区域*/
......
@charset "utf-8";
body{
background-color: white;
font-size: 14px;
}
main>section{
padding: 20px;
}
table{
display: block;
}
table td{
box-sizing: border-box;
padding: 5px 10px;
width: 260px;
}
.tr-seat{
height: 20px;
}
tbody>tr:nth-of-type(10),
tbody>tr:nth-of-type(12),
tbody>tr:nth-of-type(14),
tbody>tr:nth-of-type(16){
margin-top: 20px;
border-top: 1px solid #999;
}
.img-list>li{
width:140px;
height: 140px;
}
.img-list>li+li{
margin-left: 20px;
}
.img-list>li>img{
width: 100%;
height: 100%;
object-fit: cover;
}
.phone-list>li{
background-color: #e0e0e0;
}
.phone-list>li+li{
margin-left: 20px;
}
......@@ -61,7 +61,8 @@ function loadMain(){
url: ServerHostTempC + '/broker/useraction_search',
data: {
'AuthToken': _token,
'user_id': Number(_customerId)
'user_id': Number(_customerId),//客户id
'agent_id': Number(_userId)//当前用户的id
},
timeout: 30000,
dataType: 'json',
......@@ -70,6 +71,11 @@ function loadMain(){
console.log(data);
if(typeof data === 'object') {
if (data.code == 200) {
if(data.data.is_collect == '1'){
//收藏状态 1:表示已经收藏 2:暂未收藏
$('#mark_btn').attr('data-ismark','1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
};
$('#customer_code').html(data['data']['user_info']['user_id']);
$('#customer_name, #name').html((data['data']['user_info']['user_name'] == null?'':data['data']['user_info']['user_name'])+(data['data']['user_info']['user_nick']?('('+data['data']['user_info']['user_nick']+')'):''));
if(data['data']['user_info']['sex']==2){
......@@ -161,6 +167,56 @@ function loadMain(){
$('.record-main>ul').html('<div id="zanwu_data" class="zanwu_data" style="display: block;">暂无数据...</div>');
}
//点击收藏按钮触发的事件
var isAjaxIng = false;//是否正在执行请求操作
$('#mark_btn').click(function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
var isMark = ((_this.attr('data-ismark')=='1')?true:false);//点击的时候,是否是已经收藏的状态,记录
if(!isAjaxIng){
isAjaxIng = true;
//只有没有在执行请求操作的时候,才能进行请求
$.ajax({
type: 'GET',
url: ServerHostTempC + '/broker/addCollectUser',
data: {
'AuthToken': _token,
'agents_id': _userId,//当前用户的id
'user_id': _customerId,//客户id
'status': isMark?2:1
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
isAjaxIng = false;
if(isMark){
_this.attr('data-ismark', '0').find('img').attr('src', '/app/images/icon_collection@2x.png');
}else{
_this.attr('data-ismark', '1').find('img').attr('src', '/app/images/icon_collection_choice@2x.png');
}
}else {
layerTipsX(data['msg']);
};
}else{
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
layerTipsX('请求超时');
};
}
});
}
});
//添加报备的点击事件
$('#baobei_btn').click(function(){
......
'use strict';
require(['vue', 'css!style/shop_detail_pc.css', 'jquery0325', 'common'],function(Vue, VConsole){
var shop_id = getUrlParam('shop_id');
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var vm = new Vue({
el: '#app',
data: {
user_info_obj,
d: {}
},
created: function() {
var _this = this;
document.body.style.display = 'block';
$.ajax({
type: 'get',
url: '/broker/getShopDetail',
data: {
'id': shop_id,
'site_area': 4,//pc后台固定传4
'AuthToken': _this.user_info_obj.AuthToken
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
_this.d = _data.data;
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
methods: {
dealPriceSwicth: function(t) {
let _this = this;
if(t == '1'){
return {
}
}else if(t == '2'){
return {
}
}else{
return {
}
}
}
},
computed: {
dealPrice: function(){
let _this = this;
if(_this.d.rent_type == '1'){
return '租金均价 :' + _this.d.rent_price + '元/月';
}else if(_this.d.rent_type == '2'){
return '营业额扣点 :' + _this.d.rent_price + '%';
}else{
return '租金均价 :' + _this.d.rent_price + '元/天/m²';
}
},
dealArea: function(){
let _this = this;
if(_this.d.shop_type){
//街铺
return _this.d.shop_area_start + '㎡';
}else{
//商场
return _this.d.shop_area_start + '㎡—' + _this.d.shop_area_end + '㎡';
}
}
}
});
});
......@@ -239,7 +239,40 @@ a:hover{
max-width: 750px;
height: 600px;
}
#modal_shop_detail>div{
width: 1090px;
}
.iframe-shop-detail{
border: none;
width: 100%;
max-width: 1090px;
height: 600px;
}
.menu-sub-alink.active-a{
background-color: #ff9419!important;
}
/*商铺列表,商铺动态,跟进信息样式*/
.followup-modal-list-area{
height: 450px;
overflow-y: scroll;
}
#modal_followup_table_list>tr>td:nth-of-type(1){
width: 70%;
}
#modal_followup_table_list>tr>td:nth-of-type(2){
width: 15%;
}
#modal_followup_table_list>tr>td:nth-of-type(3){
width: 15%;
}
.followup-modal-comment-area{
padding-top: 30px;
}
.followup-modal-comment-area>textarea{
width: 100%;
height: 80px;
display: block;
margin: 0 auto;
}
......@@ -142,13 +142,16 @@ addtax_
#maid_new_btn{
float: right;
}
#maid_table_main>thead th:nth-last-of-type(-n+6){
#maid_table_main>thead th:nth-last-of-type(-n+7){
width: 91px;
}
#maid_table_main>thead th:nth-last-of-type(1){
#maid_table_main>thead th:nth-last-of-type(2){
width: 149px;
}
#maid_table_main>thead th:nth-last-of-type(1){
width: 40px;
}
.detail-modal-maid-mix-td{
padding: 0!important;
......@@ -304,7 +307,7 @@ addtax_
#modal_detail>div {
/*width: 1030px;*/
width: 1250px;
width: 1280px;
}
/*成交信息tab*/
......
......@@ -22,7 +22,25 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
$("#search").click(function() {
follow.getList(1);
});
// 部门 门店 二级联动
var _doc = $(document);
follow.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
follow.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
});
......@@ -140,8 +158,8 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
};
params.remark_name = $("#remark_name").val();
params.remark_phone = $("#remark_phone").val();
params.remark_store = $("#remark_store").val();
params.remark_district = $("#remark_district").val();
params.remark_store_id = $("#guest_stores").val();
params.remark_district_id = $("#district_id").val();
_startDateObj.val() != '' && (params.start_date = _startDateObj.val());
_endDateObj.val() != '' && (params.end_date = _endDateObj.val());
......@@ -188,6 +206,46 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'css!style/home.css'
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return follow;
......
......@@ -88,7 +88,9 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
agent.agent_id = $(this).attr("data-id");
agent.getPhoneBindingList();
});
$(document).delegate(".submit_edit", "click", function() { //提交编辑
$(document).delegate(".submit_edit", "click", function(e) { //提交编辑
e.preventDefault();
e.stopPropagation();
agent.Submit_edit();
});
......@@ -145,7 +147,7 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
return;
}
agent.id = $(this).attr("data-id");
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
// console.log(user_info_obj);
var params = {
......@@ -198,7 +200,6 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: "json",
success: function(data) {
if(data.code == 200) {
agent.getList(1);
} else {
alert("重复提交");
}
......@@ -298,8 +299,8 @@ define(['doT', 'text!temp/agent_template_tpl.html', 'text!temp/phoneBinding_temp
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('修改成功');
$("#modal-edit").modal('hide');
agent.getList(1);
} else {
alert(data.msg);
}
......
......@@ -9,7 +9,7 @@ authRule={
authRule.event();
},
event:function () {
$ (document).delegate ("#search", "click", function () {//点击编辑
$ (document).delegate ("#search", "click", function () {//点击搜索
authRule.getList(1);
});
$ (document).delegate (".edit", "click", function () {//点击编辑
......
......@@ -927,7 +927,7 @@ define(['doT', 'text!temp/commission_template_tpl.html', 'text!temp/reportList_s
$.each($('.addtax-modal-tax-table-datatr'), function(i, v) {
_data['tax['+i+']'] = {
'fee': v.childNodes[3].innerHTML,
'agent_id': JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))).id,
'agent_id': JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))).id,
'role': v.getAttribute('data-role'),
'scale': v.childNodes[2].innerHTML.split('%')[0]
};
......
......@@ -55,6 +55,8 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
follow.house_id2 = _this.attr("data-id");
console.log(follow.house_id2);
$("#real_money").val(_this.attr("data-money"));
$("#real_money2").val(_this.attr("data-fee"));
});
//编辑-收付金额-保存
......@@ -164,19 +166,28 @@ define(['doT', 'text!temp/get_collection_template_tpl.html', 'css!style/home.css
});
},
//编辑-收付金额-保存
Submit_follow: function() { //提交
Submit_follow: function() {//提交
if(!($("#real_money").val()>0&&$("#real_money2").val()>0)){
alert('实付金额及手续费需大于0')
return false;
}
$.ajax({
'type': 'POST',
'url': '/index/addRealMoney',
data: {
"collection_id": follow.house_id2,
"real_money": $("#real_money").val(),
"transaction_fee": $("#real_money2").val()
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
follow.getList(0);
} else {}
} else {
alert(data.msg)
}
}
});
},
......
define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
house = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
house_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
init: function() {
//初始化dot
$(document.body).append(template);
// house.getList(0);
house.event();
},
event: function() {
var _doc = $(document);
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time_start').val(day_start);
$('#create_time_end').val(day_end);//商铺跟进 添加 默认时间 一个月
house.getList(0);//商铺跟进列表
// 部门 门店 二级联动
house.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
record.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
$("#search").click(function() { //搜索
house.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
$('#guest_stores').html('');
});
},
getList: function(pageNo) { //获取约带看记录列表
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj.AuthToken);
house.pageNo = pageNo;
var params = {};
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;
console.log(params.start_time);
//结束时间
var end_ = $('#create_time_end').val()+" 23:59:59";
date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
console.log(date_end);
params.end_time =date_end.getTime()*0.001;
//时间转化为时间戳
//var date="2014-05-08 00:22:11";
// date = new Date(Date.parse(date.replace(/-/g, "/")));
// date = date.getTime();
// params.district_id = $('#district_id').val() * 1;
// params.store_id = $('#guest_stores').val() * 1;
// params.user_name = $('#user_name').val();
params.name_or_phone = $('#user_phone').val();
// params.report_agent_phone = $('#report_agent_phone').val();
params.search_content = $('#follow_up_con').val();
params.pageNo = house.pageNo;
params.pageSize = house.pageSize;
params.AuthToken = user_info_obj.AuthToken;
if( !(params.end_time&&params.start_time)){
alert('请选择时间')
return;
}
$.ajax({
type: 'POST',
url: '/broker/houseFollowUpList', //商铺跟进 对接接口
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('followHouseUp_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data.result));
/*分页代码*/
add_page(data.data.total, pageNo, house.pageSize, house.getList);
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return house;
});
\ No newline at end of file
......@@ -7,6 +7,10 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
pageNo: 1,
/*第几页*/
pageSize: 10,
AuthToken: '',
agent_id: 0,
agent_phone: '',
agent_name: '',
/*每页显示多少条*/
id: '',
house_id: '',
......@@ -17,6 +21,7 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
ldHtml: $('.phone_list'),
boxphoto: '',
exclusive_id: 0,
isFollowupSaving: false,
init: function() {
//初始化dot
$("body").append(template);
......@@ -60,6 +65,11 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
},
event: function() {
var _doc = $(document);
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
business.AuthToken = user_info_obj.AuthToken;
business.agent_id = user_info_obj.id;
business.phone = user_info_obj.phone;
business.name = user_info_obj.name;
$("#search").click(function() {
business.getList(1);
});
......@@ -95,7 +105,9 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
business.house_id = $(this).attr("data-id");
business.Caozuo();
});
$(document).delegate(".submit_follow2", "click", function() { //提交独家
$(document).delegate(".submit_follow2", "click", function(e) { //提交独家
e.preventDefault();
e.stopPropagation();
business.Dujianew();
});
......@@ -110,7 +122,9 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
}
});
$(document).delegate("#confirm_delete", "click", function() {
$(document).delegate("#confirm_delete", "click", function(e) {
e.preventDefault();
e.stopPropagation();
business.delBusiness();
});
$(document).delegate(".jia", "click", function() { //加号
......@@ -249,8 +263,38 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
_this.parent().prev().val(_this.html()).attr('data-id', _this.attr('data-id'));
_this.parent().html('').hide();
});
//
//点击查看,触发定位事件
_doc.on('click', '[href="#modal_detail"]', function(){
var _this = $(this);
if(_this.hasClass('btn-success')){
_this.removeClass('btn-success').addClass('btn-warning');
};
});
//点击跟进,获取商铺跟进动态的接口
_doc.on('click', '[href="#modal_followup"]', function(){
business.id = $(this).attr("data-id");
$('.followup-modal-comment-area>textarea').val('');//清空跟进框内容
business.getFollowupList();
});
//点击商铺跟进保存按钮,保存数据的接口
_doc.on('click', '#modal_followup_submit_btn', function(e){
e.preventDefault();
e.stopPropagation();
business.followupAdd();
});
//查看点击事件
_doc.on('click', 'a[href="#modal_shop_detail"]', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
_this.removeClass('btn-success').addClass('btn-warning');
var _id = _this.attr('data-id');
console.log(_id);
$('.iframe-shop-detail').attr('src', '/app_broker/shop_detail_pc?shop_id='+_id);
});
},
// 获取信息 手机号 名字
......@@ -350,7 +394,10 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
},
dataType: "json",
success: function(data) {
if(data.code == 200) {} else {
if(data.code == 200) {
alert('修改成功');
$("#modal-dujia").modal('hide');
} else {
alert('获取失败!');
}
......@@ -447,7 +494,6 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
if(data.data) {
$("#modal-anch").hide;
}
business.getList(1);
} else {
$("#modal-anch").hide;
}
......@@ -592,7 +638,6 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json',
success: function(data) {
if(data.code == 200) {
business.getList(1);
console.log(666);
}
}
......@@ -654,13 +699,76 @@ define(['doT', 'text!temp/house_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: 'json',
success: function(data) {
if(data.code == 200) {
business.getList(1);
alert('删除成功');
$("#modal-delete").modal('hide');
} else {
$("#del_msg").html('<span style="color: red">删除失败!</span>');
}
}
});
},
getFollowupList: function(){
$.ajax({
'type': 'get',
'url': '/broker/getListByHouseId',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data && Array.isArray(data.data) && data.data.length>0) {
var _htmlTemp = '';
$.each(data.data, function(i, v) {
_htmlTemp += '<tr><td>{0}</td><td>{1}</td><td>{2}</td></tr>'.stringFormatObj({
'0': v.step,
'1': v.agent_name,
'2': v.create_time
})
});
$('#modal_followup_table_list').html(_htmlTemp);
}else{
$('#modal_followup_table_list').html('<tr><td>暂无数据</td></tr>');
}
} else {
alert('请登录!');
}
}
});
},
followupAdd: function(){
var _tareaObjVal = $('.followup-modal-comment-area>textarea').val();
if(_tareaObjVal == ''){
alert('内容不能为空');
return false;
};
if(!business.isFollowupSaving){
business.isFollowupSaving = true;
$.ajax({
'type': 'post',
'url': '/broker/addShopFollowUp',
data: {
'house_id': business.id,
'AuthToken': business.AuthToken,
'agent_id': business.agent_id,
'agent_phone': business.agent_phone,
'agent_name': business.agent_name,
'follow_up_info': _tareaObjVal
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('添加成功');
business.isFollowupSaving = false;
$("#modal_followup").modal('hide');
} else {
alert('请登录!');
}
}
});
}
}
};
return business;
......
define(['doT', 'text!temp/inspectionRecord_list_template_tpl.html', 'css!style/home.css', 'ckfinder', 'ckfinderStart', 'pagination', 'bootstrapJs'], function(doT, template) {
record = {
pageNo: 1,
/*第几页*/
pageSize: 10,
/*每页显示多少条*/
id: '',
record_id: '',
type: '',
valueCurrent: '',
ajaxObj: '',
stopstatus: true,
boxphoto: '',
init: function() {
//初始化dot
$(document.body).append(template);
record.event();
},
event: function() {
var _doc = $(document);
function  getPreMonth(date)  {            
var  arr  =  date.split('-');            
var  year  =  arr[0];             
var  month  =  arr[1];             
var  day  =  arr[2];             
var  days  =  new  Date(year,  month,  0);            
days  =  days.getDate();             
var  year2  =  year;            
var  month2  =  parseInt(month)  -  1;            
if (month2  ==  0)  {                
year2  =  parseInt(year2)  -  1;                
month2  =  12;            
}            
var  day2  =  day;            
var  days2  =  new  Date(year2,  month2,  0);            
days2  =  days2.getDate();            
if (day2  >  days2)  {                
day2  =  days2;            
}            
if (month2  <  10)  {                
month2  =  '0'  +  month2;            
}            
var  t2  =  year2  +  '-'  +  month2  +  '-'  +  day2;            
return  t2;        
}
//初始化时间
var myDate = new Date();
var y = myDate.getFullYear();
var m = myDate.getMonth() + 1;
var d = myDate.getDate();
var day_end = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);
var day_start = getPreMonth(day_end);
$('#create_time_start').val(day_start);
$('#create_time_end').val(day_end);//商铺跟进 添加 默认时间 一个月
record.getList(0);
// 部门 门店 二级联动
record.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html(''); //先清空
if(_id && _id != '0') {
record.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
} else {};
});
});
_doc.on('click', 'a[href="#modal-time"]', function(e) { //获取时间轴
record.record_id = $(this).attr("data-id");
e.preventDefault();
e.stopPropagation();
$('.iframe-time-line').attr('src', '/app_broker/timeline_pc?order_id=' + record.record_id);
});
$("#search").click(function() { //搜索
record.getList(1);
});
$("#reset").click(function() { //重置
document.getElementById("form_search").reset();
$('#guest_stores').html('');
});
},
getList: function(pageNo) { //获取约带看记录列表
record.pageNo = pageNo;
var params = {};
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
console.log(user_info_obj.AuthToken);
// params.district_id = $('#district_id').val() * 1;
// params.store_id = $('#guest_stores').val() * 1;
// params.user_name = $('#user_name').val();
// 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;
// console.log(params.start_time);
// 结束时间
// var end_ = $('#create_time_end').val()+" 23:59:59";
// date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
// console.log(date_end);
// params.end_time =date_end.getTime()*0.001;
params.AuthToken = user_info_obj.AuthToken;
params.agent_id = user_info_obj.id;
params.type = 1;
$.ajax({
type: 'GET',
url: '/broker/reportList', //约带看记录 对接接口
data: params,
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('inspectionRecord_list_tpl').innerHTML);
$("#follow_list").html(doTtmpl(data.data));
/*分页代码*/
add_page(data.data.total, pageNo, record.pageSize, record.getList);
$(".move-block").html(' ');
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return record;
});
\ No newline at end of file
......@@ -53,7 +53,7 @@ $(function(){
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
sessionStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
localStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
location.href = '/admin.php/index/banner';
}else {
alert(data['msg']);
......
......@@ -37,7 +37,8 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
function menu_bar(fn) {
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$ ("#menu_bar").append (template);
......@@ -70,7 +71,7 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
}
$("#logout").click(function () {
sessionStorage.removeItem('pcUserInfo');
localStorage.removeItem('pcUserInfo');
});
var _doc = $(document);
......@@ -92,6 +93,14 @@ define(['doT', 'jquery', 'text!temp/menu_template_tpl.html', 'layer'], function
layerTipsX=function(n){layer.open({content:n,skin:"msg",time:2})};//注册一个layer自定义全局函数
});
var ServerHost = location.origin;
var ServerHostTempC = 'https://pre2.tonglianjituan.com';
if(~ServerHost.indexOf('run.tonglianjituan.com')){
ServerHostTempC = 'https://run.tonglianjituan.com';
};
if(~ServerHost.indexOf('api.tonglianjituan.com')){
ServerHostTempC = 'https://api.tonglianjituan.com';
};
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = decodeURI(window.location.search).substr(1).match(reg);
......@@ -124,7 +133,7 @@ String.prototype.stringFormatObj = function(){
* @returns {boolean}
*/
function check_auth(auth_rule) {
var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo'))); //读取缓存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
var result = false;
if (user_info_obj.id != 1) {
......
......@@ -213,6 +213,17 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}
});
//详情弹出框,分佣提成里,点击删除触发的事件
_doc.on('click', '.detail-modal-maid-a-del', function(e){
e.preventDefault();
e.stopPropagation();
var _this = $(this);
if(confirm('确认删除吗?')){
var _id = _this.closest('tr').attr('data-id');
bargain.deletMaid(_id);
};
});
//详情弹出框,分佣提成里,点击新增,分佣方选择,弹出选择列表触发的事件
_doc.on('click', '#addmaid_select_ul>li', function(e){
e.preventDefault();
......@@ -948,6 +959,40 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
}
});
},
//分佣提成,删除
deletMaid: function(id){
$.ajax({
type: 'POST',
url: '/index/delPartialCommission',
data: {
'partial_id': id
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(_data) {
if(typeof _data === 'object') {
if(_data['code'] == '200') {
alert('删除成功');
bargain.maidShow();
} else {
layerTipsX(_data['msg']);
}
} else {
layerTipsX('数据错误');
};
},
error: function() {
layerTipsX('enter error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout') {
//处理超时的逻辑
layerTipsX('请求超时,请重试');
};
}
});
},
//转到一级审核
transFirstExamine: function(){
$.ajax({
......@@ -1056,7 +1101,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('reportList_list_tpl').innerHTML);
$("#maintable_list").html(doTtmpl(data.data));
// var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo')));
// var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
/*分页代码*/
add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
......
......@@ -251,7 +251,7 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'text!temp/reportList_s
if(data.code == 200) {
var doTtmpl = doT.template(document.getElementById('reportList_list_tpl').innerHTML);
$("#maintable_list").html(doTtmpl(data.data));
// var user_info_obj = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo')));
// var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
/*分页代码*/
add_page(data.data.total, pageNo, bargain.pageSize, bargain.getList);
......
......@@ -119,7 +119,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
});
};
var _pcUserInfo = JSON.parse(decodeURIComponent(sessionStorage.getItem('pcUserInfo')));
var _pcUserInfo = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo')));
console.log(_pcUserInfo);
$('#pf_tel_jia').prev().find('input').val(_pcUserInfo.id + '-' + _pcUserInfo.name + '-' + _pcUserInfo.phone).attr('data-id', _pcUserInfo.id);
$('#acqx_tel_jia').prev().find('input').val(_pcUserInfo.id + '-' + _pcUserInfo.name + '-' + _pcUserInfo.phone).attr('data-id', _pcUserInfo.id);
......@@ -280,8 +280,8 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
_discExternalObj.val(_data['disc']); //对外区
_addressInternalObj.val(_data['internal_address']); //对内详细地址
_longitudeObj.val(_data['longitude']), //经度
_latitudeObj.val(_data['latitude']), //纬度
_trafficObj.val(_data['traffic']); //交通
_latitudeObj.val(_data['latitude']), //纬度
_trafficObj.val(_data['traffic']); //交通
_hasMovedObj.val(_data['enter_num']); //已入住
_yingyeTimeObj.val(_data['do_business_date']); //营业时间
_data['opening_date'] && _kaipanTimeObj.val(_data['opening_date'].split(' ')[0]); //开盘时间
......@@ -853,6 +853,7 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
var _isBreakFlag = false;
//是否给商户公开,是否独家验证是否选择
$.each([
_shangpuTypeObj, //商铺类型是否选择
_showCdObj, //显示给C端用户看
_exclusiveTypeObj, //是否独家
], function(i, item) {
......@@ -1137,7 +1138,9 @@ define(['doT', 'css!style/shop_edit.css', 'ckfinder', 'ckfinderStart'], function
if(_id != null) {
_data['id'] = _id;
_data['upload_id'] = _objThis.upload_id;
};
}else{
_data['id'] = '';//新增时id传空
}
//当为委托转铺新增时,需要传这两个参数
if(_source) {
_data['source'] = _source;
......
......@@ -66,7 +66,9 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
store.Edit();
});
$ (document).delegate (".submit_edit", "click", function () {//提交编辑
$ (document).delegate (".submit_edit", "click", function (e) {//提交编辑
e.preventDefault();
e.stopPropagation();
store.Submit_edit();
});
$ (document).delegate (".mend", "click", function () {//点击业务员列表
......@@ -259,7 +261,8 @@ define(['doT', 'text!temp/store_template_tpl.html', 'css!style/home.css', 'ckfin
dataType: "json",
success: function(data){
if(data.code==200){
store.getList(1);
alert('修改成功');
$("#modal-edit").modal('hide');
}else{
alert(data.msg);
}
......
define (['doT', 'text!temp/user_template_tpl.html','ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker",'pagination','bootstrapJs'], function (doT, template) {
var user = {
pageNo: 1, /*第几页*/
pageSize: 15, /*每页显示多少条*/
user_id : 0,
urls: '',
agent_id_two:'',
agent_id2 : 0,
init: function () {
//初始化dot
$ ("body").append (template);
user.getList ();
user.event ();
//时间控件初始化
/* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
language: 'zh-CN',
pickTime: false
}).on('changeDate',function(){
$(this).datetimepicker('hide');
});*/
},
event: function () {
var _doc = $(document);
//二级联动
user.getDistrict(function(){
_doc.on('input', '#district_id, #district_id2', function(){
define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart', 'css!style/home.css', "datetimepicker", 'pagination', 'bootstrapJs'], function(doT, template) {
var user = {
pageNo: 1,
/*第几页*/
pageSize: 15,
/*每页显示多少条*/
user_id: 0,
user_phone:'',
urls: '',
agent_id_two: '',
agent_id2: 0,
isAjaxSaving: false,
init: function() {
//初始化dot
$("body").append(template);
user.getList();
user.event();
//时间控件初始化
/* $('#datetimepicker').datetimepicker({
format: 'yyyy-MM-dd',
language: 'zh-CN',
pickTime: false
}).on('changeDate',function(){
$(this).datetimepicker('hide');
});*/
},
event: function() {
var _doc = $(document);
//约带看列表 点击新增商铺
var _iYJAAObj = $('.detail-modal-bargaininfo-commission-addarea');
_doc.on('click', '#bargaininfo_commission_add_btn>img', function(e) {
e.preventDefault();
e.stopPropagation();
if($('.detail-modal-bargaininfo-commission-addarea>div').length >= 5) {
alert('最多添加5条');
return false;
} else {
_iYJAAObj.append('<div class="form-group detail-modal-bargaininfo-commission-sec"><span class="fore-span ld-Marheight opacity-0">约带看商铺:</span><div class=" "><input type="text" class="form-control ld-Marheight look-shop" name=" " autocomplete="off" placeholder="请输入商铺名称、商铺编号、商铺地址关键词"><ul class="look-shop-ul"></ul></div><mark href="javascript:;"class="detail-modal-bargaininfo-commission-cancel-pic ld-Marheight"><img src="/resource/image/search_gb.png"/></mark></div>');
};
});
//详情弹出框,成交信息里的实收佣金相关的事件,点击x删除这条
_doc.on('click', '.detail-modal-bargaininfo-commission-cancel-pic', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).parent().remove();
});
_doc.on('click', '.take-look', function(e) {//点击约带看 获取 客户姓名 编号 电话
e.preventDefault();
e.stopPropagation();
$('#take_look_name').html($(this).attr("data-name"));
$('#take_look_phone').html($(this).attr("data-phone"));
$('#take_look_id').html($(this).attr("data-id"));
$('#look_shop_date').val('');
$('#note_look').val('');
$('.look-shop').val('');
$('.look-shop').removeAttr('data-id');
});
//二级联动
user.getDistrict(function() {
_doc.on('input', '#district_id, #district_id2', function() {
var _this = $(this);
var _id = _this.val();
_this.next().html('');//先清空
if(_id && _id != '0'){
user.getDistrictStoreList(_id, function(_data){
// var _str = '';
_this.next().html(''); //先清空
if(_id && _id != '0') {
user.getDistrictStoreList(_id, function(_data) {
// var _str = '';
var _str = '<option value="0">全部</option>';
$.each(_data, function(i,item) {
_str += '<option value="'+item.id+'">'+item.store_name+'</option>';
});
_this.next().html(_str);
$.each(_data, function(i, item) {
_str += '<option value="' + item.id + '">' + item.store_name + '</option>';
});
_this.next().html(_str);
});
}else{
};
} else {};
});
});
$(".Bannertu").click(function() {
BrowseServer('cover_image');
});
$("#search").click(function() {
user.getList(1);
});
$("#reset").click(function() {
document.getElementById("form_search").reset();
$('#guest_stores').html('');
$('#guest_stores2').html('');
});
$("#close").click(function() {
document.getElementById("add_user_form").reset();
$(".user-ul").empty();
});
$(".close").click(function() {
document.getElementById("add_user_form").reset();
$(".user-ul").empty();
});
$("#confirm_delete").click(function() {
var params = {};
params.id = $("#delete_id").val();
params.status = 1;
if(!params.id || params.id == null) {
alert("要删除的id不能为空");
return false;
}
user.delete_user(params);
});
$(document).delegate(".genj_ure", "click", function() {
user.user_id = $(this).attr("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
});
$(document).delegate(".add_alert", "click", function() { //重置搜索
document.getElementById("add_user_form").reset();
});
// ===========================新增客户====================
$(document).delegate("#add_user", "click", function() { //新增客户
user.user_id = $(this).attr("data-id");
user.add_user();
});
// 跟进的提交按钮 点击
$(document).delegate("#edit_add", "click", function(e) {
e.preventDefault();
e.stopPropagation();
user.edit_add();
});
// 批量修改客方
$(document).delegate("#modify_add", "click", function() {
user.modify_add();
});
$(document).delegate(".caozuo", "click", function() { //点击操作跟进详情
user.user_id = $(this).attr("data-id");
user.user_phone = $(this).attr("data-phone");
user.Caozuo();
});
$(document).on("input", "#set_father_id3", function() { //手机号搜索客方
if($("#set_father_id3").val() == '') {
$(".user-ul").html('');
} else {
user.search_phone();
}
});
//拨打手机号
$(document).on("click", "#user_call", function() { //手机号搜索客方
user.user_Call();
});
//没打通手机号
$(document).on("click", "#unbind_call", function() { //手机号搜索客方
user.unbind_Call();
});
//约带看 保存
$(document).on("click", ".save-look", function() { //手机号搜索客方
user.save_look();
});
//约带看 商铺选择
$(document).on("input", ".look-shop", function() { //手机号搜索客方
if($(this).val() == '') {
$(this).next('.look-shop-ul').html('');
$(this).removeAttr("data-id");
} else {
user.search_phone_look(this);
}
});
$(document).on("input", "#cus_fang", function() { //手机号搜索客方2
if($("#cus_fang").val() == '') {
$(".user-ul2").html('');
} else {
user.search_phone2();
}
});
$(document).delegate(".addphone", "click", function() { //list消失
user.addphone(this);
});
$(document).delegate(".addphone2", "click", function() { //list2消失
user.addphone2(this);
});
//点击列表 获取input的值
$(document).delegate(".addphone3", "click", function() { //list3消失
user.addphone3(this);
});
// =============================下拉列表===================
$(document).delegate(".submit_edit", "click", function(e) { //提交
e.preventDefault();
e.stopPropagation();
user.Submit_follow();
});
// =============下拉列表========================
var _ajaxObjTel = null;
_doc.on('input', '.phone_jia', function() {
var _this = $(this),
_thisVal = $.trim(_this.val());
_this.removeAttr('data-id'); //移除之前携带的信息
if(_thisVal != '') {
_ajaxObjTel && _ajaxObjTel.abort();
_ajaxObjTel = $.ajax({
type: 'GET',
url: '/index/getBroker_new',
data: {
'phone': $.trim(_this.val())
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if(data.code == 200) {
if(data['data'].length > 0) {
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li data-id="{3}">{2}{0}-{1}<li>'.stringFormatObj({
'0': item['name'],
'1': item['phone'],
'2': _this.parent().nextAll('.input-add-tel').data('hideid') ? '' : (item['id'] + '-'),
'3': item['id']
});
});
// 输出trim
_this.next().show().html(_htmlTemp);
} else {
_this.next().html('');
};
} else {
alert(data['msg']);
};
} else {
alert('数据错误');
};
},
error: function() {
//alert('error');
},
complete: function(xhr, textStatus) {
if(textStatus === 'timeout') {
alert('请求超时');
};
}
});
};
});
_doc.on('click', '.jian_class>ul>li', function() {
var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id', _this.attr('data-id'));
_this.parent().html('').hide();
});
// ===================
},
addphone: function(obj) {
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) {
var _obj = $(obj);
var user_ht = _obj.html();
_obj.parent().html('').prev().val(user_ht).attr('data-id', _obj.attr('data-id'));
},
save_look: function() { //约带看 点击保存
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
var arr_look=[];
for(var i=0;i<$('.look-shop').length;i++){
if($('.look-shop').eq(i).attr('data-id')){//如果id为空 不提交空的数据
arr_look[i]=$('.look-shop').eq(i).attr('data-id');
}
}
// if(user_info_obj.id==1){
// alert('当前用户没有权限提交约带看');
// return false;
// }
if(arr_look.length<0||arr_look.length==0){
alert('请选择约带看商铺');
return false;
}
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
if(!user.isAjaxSaving){
user.isAjaxSaving = true;
$.ajax({
url: '/broker/report',
type: 'POST',
async: true,
timeout: 30000,
data: {
"AuthToken": user_info_obj.AuthToken,
"report_agent_id": user_info_obj.id,
"report_store_id": user_info_obj.store_id,
"vehicle": 10,
"intro": $("#note_look").val(),
"predict_see_time": start_time,
"user_id": $("#take_look_id").html(),
"house_ids": arr_look.join(','),
"report_agent_phone": user_info_obj.phone
},
beforeSend: function() {},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
alert('提交成功');
user.isAjaxSaving = false;//请求结束,再改为初始状态
$("#modal-takeLook").modal('hide');//提交成功后 关闭弹窗
} else {
alert(data.msg);
}
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
layerTipsX('请求超时');
};
}
});
});
$ (".Bannertu").click (function () {
BrowseServer ('cover_image');
});
$("#search").click(function(){
user.getList(1);
});
$("#reset").click(function () {
document.getElementById("form_search").reset();
$('#guest_stores').html('');
$('#guest_stores2').html('');
});
$("#close").click(function () {
document.getElementById("add_user_form").reset();
$(".user-ul").empty();
});
$(".close").click(function(){
document.getElementById("add_user_form").reset();
$(".user-ul").empty();
});
$("#confirm_delete").click(function(){
var params = {};
params.id = $ ("#delete_id").val ();
params.status = 1;
if(!params.id || params.id == null){
alert ("要删除的id不能为空");
return false;
}
user.delete_user(params);
});
$ (document).delegate (".genj_ure", "click", function () {
user.user_id = $ (this).attr ("data-id");
// $("#genj_text").val('');
// $("input[name = 'user_status']:checked").removeAttr("checked");
user.getGenjinLabel();
});
$ (document).delegate (".add_alert", "click", function () {//新增客户
document.getElementById("add_user_form").reset();
});
// ===========================新增客户====================
$ (document).delegate ("#add_user", "click", function () {//新增客户
user.user_id = $ (this).attr ("data-id");
user.add_user();
});
// 跟进的提交按钮 点击
$ (document).delegate ("#edit_add", "click", function () {
user.edit_add();
});
// 批量修改客方
$ (document).delegate ("#modify_add", "click", function () {
user.modify_add();
});
$ (document).delegate (".caozuo", "click", function () {//点击操作跟进详情
user.user_id = $ (this).attr ("data-id");
user.Caozuo();
});
$ (document).on ("input","#set_father_id3", function () {//手机号搜索客方
if($("#set_father_id3").val()==''){
$(".user-ul").html('');
}else{
user.search_phone();
}
});
$ (document).on ("input","#cus_fang", function () {//手机号搜索客方2
if($("#cus_fang").val()==''){
$(".user-ul2").html('');
}else{
user.search_phone2();
}
});
$ (document).delegate (".addphone", "click", function () {//list消失
user.addphone(this);
});
$ (document).delegate (".addphone2", "click", function () {//list2消失
user.addphone2(this);
});
// =============================下拉列表===================
$ (document).delegate (".submit_edit", "click", function () {//提交
user.Submit_follow();
});
// =============下拉列表========================
var _ajaxObjTel = null;
_doc.on('input', '.phone_jia' ,function(){
var _this = $(this),
_thisVal = $.trim(_this.val());
_this.removeAttr('data-id');//移除之前携带的信息
if(_thisVal != ''){
_ajaxObjTel && _ajaxObjTel.abort();
_ajaxObjTel = $.ajax({
type: 'GET',
url: '/index/getBroker_new',
data: {
'phone': $.trim(_this.val())
},
timeout: 30000,
dataType: 'json',
beforeSend: function() {},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
if(data['data'].length > 0){
var _htmlTemp = '';
$.each(data['data'], function(i, item) {
_htmlTemp += '<li data-id="{3}">{2}{0}-{1}<li>'.stringFormatObj({
'0': item['name'],
'1': item['phone'],
'2': _this.parent().nextAll('.input-add-tel').data('hideid')?'':(item['id']+'-'),
'3': item['id']
});
});
// 输出trim
_this.next().show().html(_htmlTemp);
}else{
_this.next().html('');
};
}else {
alert(data['msg']);
};
}else{
alert('数据错误');
};
},
error: function() {
//alert('error');
},
complete: function(xhr, textStatus){
if(textStatus === 'timeout'){
alert('请求超时');
};
}
});
};
});
_doc.on('click', '.jian_class>ul>li', function(){
var _this = $(this);
_this.parent().prev().val(_this.html()).attr('data-id',_this.attr('data-id'));
_this.parent().html('').hide();
});
// ===================
}
},
addphone:function(obj){
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");
},
search_phone:function(){//手机号
$.ajax ({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone":$("#set_father_id3").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var user_ul = "";
$.each(data.data, function(i,item) {
user_ul+='<li class="addphone" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
});
$(".user-ul").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
search_phone2:function(){//手机号
$.ajax ({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone":$("#cus_fang").val()
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i,item) {
user_ul2+='<li class="addphone2" data-id="'+item.id+'">'+item.id+'-'+item.name+'-'+item.phone+'</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
Submit_follow: function() { //提交
var params = {};
params.id = user.user_id;
params.user_name = $("#cus_name").val();
params.agents_id =user.agent_id2;
params.sex = $("#sex").val();
params.industry_type=$("select[name=industry_type_two]").val();
params.price_demand=$("input[name=price_demand]").val();
params.area_demand=$("input[name=area_demand]").val();
$.ajax({
'type': 'POST',
'url': '/index/pcEditClient',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
user.getList(1);
} else {
alert(data.msg)
}
}
});
},
edit_add : function () {//提交跟进
var user_status = $("input[name = 'user_status']:checked").val();
var genj_text = $("#genj_text").val();
if (genj_text == '') {
alert('跟进内容为空');
return false;
}
if (user_status == undefined) {
alert('状态标签未选中');
return false;
}
$.ajax ({
url: '/index/pcAddFollow',
type: 'POST',
async: true,
data: {
"user_id" : user.user_id,
"content" : genj_text,
"user_status": user_status
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
user.getList(1);
} else {
alert(data.msg);
}
}
});
},
//
// 批量修改客方
//
modify_add : function () {//modify_add批量修改客方
var old_agents_text = $('.old_agents').val();
var new_agents_text = $('.new_agents').val();
console.log($('.phone_jia:eq(0)').attr('data-id'));
console.log($('.phone_jia:eq(1)').attr('data-id'));
// console.log($('.old_agents').attr('name'));
if (old_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
if (new_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
$.ajax ({
url: '/index/batchEditCustomer',
type: 'POST',
async: true,
data: {
"old_agents_id":$('.phone_jia:eq(0)').attr('data-id'),
"agents_id":$('.phone_jia:eq(1)').attr('data-id'),
},
dataType: 'json',
success: function (data) {
if (data.code == 200) {
console.log(666);
}
}
});
},
// ====================新增客户页面==================
Caozuo:function(){//获取跟进详情的数据
$.ajax({
'type': 'GET',
'url' : '/index/useraction_search',
data: {"user_id":user.user_id},
dataType: "json",
success: function(data){
if(data.code == 200){
if (data.data) {
$("#cus_id").html(data.data.user_info.user_id);//客户编号
$("#cus_name").val(data.data.user_info.user_name);//姓名
$("#cus_nick").html(data.data.user_info.user_nick);//昵称
$("#registration_time").html(data.data.user_info.registration_time);
$("#sex").val(data.data.user_info.sex);//性别
$("#cus_phone").html(hideTel(data.data.user_info.user_phone));//电话
$("#cus_date").html(data.data.user_info.create_time);//创建时间
$("#referrer_user").html(data.data.user_info.referrer_user);//上传时间
$("#cus_fang").val(data.data.user_info.agentinfo);//客方
$("select[name=industry_type_two]").val(data.data.user_info.industry_type);
$("input[name=price_demand]").val(data.data.user_info.price_demand*1);
$("input[name=area_demand]").val(data.data.user_info.area_demand*1);
user.agent_id_two=data.data.user_info.agent_id;
console.log(data.data.user_info.source);
if(data.data.user_info.source==10){
$("#source_type").html('客户c端注册');//客方
}
if(data.data.user_info.source==20){
$("#source_type").html('经纪人报备时添加,状态未激');
}
if(data.data.user_info.source==30){
$("#source_type").html('老数据报备客户');
}
var caozuo_table="";
$.each(data['data']['user_history'], function(i, item) {
caozuo_table +='<tr><td>'+item.remark+'</td><td>'+item.name+'</td><td>'+item.create_time+'</td></tr>';
});
$("#caozuo_table").html(caozuo_table);
}
} else {
alert('获取失败!');
}
}
});
},
//筛选
getList: function (pageNo) {
user.pageNo = pageNo;
var params = {};
// 并列搜索
// if($("#district_id").val()!=0){
// $("#district_id2").val('0');
// $("#guest_stores2").val('');
// console.log($("#district_id2").val());
// console.log($("#guest_stores2").val());
// };
// if($("#district_id2").val()!=0){
// $("#district_id1").val('0');
// $("#guest_stores1").val('');
// console.log($("#district_id").val());
// console.log($("#guest_stores").val());
// };
// 增加客户id的搜索 客户姓名和手机号搜索分开
params.user_nick = $("input[name='user']").val();
params.phone = $("input[name='phone']").val();
params.id = $("input[name='userID']").val();
params.phone = $("input[name='phone']").val();
params.invite_phone = $("input[name='invite_phone']").val();
params.start_date = $("#start_date").val();
params.end_date = $("#end_date").val();
params.follow_start = $("#follow_start").val();
params.follow_end = $("#follow_end").val();
params.registration_start=$("#registration_start").val()
params.registration_end=$("#registration_end").val()
params.login_status = $("select[name=login_status]").val();
params.activate = $("select[name=activate]").val();
params.rent_user=$("select[name=public_status]").val();
params.public_user=$("select[name=male_status]").val();
params.store_id=$("#guest_stores").val();
params.referrer_store_id=$("#guest_stores2").val();
params.district_id=$("#district_id").val()
params.referrer_district_id=$("#district_id2").val()
params.login_status = $("select[name=login_status]").val();
params.activate = $("select[name=activate]").val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
params.user_agent = $("input[name='user_agent']").val();
params.invite_agent_phone = $("input[name='invite_agent_phone']").val();
params.area_type = $("select[name=area_type]").val();
params.price_type = $("select[name=price_type]").val();
params.industry_type = $("select[name=industry_type]").val();
params.first_login_start = $("#first_login_start").val();
params.first_login_end = $("#first_login_end").val();
//客方和邀请人搜索项不能并列
$.ajax ({
url: '/index/users_list',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
if (data.code == 200) {
var temp = document.getElementById ('user_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#users_list").html (doTtmpl (data.data.list));
/*分页代码*/
add_page(data.data.total,pageNo,user.pageSize,user.getList);
$("#total_page").html(data.data.total);
} else {
alert(data.msg);
}
}
});
},
add_user : function () {
var params = {};
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.price_demand=$("#price_type2").val();
params.area_demand=$("#area_type2").val();
params.industry_type=$("#industry_type2").val();
params.type='add';
if (params.user_name == '') {
alert('姓名不能为空');
$("input[name='user_name']").focus();
return ;
}
if (params.user_phone == '') {
alert('手机号不能为空');
$("input[name='user_phone']").focus();
return ;
}
if (params.pwd == '') {
alert('密码不能为空');
$("input[name='pwd']").focus();
return ;
}
if (params.user_phone.length != 11) {
alert('手机号错误');
$("input[name='user_phone']").focus();
return ;
}
$.ajax ({
url: '/index/user_add',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function (data) {
if (data.code == 200) {
user.getList(1);
alert('提交成功')
// document.getElementById("add_user_form").reset();
} else {
alert(data.msg);
}
}
});
},
delete_user : function(params) {
$.ajax ({
url: '/index/del_user',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function (data) {
$ ("#modal-delete").modal ('hide');
if (data.code == "101") {
alert (data.msg);
return false;
}
user.getList (user.pageNo);
}
});
},
getGenjinLabel:function () {
$('#genj_text').val('');
$.ajax ({
url: '/index/getUserLabel',
type: 'GET',
async: true,
data: {"user_id":user.user_id},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
$("input[type='radio'][name='user_status'][value="+data.data+"]").prop("checked", "checked");
}
}
});
},
//调用部门 和 门店的接口
getDistrict : function (fn) {
$.ajax ({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {"pageSize":1000},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i,item) {
str += '<option value="'+item.id+'">'+item.district_name+'</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn){
$.ajax ({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id':id,
"pageSize":1000
},
dataType: 'json',
success: function (data) {
if (data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return user;
},
search_phone: function() { //手机号
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#set_father_id3").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul = "";
$.each(data.data, function(i, item) {
user_ul += '<li class="addphone" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul").html(user_ul);
} else {
alert(data.msg);
}
}
});
},
search_phone2: function() { //手机号
$.ajax({
url: '/index/getBroker_new',
type: 'GET',
async: true,
data: {
"phone": $("#cus_fang").val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i, item) {
user_ul2 += '<li class="addphone2" data-id="' + item.id + '">' + item.id + '-' + item.name + '-' + item.phone + '</li>';
});
$(".user-ul2").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
search_phone_look: function(n) { //商铺名选择
$.ajax({
// url:"https://pre2.tonglianjituan.com"+ '/broker/getShopList',
url:'/broker/getShopList',
type: 'GET',
async: true,
data: {
"site_area":5,
"title":$(n).val()
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var user_ul2 = "";
$.each(data.data, function(i, item) {
user_ul2 += '<li class="addphone3" data-id="' + item.id + '">' + item.id + '-' + item.title + '-' + item.address + '</li>';
});
$(n).next('.look-shop-ul').html(user_ul2);
// $(".look-shop-ul").html(user_ul2);
} else {
alert(data.msg);
}
}
});
},
user_Call: function() { //客户详情 点击拨打按钮
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
var params = {};
params.phone_a = user_info_obj.phone;
$('#phone_title').html(user_info_obj.phone);
params.AuthToken = user_info_obj.AuthToken;
params.user_id = user.user_id;
console.log(params);
$.ajax({
'type': 'POST',
'url': '/index/bindAXB',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
// alert('修改成功');
console.log(data.data.data.phone);
$('#phone_title2').html(data.data.data.phone);
// $("#modal-record").modal('hide');
} else {
alert(data.msg)
}
}
});
},
unbind_Call: function() { //客户详情 点击拨打按钮 弹出框 没打通
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
console.log(user_info_obj);
var params = {};
params.user_id = user.user_id;
params.phone_a = user_info_obj.phone;
$('#phone_title').html(user_info_obj.phone);
params.AuthToken = user_info_obj.AuthToken;
params.phone_x = $('#phone_title2').html()*1;
console.log(params);
$.ajax({
'type': 'POST',
'url': '/index/agentsUnBind',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
// alert(data.msg);
// $("#modal-record").modal('hide');
} else {
alert(data.msg)
}
}
});
},
Submit_follow: function() { //提交
var params = {};
params.id = user.user_id;
params.user_name = $("#cus_name").val();
params.agents_id = user.agent_id2;
params.sex = $("#sex").val();
params.vip = $("#user_vip2").val();
params.industry_type = $("select[name=industry_type_two]").val();
params.price_demand = $("input[name=price_demand]").val();
params.area_demand = $("input[name=area_demand]").val();
$.ajax({
'type': 'POST',
'url': '/index/pcEditClient',
data: params,
dataType: "json",
success: function(data) {
if(data.code == 200) {
alert('修改成功');
$("#modal-record").modal('hide');
} else {
alert(data.msg)
}
}
});
},
edit_add: function() { //提交跟进
var user_status = $("input[name = 'user_status']:checked").val();
var genj_text = $("#genj_text").val();
if(genj_text == '') {
alert('提交失败');
return false;
}
if(user_status == undefined) {
alert('状态标签未选中');
return false;
}
$.ajax({
url: '/index/pcAddFollow',
type: 'POST',
async: true,
data: {
"user_id": user.user_id,
"content": genj_text,
"user_status": user_status
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
alert('修改成功');
$("#modal-add").modal('hide');
} else {
alert(data.msg);
}
}
});
},
//
// 批量修改客方
//
modify_add: function() { //modify_add批量修改客方
var old_agents_text = $('.old_agents').val();
var new_agents_text = $('.new_agents').val();
console.log($('.phone_jia:eq(0)').attr('data-id'));
console.log($('.phone_jia:eq(1)').attr('data-id'));
// console.log($('.old_agents').attr('name'));
if(old_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
if(new_agents_text == '') {
alert('请输入经纪人内容为空');
return false;
}
$.ajax({
url: '/index/batchEditCustomer',
type: 'POST',
async: true,
data: {
"old_agents_id": $('.phone_jia:eq(0)').attr('data-id'),
"agents_id": $('.phone_jia:eq(1)').attr('data-id'),
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
console.log(666);
}
}
});
},
// ====================新增客户页面==================
Caozuo: function() { //获取跟进详情的数据
$.ajax({
'type': 'GET',
'url': '/index/useraction_search',
data: {
"user_id": user.user_id
},
dataType: "json",
success: function(data) {
if(data.code == 200) {
if(data.data) {
$("#cus_id").html(data.data.user_info.user_id); //客户编号
$("#cus_name").val(data.data.user_info.user_name); //姓名
$("#cus_nick").html(data.data.user_info.user_nick); //昵称
$("#registration_time").html(data.data.user_info.registration_time);
$("#firstlogin_time").html(data.data.user_info.first_login_time);//第一次登陆时间
$("#sex").val(data.data.user_info.sex); //性别
$("#user_vip2").val(data.data.user_info.vip); //是否vip
$("#cus_phone").html(hideTel(data.data.user_info.user_phone)); //电话
$("#cus_date").html(data.data.user_info.create_time); //创建时间
$("#referrer_user").html(data.data.user_info.referrer_user); //上传时间
$("#cus_fang").val(data.data.user_info.agentinfo); //客方
$("select[name=industry_type_two]").val(data.data.user_info.industry_type);
$("input[name=price_demand]").val(data.data.user_info.price_demand * 1);
$("input[name=area_demand]").val(data.data.user_info.area_demand * 1);
user.agent_id_two = data.data.user_info.agent_id;
console.log(data.data.user_info.source);
if(data.data.user_info.source == 10) {
$("#source_type").html('客户c端注册'); //客方
}
if(data.data.user_info.source == 20) {
$("#source_type").html('经纪人报备时添加,状态未激');
}
if(data.data.user_info.source == 30) {
$("#source_type").html('老数据报备客户');
}
var caozuo_table = "";
$.each(data['data']['user_history'], function(i, item) {
caozuo_table += '<tr><td>' + item.remark + '</td><td>' + item.name + '</td><td>' + item.create_time + '</td></tr>';
});
$("#caozuo_table").html(caozuo_table);
}
} else {
alert('获取失败!');
}
}
});
},
//筛选
getList: function(pageNo) {
user.pageNo = pageNo;
var params = {};
// 并列搜索
// if($("#district_id").val()!=0){
// $("#district_id2").val('0');
// $("#guest_stores2").val('');
// console.log($("#district_id2").val());
// console.log($("#guest_stores2").val());
// };
// if($("#district_id2").val()!=0){
// $("#district_id1").val('0');
// $("#guest_stores1").val('');
// console.log($("#district_id").val());
// console.log($("#guest_stores").val());
// };
// 增加客户id的搜索 客户姓名和手机号搜索分开
params.user_nick = $("input[name='user']").val();
params.phone = $("input[name='phone']").val();
params.id = $("input[name='userID']").val();
params.phone = $("input[name='phone']").val();
params.invite_phone = $("input[name='invite_phone']").val();
params.start_date = $("#start_date").val();
params.end_date = $("#end_date").val();
params.follow_start = $("#follow_start").val();
params.follow_end = $("#follow_end").val();
params.registration_start = $("#registration_start").val()
params.registration_end = $("#registration_end").val()
params.login_status = $("select[name=login_status]").val();
params.activate = $("select[name=activate]").val();
params.rent_user = $("select[name=public_status]").val();
params.public_user = $("select[name=male_status]").val();
params.store_id = $("#guest_stores").val();
params.referrer_store_id = $("#guest_stores2").val();
params.district_id = $("#district_id").val()
params.referrer_district_id = $("#district_id2").val()
params.login_status = $("select[name=login_status]").val();
params.activate = $("select[name=activate]").val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
params.user_agent = $("input[name='user_agent']").val();
params.invite_agent_phone = $("input[name='invite_agent_phone']").val();
params.area_type = $("select[name=area_type]").val();
params.price_type = $("select[name=price_type]").val();
params.industry_type = $("select[name=industry_type]").val();
params.first_login_start = $("#first_login_start").val();
params.first_login_end = $("#first_login_end").val();
//客方和邀请人搜索项不能并列
$.ajax({
url: '/index/users_list',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function(data) {
if(data.code == 200) {
var temp = document.getElementById('user_list_tpl').innerHTML;
var doTtmpl = doT.template(temp);
$("#users_list").html(doTtmpl(data.data.list));
/*分页代码*/
add_page(data.data.total, pageNo, user.pageSize, user.getList);
$("#total_page").html(data.data.total);
} else {
alert(data.msg);
}
}
});
},
add_user: function() {
var params = {};
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.price_demand = $("#price_type2").val();
params.area_demand = $("#area_type2").val();
params.industry_type = $("#industry_type2").val();
params.vip = $("#user_vip").val();
params.type = 'add';
if(params.user_name == '') {
alert('姓名不能为空');
$("input[name='user_name']").focus();
return;
}
if(params.vip=='') {
alert('请选择vip');
$("#user_vip").focus();
return;
}
if(params.user_phone == '') {
alert('手机号不能为空');
$("input[name='user_phone']").focus();
return;
}
if(params.pwd == '') {
alert('密码不能为空');
$("input[name='pwd']").focus();
return;
}
if(params.user_phone.length != 11) {
alert('手机号错误');
$("input[name='user_phone']").focus();
return;
}
$.ajax({
url: '/index/pcEditClient',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function(data) {
if(data.code == 200) {
user.getList(1);
alert('提交成功')
// document.getElementById("add_user_form").reset();
} else {
alert(data.msg);
}
}
});
},
delete_user: function(params) {
$.ajax({
url: '/index/del_user',
type: 'POST',
async: true,
data: params,
dataType: 'json',
success: function(data) {
$("#modal-delete").modal('hide');
if(data.code == "101") {
alert(data.msg);
return false;
}
user.getList(user.pageNo);
}
});
},
getGenjinLabel: function() {
$('#genj_text').val('');
$.ajax({
url: '/index/getUserLabel',
type: 'GET',
async: true,
data: {
"user_id": user.user_id
},
dataType: 'json',
success: function(data) {
if(data.code == 200) {
$("input[type='radio'][name='user_status'][value=" + data.data + "]").prop("checked", "checked");
user.getGenjincon();
}
}
});
},
getGenjincon: function() {//获取客户动态
var user_info_obj = JSON.parse(decodeURIComponent(localStorage.getItem('pcUserInfo'))); //读取缓存
$.ajax({
// url: '/index/useraction_search',
url: '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>';
});
if(caozuo_table){
$("#caozuo_table2").html(caozuo_table);
}else{
$("#caozuo_table2").html('暂无跟进信息');
}
}
}
});
},
//调用部门 和 门店的接口
getDistrict: function(fn) {
$.ajax({
url: '/index/getDistrict',
type: 'GET',
async: true,
data: {
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
var str = '';
$.each(data.data, function(i, item) {
str += '<option value="' + item.id + '">' + item.district_name + '</option>';
});
$("#district_id").append(str);
$("#district_id2").append(str);
fn && fn();
}
}
});
},
getDistrictStoreList: function(id, fn) {
$.ajax({
url: '/index/getDistrictStoreList',
type: 'GET',
async: true,
data: {
'id': id,
"pageSize": 1000
},
dataType: 'json',
success: function(data) {
if(data.code == 200 && data.data != null) {
fn && fn(data.data);
}
}
});
}
};
return user;
});
function delete_user (obj) {
$ ("#delete_id").val ($ (obj).attr ("data-id"));
function delete_user(obj) {
$("#delete_id").val($(obj).attr("data-id"));
}
function edit(obj) {
var params = {}
params.id = $(obj).attr ("data-id")
$.ajax ({
url: '/index/usersList',
type: 'get',
async: true,
data: params,
dataType: 'json',
success: function (data) {
$("#edit_user_form input[name='phone']").val(data.data.list[0].user_phone);
$("#edit_user_form input[name='password']").val(data.data.list[0].user_pswd);
$("#invite_name").html(data.data.list[0].realname);
$("#invite_phone").html(data.data.list[0].phone);
}
});
$ ("#edit_id").val ($ (obj).attr ("data-id"));
var params = {}
params.id = $(obj).attr("data-id")
$.ajax({
url: '/index/usersList',
type: 'get',
async: true,
data: params,
dataType: 'json',
success: function(data) {
$("#edit_user_form input[name='phone']").val(data.data.list[0].user_phone);
$("#edit_user_form input[name='password']").val(data.data.list[0].user_pswd);
$("#invite_name").html(data.data.list[0].realname);
$("#invite_phone").html(data.data.list[0].phone);
}
});
$("#edit_id").val($(obj).attr("data-id"));
}
\ No newline at end of file
......@@ -24,7 +24,7 @@ function add_page (total_list, page_no, page_size, methodName) {
methodName (api.getCurrent ());
}
});
var str = '<span style="float: left;min-width: 250px !important;text-align: left !important;">' +
var str = '<span style="float: left;min-width: 250px !important;text-align: left !important;" class ="move-block">' +
'每页显示' + page_size + '条 | 共' + total_list + '条</span>';
$ ('#pagediv').append (str);
......
<script id="followHouseUp_list_tpl" type="text/template">
[% if(it&&it.length!=0) { %]
[% for(var item in it){ %]
<tr class="text-center">
<!--对接接口-->
<td>[%= it[item]['create_time'] %]</td>
<td>[%= it[item]['follow_up_info'] %]</td>
<td>[%= it[item]['name'] %]</td>
<td>[%= it[item]['house_id'] %]</td>
<td>
[% if(it[item]["store_name"] != null) { %]
[%= it[item]['store_name'] %]
[% } %]
</td>
<!--<td>
<a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>查看商铺</a>
<a class="btn1 btn-info" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["report_id"] %]'>商铺跟进</a>
</td>-->
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
<!--<td>[% if(it[item]["label_name"] != null) { %]
[%= it[item]["label_name"] %]
[% } %]
</td>-->
......@@ -7,6 +7,8 @@
<td>[%= it[item]['user_phone'] %]</td>
<td>[%= it[item]['money'] %]</td>
<td>[%= it[item]['real_money'] %]</td>
<!--手续费-->
<td>[%= it[item]['transaction_fee'] %]</td>
<td>[%= it[item]['type'] %]</td>
<td>[%= it[item]['pay_type'] %]</td>
<td>[%= it[item]['internal_address'] %]</td>
......@@ -15,7 +17,7 @@
<!--增加收款图片 2.2版本-->
<a class="btn1 btn-info add-pic" href="#modal-addPic" data-toggle="modal" data-id='[%= it[item]["id"] %]' father-id='[%= it[item]["father_id"] %]'>收款图片</a>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
<a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal" data-id='[%= it[item]["id"]%]' data-money='[%= it[item]["real_money"] %]'>编辑</a>
<a class="btn1 btn-info submit_edit2" href="#modal-linetime" data-toggle="modal" data-id='[%= it[item]["id"]%]' data-fee='[%= it[item]["transaction_fee"]%]' data-money='[%= it[item]["real_money"] %]'>实付金额</a>
</td>
</tr>
[% } %]
......
......@@ -42,7 +42,7 @@
待租
[% } %]
</td>
<td>
<!--<td>
[% if(it[item]["dish_name"] != "") { %]
[%= it[item]['dish_name'] %]
[% } %]
......@@ -50,19 +50,25 @@
[% if(check_auth('index/addHousesAgentsDish')) { %]
<a data-toggle="modal" data-id='[%= it[item]["id"] %]' href="#modal-anch" class="btn1 btn-danger add_applies">修改</a>
[% } %]
</td>
</td>-->
<td>
<a class="btn1 [%= (it[item]['is_look'] && it[item]['auth_edit_house'] == 0)?'btn-warning':'btn-success' %]" href="#modal_shop_detail" data-id='[%= it[item]["id"] %]' data-toggle="modal" >查看</a>
[% if(check_auth('broker/addShopFollowUp')) { %]
<a class="btn1 btn-success " href="#modal_followup" data-id='[%= it[item]["id"] %]' data-toggle="modal" >跟进</a>
[% } %]
[% if(it[item]['auth_edit_house'] || check_auth('index/houseEdit')) { %]
<a class="btn1 btn-success " href="/admin.php/index/houseEdit?id=[%= it[item]['id']%]" data-toggle="modal" >编辑</a>
[% } %]
[% if(check_auth('index/houseEdit')) { %]
<a class="btn1 btn-success is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>推荐至首页</a>
<a class="btn1 btn-success is_show" data-toggle="modal" data-id='[%= it[item]["id"] %]'>推荐</a>
[% } %]
[% if(check_auth('index/addHousesAgents')) { %]
<!--[% if(check_auth('index/addHousesAgents')) { %]
<a class="btn1 btn-success anch" data-target="#modal-anch" data-toggle="modal" data-id='[%= it[item]["id"] %]'>设置案场权限人</a>
[% } %]
[% } %]-->
[% if(check_auth('index/editExclusive')) { %]
<a class="btn1 btn-success dujia" href="#modal-dujia" data-toggle="modal" data-id='[%= it[item]["id"] %]' >是否独家</a>
......
<script id="inspectionRecord_list_tpl" type="text/template">
[% if(it&&it.length!=0) { %]
[% for(var item in it){ %]
<tr class="text-center">
<!--对接接口-->
<td>[%= it[item]['user_name'] %]</td>
<td>[%= it[item]['user_phone'] %]</td>
<td>[%= it[item]['create_time'] %]</td>
<!--<td>[%= it[item]['report_agent_name'] %]</td>-->
<td>[%= it[item]['house_title'] %]</td>
<td>[%= it[item]['predict_see_time'] %]</td>
<td>
<a class="btn1 btn-info timeline" href="#modal-time" data-toggle="modal" data-id='[%= it[item]["order_id"] %]'>时间轴</a>
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="8" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
......@@ -18,7 +18,11 @@
[%= it[item]['content'] %]
</td>
<td>[%= it[item]['admin'] %]</td>
<td>[%= it[item]['user_nick'] %]</td>
<td>
[% if(it[item]['user_name']) { %]
[%= it[item]['user_name'] %]
[% } %]
</td>
<td>[%= it[item]['user_phone'] %]</td>
<td>
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>详细信息</a>
......
......@@ -31,6 +31,11 @@
</div>
[% } %]
</td>
<td>
[% if(check_auth('index/delPartialCommission') && (it['data'][i]['father_id'] != 0)) { %]
<a href="javascript:;" class="detail-modal-maid-a-del">删除</a>
[% } %]
</td>
</tr>
[% } %]
[% }else{ %]
......
......@@ -4,7 +4,8 @@
[% for(var item in it["list"]){ %]
<tr data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center" width="10%">[%= it["list"][item]['create_time'] %]</td>
<td class="text-left" width="36%">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center" width="8%">[%= it["list"][item]['is_open']?'是':'否' %]</td>
<td class="text-left">[%= it["list"][item]['internal_address'] %]</td>
<td class="text-center">[%= it["list"][item]['house_number'] %]</td>
<td class="text-center">[%= it["list"][item]['user_name'] %]</td>
<td class="text-center">[%= hideTel(it["list"][item]['user_phone']) %]</td>
......
<script id="user_list_tpl" type="text/template">
[% if(it[0]) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>
[% if(it[item]["user_name"] != null) { %]
[%= it[item]["user_name"] %]
[% } %]
</td>
<td>[%= hideTel(it[item]["user_phone"]) %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["follow_time"] != null) { %]
[%= it[item]["follow_time"] %]
[% } %]
</td>
<td>
[% if(it[item]["status"] == -1) { %]
未注册
[% }else if(it[item]["status"] == 0) { %]
注册
[% }else{ %]
删除
[% } %]
</td>
<td>
[% if (it[item]['first_login_time'] == null){ %]
[% }else{ %]
[% } %]
</td>
<td>
[% if (it[item]['user_nick'] != null){ %]
[%= it[item]["user_nick"] %]
[% } %]
</td>
<td>
[% if (it[item]['registration_time'] != null){ %]
[%= it[item]["registration_time"] %]
[% } %]
</td>
<td>
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-id='[%= it[item]["id"] %]'>
详细信息
</a>
<a class="btn1 btn-success genj_ure" href="#modal-add" data-toggle="modal" data-id='[%= it[item]["id"] %]'>
跟进
</a>
<!--<a class="btn1 btn-danger " href="#modal-delete" data-toggle="modal" onclick="delete_user(this)" data-id='[%= it[item]["id"] %]'>-->
<!--删除-->
<!--</a>-->
</td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="7" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
[% if(it[0]) { %] [% for(var item in it){ %]
<tr>
<td>[%= it[item]['id'] %]</td>
<td>
[% if(it[item]["user_name"] != null) { %] [%= it[item]["user_name"] %] [% } %]
</td>
<td>[%= hideTel(it[item]["user_phone"]) %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
[% if(it[item]["follow_time"] != null) { %] [%= it[item]["follow_time"] %] [% } %]
</td>
<td>
[% if(it[item]["status"] == -1) { %] 未注册 [% }else if(it[item]["status"] == 0) { %] 注册 [% }else{ %] 删除 [% } %]
</td>
<td>
[% if (it[item]['first_login_time'] == null){ %] [% }else{ %] [% } %]
</td>
<td>
[% if (it[item]['user_nick'] != null){ %] [%= it[item]["user_nick"] %] [% } %]
</td>
<td>
[% if (it[item]['registration_time'] != null){ %] [%= it[item]["registration_time"] %] [% } %]
</td>
<td>
[% 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'))) { %]
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>
详细信息
</a>
<a class="btn1 btn-success genj_ure" href="#modal-add" data-toggle="modal" data-id='[%= it[item]["id"] %]'>
跟进
</a>
<a class="btn1 btn-success take-look" href="#modal-takeLook" data-toggle="modal" data-id='[%= it[item]["id"] %]' data-name='[%= it[item]["user_name"] %]' data-phone='[%= it[item]["user_phone"] %]'>
约带看
</a>
[% } %]
<!--<a class="btn1 btn-danger " href="#modal-delete" data-toggle="modal" onclick="delete_user(this)" data-id='[%= it[item]["id"] %]'>-->
<!--删除-->
<!--</a>-->
</td>
</tr>
[% } %] [% }else{ %]
<tr>
<td colspan="7" 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