admin_clues_721

This commit is contained in:
dengbw
2021-07-21 09:28:52 +08:00
committed by lccsw
parent 9e30154f6c
commit b97d7f23d9
4 changed files with 504 additions and 48 deletions
+37 -39
View File
@@ -4,13 +4,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
class Clues extends HD_Controller{
private $searchTpAry = array('mobile' => '客户手机号', 'name' => '客户姓名');
protected $log_dir;
public function __construct(){
parent::__construct();
$this->log_dir = 'receiver_clues';
$this->load->model('receiver/receiver_clues_model','clues_model');
$this->load->model('receiver/receiver_clues_cfrom_model','clues_cfrom_model');
$this->load->model('receiver/receiver_customers_model','customers_model');
@@ -75,41 +70,34 @@ class Clues extends HD_Controller{
}
public function get(){
$id = $this->input->get('id');
if($id){
$row = $this->clues_model->get(array('id' => $id));
if(!$row){
return $this->show_json(SYS_CODE_FAIL, '记录不存在');
}
$info = array(
'name' => $row['name'],
'mobile' => $row['mobile'],
'cf_id' => $row['cf_id'],
);
$title = "编辑线索";
$action = "edit";
} else {
$info = array(
'name' => '',
'mobile' => '',
'cf_id' => '',
);
$title = "新增线索";
$action = "add";
$params = $this->input->get();
$id = intval($params['id']);
if (!$id) {
return $this->show_json(SYS_CODE_FAIL, '非法参数!');
}
$where = array('status' => 1);
$select = 'id, title';
$map_cfrom = $this->clues_cfrom_model->map('id', 'title', $where, '', 0, 0, $select);
$this->data['info'] = $info;
$this->data['cfrom_ary'] = $map_cfrom;
$this->data['action'] = $action;
$this->data['_title'] = $title;
return $this->show_view('receiver/clues/get');
$statusList = $logsList = array();
$re = $this->clues_model->get(array('id'=>$id));
$dataInfo = $re;
foreach ($this->clues_model->get_status() as $key => $value) {
$statusList[] = 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['c_time'] = date('Y-m-d H:i', $re['c_time']);
$info_show['mobile_sub'] = $re['mobile'] ? substr_replace($re['mobile'], '*****', 0, 5) : '';
$resLogs = $this->mdReceiverOplogs->select(array('clue_id'=>$id), 'id desc', 0, 0);
foreach ($resLogs as $key => $value) {
$setValue = array();
$logsList[] = $setValue;
}
$info_show['logsList'] = $logsList;
$this->data['info'] = $dataInfo;
$this->data['info_show'] = $info_show;
$this->data['_title'] = '线索详情';
return $this->show_view('receiver/clues/edit', true);
}
//添加单条数据
@@ -263,6 +251,16 @@ class Clues extends HD_Controller{
return $this->show_json(SYS_CODE_SUCCESS, '分配成功!');
}
//晓致绑定手机号
public function get_xbind()
{
$id = $this->input->get_post('id');
$mobile = '18350451617';
$this->data['mobile_sub'] = substr_replace($mobile, '*****', 0, 5);
$this->data['id'] = $id;
$this->show_view('receiver/clues/edit_xbind');
}
private function upload()
{
$config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . '/temp/';
+426
View File
@@ -0,0 +1,426 @@
<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" disabled="disabled" v-model="info.status"
@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="status_id" v-model="info.status_id" 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>
</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:10px 10px 10px 20px;">
<tr>
<td class="table-td" style="width: 35%;">
<table>
<tr>
<td>客户姓名:</td>
<td><input type="text" v-model="info.name" placeholder="请输入客户姓名"></td>
</tr>
</table>
</td>
<td class="table-td">
渠道来源:{{infoShow.cfrom_title}}
</td>
<td class="table-td">
加入时间:{{infoShow.c_time}}
</td>
</tr>
<tr>
<td class="table-td" style="width: 35%;">
<table>
<tr>
<td>业主电话:</td>
<td><input type="text" v-model="infoShow.mobile_sub" disabled="disabled"/></td>
</tr>
</table>
</td>
<td class="table-td" colspan="3"></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'] ?>&mobile=<?= $info['mobile'] ?>&type=1"
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="/receiver/clues/get_xbind?id=<?= $info['id'] ?>"
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:void(0)" @click="logModal()">新增小记</a>
</span>
</div>
<div class="am-panel-bd">
<div class="am-tabs" data-am-tabs>
<ul class="am-tabs-nav am-nav am-nav-tabs">
<li class="am-active"><a href="javascript: void(0)">线索日志</a></li>
</ul>
<div class="am-tabs-bd">
<div class="am-tab-panel am-active">
<table class="am-table">
<thead>
<tr>
<th width="10%"><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 ($logsList as $key => $val) { ?>
<tr>
<td style="vertical-align:middle;word-wrap:break-word"><?= $val['admin_name'] ?></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'] ?>
<? } ?>
<? if ($val['imgs']) { ?>
<div class="photo-upload" style="padding-top: 10px;">
<?php foreach ($val['imgs'] as $key1 => $val1) { ?>
<div class="photo-upload-item">
<a href="javascript:void (0);">
<img src="<?= $val1 ?>" class="img-thumbnail"
data-tips-image
style="width:100px;height:100px;"></a>
</div>
<? } ?>
</div>
<? } ?>
</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>
<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>
</div>
</div>
<script>
var vue_obj;
$(document).ready(function () {
vue_obj = new Vue({
el: '#vue-edit',
data: {
info: {},
infoShow: {},
goods: {"imgs_url": [], "imgs": [], "log": ''},
},
mounted: function () {
var that = this;
that.info = <?=json_encode($info)?>;
that.infoShow = <?=json_encode($info_show)?>;
},
computed: {},
created: function () {
},
updated: function () {
},
methods: {
editType: function (index) {
var vm = this;
if (index == 1) {
if (vm.info.editType == 1) {
$("#status").attr("disabled", "disabled");
$("#status_id").attr("disabled", "disabled");
vm.info.editType = 0;
} else {
$("#status").removeAttr("disabled");
$("#status_id").removeAttr("disabled");
vm.info.editType = 1;
}
} else if (index == 2) {
if (vm.info.editType == 2) {
vm.info.editType = 0;
} else {
vm.info.editType = 2;
}
} else {
vm.info.editType = 0;
}
},
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;
// }
// },
// });
},
logModal: function () {
var vm = this;
layer.open({
type: 1,
area: ['50%'], //宽高
content: $('#log-modal'),
title: '新增小记',
shade: false,
btn: ['保存', '取消'],
yes: function (index) {
$.ajax({
url: '/app/jdb/log/add',
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;
if (vm.info.editType == 6) {
vm.info.visit_time = $('#visit_time_id').val();
}
$.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');
},
});
},
}
});
});
</script>
<style type="text/css">
.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">
+14
View File
@@ -0,0 +1,14 @@
<form class="am-form am-form-horizontal" action="" data-auto="true" method="post" style="width: 90%;padding-top: 20px">
<div class="am-form-group div_middlenumber">
<label class="am-para-label" style="width:150px;">绑定用户手机号:</label>
<div class="am-para-label">
<span id=""><?= $mobile_sub ?></span>
</div>
</div>
<div class="am-form-group div_middlenumber">
<label class="am-para-label" style="width:150px;">虚拟手机号:</label>
<div class="am-para-label">
<span id="middlenumber"><?= $middlenumber ?></span>
</div>
</div>
</form>
+27 -9
View File
@@ -1,16 +1,17 @@
<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;">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="<?=!strlen($params['status'])?'active':'' ?>">
<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){?>
<li role="presentation" class="<?=strlen($params['status']) && $params['status']==$key?'active':''?>">
<a href="javascript:void (0);" data-open="/receiver/clues?status=<?=$key?>">
<?=$val?>
</a>
</li>
<?}?>
<? foreach ($status_arr as $key => $val) { ?>
<li role="presentation"
class="<?= strlen($params['status']) && $params['status'] == $key ? 'active' : '' ?>">
<a href="javascript:void (0);" data-open="/receiver/clues?status=<?= $key ?>">
<?= $val ?>
</a>
</li>
<? } ?>
</ul>
</div>
@@ -105,7 +106,24 @@
<td><?= $v['cf_title'] ?></td>
<td><?= $v['status_name'] ?></td>
<td><?= $v['admin_name'] ?></td>
<td><?= date('Y-m-d H:i:s',$v['c_time']) ?></td>
<td><?= date('Y-m-d H:i:s', $v['c_time']) ?></td>
</tr>
<tr>
<td colspan="7">
<div class="row">
<div class="col-md-4 align-l">
</div>
<div class="col-md-8 align-r" style="padding-right: 30px;">
<a href="javascript:void(0);"
data-modal="/receiver/clues/get_xbind?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs" data-title="获取手机号">拨打电话</a>
<a data-modal="/common/show_sms?id=<?= $v['id'] ?>&mobile=<?= $v['mobile'] ?>&type=1"
data-title="发送短信"
class="am-btn am-btn-primary am-btn-xs">短信</a>
<a href="javascript:void(0);" data-open="/receiver/clues/get?id=<?= $v['id'] ?>"
class="am-btn am-btn-primary am-btn-xs">查看详情</a>
</div>
</td>
</tr>
<?php }
} ?>