This commit is contained in:
2025-03-24 15:33:37 +08:00
parent 51ae66b0ed
commit 4632eb8d0b
18 changed files with 495 additions and 109 deletions

View File

@@ -11,9 +11,9 @@ if (!function_exists('build_select')) {
/**
* 生成下拉列表
* @param string $name
* @param mixed $options
* @param mixed $selected
* @param mixed $attr
* @param mixed $options
* @param mixed $selected
* @param mixed $attr
* @return string
*/
function build_select($name, $options, $selected = [], $attr = [])
@@ -29,8 +29,8 @@ if (!function_exists('build_radios')) {
/**
* 生成单选按钮组
* @param string $name
* @param array $list
* @param mixed $selected
* @param array $list
* @param mixed $selected
* @return string
*/
function build_radios($name, $list = [], $selected = null)
@@ -50,8 +50,8 @@ if (!function_exists('build_checkboxs')) {
/**
* 生成复选按钮组
* @param string $name
* @param array $list
* @param mixed $selected
* @param array $list
* @param mixed $selected
* @return string
*/
function build_checkboxs($name, $list = [], $selected = null)
@@ -73,9 +73,9 @@ if (!function_exists('build_category_select')) {
* 生成分类下拉列表框
* @param string $name
* @param string $type
* @param mixed $selected
* @param array $attr
* @param array $header
* @param mixed $selected
* @param array $attr
* @param array $header
* @return string
*/
function build_category_select($name, $type, $selected = null, $attr = [], $header = [])
@@ -112,10 +112,10 @@ if (!function_exists('build_toolbar')) {
}
$btnAttr = [
'refresh' => ['javascript:;', 'btn btn-primary btn-refresh', 'fa fa-refresh', '', __('Refresh')],
'add' => ['javascript:;', 'btn btn-success btn-add', 'fa fa-plus', __('Add'), __('Add')],
'edit' => ['javascript:;', 'btn btn-success btn-edit btn-disabled disabled', 'fa fa-pencil', __('Edit'), __('Edit')],
'del' => ['javascript:;', 'btn btn-danger btn-del btn-disabled disabled', 'fa fa-trash', __('Delete'), __('Delete')],
'import' => ['javascript:;', 'btn btn-info btn-import', 'fa fa-upload', __('Import'), __('Import')],
'add' => ['javascript:;', 'btn btn-success btn-add', 'fa fa-plus', __('Add'), __('Add')],
'edit' => ['javascript:;', 'btn btn-success btn-edit btn-disabled disabled', 'fa fa-pencil', __('Edit'), __('Edit')],
'del' => ['javascript:;', 'btn btn-danger btn-del btn-disabled disabled', 'fa fa-trash', __('Delete'), __('Delete')],
'import' => ['javascript:;', 'btn btn-info btn-import', 'fa fa-upload', __('Import'), __('Import')],
];
$btnAttr = array_merge($btnAttr, $attr);
$html = [];
@@ -197,18 +197,28 @@ if (!function_exists('build_heading')) {
}
function session_admin($key=''){
$admin = session('admin');
if($key){
return $admin[$key];
if (!function_exists('session_admin')) {
function session_admin($key = '')
{
$admin = session('admin');
if ($key) {
return $admin[$key];
}
return $admin;
}
return $admin;
}
function session_admin_firm_id(){
$admin = session('admin.firm_id');
return $admin;
if (!function_exists('session_admin_firm_id')) {
function session_admin_firm_id()
{
$admin = session('admin.firm_id');
return $admin;
}
}
function session_admin_firmstore_id(){
$admin = session('admin.firmstore_id');
return $admin;
if (!function_exists('session_admin_firmstore_id')) {
function session_admin_firmstore_id()
{
$admin = session('admin.firmstore_id');
return $admin;
}
}

View File

@@ -0,0 +1,51 @@
<?php
/*
* description
* authorwh
* email
* createTime{2025/3/24} {11:06}
*/
namespace app\admin\controller;
use think\Controller;
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
use wanghua\general_utility_tools_php\tool\Tools;
class Ai extends Controller
{
/**
* desc
* authorwh
*
* /ai/talk_skill
*/
public function talk_skill()
{
$txt = input('txt');
$txt = $txt?:'示例话术';
$ai_config = config('ai_config');
$talk_skill = $ai_config['talk_skill'];
$obj = new ChatGPT();
$obj->url = $talk_skill['base_url'];
$obj->apiKey = $talk_skill['api_key'];
$answer_json_arr = [];
Tools::log_to_write_txt(['示例话术请求gpt,入参'=>input()]);
$obj->returnAnswer($txt,['stream' => false],$answer_json_arr);
Tools::log_to_write_txt(['示例话术请求gpt,出参'=>$answer_json_arr]);
$json_arr = json_decode($answer_json_arr[0],true);
if(empty($json_arr['choices'][0]['message']['content'])){
$msg = '处理失败';
}else{
$msg = $json_arr['choices'][0]['message']['content'];
}
return json(Tools::set_ok('ok',$msg));
}
}

View File

@@ -34,4 +34,39 @@ class Firmcustomerfollowuptimelist extends Backend
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
//如果发送的来源是Selectpage则转发到Selectpage
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$list = $this->model
->with(['firmcustomerfollowuprecord'])
->where($where)
->order($sort, $order)
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','day','followup_time']);
$row->visible(['firmcustomerfollowuprecord']);
$row->getRelation('firmcustomerfollowuprecord')->visible(['name']);
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
return $this->view->fetch();
}
}

View File

@@ -23,8 +23,6 @@ class Firmfollowuptemplate extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmfollowuptemplate;
$this->model->where('firmfollowuptemplate.firm_id',session_admin_firm_id());
$this->model->where('firmfollowuptemplate.firmstore_id',session_admin_firmstore_id());
}
@@ -52,6 +50,8 @@ class Firmfollowuptemplate extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$this->model->where('firmfollowuptemplate.firm_id',session_admin_firm_id());
$this->model->where('firmfollowuptemplate.firmstore_id',session_admin_firmstore_id());
$list = $this->model
->with(['firmbigcategory'])
->where($where)

View File

@@ -3,6 +3,7 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
/**
* 回访模板回访时间列管理
@@ -17,7 +18,8 @@ class Firmfollowuptemplatetimelist extends Backend
* @var \app\admin\model\Firmfollowuptemplatetimelist
*/
protected $model = null;
//protected $selectpageFields = "day,send_time";
protected $noNeedRight = ['getList'];
public function _initialize()
{
parent::_initialize();
@@ -50,6 +52,11 @@ class Firmfollowuptemplatetimelist extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$firmfollowuptemplate_id = input('firmfollowuptemplate_id');
if($firmfollowuptemplate_id){
$this->model->where('firmfollowuptemplate_id',$firmfollowuptemplate_id);
}
//dump(input());die;
$list = $this->model
->with(['firmfollowuptemplate'])
->where($where)
@@ -57,16 +64,28 @@ class Firmfollowuptemplatetimelist extends Backend
->paginate($limit);
foreach ($list as $row) {
$row->visible(['id','day','send_time']);
$row->visible(['id','day','send_time','name']);
$row->visible(['firmfollowuptemplate']);
$row->getRelation('firmfollowuptemplate')->visible(['name']);
$row->send_time = $row['day'].'天-'.$row['send_time'];
}
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}
$this->assignconfig('firmfollowuptemplate_id',input('firmfollowuptemplate_id'));
return $this->view->fetch();
}
function getList(){
$list = Db::table('fa_firmfollowuptemplatetimelist')
->select();
foreach ($list as $k=>&$v){
$v['name'] = $v['day'].'天后 - '.$v['send_time'].'发送';
}
return json(['list'=>$list,'total'=>count($list)]);
}
}

View File

@@ -1,7 +1,9 @@
<?php
return [
'Id' => 'ID',
'Firmcustomerfollowuprecord_id' => '回访记录ID非必须',
'Followup_time' => '回访时间'
'Id' => 'ID',
'Firmcustomerfollowuprecord_id' => '回访记录',
'Day' => 'N天后回访',
'Followup_time' => '回访时间',
'Firmcustomerfollowuprecord.name' => '客户名称'
];

View File

@@ -37,4 +37,8 @@ class Firmcustomerfollowuptimelist extends Model
public function firmcustomerfollowuprecord()
{
return $this->belongsTo('Firmcustomerfollowuprecord', 'firmcustomerfollowuprecord_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}

View File

@@ -91,12 +91,13 @@
<input id="c-firmcustomerorigin_id" min="0" data-rule="required" data-source="firmcustomerorigin/index" class="form-control selectpage" name="row[firmcustomerorigin_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Return_visit_content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-return_visit_content" data-rule="required" class="form-control editor" rows="5" name="row[return_visit_content]" cols="50"></textarea>
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Return_visit_content')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <textarea id="c-return_visit_content" data-rule="required" class="form-control editor" rows="5" name="row[return_visit_content]" cols="50"></textarea>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
@@ -126,17 +127,46 @@
name="row[firmstore_id]" type="text" value="{:session_admin_firmstore_id()}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">设置回访:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-firmfollowuptemplate_id" min="0" data-rule="required"-->
<!-- data-source="firmfollowuptemplate/index" class="form-control selectpage"-->
<!-- name="row[firmfollowuptemplate_ids][]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group ">-->
<!-- <label class="control-label col-xs-12 col-sm-2"></label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input data-rule="required" data-source="firmfollowuptemplatetimelist/getList"-->
<!-- data-field="name"-->
<!-- class="form-control selectpage"-->
<!-- name="row[followup_template_time][]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="add_follow_up_div">-->
<!-- </div>-->
<!-- <div class="form-group ">-->
<!-- <label class="control-label col-xs-12 col-sm-2"></label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!--&lt;!&ndash; <input data-rule="required"&ndash;&gt;-->
<!--&lt;!&ndash; class="form-control " type="button" value="添加回访">&ndash;&gt;-->
<!-- <a class="form-control " href="firmcustomerfollowuprecord/add">添加回访</a>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>

View File

@@ -18,12 +18,12 @@
<input id="c-firmstoreprojectstwo_id" min="0" data-rule="required" data-source="firmstoreprojectstwo/index" class="form-control selectpage" name="row[firmstoreprojectstwo_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Store_project_name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-store_project_name" class="form-control" name="row[store_project_name]" type="text" value="">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Store_project_name')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-store_project_name" class="form-control" name="row[store_project_name]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
<div class="col-xs-12 col-sm-8">
@@ -36,16 +36,26 @@
<input id="c-firmnotespoints_id" min="0" data-rule="required" data-source="firmnotespoints/index" class="form-control selectpage" name="row[firmnotespoints_id]" type="text" value="">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Notes')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-notes" class="form-control" name="row[notes]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Notes')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-notes" class="form-control" name="row[notes]" type="text" value="">
<label class="control-label col-xs-12 col-sm-2">{:__('回访要点')}:</label>
<div class="col-xs-12 col-sm-6">
<input class="form-control" id="c-hui-fang-yao-dian" type="text" value="" placeholder="请输入回访要点">
</div>
<div class="col-xs-12 col-sm-2">
<input class="form-control shili_huashu_btn" type="button" value="示例话术">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Visit_msg')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-visit_msg" class="form-control" name="row[visit_msg]" type="text" value="">
<!-- <input id="c-visit_msg" class="form-control" name="row[visit_msg]" type="text" value="">-->
<textarea id="c-visit_msg" class="form-control" name="row[visit_msg]" cols="30" rows="5"></textarea>
</div>
</div>
<div class="form-group">
@@ -54,22 +64,31 @@
<input id="c-feedback" class="form-control" name="row[feedback]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Send_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-send_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[send_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="no"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Send_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-send_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[send_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- -->
<!-- <div class="radio">-->
<!-- {foreach name="statusList" item="vo"}-->
<!-- <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="no"}checked{/in} /> {$vo}</label> -->
<!-- {/foreach}-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Firm_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-firm_id" min="0" data-rule="required"
disabled
data-source="firm/index" class="form-control selectpage"
name="row[firm_id]" type="text" value="{:session_admin_firm_id()}">
</div>
</div>
<div class="form-group">
@@ -81,27 +100,18 @@
name="row[firmstore_id]" type="text" value="{:session_admin_firmstore_id()}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Firm_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-firm_id" min="0" data-rule="required"
disabled
data-source="firm/index" class="form-control selectpage"
name="row[firm_id]" type="text" value="{:session_admin_firm_id()}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">

View File

@@ -6,6 +6,12 @@
<input id="c-firmcustomerfollowuprecord_id" min="0" data-rule="required" data-source="firmcustomerfollowuprecord/index" class="form-control selectpage" name="row[firmcustomerfollowuprecord_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Day')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-day" min="0" class="form-control" name="row[day]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Followup_time')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@@ -6,6 +6,12 @@
<input id="c-firmcustomerfollowuprecord_id" min="0" data-rule="required" data-source="firmcustomerfollowuprecord/index" class="form-control selectpage" name="row[firmcustomerfollowuprecord_id]" type="text" value="{$row.firmcustomerfollowuprecord_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Day')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-day" min="0" class="form-control" name="row[day]" type="number" value="{$row.day|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Followup_time')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@@ -44,9 +44,12 @@
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Main_points')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="col-xs-12 col-sm-6">
<input id="c-main_points" class="form-control" name="row[main_points]" type="text" value="">
</div>
<div class="col-xs-12 col-sm-2">
<input class="form-control shi_li_huashu" type="button" value="示例话术">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Ai_text')}:</label>
@@ -54,18 +57,18 @@
<textarea id="c-ai_text" class="form-control" name="row[ai_text]" type="text"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-create_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- <input id="c-update_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">

View File

@@ -339,5 +339,17 @@ return [
],
'gewechat'=>[
'base_url'=>'https://wechat-api-test.excn.vip/v2/api'
],
'ai_config'=>[
//AI话术/话术示例
'talk_skill'=>[
'base_url'=> 'https://uegpt-newest.excn.vip/api/v1/chat/completions',
'api_key'=> 'fastgpt-uymTwSwQiSc9BcwtgsfJ7QWG0AQRYxVnTPrZuuqRdU6mMQ4pp7jZHhfKkGAhGc',
],
//回访结果/反馈总结
'follow_result'=>[
'base_url'=> 'https://uegpt-newest.excn.vip/api/v1/chat/completions',
'api_key'=> 'fastgpt-tQ3TLwgcUfZO6RsgsL1nobdNhCpd31NrsZvYfGUyhQzc7JuPMbKPCQQpU4h',
],
]
];

View File

@@ -42,7 +42,71 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'firmcustomerorigin.name', title: __('Firmcustomerorigin.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'firmemployee.name', title: __('Firmemployee.name'), operate: 'LIKE'},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'addFollwup',
text: __('新增回访'),
title: __('新增回访'),
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-magic',
url: 'firmcustomerfollowuprecord/add',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
{
name: 'follwuplist',
text: __('回访列表'),
title: __('回访列表'),
classname: 'btn btn-xs btn-success btn-dialog',
icon: 'fa fa-list',
url: 'firmcustomerfollowuprecord/index',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
{
name: 'setFollwupPlan',
text: __('设置回访计划'),
title: __('设置回访计划'),
classname: 'btn btn-xs btn-danger btn-dialog',
icon: 'fa fa-plus',
url: 'firmcustomerfollowuptimelist/add',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
// {
// name: 'selectSendTime',
// text: __('查看发送时间'),
// title: __('查看发送时间'),
// classname: 'btn btn-xs btn-danger btn-dialog',
// icon: 'fa fa-list',
// url: 'firmfollowuptemplatetimelist/index/firmfollowuptemplate_id/{id}',
// callback: function (data) {
// Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
// },
// visible: function (row) {
// //返回true时按钮显示,返回false隐藏
// return true;
// }
// },
]
}
]
]
});
@@ -78,13 +142,24 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table.api.bindevent(table);
},
add: function () {
// $("#c-category").data("format-item", function(row){
// return row.title + " - " + row.author;
// });
//设置下拉框后的值
$(document).on("change", "#c-rel_wx", function(data){
//变更后的回调事件
// console.log(data.currentTarget.defaultValue);
$('#c-rel_wx').attr('data-wx_id',data.currentTarget.defaultValue);
});
$(document).on("change", "#c-firmfollowuptemplate_id", function(data){
//变更后的回调事件
console.log(data.currentTarget.defaultValue);
let tmp_id = data.currentTarget.defaultValue;
// $('#c-rel_wx').attr('data-wx_id',data.currentTarget.defaultValue);
$.get('firmfollowuptemplatetimelist/index',{firmfollowuptemplate_id:tmp_id},function (res) {
},'json');
});
$('.firmcustomer-sync-info').on('click',function (e){
//读取下拉框的值

View File

@@ -37,7 +37,72 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'send_time', title: __('Send_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'status', title: __('Status'), searchList: {"no":__('Status no'),"yes":__('Status yes')}, formatter: Table.api.formatter.status},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
// {
// name: 'addFollwup',
// text: __('新增回访'),
// title: __('新增回访'),
// classname: 'btn btn-xs btn-primary btn-dialog',
// icon: 'fa fa-magic',
// url: 'firmcustomerfollowuprecord/add',
// callback: function (data) {
// Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
// },
// visible: function (row) {
// //返回true时按钮显示,返回false隐藏
// return true;
// }
// },
{
name: 'planList',
text: __('计划列表'),
title: __('计划列表'),
classname: 'btn btn-xs btn-success btn-dialog',
icon: 'fa fa-list',
url: 'firmcustomerfollowuptimelist/index',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
// {
// name: 'setFollwupPlan',
// text: __('设置回访计划'),
// title: __('设置回访计划'),
// classname: 'btn btn-xs btn-danger btn-dialog',
// icon: 'fa fa-plus',
// url: 'firmcustomerfollowuptimelist/add',
// callback: function (data) {
// Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
// },
// visible: function (row) {
// //返回true时按钮显示,返回false隐藏
// return true;
// }
// },
// {
// name: 'selectSendTime',
// text: __('查看发送时间'),
// title: __('查看发送时间'),
// classname: 'btn btn-xs btn-danger btn-dialog',
// icon: 'fa fa-list',
// url: 'firmfollowuptemplatetimelist/index/firmfollowuptemplate_id/{id}',
// callback: function (data) {
// Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
// },
// visible: function (row) {
// //返回true时按钮显示,返回false隐藏
// return true;
// }
// },
]
}
]
]
});
@@ -46,6 +111,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table.api.bindevent(table);
},
add: function () {
$('.shili_huashu_btn').on('click',function (e){
//读取下拉框的值
let txt = $('#c-hui-fang-yao-dian').val();
// console.log(wx_id);
// console.log(e);
// let load_index = layer.load(1);
$.post('ai/talk_skill',{txt:txt},function (res) {
// layer.close(load_index);
//回显
$('#c-visit_msg').val(res.data);
},'json');
});
Controller.api.bindevent();
},
edit: function () {

View File

@@ -26,8 +26,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'firmcustomerfollowuprecord_id', title: __('Firmcustomerfollowuprecord_id')},
{field: 'day', title: __('Day')},
{field: 'followup_time', title: __('Followup_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'firmcustomerfollowuprecord.name', title: __('Firmcustomerfollowuprecord.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]
]

