Compare commits
3 Commits
8da31ba095
...
5df9fa6746
| Author | SHA1 | Date | |
|---|---|---|---|
| 5df9fa6746 | |||
| fe2df1065b | |||
| 862710f9ee |
@ -3,6 +3,10 @@
|
||||
namespace app\admin\controller\user4s;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use Exception;
|
||||
use think\Db;
|
||||
use think\exception\PDOException;
|
||||
use think\exception\ValidateException;
|
||||
|
||||
/**
|
||||
* 回访单
|
||||
@ -22,7 +26,10 @@ class Visit extends Backend
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\common\model\user4s\Visit;
|
||||
|
||||
$this->user_model = new \app\common\model\user4s\User();
|
||||
$this->type_model = new \app\common\model\user4s\Visittype();
|
||||
$this->log_model = new \app\common\model\user4s\Visitlog();
|
||||
$this->view->assign("statusList", $this->model->getStatusList());
|
||||
}
|
||||
|
||||
|
||||
@ -49,16 +56,14 @@ class Visit extends Backend
|
||||
return $this->selectpage();
|
||||
}
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
//var_dump($this->request->request());
|
||||
$list = $this->model
|
||||
->with(['visittype','user','admin'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
->with(['visittype', 'user', 'admin'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
@ -67,5 +72,158 @@ class Visit extends Backend
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if (!$this->request->isPost()) {
|
||||
$user4s_id = $this->request->get("user4s_id/d");
|
||||
if ($user4s_id > 0) {
|
||||
$user4s=$this->user_model->get($user4s_id);
|
||||
//var_dump($user4s);
|
||||
if(isset($user4s->id)){
|
||||
$this->view->assign("user4s", $user4s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return parent::add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds)) {
|
||||
if (!in_array($row[$this->dataLimitField], $adminIds)) {
|
||||
$this->error(__('You have no permission'));
|
||||
}
|
||||
}
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post("row/a");
|
||||
if ($params) {
|
||||
$params = $this->preExcludeFields($params);
|
||||
$result = false;
|
||||
$this->model->startTrans();
|
||||
try {
|
||||
//是否采用模型验证
|
||||
if ($this->modelValidate) {
|
||||
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
|
||||
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
|
||||
$row->validateFailException(true)->validate($validate);
|
||||
}
|
||||
$result = $row->allowField(true)->save($params);
|
||||
$this->model->commit();
|
||||
} catch (ValidateException $e) {
|
||||
$this->model->rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (PDOException $e) {
|
||||
$this->model->rollback();
|
||||
$this->error($e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
$this->model->rollback();
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
if ($result !== false) {
|
||||
$this->success();
|
||||
} else {
|
||||
$this->error(__('No rows were updated'));
|
||||
}
|
||||
}
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
$this->view->assign("row", $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
/**
|
||||
* 回访记录和结单
|
||||
*/
|
||||
public function visitlog($vid = null)
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$this->token();
|
||||
}
|
||||
$row = $this->model->get($vid);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
$adminIds = $this->getDataLimitAdminIds();
|
||||
if (is_array($adminIds)) {
|
||||
if (!in_array($row[$this->dataLimitField], $adminIds)) {
|
||||
$this->error(__('You have no permission'));
|
||||
}
|
||||
}
|
||||
$all_type = $this->type_model->where('deletetime', null)->column('id,name');
|
||||
$all_star = array(
|
||||
1=>'★',
|
||||
2=>'★★',
|
||||
3=>'★★★',
|
||||
4=>'★★★★',
|
||||
5=>'★★★★★',
|
||||
);
|
||||
if ($this->request->isAjax()) {
|
||||
//当前是否为关联查询
|
||||
$this->relationSearch = true;
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
$where_v = ['visit_id'=>$row->id];
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
$list = $this->log_model
|
||||
->with(['visittype', 'user', 'visit','admin'])
|
||||
->where($where)
|
||||
->where($where_v)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
foreach ($list as &$item) {
|
||||
$item->visit_time_f=date('Y-m-d',$item->visit_time);
|
||||
//var_dump($item->visit_time_f);
|
||||
$item->star_f = $all_star[$item->star];
|
||||
}
|
||||
//var_dump($list->items());
|
||||
$result = array("total" => $list->total(), "rows" => $list->items(),'all_star'=>$all_star);
|
||||
return json($result);
|
||||
}
|
||||
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post("row/a");
|
||||
//记录用户续保记录
|
||||
if (!empty($params['inscom']) && !empty($params['insdate'])) {
|
||||
$log_data = array(
|
||||
'user4s_id' => $row->id,
|
||||
'admin_id'=>$this->auth->id,
|
||||
'inscom'=>$params['inscom'],
|
||||
'insdate'=>$params['insdate'],
|
||||
'star'=>$params['star'],
|
||||
'description'=>$params['description']
|
||||
);
|
||||
$this->Inslog_model = new \app\common\model\user4s\Inslog();
|
||||
$this->Inslog_model->isUpdate(false)->save($log_data);
|
||||
$user_data = array(
|
||||
'inscom'=>$params['inscom'],
|
||||
'insdate'=>$params['insdate'],
|
||||
);
|
||||
$this->model->save($user_data, ['id' => $row->id]);
|
||||
}else{
|
||||
$this->error('请填写续保信息',url('user4s/user/expireins',['user4s_id'=>$row->id]));
|
||||
}
|
||||
$this->success('续保成功!',url('user4s/user/expireins',['user4s_id'=>$row->id]));
|
||||
}
|
||||
|
||||
$this->view->assign("now", date('Y-m-d'));
|
||||
$this->view->assign("all_star", $all_star);
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
71
application/admin/controller/user4s/Visitlog.php
Normal file
71
application/admin/controller/user4s/Visitlog.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\user4s;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 回访记录
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Visitlog extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Visitlog模型对象
|
||||
* @var \app\common\model\user4s\Visitlog
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\common\model\user4s\Visitlog;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
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(['user','visit','visittype'])
|
||||
->where($where)
|
||||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
foreach ($list as $row) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $list->items());
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
}
|
||||
@ -33,5 +33,25 @@ class Visittype extends Backend
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 计算回访时间
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function getvtime()
|
||||
{
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->post("id/d");
|
||||
$type = $this->model->get($id);
|
||||
//var_dump($type,$id);
|
||||
$vtime = date('Y-m-d');
|
||||
if(!empty($type->tip_time)){
|
||||
$vtime = date('Y-m-d',strtotime('+'.$type->tip_time.' days'));
|
||||
}
|
||||
return json(['code' => 1, 'data' => ['visit_time' => $vtime]]);
|
||||
}
|
||||
return json(['code' => 0, 'msg' => '非法请求']);
|
||||
}
|
||||
}
|
||||
|
||||
55
application/admin/lang/zh-cn/user4s/visitlog.php
Normal file
55
application/admin/lang/zh-cn/user4s/visitlog.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'User4s_id' => '会员',
|
||||
'Admin_id' => '操作员',
|
||||
'Visit_id' => '回访单',
|
||||
'Type_id' => '回访类型',
|
||||
'Visit_time' => '回访时间',
|
||||
'Star' => '满意度',
|
||||
'Description' => '备注',
|
||||
'Createtime' => '创建时间',
|
||||
'User.id' => 'ID',
|
||||
'User.category_id' => '用户分组',
|
||||
'User.level_id' => '用户等级',
|
||||
'User.name' => '姓名',
|
||||
'User.tel' => '联系方式',
|
||||
'User.balance' => '余额',
|
||||
'User.integral' => '积分',
|
||||
'User.genderdata' => '性别',
|
||||
'User.genderdata male' => '男',
|
||||
'User.genderdata female' => '女',
|
||||
'User.city' => '省市',
|
||||
'User.buydate' => '购车日期',
|
||||
'User.carno' => '车牌号码',
|
||||
'User.model' => '车型',
|
||||
'User.color' => '颜色',
|
||||
'User.inscom' => '保险类型',
|
||||
'User.insdate' => '保险日期',
|
||||
'User.tags' => '标签',
|
||||
'User.description' => '备注',
|
||||
'User.admin_id' => '销售顾问',
|
||||
'User.createtime' => '创建时间',
|
||||
'User.updatetime' => '更新时间',
|
||||
'User.deletetime' => '删除时间',
|
||||
'User.status' => '状态值',
|
||||
'User.status 0' => '禁用',
|
||||
'User.status 1' => '正常',
|
||||
'Visit.id' => 'ID',
|
||||
'Visit.user4s_id' => '会员',
|
||||
'Visit.admin_id' => '操作员',
|
||||
'Visit.type_id' => '回访类型',
|
||||
'Visit.visittime' => '回访时间',
|
||||
'Visit.description' => '备注',
|
||||
'Visit.createtime' => '创建时间',
|
||||
'Visit.deletetime' => '删除时间',
|
||||
'Visit.status' => '是否结单',
|
||||
'Visit.endtime' => '结单时间',
|
||||
'Visittype.id' => 'ID',
|
||||
'Visittype.name' => '名称',
|
||||
'Visittype.tip_time' => '提醒时间',
|
||||
'Visittype.description' => '备注',
|
||||
'Visittype.createtime' => '创建时间',
|
||||
'Visittype.deletetime' => '删除时间'
|
||||
];
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<div class="panel-lead"><em>保险临期</em>保险即将临期的会员列表,请提醒用户及时购买保险。</div>
|
||||
<div class="panel-lead"><em>回访记录</em>本回访单的回访记录。</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -3,7 +3,12 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User4s_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
{if isset($user4s.id)}
|
||||
<input type="hidden" name="row[user4s_id]" value="{$user4s.id}">
|
||||
<input id="c-user4s_id" class="form-control disabled" type="text" value="{$user4s.name}" readonly>
|
||||
{else}
|
||||
<input id="c-user4s_id" data-rule="required" data-source="user4s/user/index" class="form-control selectpage" name="row[user4s_id]" type="text" value="">
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@ -15,7 +20,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visittime')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visittime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[visittime]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
<input id="c-visittime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[visittime]" type="text" value="{:date('Y-m-d')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@ -3,19 +3,19 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User4s_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user4s_id" data-rule="required" data-source="user4s/index" class="form-control selectpage" name="row[user4s_id]" type="text" value="{$row.user4s_id|htmlentities}">
|
||||
<input id="c-user4s_id" data-rule="required" data-source="user4s/user/index" class="form-control selectpage" name="row[user4s_id]" type="text" value="{$row.user4s_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-type_id" data-rule="required" data-source="type/index" class="form-control selectpage" name="row[type_id]" type="text" value="{$row.type_id|htmlentities}">
|
||||
<input id="c-type_id" data-rule="required" data-source="user4s/visittype/index" class="form-control selectpage" name="row[type_id]" type="text" value="{$row.type_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visittime')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visittime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[visittime]" type="text" value="{:$row.visittime?datetime($row.visittime):''}">
|
||||
<input id="c-visittime" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[visittime]" type="text" value="{:$row.visittime?datetime($row.visittime):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@ -1,5 +1,13 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<ul class="nav nav-tabs" data-field="status">
|
||||
{foreach name="statusList" item="vo"}
|
||||
<li class="{:$Think.get.status === (string)$key || $key == 0 ? 'active' : ''}"><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
@ -7,7 +15,7 @@
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user4s/visit/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add2 {:$auth->check('user4s/visit/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('开单')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user4s/visit/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<!-- <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user4s/visit/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a> -->
|
||||
|
||||
|
||||
33
application/admin/view/user4s/visit/visitlog.html
Normal file
33
application/admin/view/user4s/visit/visitlog.html
Normal file
@ -0,0 +1,33 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading(null,FALSE)}
|
||||
<!-- <div class="panel-heading">
|
||||
{:build_heading(null,FALSE)}
|
||||
<div class="panel-lead"><em>保险临期</em>保险即将临期的会员列表,请提醒用户及时购买保险。</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<!-- <a href="javascript:;" class="btn btn-default" style="font-size:14px;color:dodgerblue;">
|
||||
<i class="fa fa-calendar"></i>
|
||||
<span class="extend">
|
||||
回访单号:<span id="start_date"></span>
|
||||
至 <span id="end_date"></span>
|
||||
</span>
|
||||
</a> -->
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('user4s/user/edit')}"
|
||||
data-operate-del="{:$auth->check('user4s/user/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
46
application/admin/view/user4s/visitlog/add.html
Normal file
46
application/admin/view/user4s/visitlog/add.html
Normal file
@ -0,0 +1,46 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User4s_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user4s_id" data-rule="required" data-source="user4s/index" class="form-control selectpage" name="row[user4s_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visit_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visit_id" data-rule="required" data-source="visit/index" class="form-control selectpage" name="row[visit_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-type_id" data-rule="required" data-source="type/index" class="form-control selectpage" name="row[type_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visit_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visit_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[visit_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">{:__('Star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-star" min="0" class="form-control" name="row[star]" type="number" value="0">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-description" class="form-control" name="row[description]" type="text" value="">
|
||||
</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">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
46
application/admin/view/user4s/visitlog/edit.html
Normal file
46
application/admin/view/user4s/visitlog/edit.html
Normal file
@ -0,0 +1,46 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('User4s_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-user4s_id" data-rule="required" data-source="user4s/index" class="form-control selectpage" name="row[user4s_id]" type="text" value="{$row.user4s_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visit_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visit_id" data-rule="required" data-source="visit/index" class="form-control selectpage" name="row[visit_id]" type="text" value="{$row.visit_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Type_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-type_id" data-rule="required" data-source="type/index" class="form-control selectpage" name="row[type_id]" type="text" value="{$row.type_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Visit_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-visit_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[visit_time]" type="text" value="{:$row.visit_time?datetime($row.visit_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Star')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-star" min="0" class="form-control" name="row[star]" type="number" value="{$row.star|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-description" class="form-control" name="row[description]" type="text" value="{$row.description|htmlentities}">
|
||||
</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">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
35
application/admin/view/user4s/visitlog/index.html
Normal file
35
application/admin/view/user4s/visitlog/index.html
Normal file
@ -0,0 +1,35 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('user4s/visitlog/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('user4s/visitlog/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('user4s/visitlog/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
<div class="dropdown btn-group {:$auth->check('user4s/visitlog/multi')?'':'hide'}">
|
||||
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||
<ul class="dropdown-menu text-left" role="menu">
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
|
||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('user4s/visitlog/edit')}"
|
||||
data-operate-del="{:$auth->check('user4s/visitlog/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -25,13 +25,23 @@ class Visit extends Model
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'visittime_text'
|
||||
'visittime_text',
|
||||
'status_text',
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['0' => __('进行中'), '1' => __('已办结')];
|
||||
}
|
||||
public function getStatusTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
|
||||
$list = $this->getStatusList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
public function getVisittimeTextAttr($value, $data)
|
||||
{
|
||||
|
||||
68
application/common/model/user4s/Visitlog.php
Normal file
68
application/common/model/user4s/Visitlog.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model\user4s;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Visitlog extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'user4s_visitlog';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'visit_time_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function getVisitTimeTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['visit_time']) ? $data['visit_time'] : '');
|
||||
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||
}
|
||||
|
||||
protected function setVisitTimeAttr($value)
|
||||
{
|
||||
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||
}
|
||||
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('User', 'user4s_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function visit()
|
||||
{
|
||||
return $this->belongsTo('Visit', 'visit_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
|
||||
|
||||
public function visittype()
|
||||
{
|
||||
return $this->belongsTo('Visittype', 'type_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
public function admin()
|
||||
{
|
||||
return $this->belongsTo('app\common\model\Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||
}
|
||||
}
|
||||
27
application/common/validate/user4s/Visitlog.php
Normal file
27
application/common/validate/user4s/Visitlog.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\validate\user4s;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Visitlog extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
@ -55,7 +55,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{ checkbox: true },
|
||||
//{field: 'id', title: __('Id'), operate:false},
|
||||
{field: 'id', title: __('会员ID'), operate:false},
|
||||
{ field: 'name', title: __('Name'), operate: 'LIKE' },
|
||||
{ field: 'tel', title: __('Tel'), operate: 'LIKE' },
|
||||
{ field: 'genderdata', title: __('Genderdata'), operate: false,searchList: { "male": __('Genderdata male'), "female": __('Genderdata female') }, formatter: Table.api.formatter.normal },
|
||||
@ -87,7 +87,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
return row['fuzheren'];
|
||||
}
|
||||
},
|
||||
//{ field: 'createtime', title: __('Createtime'), operate: false, addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime },
|
||||
//{ field: 'createtime', title: __('Createtime'), operate: false, addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime,datetimeFormat:'YYYY-MM-DD'},
|
||||
//{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{ field: 'status', title: __('Status'), operate: '=',searchList: { "0": __('Status 0'), "1": __('Status 1') }, formatter: Table.api.formatter.status },
|
||||
|
||||
@ -96,7 +96,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'push',
|
||||
name: 'recharge',
|
||||
text: __('充值消费'),
|
||||
title: __('充值消费'),
|
||||
classname: 'btn btn-xs btn-danger btn-dialog',
|
||||
@ -112,7 +112,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'push',
|
||||
name: 'rechargelog',
|
||||
text: __('消费记录'),
|
||||
title: __('消费记录'),
|
||||
classname: 'btn btn-xs btn-warning btn-dialog',
|
||||
@ -120,14 +120,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
url: 'user4s/log/index?user4s_id={id}',
|
||||
extend: 'data-area=\'["1000px","800px"]\'',
|
||||
},
|
||||
// {
|
||||
// name: 'push',
|
||||
// text: __('推送'),
|
||||
// title: __('推送'),
|
||||
// classname: 'btn btn-xs btn-warning btn-ajax',
|
||||
// icon: 'fa fa-paper-plane-o',
|
||||
// url: 'soft_order/push'
|
||||
// },
|
||||
{
|
||||
name: 'visit',
|
||||
text: __('回访单'),
|
||||
title: function(row){
|
||||
return row.name +'-的回访单'
|
||||
},
|
||||
classname: 'btn btn-xs btn-info btn-addtabs',
|
||||
icon: 'fa fa-comments-o',
|
||||
url: 'user4s/visit/index?user4s_id={id}',
|
||||
extend: 'data-area=\'["1000px","800px"]\'',
|
||||
},
|
||||
// {
|
||||
// name: 'addtabs',
|
||||
// text: __('日志'),
|
||||
|
||||
@ -32,7 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
//{ field: 'id', title: __('Id') },
|
||||
//{ field: 'type_id', title: __('Type_id') },
|
||||
{field: 'visittype.name', title: __('Type_id'), operate: 'LIKE'},
|
||||
//{ field: 'user4s_id', title: __('User4s_id') },
|
||||
{ field: 'user4s_id', title: __('会员ID'),visible:false,operate:false},
|
||||
{ field: 'user.name', title: __('会员姓名'), operate: 'LIKE' },
|
||||
{field: 'user.carno', title: __('User.carno'), operate: 'LIKE'},
|
||||
//{ field: 'user.buydate', title: __('User.buydate'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||
@ -42,17 +42,112 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
//{ field: 'user.insdate', title: __('User.insdate'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false },
|
||||
//{ field: 'user.description', title: __('User.description'), operate: 'LIKE' },
|
||||
|
||||
{field: 'visittime', title: __('Visittime'), operate:'BETWEEN', addclass:'datetimepicker',data:'data-date-format="YYYY-MM-DD",data-date-use-current="true"', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visittime', title: __('Visittime'), operate:'BETWEEN', addclass:'datetimepicker',data:'data-date-format="YYYY-MM-DD",data-date-use-current="true"', autocomplete:false, formatter: Table.api.formatter.datetime,datetimeFormat:'YYYY-MM-DD'},
|
||||
//{field: 'admin.nickname', title: __('操作员'), operate: 'LIKE'},
|
||||
{ field: 'createtime', title: __('Createtime'), operate: 'BETWEEN', addclass: 'datetimepicker',data: 'data-date-format="YYYY-MM-DD",data-date-use-current="true"', autocomplete: false, formatter: Table.api.formatter.datetime },
|
||||
{ field: 'createtime', title: __('开单时间'), operate: 'BETWEEN', addclass: 'datetimepicker',data: 'data-date-format="YYYY-MM-DD",data-date-use-current="true"',datetimeFormat:'YYYY-MM-DD', autocomplete: false, formatter: Table.api.formatter.datetime },
|
||||
{field: 'description', title: __('Description'), operate: 'LIKE'},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
{ field: 'status', title: __('Status'), operate: '=',searchList: { "0": __('进行中'), "1": __('已办结') }, formatter: Table.api.formatter.status },
|
||||
//{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,
|
||||
buttons: [
|
||||
{
|
||||
name: 'push',
|
||||
text: __('填报回访记录'),
|
||||
title: __('填报回访记录'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-cloud-upload',
|
||||
url: 'user4s/visit/visitlog?vid={ids}',
|
||||
extend: 'data-area=\'["1000px","800px"]\'',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), { title: "回传数据" });
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'visitlog',
|
||||
text: __('历史回访记录'),
|
||||
title: __('历史回访记录'),
|
||||
classname: 'btn btn-xs btn-default btn-dialog',
|
||||
icon: 'fa fa-building-o',
|
||||
url: 'user4s/visit/visitlog?vid={ids}',
|
||||
extend: 'data-area=\'["1000px","800px"]\'',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), { title: "回传数据" });
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: 'rechargelog',
|
||||
// text: __('结单'),
|
||||
// title: __('结单'),
|
||||
// classname: 'btn btn-xs btn-danger btn-dialog',
|
||||
// icon: 'fa fa-calendar-check-o',
|
||||
// url: 'user4s/log/index?user4s_id={id}',
|
||||
// extend: 'data-area=\'["1000px","800px"]\'',
|
||||
// },
|
||||
// {
|
||||
// name: 'visit',
|
||||
// text: __('回访单'),
|
||||
// title: __('回访单'),
|
||||
// classname: 'btn btn-xs btn-info btn-dialog',
|
||||
// icon: 'fa fa-comments-o',
|
||||
// url: 'user4s/visit/index?user4s_id={id}',
|
||||
// extend: 'data-area=\'["1000px","800px"]\'',
|
||||
// },
|
||||
// {
|
||||
// name: 'addtabs',
|
||||
// text: __('日志'),
|
||||
// title: __('订单任务日志'),
|
||||
// classname: 'btn btn-xs btn-info btn-addtabs',
|
||||
// icon: 'fa fa-list-ol',
|
||||
// url: 'soft_log/?ids={row.id}&ref=addtabs'
|
||||
// }
|
||||
],
|
||||
formatter: Table.api.formatter.operate
|
||||
}
|
||||
]
|
||||
]
|
||||
],
|
||||
queryParams: function (params) {
|
||||
//这里可以追加搜索条件
|
||||
var filter = JSON.parse(params.filter);
|
||||
var op = JSON.parse(params.op);
|
||||
//这里可以动态赋值,比如从URL中获取admin_id的值,filter.admin_id=Fast.api.query('admin_id');
|
||||
filter.user4s_id = Fast.api.query('user4s_id');
|
||||
op.user4s_id = "=";
|
||||
if (filter.user4s_id == null || filter.user4s_id == "") {
|
||||
delete filter.user4s_id;
|
||||
delete op.user4s_id;
|
||||
}
|
||||
|
||||
params.filter = JSON.stringify(filter);
|
||||
params.op = JSON.stringify(op);
|
||||
console.log(params);
|
||||
return params;
|
||||
},
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
// 添加按钮事件
|
||||
$(document).on('click', '.btn-add2', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
var user4s_id =Fast.api.query('user4s_id');
|
||||
var url = $.fn.bootstrapTable.defaults.extend.add_url;
|
||||
if(user4s_id !== ''){
|
||||
url = url + '?user4s_id=' + user4s_id;
|
||||
}
|
||||
if (url.indexOf("{ids}") !== -1) {
|
||||
url = Table.api.replaceurl(url, {ids: ids.length > 0 ? ids.join(",") : 0}, table);
|
||||
}
|
||||
Fast.api.open(url, $(this).data("original-title") || $(this).attr("title") || __('Add'), $(this).data() || {});
|
||||
});
|
||||
},
|
||||
recyclebin: function () {
|
||||
// 初始化表格参数配置
|
||||
@ -115,11 +210,117 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
},
|
||||
|
||||
add: function () {
|
||||
$('#c-type_id').on('change', function () {
|
||||
var id = $('#c-type_id').val();
|
||||
$.ajax({
|
||||
url: "user4s/visittype/getvtime",
|
||||
type: "POST", //Use "PUT" for HTTP PUT methods
|
||||
dataType: 'json',
|
||||
data: {
|
||||
id: id,
|
||||
},
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
console.log(data);
|
||||
if (data.code == 1) {
|
||||
if (data.data.visit_time != undefined && data.data.visit_time != null && data.data.visit_time != '') {
|
||||
$('#c-visittime').val(data.data.visit_time);
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
});
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
//回访记录
|
||||
visitlog: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'user4s/visit/visitlog' + location.search,
|
||||
table: 'user4s_visit',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
//当表格数据加载完成时
|
||||
// table.on('load-success.bs.table', function (e, data) {
|
||||
// //这里可以获取从服务端获取的JSON数据
|
||||
// console.log(data);
|
||||
// //这里我们手动设置底部的值
|
||||
// $("#start_date").text(data.extend.start_date);
|
||||
// $("#end_date").text(data.extend.end_date);
|
||||
// });
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
showToggle: false,
|
||||
commonSearch: false,
|
||||
//maintainSelected: true,
|
||||
columns: [
|
||||
[
|
||||
//{ checkbox: true },
|
||||
{field: 'id', title: __('回访记录号'), operate:false},
|
||||
{field: 'visit_id', title: __('回访单号'), operate:false},
|
||||
{ field: 'user.name', title: __('会员姓名'), operate: false },
|
||||
{ field: 'user.tel', title: __('联系方式'), operate: false },
|
||||
//{ field: 'user.buydate', title: __('购车时间'), operate: false},
|
||||
{ field: 'user.carno', title: __('车牌号'), operate: false },
|
||||
// { field: 'user.model', title: __('车型'), operate: false },
|
||||
// { field: 'user.color', title: __('颜色'), operate: false },
|
||||
{field: 'star_f', title: __('满意度'), operate: false},
|
||||
{field: 'description', title: __('Description'), operate: false},
|
||||
{ field: 'visit_time', title: __('回访时间'), operate: 'BETWEEN', addclass: 'datetimepicker',data: 'data-date-format="YYYY-MM-DD",data-date-use-current="true"', autocomplete: false,formatter: Table.api.formatter.datetime,datetimeFormat:'YYYY-MM-DD' },
|
||||
{
|
||||
field: 'admin_id', title: __('Admin_id'), operate: false, formatter: function (value, row, index) {
|
||||
return row['admin']['nickname'];
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
// buttons: [
|
||||
// {
|
||||
// name: 'renewal',
|
||||
// text: __('续保'),
|
||||
// title: __('续保'),
|
||||
// classname: 'btn btn-xs btn-danger btn-dialog',
|
||||
// icon: 'fa fa-dashboard',
|
||||
// url: 'user4s/user/renewal',
|
||||
// extend: 'data-area=\'["1000px","800px"]\'',
|
||||
// callback: function (data) {
|
||||
// Layer.alert("接收到回传数据:" + JSON.stringify(data), { title: "回传数据" });
|
||||
// },
|
||||
// visible: function (row) {
|
||||
// //返回true时按钮显示,返回false隐藏
|
||||
// return true;
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: 'inslog',
|
||||
// text: __('续保记录'),
|
||||
// title: __('续保记录'),
|
||||
// classname: 'btn btn-xs btn-warning btn-dialog',
|
||||
// icon: 'fa fa-calendar-check-o',
|
||||
// url: 'user4s/inslog/index?user4s_id={id}',
|
||||
// extend: 'data-area=\'["1000px","800px"]\'',
|
||||
// },
|
||||
// ],
|
||||
// formatter: Table.api.formatter.operate
|
||||
// }
|
||||
]
|
||||
],
|
||||
|
||||
});
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
|
||||
96
public/assets/js/backend/user4s/visitlog.js
Normal file
96
public/assets/js/backend/user4s/visitlog.js
Normal file
@ -0,0 +1,96 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'user4s/visitlog/index' + location.search,
|
||||
add_url: 'user4s/visitlog/add',
|
||||
edit_url: 'user4s/visitlog/edit',
|
||||
del_url: 'user4s/visitlog/del',
|
||||
multi_url: 'user4s/visitlog/multi',
|
||||
import_url: 'user4s/visitlog/import',
|
||||
table: 'user4s_visitlog',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user4s_id', title: __('User4s_id')},
|
||||
{field: 'admin_id', title: __('Admin_id')},
|
||||
{field: 'visit_id', title: __('Visit_id')},
|
||||
{field: 'type_id', title: __('Type_id')},
|
||||
{field: 'visit_time', title: __('Visit_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'star', title: __('Star')},
|
||||
{field: 'description', title: __('Description'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'user.id', title: __('User.id')},
|
||||
{field: 'user.category_id', title: __('User.category_id')},
|
||||
{field: 'user.level_id', title: __('User.level_id')},
|
||||
{field: 'user.name', title: __('User.name'), operate: 'LIKE'},
|
||||
{field: 'user.tel', title: __('User.tel'), operate: 'LIKE'},
|
||||
{field: 'user.balance', title: __('User.balance'), operate:'BETWEEN'},
|
||||
{field: 'user.integral', title: __('User.integral')},
|
||||
{field: 'user.genderdata', title: __('User.genderdata')},
|
||||
{field: 'user.city', title: __('User.city'), operate: 'LIKE'},
|
||||
{field: 'user.buydate', title: __('User.buydate'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'user.carno', title: __('User.carno'), operate: 'LIKE'},
|
||||
{field: 'user.model', title: __('User.model'), operate: 'LIKE'},
|
||||
{field: 'user.color', title: __('User.color'), operate: 'LIKE'},
|
||||
{field: 'user.inscom', title: __('User.inscom'), operate: 'LIKE'},
|
||||
{field: 'user.insdate', title: __('User.insdate'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'user.tags', title: __('User.tags'), operate: 'LIKE', formatter: Table.api.formatter.flag},
|
||||
{field: 'user.description', title: __('User.description'), operate: 'LIKE'},
|
||||
{field: 'user.admin_id', title: __('User.admin_id')},
|
||||
{field: 'user.createtime', title: __('User.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'user.updatetime', title: __('User.updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'user.deletetime', title: __('User.deletetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'user.status', title: __('User.status'), formatter: Table.api.formatter.status},
|
||||
{field: 'visit.id', title: __('Visit.id')},
|
||||
{field: 'visit.user4s_id', title: __('Visit.user4s_id')},
|
||||
{field: 'visit.admin_id', title: __('Visit.admin_id')},
|
||||
{field: 'visit.type_id', title: __('Visit.type_id')},
|
||||
{field: 'visit.visittime', title: __('Visit.visittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visit.description', title: __('Visit.description'), operate: 'LIKE'},
|
||||
{field: 'visit.createtime', title: __('Visit.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visit.deletetime', title: __('Visit.deletetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visit.status', title: __('Visit.status'), formatter: Table.api.formatter.status},
|
||||
{field: 'visit.endtime', title: __('Visit.endtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visittype.id', title: __('Visittype.id')},
|
||||
{field: 'visittype.name', title: __('Visittype.name'), operate: 'LIKE'},
|
||||
{field: 'visittype.tip_time', title: __('Visittype.tip_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visittype.description', title: __('Visittype.description'), operate: 'LIKE'},
|
||||
{field: 'visittype.createtime', title: __('Visittype.createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'visittype.deletetime', title: __('Visittype.deletetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user