admin_clues_915
This commit is contained in:
@@ -32,7 +32,7 @@ class Clues extends HD_Controller
|
||||
|
||||
public function lists($where = array())
|
||||
{
|
||||
$status_arr = $this->clues_model->get_status();
|
||||
$statusAry = $this->clues_model->statusAry();
|
||||
$params = $this->input->get();
|
||||
|
||||
$this->data['city_id'] = $city_id = intval($params['city_id']);
|
||||
@@ -69,6 +69,7 @@ class Clues extends HD_Controller
|
||||
}
|
||||
}
|
||||
strlen($params['status']) && $where["status"] = $params['status'];
|
||||
strlen($params['status2']) && $where["status2"] = $params['status2'];
|
||||
$city_id && $where['city_id'] = $city_id;
|
||||
$county_id && $where['county_id'] = $county_id;
|
||||
if ($params['cfrom_id'] || $params['cfrom_id2']) {
|
||||
@@ -85,7 +86,7 @@ class Clues extends HD_Controller
|
||||
$count = $this->clues_model->count($where);
|
||||
$lists = [];
|
||||
if ($count) {
|
||||
$fileds = 'id,name,mobile,cf_id,status_id,c_time,admin_id,status,en_time';
|
||||
$fileds = 'id,name,mobile,cf_id,c_time,admin_id,status,status2,en_time';
|
||||
$rows = $this->clues_model->select($where, 'en_time desc,id desc', $page, $size, $fileds);
|
||||
//获取来源
|
||||
$cf_id_arr = array_unique(array_column($rows, 'cf_id'));
|
||||
@@ -100,9 +101,11 @@ class Clues extends HD_Controller
|
||||
}
|
||||
foreach ($rows as $key => $val) {
|
||||
$val['cf_title'] = isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : '';
|
||||
$val['status_name'] = $status_arr[$val['status']];
|
||||
$status_name = $statusAry[$val['status']]['name'];
|
||||
$val['status2'] && $status_name .= '‒' . $statusAry[$val['status']]['list'][$val['status2']];
|
||||
$val['status_name'] = $status_name;
|
||||
$val['admin_name'] = isset($map_admin[$val['admin_id']]) ? $map_admin[$val['admin_id']] : '';
|
||||
if(SUPER_ADMIN == $this->role){
|
||||
if (SUPER_ADMIN == $this->role) {
|
||||
$val['mobile_sub'] = $val['mobile'];
|
||||
} else {
|
||||
$val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '';
|
||||
@@ -110,11 +113,25 @@ class Clues extends HD_Controller
|
||||
$lists[] = $val;
|
||||
}
|
||||
}
|
||||
$statusList = array();
|
||||
foreach ($this->clues_model->statusAry() as $key => $value) {
|
||||
$cate = array();
|
||||
$where = array("status" => $key);
|
||||
$count1 = $this->clues_model->count($where);
|
||||
if ($value['list']) {
|
||||
foreach ($value['list'] as $key2 => $value2) {
|
||||
$where['status2'] = $key2;
|
||||
$count2 = $this->clues_model->count($where);
|
||||
$cate[] = array("id" => $key2, "name" => $value2, "count" => $count2);
|
||||
}
|
||||
}
|
||||
$statusList[] = array("id" => $key, "name" => $value['name'], "cate" => $cate, "count" => $count1);
|
||||
}
|
||||
$this->data['lists'] = $lists;
|
||||
$this->data['pager'] = array('count' => ceil($count / $size), 'curr' => $page, 'totle' => $count);
|
||||
$this->data['searchTpAry'] = $this->searchTpAry;
|
||||
$this->data['params'] = $params;
|
||||
$this->data['status_arr'] = $status_arr;
|
||||
$this->data['statusList'] = $statusList;
|
||||
$this->data['_title'] = '线索池列表';
|
||||
return $this->show_view('receiver/clues/lists', true);
|
||||
}
|
||||
@@ -126,23 +143,28 @@ class Clues extends HD_Controller
|
||||
if (!$id) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
|
||||
}
|
||||
$statusList = $logsList = $intention = $autoList = array();
|
||||
$statusList = $status2List = $logsList = $intention = $autoList = array();
|
||||
$re = $this->clues_model->get(array('id' => $id));
|
||||
if (!$re || empty($re)) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '线索不存在!');
|
||||
}
|
||||
$dataInfo = $re;
|
||||
foreach ($this->clues_model->get_status() as $key => $value) {
|
||||
$statusList[] = array("id" => $key, "name" => $value);
|
||||
foreach ($this->clues_model->statusAry() as $key => $value) {
|
||||
$statusList[] = array("id" => $key, "name" => $value['name']);
|
||||
}
|
||||
if (strlen($re['status'])) {
|
||||
foreach ($this->clues_model->statusAry($re['status'])['list'] as $key => $value) {
|
||||
$status2List[] = array("id" => $key, "name" => $value);
|
||||
}
|
||||
}
|
||||
$dataInfo['editType'] = 0;
|
||||
$re_cf = $this->clues_cfrom_model->get(array('id' => $re['cf_id']));
|
||||
$info_show['cfrom_title'] = $re_cf['title'] ? $re_cf['title'] : '';
|
||||
$info_show['statusList'] = $statusList;
|
||||
$info_show['status2List'] = array(array("id" => 1, "name" => '未回访'), array("id" => 2, "name" => '已回访'));
|
||||
$info_show['status2List'] = $status2List;
|
||||
$info_show['c_time'] = date('Y-m-d H:i', $re['c_time']);
|
||||
$info_show['en_time'] = $re['en_time'];
|
||||
if(SUPER_ADMIN == $this->role){
|
||||
if (SUPER_ADMIN == $this->role) {
|
||||
$info_show['mobile_sub'] = $re['mobile'];
|
||||
} else {
|
||||
$info_show['mobile_sub'] = $re['mobile'] ? substr_replace($re['mobile'], '*****', 0, 5) : '';
|
||||
@@ -217,6 +239,26 @@ class Clues extends HD_Controller
|
||||
return $this->show_view('receiver/clues/edit', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notes:二级分类
|
||||
* Created on: 2021/9/15 14:16
|
||||
* Created by: dengbw
|
||||
* @return bool
|
||||
*/
|
||||
public function get_status2()
|
||||
{
|
||||
$params = $this->input->post();
|
||||
$status = $params['status'];
|
||||
$status2List = array();
|
||||
if (strlen($status)) {
|
||||
foreach ($this->clues_model->statusAry($status)['list'] as $key => $value) {
|
||||
$status2List[] = array("id" => $key, "name" => $value);
|
||||
}
|
||||
}
|
||||
$this->data = $status2List;
|
||||
return $this->show_json(SYS_CODE_SUCCESS);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @return bool
|
||||
@@ -386,10 +428,18 @@ class Clues extends HD_Controller
|
||||
$msg = '修改成功';
|
||||
$code = SYS_CODE_SUCCESS;
|
||||
if ($info['editType'] == 1) {
|
||||
$status_name = $this->clues_model->get_status()[$re['status']];
|
||||
$status_name_up = $this->clues_model->get_status()[$info['status']];
|
||||
$statusAry = $this->clues_model->statusAry();
|
||||
if ($info['status'] == $re['status'] && $info['status2'] == $re['status2']) {
|
||||
return $this->show_json(SYS_CODE_FAIL, '状态未修改!');
|
||||
}
|
||||
$status_name = $statusAry[$re['status']]['name'];
|
||||
$status_name_up = $statusAry[$info['status']]['name'];
|
||||
if ($info['status2']) {
|
||||
$status_name .= '-' . $statusAry[$re['status']]['list'][$re['status2']];
|
||||
$status_name_up .= '-' . $statusAry[$info['status']]['list'][$info['status2']];
|
||||
}
|
||||
$log = '更新状态(' . $status_name . ')为(' . $status_name_up . ')';
|
||||
$ret = $this->clues_model->update(array('status' => $info['status']), array('id' => $info['id']));
|
||||
$ret = $this->clues_model->update(array('status' => $info['status'], 'status2' => $info['status2']), array('id' => $info['id']));
|
||||
if (!$ret) {
|
||||
$code = SYS_CODE_FAIL;
|
||||
$msg = '修改状态失败';
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
状态
|
||||
</div>
|
||||
<div class="text-center" style="padding-top: 5px;">
|
||||
<select id="status" disabled="disabled" v-model="info.status"
|
||||
<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>
|
||||
@@ -17,13 +17,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-2" style="display: none">
|
||||
<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_id" v-model="info.status_id" disabled="disabled">
|
||||
<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>
|
||||
@@ -44,8 +44,9 @@
|
||||
<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 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>
|
||||
@@ -218,7 +219,8 @@
|
||||
<td class="table-td" colspan="3">
|
||||
<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)">
|
||||
<button v-for="(val,key) in infoShow['near_bizs']"
|
||||
:class="'btn ml5 btn-xs btn-'+randClass()" @click="showBizInfo(val)">
|
||||
{{val.biz_name}}
|
||||
</button>
|
||||
</div>
|
||||
@@ -331,9 +333,9 @@
|
||||
info: {},
|
||||
infoShow: {"intention": {}, 'autoList': []},
|
||||
goods: {"imgs_url": [], "imgs": [], "log": ''},
|
||||
cityAry:[],
|
||||
countyAry:[],
|
||||
bizInfo:[],
|
||||
cityAry: [],
|
||||
countyAry: [],
|
||||
bizInfo: [],
|
||||
},
|
||||
mounted: function () {
|
||||
var that = this;
|
||||
@@ -347,7 +349,7 @@
|
||||
updated: function () {
|
||||
},
|
||||
methods: {
|
||||
init_citys:function(){
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
@@ -355,10 +357,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: '350',
|
||||
key:'city',
|
||||
type:1
|
||||
key: 'city',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
@@ -370,11 +372,11 @@
|
||||
if (index == 1) {
|
||||
if (vm.info.editType == 1) {
|
||||
$("#status").attr("disabled", "disabled");
|
||||
$("#status_id").attr("disabled", "disabled");
|
||||
$("#status2").attr("disabled", "disabled");
|
||||
vm.info.editType = 0;
|
||||
} else {
|
||||
$("#status").removeAttr("disabled");
|
||||
$("#status_id").removeAttr("disabled");
|
||||
$("#status2").removeAttr("disabled");
|
||||
vm.info.editType = 1;
|
||||
}
|
||||
} else {
|
||||
@@ -442,21 +444,20 @@
|
||||
getStatus2: function () {
|
||||
//二级分类
|
||||
var vm = this;
|
||||
// $.ajax({
|
||||
// url: '/common/receiver_status',
|
||||
// type: 'post',
|
||||
// dataType: 'json',
|
||||
// data: {
|
||||
// pid: vm.info.status,
|
||||
// type: vm.info.type
|
||||
// },
|
||||
// success: function (data) {
|
||||
// vm.info.status_id = 0;
|
||||
// if (data.data) {
|
||||
// vm.info.status2List = data.data;
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
$.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;
|
||||
@@ -532,16 +533,16 @@
|
||||
},
|
||||
});
|
||||
},
|
||||
randClass:function(){
|
||||
var classArr = ['default','primary','success','info','warning','danger'];
|
||||
var rand = Math.floor( Math.random() * classArr.length );
|
||||
randClass: function () {
|
||||
var classArr = ['default', 'primary', 'success', 'info', 'warning', 'danger'];
|
||||
var rand = Math.floor(Math.random() * classArr.length);
|
||||
return classArr[rand]
|
||||
},
|
||||
showBizInfo:function(info){
|
||||
showBizInfo: function (info) {
|
||||
var that = this
|
||||
$.get('/receiver/clues/get_bizInfo',{'id':info.id},function(response){
|
||||
if(response.code){
|
||||
that.bizInfo = response.data.bizinfo
|
||||
$.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,
|
||||
@@ -553,14 +554,14 @@
|
||||
})
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'info.city_id':function(nv, ov){
|
||||
watch: {
|
||||
'info.city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.info.county_id = '';
|
||||
} else {
|
||||
if(nv.substring(0,4) != that.info.county_id.substring(0, 4)){
|
||||
if (nv.substring(0, 4) != that.info.county_id.substring(0, 4)) {
|
||||
that.info.county_id = '';
|
||||
}
|
||||
$.ajax({
|
||||
@@ -569,10 +570,10 @@
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: nv,
|
||||
key:'county',
|
||||
type:1
|
||||
key: 'county',
|
||||
type: 1
|
||||
},
|
||||
success:function(response){
|
||||
success: function (response) {
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,45 @@
|
||||
<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="/receiver/clues">全部</a>
|
||||
</li>
|
||||
<? foreach ($status_arr as $key => $val) { ?>
|
||||
<? foreach ($statusList as $v) { ?>
|
||||
<li role="presentation"
|
||||
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
|
||||
<a href="javascript:void (0);" data-open="/receiver/clues?status=<?= $key ?>">
|
||||
<?= $val ?>
|
||||
</a>
|
||||
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="/receiver/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="/receiver/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="/receiver/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>
|
||||
@@ -18,13 +48,13 @@
|
||||
<div class="coms-table-wrap mt10">
|
||||
<form class="form-search coms-table-hd clearfix no-border" onsubmit="return false"
|
||||
action="/receiver/clues" id="search_form">
|
||||
<input name="status" value="<?=$params['status']?>" type="hidden">
|
||||
<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">
|
||||
<?php foreach ($searchTpAry as $key => $value) { ?>
|
||||
<? foreach ($searchTpAry as $key => $value) { ?>
|
||||
<option value="<?= $key ?>"
|
||||
<?= $key == $params['search_tp'] ? 'selected' : '' ?>><?= $value ?></option>
|
||||
<? } ?>
|
||||
@@ -84,10 +114,14 @@
|
||||
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="7day" data-source="id-create-time">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day" data-source="id-create-time">最近30天</a>
|
||||
<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="7day"
|
||||
data-source="id-create-time">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day"
|
||||
data-source="id-create-time">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,10 +134,14 @@
|
||||
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-en-time">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday" data-source="id-en-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day" data-source="id-en-time">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day" data-source="id-en-time">最近30天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="today"
|
||||
data-source="id-en-time">今天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="yesterday"
|
||||
data-source="id-en-time">昨日</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="7day"
|
||||
data-source="id-en-time">最近7天</a>
|
||||
<a class="mr10 id-day-btn" href="javascript:void (0);" data-date="30day"
|
||||
data-source="id-en-time">最近30天</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -151,7 +189,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ($lists) {
|
||||
<? if ($lists) {
|
||||
foreach ($lists as $v) { ?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="ids[]" class="order-ids"
|
||||
@@ -181,7 +219,7 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
<? }
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -190,7 +228,7 @@
|
||||
<div class="hander am-form">
|
||||
</div>
|
||||
<div class="coms-pagination fr mr20">
|
||||
<?php page_view($pager) ?>
|
||||
<? page_view($pager) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -218,47 +256,47 @@
|
||||
vue_obj = new Vue({
|
||||
el: '#search_form',
|
||||
data: {
|
||||
city_id:<?=$params['city_id']?$params['city_id']:0?>,
|
||||
county_id:<?=$params['county_id']?$params['county_id']:0?>,
|
||||
cfrom_id:<?=$params['cfrom_id']?$params['cfrom_id']:0?>,
|
||||
cfrom_id2:<?=$params['cfrom_id2']?$params['cfrom_id2']:0?>,
|
||||
cfroms:[],
|
||||
cfroms2:[],
|
||||
cityAry:[],
|
||||
countyAry:[]
|
||||
city_id:<?=$params['city_id'] ? $params['city_id'] : 0?>,
|
||||
county_id:<?=$params['county_id'] ? $params['county_id'] : 0?>,
|
||||
cfrom_id:<?=$params['cfrom_id'] ? $params['cfrom_id'] : 0?>,
|
||||
cfrom_id2:<?=$params['cfrom_id2'] ? $params['cfrom_id2'] : 0?>,
|
||||
cfroms: [],
|
||||
cfroms2: [],
|
||||
cityAry: [],
|
||||
countyAry: []
|
||||
},
|
||||
mounted: function(){
|
||||
mounted: function () {
|
||||
this.getCfroms()
|
||||
this.init_citys();
|
||||
},
|
||||
methods: {
|
||||
init_citys:function(){
|
||||
init_citys: function () {
|
||||
var vm = this;
|
||||
$.get('common/area',{id:'350',key:'city',type:1},function(response){
|
||||
$.get('common/area', {id: '350', key: 'city', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.cityAry = response.data;
|
||||
}
|
||||
});
|
||||
if(vm.city_id>0){
|
||||
$.get('common/area',{id:vm.city_id,key:'county',type:1},function(response){
|
||||
if (vm.city_id > 0) {
|
||||
$.get('common/area', {id: vm.city_id, key: 'county', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
vm.countyAry = response.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
getCfroms: function(){
|
||||
getCfroms: function () {
|
||||
var that = this
|
||||
$.get('/receiver/clues/get_cfroms',function(result){
|
||||
$.get('/receiver/clues/get_cfroms', function (result) {
|
||||
that.cfroms = result.data.data
|
||||
});
|
||||
if(that.cfrom_id>0){
|
||||
$.get('/receiver/clues/get_cfroms',{'id':that.cfrom_id},function(result){
|
||||
if (that.cfrom_id > 0) {
|
||||
$.get('/receiver/clues/get_cfroms', {'id': that.cfrom_id}, function (result) {
|
||||
that.cfroms2 = result.data.data
|
||||
});
|
||||
}
|
||||
},
|
||||
reset:function(){
|
||||
reset: function () {
|
||||
var that = this;
|
||||
$('#search_tp').val('mobile');
|
||||
$('#title').val('');
|
||||
@@ -270,21 +308,21 @@
|
||||
that.cfrom_id2 = 0;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
'city_id':function(nv, ov){
|
||||
watch: {
|
||||
'city_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.countyAry = [];
|
||||
that.county_id = '0';
|
||||
} else {
|
||||
$.get('common/area',{id:nv,key:'county',type:1},function(response){
|
||||
$.get('common/area', {id: nv, key: 'county', type: 1}, function (response) {
|
||||
if (response.code == 1) {
|
||||
that.countyAry = response.data;
|
||||
if(that.county_id>0){
|
||||
if (that.county_id > 0) {
|
||||
var county_id = '0';
|
||||
for(var i in that.countyAry){
|
||||
for (var i in that.countyAry) {
|
||||
var county = that.countyAry[i];
|
||||
if(county.id == that.county_id){
|
||||
if (county.id == that.county_id) {
|
||||
county_id = county.id;
|
||||
break;
|
||||
}
|
||||
@@ -295,19 +333,19 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
'cfrom_id':function(nv,ov){
|
||||
'cfrom_id': function (nv, ov) {
|
||||
var that = this;
|
||||
if(nv == ''){
|
||||
if (nv == '') {
|
||||
that.cfrom_id2 = 0;
|
||||
that.cfroms = [];
|
||||
} else {
|
||||
$.get('/receiver/clues/get_cfroms',{'id':nv},function(result){
|
||||
$.get('/receiver/clues/get_cfroms', {'id': nv}, function (result) {
|
||||
that.cfroms2 = result.data.data;
|
||||
if(that.cfrom_id2>0){
|
||||
if (that.cfrom_id2 > 0) {
|
||||
var cfrom_id2 = '0';
|
||||
for(var i in that.cfroms){
|
||||
for (var i in that.cfroms) {
|
||||
var county = that.cfroms[i];
|
||||
if(county.id == that.cfrom_id2){
|
||||
if (county.id == that.cfrom_id2) {
|
||||
cfrom_id2 = county.id;
|
||||
break;
|
||||
}
|
||||
@@ -361,7 +399,7 @@
|
||||
date = (new Date(d_obj.getTime() - 86400000 * 30)).Format('yyyy-MM-dd') + ' ~ ' + d_obj.Format('yyyy-MM-dd');
|
||||
break;
|
||||
}
|
||||
$('#'+source_id).val(date);
|
||||
$('#' + source_id).val(date);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -12,24 +12,45 @@ class Receiver_clues_model extends HD_Model
|
||||
{
|
||||
private $table_name = 'lc_receiver_clues';
|
||||
|
||||
private $status_arr = [ 0 => '待处理',1 => '已处理',2 => '跟进中',3 => '无效线索'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct($this->table_name, 'default');
|
||||
}
|
||||
|
||||
//关联订单
|
||||
public function count_order($where){
|
||||
return $this->select_order($where,'','','','',1);
|
||||
/**
|
||||
* Notes:线索状态
|
||||
* Created on: 2021/9/15 10:25
|
||||
* Created by: dengbw
|
||||
* @param $status
|
||||
* @return array
|
||||
*/
|
||||
public function statusAry($status = '')
|
||||
{
|
||||
$status_ary[0] = array('name' => '待处理', 'list' => array());
|
||||
$status_ary[1] = array('name' => '已分配', 'list' => array(1 => '强意向', 2 => '中意向', 3 => '弱意向'));
|
||||
$status_ary[2] = array('name' => '跟进中', 'list' => array(4 => '未接通', 5 => '未完整触碰', 6 => '近期没时间'));
|
||||
$status_ary[3] = array('name' => '无效线索', 'list' => array(7 => '明确拒绝', 8 => '误报', 9 => '战败'));
|
||||
if (strlen($status)) {
|
||||
$return_status = $status_ary[$status];
|
||||
} else {
|
||||
$return_status = $status_ary;
|
||||
}
|
||||
return $return_status;
|
||||
}
|
||||
|
||||
public function select_order($where = array(), $order = '', $page = 0, $page_size = 20 , $fileds = '', $count = 0){
|
||||
//关联订单
|
||||
public function count_order($where)
|
||||
{
|
||||
return $this->select_order($where, '', '', '', '', 1);
|
||||
}
|
||||
|
||||
public function select_order($where = array(), $order = '', $page = 0, $page_size = 20, $fileds = '', $count = 0)
|
||||
{
|
||||
!$fileds && $fileds = 'lc_receiver_clues.*';
|
||||
$this->db->select($fileds);
|
||||
$this->db->from('lc_receiver_clues');
|
||||
$this->db->join('lc_receiver_customers', 'lc_receiver_customers.rid = lc_receiver_clues.id','left');
|
||||
$this->db->join('lc_receiver_orders', 'lc_receiver_orders.rid = lc_receiver_customers.id','left');
|
||||
$this->db->join('lc_receiver_customers', 'lc_receiver_customers.rid = lc_receiver_clues.id', 'left');
|
||||
$this->db->join('lc_receiver_orders', 'lc_receiver_orders.rid = lc_receiver_customers.id', 'left');
|
||||
|
||||
if ($where) {
|
||||
$this->db->where($where);
|
||||
@@ -50,8 +71,4 @@ class Receiver_clues_model extends HD_Model
|
||||
$this->db->limit($limit, $offset);
|
||||
return $this->db->get()->result_array();
|
||||
}
|
||||
|
||||
public function get_status(){
|
||||
return $this->status_arr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user