This commit is contained in:
xiaoyu
2024-03-06 11:33:06 +08:00
parent 786fa54b03
commit a06c9f4bc8
14 changed files with 1484 additions and 383 deletions
+205 -364
View File
@@ -6,97 +6,118 @@ class Clues extends HD_Controller
{
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名', 'void' => 'voId', );
private $bizs = array(
'100958' => array(
'biz' => '福州齐安路',
'sa' => '陈秋龙',
'mobile' => '17758949069'
'350' => array(
'name' => '福',
'list' => array(
'100958' => array(
'biz' => '福州齐安路',
'sa' => '陈秋龙',
'mobile' => '17758949069'
),
'100966' => array(
'biz' => '泉州南环路',
'sa' => '傅玲玲',
'mobile' => '18519510420'
),
'101077' => array(
'biz' => '晋江豪信',
'sa' => '杨晓默',
'mobile' => '13799859101'
),
'100619' => array(
'biz' => '漳州狸车',
'sa' => '陈鸿喜',
'mobile' => '17750151079'
),
'100231' => array(
'biz' => '宁德辉科',
'sa' => '余玮',
'mobile' => '18659197547'
),
'100421' => array(
'biz' => '南平绿衡',
'sa' => '周伟豪',
'mobile' => '16659478792'
),
'100179' => array(
'biz' => '莆田众诚',
'sa' => '林昉',
'mobile' => '18760550059'
),
'100690' => array(
'biz' => '龙岩胜华成',
'sa' => '郭晓芬',
'mobile' => '13600983210'
),
'101207' => array(
'biz' => '厦门胜华嘉',
'sa' => '',
'mobile' => ''
),
),
),
'100966' => array(
'biz' => '泉州南环路',
'sa' => '傅玲玲',
'mobile' => '18519510420'
),
'101077' => array(
'biz' => '晋江豪信',
'sa' => '杨晓默',
'mobile' => '13799859101'
),
'100619' => array(
'biz' => '漳州狸车',
'sa' => '陈鸿喜',
'mobile' => '17750151079'
),
'100231' => array(
'biz' => '宁德辉科',
'sa' => '余玮',
'mobile' => '18659197547'
),
'100421' => array(
'biz' => '南平绿衡',
'sa' => '周伟豪',
'mobile' => '16659478792'
),
'100179' => array(
'biz' => '莆田众诚',
'sa' => '林昉',
'mobile' => '18760550059'
),
'100690' => array(
'biz' => '龙岩胜华成',
'sa' => '郭晓芬',
'mobile' => '13600983210'
),
'101207' => array(
'biz' => '厦门胜华嘉',
'sa' => '',
'mobile' => ''
'440' => array(
'name' => '广东',
'list' => array(
'101071' => array(
'biz' => '江门朋赢',
'sa' => '余镜苗',
'mobile' => '18127125536'
),
'100647' => array(
'biz' => '珠海金浩',
'sa' => '占杨',
'mobile' => '18923392948'
),
'100832' => array(
'biz' => '中山金玺',
'sa' => '黄美愉',
'mobile' => '17329610587'
),
'101252' => array(
'biz' => '佛山鑫明宇',
'sa' => '陈惠伦',
'mobile' => '13790011910'
),
'101289' => array(
'biz' => '深圳东浩',
'sa' => '余佳思',
'mobile' => '15889556579'
),
'101204' => array(
'biz' => '东莞金屹',
'sa' => '林耿文',
'mobile' => '17620573545'
),
'101043' => array(
'biz' => '惠州新零致',
'sa' => '张安琪',
'mobile' => '15999955547'
),
'100671' => array(
'biz' => '梅州利兴',
'sa' => '石绿绿',
'mobile' => '14718175658'
),
'101214' => array(
'biz' => '汕头骏华',
'sa' => '黎旭',
'mobile' => '15766613213'
),
'100917' => array(
'biz' => '揭阳顺鹏',
'sa' => '吴佳鸿',
'mobile' => '19902714365'
),
'101487' => array(
'biz' => '广州长瑞',
'sa' => '吴国腾',
'mobile' => '15323380908'
),
)
),
'101071' => array(
'biz' => '江门朋赢',
'sa' => '余镜苗',
'mobile' => '18127125536'
),
'100647' => array(
'biz' => '珠海金浩',
'sa' => '占杨',
'mobile' => '18923392948'
),
'100832' => array(
'biz' => '中山金玺',
'sa' => '黄美愉',
'mobile' => '17329610587'
),
'101252' => array(
'biz' => '佛山鑫明宇',
'sa' => '陈惠伦',
'mobile' => '13790011910'
),
'101289' => array(
'biz' => '深圳东浩',
'sa' => '余佳思',
'mobile' => '15889556579'
),
'101204' => array(
'biz' => '东莞金屹',
'sa' => '林耿文',
'mobile' => '17688624688'
),
'101043' => array(
'biz' => '惠州华致',
'sa' => '张安琪',
'mobile' => '15999955547'
),
'100671' => array(
'biz' => '梅州利兴',
'sa' => '石绿绿',
'mobile' => '14718175658'
),
'101214' => array(
'biz' => '汕头骏华',
'sa' => '黎旭',
'mobile' => '15766613213'
),
);
protected $log_dir;
@@ -118,9 +139,8 @@ class Clues extends HD_Controller
$statusAry = $this->clues_model->statusAry();
$params = $this->input->get();
$this->data['province_id'] = $province_id = intval($params['province_id']);
$this->data['city_id'] = $city_id = intval($params['city_id']);
$this->data['county_id'] = $county_id = intval($params['county_id']);
$this->data['pro_id'] = $pro_id = intval($params['pro_id']);
$this->data['biz_id'] = $biz_id = intval($params['biz_id']);
$page = $params['page'] = $params['page'] ? intval($params['page']) : 1;
$size = $params['size'] = $params['size'] ? intval($params['size']) : 20;
@@ -141,10 +161,9 @@ class Clues extends HD_Controller
}
strlen($params['status']) && $where["status"] = $params['status'];
strlen($params['status2']) && $where["status2"] = $params['status2'];
$province_id && $where['province_id'] = $province_id;
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$pro_id && $where['pro_id'] = $pro_id;
$biz_id && $where['biz_id'] = $biz_id;
$count = $this->clues_model->count($where);
$lists = [];
@@ -185,7 +204,7 @@ class Clues extends HD_Controller
$this->data['_title'] = '线索池列表';
return $this->show_view('receiver/clues/lists', true);
return $this->show_view('hdcloud/clues/lists', true);
}
public function get()
@@ -210,13 +229,6 @@ class Clues extends HD_Controller
}
}
$dataInfo['editType'] = 0;
$re_cf = $this->clues_cfrom_model->get(array('id' => $re['cf_id']));
$re_cf_title_p = '';
if ($re_cf && $re_cf['pid']) {
$re_cf_pid = $this->clues_cfrom_model->get(array('id' => $re_cf['pid']));
$re_cf_title_p = $re_cf_pid['title'] ? $re_cf_pid['title'] . '-' : '';
}
$info_show['cfrom_title'] = $re_cf['title'] ? $re_cf_title_p . $re_cf['title'] : '';
$info_show['statusList'] = $statusList;
$info_show['status2List'] = $status2List;
$info_show['c_time'] = date('Y-m-d H:i', $re['c_time']);
@@ -228,43 +240,10 @@ class Clues extends HD_Controller
$dataInfo['city_id'] = $re['city_id'];
$dataInfo['county_id'] = $re['county_id'];
//获取已分配店铺
$cus = $this->customers_model->select(['rid' => $re['id']], '', '', '', 'biz_id');
$biz_arr = [];
if ($cus) {
$biz_ids = implode(array_column($cus, 'biz_id'), ',');
if ($biz_ids) {
$where_biz["id in ($biz_ids)"] = null;
$cus_biz = $this->biz_model->select($where_biz, '', '', '', 'biz_name');
$biz_arr = array_column($cus_biz, 'biz_name');
}
}
$info_show['cus_bizs'] = implode($biz_arr, ',');
//附近门店
if ($re['lat'] && $re['lng']) {
$info_show['near_bizs'] = $this->biz_model->nearby($re['lat'], $re['lng'], 1, 3, 'id,biz_name');
} else {
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',', array_keys($typeAry));
$info_show['near_bizs'] = $this->biz_model->select(['city_id' => $re['city_id'], 'county_id' => $re['county_id'], "type in ($type_ids)" => null, 'status' => 1], 'id desc', 1, 3, 'id,biz_name');
}
//获取分销用户
$cf_user = '';
if ($dataInfo['recommend_id']) {
$this->load->model('app/liche/app_liche_users_model');
$user = $this->app_liche_users_model->get(['id' => $dataInfo['recommend_id']], 'id,nickname,up_uid');
$user['up_uid'] && $up_user = $this->app_liche_users_model->get(['id' => $user['up_uid']], 'id,nickname'); //上一级分销用户
if ($up_user) {
$cf_user = "{$up_user['nickname']}(一级) => {$user['nickname']}(二级)";
} else {
$cf_user = $user['nickname'];
}
}
$info_show['cf_user'] = $cf_user;
$this->data['info'] = $dataInfo;
$this->data['info_show'] = $info_show;
$this->data['_title'] = '线索详情';
return $this->show_view('receiver/clues/edit', true);
return $this->show_view('hdcloud/clues/edit', true);
}
/**
@@ -281,23 +260,9 @@ class Clues extends HD_Controller
return $this->show_json(SYS_CODE_FAIL, '记录不存在');
}
$cf_id1 = '';
$cf_id2 = '';
if ($row['cf_id']) {
$row_cfrom = $this->clues_cfrom_model->get(array('id' => $row['cf_id']));
if ($row_cfrom['pid']) {
$cf_id1 = $row_cfrom['pid'];
$cf_id2 = $row['cf_id'];
} else {
$cf_id1 = $row['cf_id'];
}
}
$info = array(
'name' => $row['name'],
'mobile' => $row['mobile'],
'cf_id1' => $cf_id1,
'cf_id2' => $cf_id2,
);
$title = "编辑线索";
$action = "edit";
@@ -314,14 +279,12 @@ class Clues extends HD_Controller
$where = array('status' => 1, 'pid' => 0);
$select = 'id, title';
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', $where, '', 0, 0, $select);
$this->data['info'] = $info;
$this->data['cfromAry'] = $map_cfrom;
$this->data['action'] = $action;
$this->data['_title'] = $title;
return $this->show_view('receiver/clues/get');
return $this->show_view('hdcloud/clues/get');
}
//添加单条数据
@@ -339,17 +302,10 @@ class Clues extends HD_Controller
if ($this->clues_model->get(['mobile' => $info['mobile']])) {
return $this->show_json(SYS_CODE_FAIL, '手机号已存在');
}
$cf_id = 0;
if ($info['cf_id2']) {
$cf_id = $info['cf_id2'];
} else if ($info['cf_id1']) {
$cf_id = $info['cf_id1'];
}
$add = array(
'name' => $info['name'],
'mobile' => $info['mobile'],
'cf_id' => $cf_id,
'admin_id' => $this->uid,
'c_time' => time(),
);
@@ -538,228 +494,68 @@ class Clues extends HD_Controller
}
//分配
public function get_adviser()
{
$ids = $this->input->get('ids');
if ($this->input->method() == 'post') {
$city_id = $this->input->post('city_id');
$county_id = $this->input->post('county_id');
$where = [
'status' => 1,
];
$city_id && $where['city_id'] = $city_id;
$county_id && $where['county_id'] = $county_id;
$typeAry = $this->biz_model->type_ary();
$type_ids = implode(',', array_keys($typeAry));
$type_ids && $where["type in ($type_ids)"] = null;
$bizList = $this->biz_model->select($where, '', '', '', 'id,biz_name');
$this->data['bizList'] = $bizList;
return $this->show_json(SYS_CODE_SUCCESS, '操作成功');
public function get_bizs(){
$pro_id = $this->input->get('pro_id');
if($pro_id){
$bizs = $this->bizs[$pro_id];
if($bizs){
foreach ($bizs['list'] as $k => $v){
$this->data[] = array(
'id' => $k,
'biz_name' => $v['biz'],
'sa' => $v['sa'],
'mobile' => $v['mobile'],
);
}
}
}
$this->data['ids'] = $ids;
return $this->show_view('receiver/clues/get_adviser');
return $this->show_json(SYS_CODE_SUCCESS);
}
public function edit_adviser()
public function get_adviser()
{
$this->load->library('receiver/clues_entity');
$this->load->library('receiver/customers_entity');
$id = $this->input->get('id');
$this->data['id'] = $id;
return $this->show_view('hdcloud/clues/get_adviser');
}
public function edit_adviser(){
$id = $this->input->post('id');
$pro_id = $this->input->post('pro_id');
$biz_id = $this->input->post('biz_id');
$ids = $this->input->post('ids');
$ids_arr = explode(',', $ids);
$biz = $this->biz_model->get(['id' => $biz_id]);
$intent = $this->input->post('intent');
$remark = $this->input->post('remark');
$biz = $this->bizs[$pro_id]['list'][$biz_id];
if (!$biz) {
return $this->show_json(SYS_CODE_FAIL, '请选择分配门店!');
}
if (!is_array($ids_arr)) {
return $this->show_json(SYS_CODE_FAIL, '参数错误!');
}
$where = [
"id in ($ids)" => null
];
$clues_rows = $this->clues_model->map('id', '', $where);
foreach ($ids_arr as $val) {
$clues_row = $clues_rows[$val][0];
//判断是否已分配
$cus_row = $this->customers_model->get(['rid' => $val, 'status>=' => 0]);
if ($clues_row && !$cus_row) {
$jsondata = json_decode($clues_row['jsondata'], true);
$add_data = [
'rid' => $val,
'name' => $clues_row['name'],
'mobile' => $clues_row['mobile'],
'biz_id' => $biz_id,
'city_id' => $biz['city_id'],
'county_id' => $biz['county_id'],
'brand_id' => $clues_row['brand_id'],
's_id' => $clues_row['s_id'],
'if_driver' => $clues_row['if_driver'],
'cf_title' => '平台分配',
'of_id' => 3,
'of2_id' => 37,
'cf_id' => $clues_row['cf_id'],
'p_time' => date('Y-m-d H:i:s'),
'c_time' => $clues_row['en_time'] == '0000-00-00 00:00:00' ? $clues_row['c_time'] : strtotime($clues_row['en_time'])
];
if ($biz['type'] == 5) {//异业店
$add_data['cf_clues'] = '异业店';
}
if ($jsondata['car']) {
isset($jsondata['car']['version']) && $add_data['v_id'] = $jsondata['car']['version']['id'];
$add_data['car_json'] = json_encode($jsondata['car'], JSON_UNESCAPED_UNICODE);
unset($jsondata['car']);
}
$jsondata && $add_data['jsondata'] = json_encode($jsondata, JSON_UNESCAPED_UNICODE);
$customers_id = $this->customers_model->add($add_data);
if ($customers_id) {
$this->clues_model->update(['status' => 1], ['id' => $val]);
//同步线索日志到客户日志
$this->customers_entity->syn_clues($customers_id, $val);
$this->customers_entity->add_log($customers_id, $this->uid, $this->username, "平台分配", 0, 'admin');
$this->clues_entity->add_log($val, $this->uid, $this->username, "分配给【{$biz['biz_name']}】商家");
}
}
}
return $this->show_json(SYS_CODE_SUCCESS, '分配成功!');
}
$biz['id'] = $biz_id;
public function lists_call()
{
$this->load->model('sys/sys_admin_model', 'mdAdmin');
$cache = &load_cache('redis');
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
$params = $this->input->get();
$username = $params['username'];
$params['page'] = $params['page'] ? intval($params['page']) : 1;
$params['size'] = $params['size'] ? intval($params['size']) : 20;
$lists = array();
$where['status'] = 1;
if (!empty($username)) $where["username like '%$username%'"] = null;
if (!empty($params['mobile'])) $where['mobile'] = $params['mobile'];
$count = $this->mdAdmin->count($where);
if ($count) {
$res = $this->mdAdmin->select($where, 'id desc', $params['page'], $params['size'], 'id,username,mobile');
foreach ($res as $key => $value) {
$setValue = array();
$setValue['id'] = $value['id'];
$setValue['username'] = $value['username'];
$setValue['mobile'] = $value['mobile'];
$phone = $xz_admin_phone['admins'][$value['id']];
if ($phone) {
$phone_btn = '<a class="am-btn am-btn-danger am-btn-xs" data-action="/receiver/clues/edit_call" data-ajax="post"
data-params-type="1" data-params-id="' . $value['id'] . '" >取消分配</a>';
} else {
$phone = '未分配';
$phone_btn = '<a class="am-btn am-btn-primary am-btn-xs" data-action="/receiver/clues/edit_call" data-ajax="post"
data-params-type="0" data-params-id="' . $value['id'] . '" >分配号码</a>';
}
$setValue['phone'] = $phone;
$setValue['phone_btn'] = $phone_btn;
$lists[] = $setValue;
$clue_row = $this->clues_model->get(['id' => $id]);
if ($clue_row) {
if($clue_row['status']){
return $this->show_json(SYS_CODE_FAIL, '已分配!');
}
}
$this->data['params'] = $params;
$this->data['_title'] = '虚似号分配';
$this->data['pager'] = array('count' => ceil($count / $params['size']), 'curr' => $params['page'], 'totle' => $count);
$this->data['lists'] = $lists;
return $this->show_view('receiver/clues/lists_call', true);
}
public function edit_call()
{
$id = intval($this->input->post('id'));
$type = $this->input->post('type');
if ($type != 3 && !$id) {
return $this->show_json(SYS_CODE_FAIL, '参数错误');
}
$cache = &load_cache('redis');
$xz_admin_phone = $cache->get($this->cacheKeyPhone);
$this->config->load('xcall', TRUE);
$mobiles = $this->config->item('mobile_list', 'xcall');
$mobiles && shuffle($mobiles);
if ($type == 0) {//分配手机
if (!$mobiles) {
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
}
$number = '';
foreach ($mobiles as $key => $value) {
if (!$xz_admin_phone['numbers'][$value]) {
$number = $value;
break;
}
}
if ($number) {
$xz_admin_phone['admins'][$id] = $number;
$xz_admin_phone['numbers'][$number] = $id;
$cache->save($this->cacheKeyPhone, $xz_admin_phone);
return $this->show_json(SYS_CODE_SUCCESS, '分配号码成功');
} else {
return $this->show_json(SYS_CODE_FAIL, '号码已全部分配完了');
}
} else if ($type == 1) {//取消分配
$number = $xz_admin_phone['admins'][$id];
unset($xz_admin_phone['admins'][$id]);
unset($xz_admin_phone['numbers'][$number]);
$cache->save($this->cacheKeyPhone, $xz_admin_phone);
return $this->show_json(SYS_CODE_SUCCESS, '取消分配成功');
} else if ($type == 3) {//全部重新分配
if (!$mobiles) {
return $this->show_json(SYS_CODE_FAIL, '无号码库!');
}
if (!$xz_admin_phone['admins']) {
return $this->show_json(SYS_CODE_FAIL, '未分配号码,不能重置');
}
$xz_admin_phone_new = array();
$i = 0;
foreach ($xz_admin_phone['admins'] as $key => $value) {
$number = $mobiles[$i];
$id = $key;
if ($number) {
$xz_admin_phone_new['admins'][$id] = $number;
$xz_admin_phone_new['numbers'][$number] = $id;
}
$i++;
}
$cache->save($this->cacheKeyPhone, $xz_admin_phone_new);
return $this->show_json(SYS_CODE_SUCCESS, '重置已分配成功');
}
}
$result = $this->push_neta($clue_row['name'], $clue_row['mobile'], $pro_id, $biz, $intent, $remark);
$json = json_decode($result, true);
/**
* 返回map select数据
* @return bool
*/
function json_map_cfrom()
{
$pid = $this->input->post('pid');
$status = $this->input->post('status');
if($json['dataInfo']['rtnMessage'] == '处理成功'){
$where = array();
if (strlen($pid) > 0) {
$where['pid'] = $pid;
}
$this->clues_model->update(['status' => 1], ['id' => $id]);
if (strlen($status) > 0) {
$where['status'] = $status;
} else {
$where["status>-1"] = null;
}
$total = $this->clues_cfrom_model->count($where);
$map = array();
if ($total) {
$orderby = 'id desc';
$select = 'id, title';
$rows = $this->clues_cfrom_model->select($where, $orderby, 0, 0, $select);
foreach ($rows as $v) {
$map[$v['id']] = $v['title'];
return $this->show_json(SYS_CODE_SUCCESS, '分配成功!');
}
}
$this->data = $map;
return $this->show_json(SYS_CODE_SUCCESS);
return $this->show_json(SYS_CODE_FAIL, '分配失败!');
}
private function upload()
@@ -855,4 +651,49 @@ class Clues extends HD_Controller
$this->data['bizinfo'] = $bizinfo;
return $this->show_json(SYS_CODE_SUCCESS);
}
public function push_neta($customerName, $mobile, $pro_id, $biz, $intentModel = '', $remark = '')
{
$voId = $pro_id . date('mdHis') . sprintf("%06d", rand(1,999999));
$data[] = array(
'voId' => $voId,
'cusSource3' => '023409',
'customerName' => $customerName,
'dealerCode' => $biz['id'],
'fromSystem' => "好店云",
'mobile' => $mobile,
'saMobile' => $biz['mobile'],
'cusType' => '30111001',
'remark' => $remark,
'intentModel' => $intentModel,
);
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
//测试地址
$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
//$url = 'https://salesapp.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//https
if (strlen($url) > 5 && strtolower(substr($url, 0, 5)) == "https") {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json; charset=utf-8',
'Content-Length: ' . strlen($data)
)
);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return $response;
}
}
+598
View File
@@ -0,0 +1,598 @@
<div class="am-form am-form-horizontal" style="width: 98%;padding-top: 10px">
<div id="vue-edit">
<div class="am-g">
<div class="col-sm-12" style="margin-bottom: 20px;">
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select id="status" v-model="info.status" disabled="disabled"
@change='getStatus2();'>
<template v-for="(v,i) in infoShow.statusList">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div class="col-sm-2">
<div class="my-panel">
<div class="text-center">
二级状态
</div>
<div class="text-center" style="padding-top: 5px;">
<select id="status2" v-model="info.status2" disabled="disabled">
<option value="0">二级状态</option>
<template v-for="(v,i) in infoShow.status2List">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</div>
</div>
<div class="am-form-inline" style="padding-right: 10px;padding-top: 12px;">
<div class="text-right">
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-if="info.editType==1">取消编辑</a>
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-default"
@click="editType(1)" v-else>编辑状态</a>
</div>
<div class="am-form-group ml10" v-if="info.editType==1">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">修改状态</a>
</div>
<div class="am-form-group ml10">
<a href="javascript:void(0)" class="am-btn am-btn-sm am-btn-success"
onclick="edit_adviser()">分配</a>
</div>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
用户信息
</span>
<span style="float:right;margin-top:5px;">
<a href="javascript:" @click="editType(2)"><i class="fa fa-edit"></i></a>
</span>
</div>
<div class="am-panel-bd am-g">
<table width="100%" style="margin:0px 0px 10px 0px;">
<tr>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">客户姓名:</div>
<input type="text" v-model="info.name" placeholder="请输入客户姓名"></div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">客户电话:</div>
{{infoShow.mobile_sub}}
</div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">线索来源:</div>
{{infoShow.cfrom_title}}
</div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">加入时间:</div>
{{infoShow.c_time}}
</div>
</td>
</tr>
<tr>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">最后报名时间:</div>
{{infoShow.en_time}}
</div>
</td>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">分配商家:</div>
<template v-if="infoShow.cus_bizs">
{{infoShow.cus_bizs}}
</template>
<template v-else>
未分配
</template>
</div>
</td>
<td class="table-td" v-if="infoShow.cf_user">
<div class="input-group">
<div class="input-group-addon">分销来源:</div>
{{infoShow.cf_user}}
</div>
</td>
</tr>
<tr>
<td>
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-left pt10">
<div class="am-form-group ml10">
<a v-if="info.editType==2" href="javascript:void(0)"
class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">修改用户信息</a>
</div>
</div>
</div>
</td>
<td colspan="3">
<div class="am-form-inline" style="padding-right: 40px;padding-top: 10px;">
<div class="text-right pt10">
<div class="am-form-group ml10">
<a data-modal="/common/show_sms?id=<?= $info['id'] ?>&type=clues"
data-title="发送短信"
class="am-btn am-btn-sm am-btn-success">短信</a>
</div>
<div class="am-form-group ml10">
<a href="javascript:void(0);"
data-modal="/common/bind_mobile?id=<?= $info['id'] ?>&type=clues"
class="am-btn am-btn-sm am-btn-success" data-title="获取手机号">
拨打电话
</a>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
意向信息
</span>
<span style="float:right;margin-top:5px;">
<a href="javascript:" @click="editType(3)"><i class="fa fa-edit"></i></a>
</span>
</div>
<div class="am-panel-bd am-g">
<table width="100%" style="margin:0px 0px 10px 0px;">
<tr>
<td class="table-td" colspan="2">
<div class="input-group">
<div class="input-group-addon">地区:</div>
<select class="mr5" style="width: 120px; display: inline" v-model="info.city_id">
<option value="">选择城市</option>
<template v-for="(v,i) in cityAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
<select style="width: 120px; display: inline" v-model="info.county_id">
<option value="">选择行政区</option>
<template v-for="(v,i) in countyAry">
<option :value="v.id">{{v.name}}</option>
</template>
</select>
</div>
</td>
<td class="table-td" colspan="2">
<div class="input-group">
<div class="input-group-addon">推荐门店:</div>
<button v-for="(val,key) in infoShow['near_bizs']"
:class="'btn ml5 btn-xs btn-'+randClass()" @click="showBizInfo(val)">
{{val.biz_name}}
</button>
</div>
</td>
</tr>
<tr v-if="info.editType==3">
<td colspan="4">
<div class="am-form-inline" style="padding-right: 30px;padding-top: 10px;">
<div class="text-left pt10">
<div class="am-form-group ml10">
<a href="javascript:void(0)"
class="am-btn am-btn-sm am-btn-success"
@click="saveEdit()">修改意向信息</a>
</div>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="am-u-lg-12">
<div class="am-panel am-panel-default">
<div class="am-panel-hd">
<span href="javascript:void(0)" style="font-size: 20px">
线索日志
</span>
<span style="float:right;margin-top:5px">
<a href="javascript:void(0)" @click="logModal()">新增小记</a>
</span>
</div>
<div class="am-panel-bd">
<div class="am-tabs" data-am-tabs>
<div class="am-tab-panel am-active">
<table class="am-table">
<thead>
<tr>
<th width="15%"><span>操作人员</span></th>
<th width=""><span>内容</span></th>
<th width="13%"><span>类型</span></th>
<th width="15%"><span>操作时间</span></th>
</tr>
</thead>
<tbody>
<?php foreach ($info_show['logsList'] as $key => $val) { ?>
<tr>
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['uname'] ?></td>
<td style="vertical-align:middle;word-wrap:break-word">
<? if ($val['rec_url']) { ?>
<audio controls="controls">
<source src="<?= $val['rec_url'] ?>"/>
</audio>
<? } else if ($val['rec_text']) { ?>
<?= $val['rec_text'] ?>
<? } else { ?>
<?= $val['log'] ?>
<? } ?>
</td>
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['type_name'] ?></td>
<td style="vertical-align:middle;word-wrap:break-word;"><?= $val['c_time'] ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div id="log-modal" style="display: none;">
<div style="padding-top: 20px;">
<div class="am-form-group">
<label class="am-para-label label-width">内容:</label>
<div class="am-para-input" style="width: 80%">
<textarea name="log" rows="5" placeholder="请输入内容" v-model="goods.log"></textarea>
</div>
</div>
</div>
</div>
<div class="am-u-lg-12" id="modal-biz-info" style="display:none">
<table width="100%" style="margin:0px 0px 10px 0px;">
<tr>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">城市地区:</div>
{{bizInfo.city_name}}-{{bizInfo.county_name}}
</div>
</td>
</tr>
<tr>
<td class="table-td">
<div class="input-group">
<div class="input-group-addon">详细地址:</div>
{{bizInfo.address}}
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<script>
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
infoShow: {},
goods: {"imgs_url": [], "imgs": [], "log": ''},
cityAry: [],
countyAry: [],
bizInfo: [],
},
mounted: function () {
var that = this;
that.info = <?=json_encode($info)?>;
that.infoShow = <?=json_encode($info_show)?>;
that.init_citys();
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
init_citys: function () {
var vm = this;
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: '350',
key: 'city',
type: 1
},
success: function (response) {
if (response.code == 1) {
vm.cityAry = response.data;
}
}
});
},
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.editType == 1) {
$("#status").attr("disabled", "disabled");
$("#status2").attr("disabled", "disabled");
vm.info.editType = 0;
} else {
$("#status").removeAttr("disabled");
$("#status2").removeAttr("disabled");
vm.info.editType = 1;
}
} else {
if (vm.info.editType == index) {
vm.info.editType = 0;
} else {
vm.info.editType = index;
}
}
},
getStatus2: function () {
//二级分类
var vm = this;
$.ajax({
url: '/receiver/clues/get_status2',
type: 'post',
dataType: 'json',
data: {
status: vm.info.status,
},
success: function (data) {
vm.info.status2 = 0;
if (data.data) {
vm.infoShow.status2List = data.data;
}
},
});
},
logModal: function () {
var vm = this;
layer.open({
type: 1,
area: ['50%'], //宽高
content: $('#log-modal'),
title: '新增小记',
shade: false,
btn: ['保存', '取消'],
yes: function (index) {
$.ajax({
url: '/receiver/clues/add_log',
type: 'post',
dataType: 'json',
data: {
act_type: 1, id: <?= $info['id'] ?>, type: 0, log: vm.goods.log, imgs: vm.goods.imgs
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
layer.closeAll('loading');
},
});
}
});
},
saveEdit: function () {
var vm = this;
$.ajax({
url: '/receiver/clues/edit',
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
loading = false;
if (data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
},
});
},
randClass: function () {
var classArr = ['default', 'primary', 'success', 'info', 'warning', 'danger'];
var rand = Math.floor(Math.random() * classArr.length);
return classArr[rand]
},
showBizInfo: function (info) {
var that = this
$.get('/receiver/clues/get_bizInfo', {'id': info.id}, function (response) {
if (response.code) {
that.bizInfo = response.data.bizinfo
layer.open({
type: 1, //Page层类型
title: info.biz_name,
shade: false,
area: ['420px', '240px'], //宽高
content: $("#modal-biz-info")
});
}
})
}
},
watch: {
'info.city_id': function (nv, ov) {
var that = this;
if (nv == '') {
that.countyAry = [];
that.info.county_id = '';
} else {
if (nv.substring(0, 4) != that.info.county_id.substring(0, 4)) {
that.info.county_id = '';
}
$.ajax({
type: 'get',
url: '/common/area',
dataType: 'json',
data: {
id: nv,
key: 'county',
type: 1
},
success: function (response) {
if (response.code == 1) {
that.countyAry = response.data;
}
}
});
}
}
}
});
});
function edit_adviser() {
var ids = '<?=$info['id']?>'
return $.form.modal("/receiver/clues/get_adviser?ids=" + ids, 'open_type=modal', "分配顾问");
}
</script>
<style type="text/css">
.input-group {
width: 100%;
padding-right: 30px;
}
.input-group-addon {
padding: 0px 0px 0px 0px;
font-size: 1.6rem;
font-weight: normal;
line-height: 0px;
color: #333;
text-align: right;
background-color: #fff;
border: 0px solid #fff;
border-radius: 0px;
width: 110px;
}
.table-td {
width: 20%;
padding-top: 15px;
line-height: 37px;
font-size: 1.6rem;
}
.my-ul ul li {
padding: 10px;
}
.my-panel {
padding: 10px;
border: 1px solid #ddd;
height: 90px;
}
.auto-content {
width: min-content;
min-width: 50%;
}
.btn-group .disabled {
background-color: #eee;
opacity: 1;
}
.photo-upload {
position: relative;
font-size: 0;
}
.photo-upload:after {
content: "";
display: table;
clear: both;
}
.photo-upload-item {
position: relative;
float: left;
margin-right: 10px;
margin-bottom: 10px;
font-size: 12px; /*display:inline-block;width:120px;*/
}
.photo-upload-item > img {
}
.photo-upload-item-check,
.photo-upload-item-remove {
opacity: 0;
position: absolute;
top: -8px;
right: -8px;
width: 24px;
height: 24px;
line-height: 24px;
border: 1px solid #fff;
background-color: #eee;
border-radius: 50%;
text-align: center;
cursor: pointer;
}
.photo-upload-item:hover .photo-upload-item-remove {
opacity: 1;
transition: all .4s ease
}
.photo-upload-item-check {
opacity: 1;
background-color: #36f;
color: #fff;
}
</style>
<link rel="stylesheet" type="text/css" href="/static/css/appitem/font-awesome.min.css?v=1581252500">
+121
View File
@@ -0,0 +1,121 @@
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post" style="padding-top: 10px;padding-bottom: 10px;"
action="" id="edit-form">
<div class="am-form-group">
<label class="am-para-label">姓名:</label>
<div class="am-para-input w300">
<input type="text" placeholder="输入姓名" v-model="info.name" name="name"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">手机号:</label>
<div class="am-para-input w300">
<input type="text" placeholder="输入手机号" v-model="info.mobile" name="mobile"/>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">来源:</label>
<div class="am-para-input w300">
<select name="cf_id1" v-model="info.cf_id1" style="width: 45%;display: inline">
<option value="">选择来源</option>
<option :value="i" v-for="(v,i) in cfromAry">{{v}}</option>
</select>
<select name="cf_id2" v-model="info.cf_id2" style="width: 45%;display: inline">
<option value="">选择来源</option>
<option :value="i" v-for="(v,i) in cfromAry2">{{v}}</option>
</select>
</div>
</div>
<div class="am-form-group">
<div class="am-para-input">
<button class="am-btn am-btn-secondary" type="button" id="add-btn" @click="saveEdit">保存</button>
</div>
</div>
</form>
<script>
var loading = false;
var vue_obj = false;
$(function(){
vue_obj = new Vue({
el: '#edit-form',
data: {
info:{},
cfromAry:[],
cfromAry2:[],
action:""
},
mounted:function() {
var vm = this;
vm.info = <?=json_encode($info, JSON_UNESCAPED_UNICODE)?>;
vm.cfromAry = <?=json_encode($cfromAry, JSON_UNESCAPED_UNICODE)?>;
vm.action = "<?=$action?>";
},
methods:{
saveEdit:function(){
var vm = this;
if (loading) {
return;
}
loading = 1;
$.ajax({
url: "receiver/clues/" + vm.action,
type: 'post',
dataType: 'json',
data: {
info: vm.info
},
beforeSend: function () {
layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
},
success: function (data) {
if (1 == data['code']) {
layer.msg(data.msg, {
icon: 1,
time: 2000
}, function () {
window.location.reload();
});
} else {
layer.msg(data.msg, {icon: 2});
}
},
complete: function () {
loading = false;
layer.closeAll('loading');
}
});
}
},
watch:{
'info.cf_id1':function(nv, ov){
var vm = this;
if(nv > 0){
$.ajax({
url: "receiver/clues/json_map_cfrom",
type: 'post',
dataType: 'json',
data: {
pid:vm.info.cf_id1,
status:1
},
beforeSend: function () {},
success: function (data) {
if (1 == data.code) {
vm.cfromAry2 = data.data;
if(undefined == vm.cfromAry2[vm.info.cf_id2]){
vm.info.cf_id2 = '';
}
}
}
});
} else {
vm.cfromAry2 = [];
vm.info.cf_id2 = '';
}
}
}
});
});
</script>
+124
View File
@@ -0,0 +1,124 @@
<form class="am-form am-form-horizontal ptb20 pr20 mt10" data-auto="true" method="post" style="padding-top: 10px;padding-bottom: 10px;"
action="/hdcloud/clues/edit_adviser" id="edit-form">
<div class="am-form-group">
<label class="am-para-label">省份:</label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group w200">
<select name="pro_id" v-model="pro_id">
<option value="0">请选择省份</option>
<option value="350">福建</option>
<option value="440">广东</option>
</select>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">门店:</label>
<div class="am-para-input w200">
<select name="biz_id" v-model="biz_id">
<option value="0">请选择门店</option>
<template v-for="(v,i) in bizList">
<option :value="v.id">{{v.biz_name}} ({{v.sa}})</option>
</template>
</select>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">意向车型:</label>
<div class="am-para-input">
<div class="am-form-inline">
<div class="am-form-group w200">
<select name="intent" v-model="intent">
<option value="">请选择车系</option>
<option value="哪吒X">哪吒X</option>
<option value="哪吒U">哪吒U</option>
<option value="哪吒AYA">哪吒AYA</option>
<option value="哪吒V">哪吒V</option>
<option value="哪吒S">哪吒S</option>
<option value="哪吒GT">哪吒GT</option>
</select>
</div>
</div>
</div>
</div>
<div class="am-form-group">
<label class="am-para-label">备注:</label>
<div class="am-para-input"><textarea name="remark" rows="4" v-model="remark">><?= $content ?></textarea></div>
</div>
<div class="am-form-group">
<div class="am-para-input">
<input type="hidden" name="id" value="<?= $id ?>">
<button class="am-btn am-btn-secondary" type="button" @click="save()">保存分配</button>
</div>
</div>
</form>
<script>
$(function () {
vue_obj = new Vue({
el: '#edit-form',
data: {
pro_id: 0,
biz_id: 0,
bizList: [],
intent: '',
remark: '',
},
mounted: function(){
this.init_bizs();
},
methods: {
init_bizs:function(){
var vm = this;
$.get('hdcloud/clues/get_bizs',{pro_id:'0'},function(response){
if (response.code == 1) {
vm.bizList = response.data;
}
});
},
save:function(){
pdata = {pro_id:this.pro_id, 'biz_id':this.biz_id, 'id':'<?=$id?>', 'intent':this.intent, 'remark':this.remark}
$.post('hdcloud/clues/edit_adviser',pdata,function(response){
if (response.code == 1) {
layer.msg(response.msg,{'icon':1},function(){
layer.closeAll();
$.form.reload();
})
}else{
layer.msg(response.msg,{'icon':2});
}
});
}
},
watch:{
'pro_id':function(nv, ov){
var that = this;
if (nv == '') {
that.bizList = [];
that.biz_id = '0';
} else {
$.get('hdcloud/clues/get_bizs',{pro_id:nv},function(response){
that.bizList = response.data;
if (that.biz_id > 0) {
var biz_id = '0';
for (var i in that.bizList) {
var biz = that.bizList[i];
if (biz.id == that.biz_id) {
biz_id = biz.id;
break;
}
}
that.biz_id = biz_id;
}
});
}
},
}
})
});
</script>
+343
View File
@@ -0,0 +1,343 @@
<link rel="stylesheet" type="text/css" href="/static/css/font-awesome.min.css?v=1581252500">
<div class="bs-example bs-example-tabs" data-example-id="togglable-tabs" style="font-size:15px;">
<div id="recom-stat"></div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?= !strlen($params['status']) ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/hdcloud/clues">全部</a>
</li>
<? foreach ($statusList as $v) { ?>
<li role="presentation"
class="<? if (strlen($params['status']) && $params['status'] == $v['id']) { ?>active<? } ?>">
<? if ($v['cate']) { ?>
<a href="javascript:void (0);" class="dropdown-toggle" data-toggle="dropdown">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
<?= $v['cate'] ? ' <span class="caret"></span>' : '' ?>
</a>
<ul class="dropdown-menu">
<? if ($v['cate']) { ?>
<li class="<?= $params['status'] == $v['id'] && !$params['status2'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/hdcloud/clues?status=<?= $v['id'] ?>">
全部
</a>
</li>
<? } ?>
<? foreach ($v['cate'] as $v2) { ?>
<li class="<?= $params['status2'] == $v2['id'] ? 'active' : '' ?>">
<a href="javascript:void (0);"
data-open="/hdcloud/clues?status=<?= $v['id'] ?>&status2=<?= $v2['id'] ?>">
<?= $v2['name'] ?>
<?= $v2['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v2['count'] . '</span>' : '' ?>
</a>
</li>
<? } ?>
</ul>
<? } else { ?>
<a href="javascript:void (0);"
data-open="/hdcloud/clues?status=<?= $v['id'] ?>">
<?= $v['name'] ?>
<?= $v['count'] > 0 ? '<span style="background-color:#ff6600" class="am-badge am-round">' . $v['count'] . '</span>' : '' ?>
</a>
<? } ?>
</li>
<? } ?>
</ul>
</div>
<div class="coms-table-wrap mt10">
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
action="/hdcloud/clues" id="search_form">
<input name="status" value="<?= $params['status'] ?>" type="hidden">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label w100">客户搜索:</label>
<div class="am-para-inline w100">
<select name="search_tp" id="search_tp">
<? foreach ($searchTpAry as $key => $value) { ?>
<option value="<?= $key ?>"
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
<? } ?>
</select>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w260">
<input id="title" name="title" type="text" value="<?= $params['title'] ?>"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label w100">所在地区:</label>
<div class="am-form-group am-para-inline w150">
<select name="pro_id" v-model="pro_id">
<option value="0">请选择省份</option>
<option value="350">福建</option>
<option value="440">广东</option>
</select>
</div>
<div class="am-form-group am-para-inline w150">
<select name="biz_id" v-model="biz_id">
<option value="0">请选择门店</option>
<template v-for="(v,i) in bizList">
<option :value="v.id">{{v.biz_name}}</option>
</template>
</select>
</div>
</div>
<div class="am-form-group fl">
<!--label class="am-para-label w100">线索来源:</label>
<div class="am-form-group am-para-inline w150">
<select name="cfrom_id" v-model="cfrom_id">
<option value=0>请选择</option>
<template v-for="(v,i) in cfroms">
<option :value="v.id">{{v.title}}</option>
</template>
</select>
</div-->
</div>
<div class="am-form-group">
<div class="am-form-group" style="margin-bottom: 0px;"></div>
<label class="am-para-label w100">创建时间:</label>
<div class="am-form-group fl">
<div class="am-para-inline w300">
<input id="id-create-time" name="c_time" type="text" value="<?= $params['c_time'] ?>"
placeholder="创建时间范围" autocomplete="off"/>
</div>
<div class="am-para-inline" style="padding-top: 5px;">
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
data-source="id-create-time">今日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
data-source="id-create-time">昨日</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="weeks"
data-source="id-create-time">本周</a>
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="month"
data-source="id-create-time">本月</a>
</div>
</div>
</div>
<div class="am-form-group fl" style="margin-bottom: 0px;">
<div class="am-form-group fl ml10">
<button type="submit" class="am-btn am-btn-success am-btn-sm w100">搜索</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100" @click="reset">重置</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" id="import" class="am-btn am-btn-success am-btn-sm w100">导入</button>
</div>
<div class="am-form-group fl ml10">
<button type="button" class="am-btn am-btn-success am-btn-sm w100"
data-modal="/hdcloud/clues/get_add" data-title="新增线索">新增
</button>
</div>
</div>
</div>
</form>
<div class="coms-table-bd">
<div class="fr">共有<?= $pager['totle'] ?>条数据</div>
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="5%"><label class="checkall">
<input type="checkbox" data-check-target=".order-ids"> 全选</label></th>
<th width="10%"><span>ID</span></th>
<th width="10%"><span>客户姓名</span></th>
<th width="10%"><span>客户电话</span></th>
<th width="10%"><span>所在地区</span></th>
<th width="10%"><span>状态</span></th>
<th width="15%"><span>创建时间</span></th>
<th width="15%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<? if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['void'] ?></td>
<td><?= $v['name'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['poi'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
<td><a data-open="/hdcloud/clues/get?id=<?= $v['id'] ?>&type=clues" href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs">详情</a>
<a href="javascript:void(0);" class="am-btn am-btn-primary am-btn-xs" onclick="edit_adviser(<?= $v['id'] ?>);">分配</a>
</td>
</tr>
<? }
} ?>
</tbody>
</table>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form">
</div>
<div class="coms-pagination fr mr20">
<? page_view($pager) ?>
</div>
</div>
<div id="cule-modal" style="display: none;padding: 10px">
<div class="modal-body">
<div class="text-center">
<h2><i class="fa fa-info-circle"></i> 请上传Excel文件</h2>
<p>Excel文件格式必须与模板保持一致,否则无法导入</p>
<div class="form-group-action">
<a href="/temp/clues.xlsx" target="_blank" class="btn btn-default">查看模板</a>
<label href="javascript:" class="btn btn-primary" style="margin-left: 10px;">
<form id="import-form">
<input type="file" id="clue-file" name="file" accept=".xls,.xlsx"
style="left:-9999px;position:absolute;" onchange="load_clue()">
</form>
<span>上传Excel文件</span>
</label>
</div>
</div>
</div>
</div>
</div>
<script>
$(function () {
vue_obj = new Vue({
el: '#search_form',
data: {
pro_id:<?=$params['pro_id'] ? $params['pro_id']:0?>,
bizList:[],
biz_id:0
},
mounted: function(){
this.init_bizs();
},
methods: {
init_bizs:function(){
var vm = this;
$.get('hdcloud/clues/get_bizs',{pro_id:'0'},function(response){
vm.bizList = response.data;
});
},
reset: function () {
var that = this;
$('#search_tp').val('mobile');
$('#title').val('');
$('#id-create-time').val('');
$('#id-en-time').val('');
that.pro_id = '0';
}
},
watch:{
'pro_id':function(nv, ov){
var that = this;
if (nv == '') {
that.bizList = [];
that.biz_id = '0';
} else {
$.get('hdcloud/clues/get_bizs',{pro_id:nv},function(response){
that.bizList = response.data;
if (that.biz_id > 0) {
var biz_id = '0';
for (var i in that.bizList) {
var biz = that.bizList[i];
if (biz.id == that.biz_id) {
biz_id = biz.id;
break;
}
}
that.biz_id = biz_id;
}
});
}
},
}
});
$("#import").click(function () {
$("#clue-file").val('');
layer.open({
type: 1,
area: ['40%'], //宽高
content: $('#cule-modal'),
title: '导入线索',
shade: false,
btn: ['完成'],
yes: function (index) {
layer.close(index);
}
});
});
});
require(['laydate', 'autocomplete'], function (laydate) {
laydate.render({
elem: '#id-create-time', range: '~'
});
laydate.render({
elem: '#id-en-time', range: '~'
});
$('.id-day-btn').click(function () {
var type = $(this).data('date'), date = '', nowDate = new Date();
var source_id = $(this).data('source') || 'id-create-time';
var beginDate = '', endDate = '';
switch (type) {
case 'today':
beginDate = endDate = nowDate.Format('yyyy-MM-dd');
break;
case 'yesterday':
beginDate = endDate = (new Date(nowDate.getTime() - 86400000)).Format('yyyy-MM-dd');
break;
case 'weeks':
nowDate.setDate(nowDate.getDate() - nowDate.getDay() + 1);
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
nowDate.setDate(nowDate.getDate() + 6);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + nowDate.getDate();
break;
case 'month':
beginDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-01";
var day = new Date(nowDate.getFullYear(), nowDate.getMonth() + 1, 0);
endDate = nowDate.getFullYear() + "-" + (nowDate.getMonth() + 1) + "-" + day.getDate();
break;
}
date = beginDate + ' ~ ' + endDate;
$('#' + source_id).val(date);
});
});
function edit_adviser(id) {
return $.form.modal("/hdcloud/clues/get_adviser?id=" + id, 'open_type=modal', "分配门店");
}
function load_clue() {
var file = $("#clue-file");
if (file.val() == '') {
layer.msg('文件是空的');
return 0;
}
var loading = layer.load(1, {
shade: [0.1, '#fff'] //0.1透明度的白色背景
});
var options = {
url: "/hdcloud/clues/add_excel",
type: "post",
dataType: "json",
data: {},
success: function (res) {
if (1 == res.code) {
layer.msg(res.msg, {
icon: 1,
time: 2000
}, function () {
$.form.reload();
});
}
},
complete: function () {
file.val('');
layer.close(loading);
}
};
$("#import-form").ajaxSubmit(options);
}
</script>
+67
View File
@@ -0,0 +1,67 @@
<div class="coms-table-wrap">
<div class="coms-table-hd clearfix no-border">
<form action="/receiver/clues/lists_call" class="form-search" onsubmit="return false">
<div class="am-form am-form-horizontal">
<div class="am-form-group fl">
<label class="am-para-label">用户名:</label>
<div class="am-para-inline w150">
<input type="text" value="<?= $params['username'] ?>"
name="username"/>
</div>
</div>
<div class="am-form-group fl">
<label class="am-para-label">手机号:</label>
<div class="am-para-inline w150">
<input type="text" value="<?= $params['mobile'] ?>"
name="mobile"/>
</div>
</div>
<div class="am-form-group fl">
<div class="am-para-inline w150">
<button type="submit" class="am-btn ml20 am-btn-sm am-btn-success w100">搜索</button>
</div>
</div>
<div class="am-form-group fl">
<button type="button" data-action="/receiver/clues/edit_call" data-ajax="post"
data-params-type="3" class="add am-btn ml20 am-btn-sm am-btn-success w120">重置已分配
</button>
</div>
<div class="am-form-group fr" style="font-size: 15px;padding-right: 20px;padding-top: 6px;">
共有<?= $pager['totle'] ?>条数据
</div>
</div>
</form>
</div>
<div class="coms-table-bd">
<table class="am-table am-table-bordered">
<thead>
<tr>
<th width="3%"><span>ID</span></th>
<th width="10%"><span>用户名</span></th>
<th width="10%"><span>手机号</span></th>
<th width="10%"><span>分配号码</span></th>
<th width="10%"><span>操作</span></th>
</tr>
</thead>
<tbody>
<?php if ($lists) {
foreach ($lists as $v) { ?>
<tr>
<td><?= $v['id'] ?></td>
<td><?= $v['username'] ?></td>
<td><?= $v['mobile'] ?></td>
<td><?= $v['phone'] ?></td>
<td><?= $v['phone_btn'] ?></td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
</div>
<div class="coms-table-ft clearfix">
<div class="hander am-form"></div>
<div class="coms-pagination fr mr20">
<?php page_view($pager) ?>
</div>
</div>
+1 -1
View File
@@ -637,7 +637,7 @@ class Syt extends CI_Controller
$where = [
"activityId" => 27,
"itemId" => 36,
'id not in (select tagId from lc_market_sylive_activity_kpidata where activityId = 27 and kpi like "beforeOrder")' => null,
'id not in (select tagId from lc_market_sylive_activity_kpidata where activityId = 27 and kpi like "browse")' => null,
'cfUserId >' => 0
];
$rows = $this->market_sylive_order_model->select($where,'id desc',$page,$size);
+1 -2
View File
@@ -962,8 +962,7 @@ if (!function_exists('http_host_com')) {
if ($type == 'api') {
$url = 'https://api.liche.cn';
} else if ($type == 'home') {
$url = "https://live.haodian.cn";
//$url = "https://www.liche.cn";
$url = "https://www.liche.cn";
} else if ($type == 'admin') {
$url = "https://admin.liche.cn";
}
@@ -27,8 +27,8 @@ class Hdcloud_clues_model extends HD_Model
public function statusAry($status = '')
{
$status_ary[0] = array('name' => '待处理', 'list' => array());
$status_ary[1] = array('name' => '已分配', 'list' => array(1 => '强意向', 2 => '中意向', 3 => '弱意向'));
$status_ary[3] = array('name' => '无效线索', 'list' => array(7 => '明确拒绝', 8 => '误点', 9 => '战败'));
$status_ary[1] = array('name' => '已分配', 'list' => array());
if (strlen($status)) {
$return_status = $status_ary[$status];
} else {
+6 -6
View File
@@ -16,11 +16,11 @@ class Welcome extends CI_Controller {
//测试地址
//$url = 'https://salespp-sit.hozonauto.com/appservice/app/if/salesclue/createSalesclue';
$name = '詹小姐'; //客户姓名
$mobile = '15813115992';//客户手机
$name = '欢天喜地小马哥'; //客户姓名
$mobile = '18219376181';//客户手机
$comments = '100832'; //门店编码
$samobile = '17329610587';//销售手机
$comments = '101043'; //门店编码
$samobile = '15999955547';//销售手机
$city_id = '350200';
$voId = $city_id . date('mdHis') . sprintf("%06d", rand(1,999999));
@@ -35,7 +35,7 @@ class Welcome extends CI_Controller {
'saMobile' => $samobile,
'cusType' => '30111001',
'remark' => "",
'intentModel' => "哪吒X",
'intentModel' => "哪吒AYA",
);
print_r(json_encode($data,JSON_UNESCAPED_UNICODE));
@@ -66,7 +66,7 @@ class Welcome extends CI_Controller {
public function add_clues()
{
$mobiles = array('13124078183','13950216673','13625099806','15806064642','18359124166','18506081931','18046404796','13960855123','18659119209','18359768996','13290930865','13799312264','18506068867','13609575537','18659229626','18759223604','18250495067','18006917070','18350186430','13950412215','13615054818','13101431157','18259150643','13960741877','13850182332','18965055255','15960099209','15985747193','18805022611','15377915618','13338443200','13805014290','13720825977','18359169978','18250853102','13805057858','18359168838','13788898541','13960987292','13459479065','17506079707','18750718803','17506061272','18396132185','13514078677','18259072881','18558752932','19959106359','17805950156','13489029633','13599548606','15060030091','15080042524','13905914852','18106021611');
$mobiles = array('13049472202','15585368870','18584629183','15115587010','19909385819','15625380425','18565017555','13647638758','13068141528','15918972993','15307320324','15279175074','15629077890','18559034278','18725223562','17822040710','13713839257','18750923890','13958855501','15859898823','13051232698','18845262491','17092045062','13606914164','15638743863','13782110671','18845262491','13860475431','13163900932','13737356228','18268278796','13159241079','15158863727','18696655951','13183107838','18808131786','15818216088','13312352888','13078769899','18987509830','15597731673','13658525666','17395819188','13804561048','13924569675','18288759857','15919350098','13730684073','13057588119','13560163788','15558732182','18968671550','17502250513','18393862516','13984478060','13257767311','18063639666','13270852317','13777536321','18294902741');
foreach ($mobiles as $k => $v) {
$city_id = '350200';
@@ -288,6 +288,9 @@ class Act extends Wx {
}else{
$this->data['posterTip'] = "{$user['nickname']}诚挚邀请您参与";
}
$jsondata = json_decode($row['jsondata'], true);
$this->data['fillStyle'] = $jsondata['barrage']['color'] ? '#fff' : '#333';;
$this->data['lists'] = $lists;
$this->data['shareTitle'] = $shareTitle;
//微信分享
+6 -6
View File
@@ -27,12 +27,12 @@
desc: '<?=$share['desc']?>', // 分享描述
success: function () {
// 用户成功分享后执行的回调函数
alert(option.title);
option.success()
//alert(option.title);
//option.success()
},
cancel: function () {
// 用户取消分享后执行的回调函数
option.error()
//option.error()
}
});
//自定义“分享给朋友”及“分享到QQ”按钮的分享内容
@@ -43,12 +43,12 @@
imgUrl: '<?=$share['img']?>', // 分享图标
success: function () {
// 用户成功分享后执行的回调函数
alert(option.title);
option.success()
//alert(option.title);
//option.success()
},
cancel: function () {
// 用户取消分享后执行的回调函数
option.error()
//option.error()
}
});
+5 -1
View File
@@ -91,7 +91,11 @@
href="https://www.liche.cn/h5/market/sylive2/item/detail?skey=YV9pZD0yNiZpdGVtSWQ9MzU">
支付9.9元瓜分百万红包
</a>
<a class="block bg-ff0000 pt20 pb20 text-center font-36 color-fff ulib-r20" v-else
<a class="block bg-ff0000 pt20 pb20 text-center font-36 color-fff ulib-r20" v-else-if="info.a_id == 28"
href="https://live.haodian.cn/h5/market/sylive2/item/detail?skey=YV9pZD0yOCZpdGVtSWQ9Mzg">
99下定赢免单
</a>
<a class="block bg-1a1a1a pt20 pb20 text-center font-36 color-fff ulib-r20" v-else
href="javascript:;" @click="showCode">
<!--<i class="iconfont icon-tixing mr10"></i>-->
{{info.btn_text}}
+2 -1
View File
@@ -67,6 +67,7 @@
activeIndex:0,
posterSrc:'',
posterTip:'<?=$posterTip?>',
fillStyle:'<?=$fillStyle?>',
shareTx:<?=json_encode($shareTitle,JSON_UNESCAPED_UNICODE)?>,
},
mounted() {
@@ -134,7 +135,7 @@
codeimg.setAttribute("crossOrigin",'Anonymous')//如果二维码图片域名跨域,则保留此代码
codeimg.src = that.list[that.activeIndex].code
codeimg.onload = function () {
ctx.fillStyle="#000";
ctx.fillStyle=that.fillStyle;
ctx.textAlign="center";
ctx.font="22px Georgia";
ctx.fillText(that.posterTip,that.canW/2,that.canH-34,);