View File

@@ -31,9 +31,42 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'main_points', title: __('Main_points'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'ai_text', title: __('Ai_text'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
// {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
{field: 'firmbigcategory.name', title: __('Firmbigcategory.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'addSendTime',
text: __('添加发送时间'),
title: __('添加发送时间'),
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-magic',
url: 'firmfollowuptemplatetimelist/add',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
{
name: 'selectSendTime',
text: __('查看发送时间'),
title: __('查看发送时间'),
classname: 'btn btn-xs btn-danger btn-dialog',
icon: 'fa fa-list',
url: 'firmfollowuptemplatetimelist/index/firmfollowuptemplate_id/{id}',
callback: function (data) {
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
}
},
]
}
]
]
});
@@ -42,6 +75,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
Table.api.bindevent(table);
},
add: function () {
$('.shi_li_huashu').on('click',function () {
let txt = $('#c-main_points').val();
$.post('ai/talk_skill',{txt:txt},function (res) {
$('#c-ai_text').val(res.data);
},'json');
});
Controller.api.bindevent();
},
edit: function () {

View File

@@ -17,9 +17,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
var table = $("#table");
let firmfollowuptemplate_id = Config.firmfollowuptemplate_id;
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
url: $.fn.bootstrapTable.defaults.extend.index_url+'&firmfollowuptemplate_id='+firmfollowuptemplate_id,
pk: 'id',
sortName: 'id',
columns: [