From 04cb00948de3ccc3b6fa10d3ffdd04053e4b0302 Mon Sep 17 00:00:00 2001 From: wh <382379437@qq.com> Date: Thu, 27 Mar 2025 19:45:35 +0800 Subject: [PATCH] fixed --- .../admin/controller/Firmcustomer.php | 13 +- .../controller/Firmcustomerfollowuprecord.php | 130 +++++++++++++++++- .../Firmcustomerfollowuptimelist.php | 103 ++++++++++++++ .../application/admin/controller/Firmduty.php | 2 +- .../admin/controller/Firmstore.php | 1 + .../admin/controller/Firmstoreprojectsone.php | 2 +- .../admin/controller/Firmstoreprojectstwo.php | 2 +- .../application/admin/controller/Firmtags.php | 8 ++ .../admin/controller/general/Profile.php | 5 +- .../admin/view/firmcustomer/add.html | 6 +- .../admin/view/firmcustomer/edit.html | 6 +- .../view/firmcustomerfollowuprecord/add.html | 24 ++-- .../view/firmcustomerfollowuprecord/edit.html | 13 +- .../firmcustomerfollowuprecord/index.html | 24 ++-- .../firmcustomerfollowuptimelist/add.html | 5 +- .../firmcustomerfollowuptimelist/index.html | 6 +- .../admin/view/firmstoreprojectsone/add.html | 1 - .../admin/view/firmstoreprojectsone/edit.html | 1 - .../admin/view/general/profile/index.html | 2 +- admin/application/api/controller/Wxgroup.php | 2 +- .../public/assets/js/backend/firmcustomer.js | 17 +-- .../js/backend/firmcustomerfollowuprecord.js | 18 ++- .../backend/firmcustomerfollowuptimelist.js | 17 ++- 23 files changed, 343 insertions(+), 65 deletions(-) diff --git a/admin/application/admin/controller/Firmcustomer.php b/admin/application/admin/controller/Firmcustomer.php index 18ad263..859b372 100755 --- a/admin/application/admin/controller/Firmcustomer.php +++ b/admin/application/admin/controller/Firmcustomer.php @@ -17,6 +17,7 @@ use wanghua\general_utility_tools_php\tool\Tools; */ class Firmcustomer extends Backend { + protected $noNeedRight = ['firmcustomerGetList']; /** * Firmcustomer模型对象 @@ -57,7 +58,7 @@ class Firmcustomer extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $this->model->where('firmcustomer.firm_id',session_admin_firm_id()); - $this->model->where('firmcustomer.firmstore_id',session_admin_firmstore_id()); + //$this->model->where('firmcustomer.firmstore_id',session_admin_firmstore_id()); $list = $this->model ->with(['firmstoreprojectstwo','firmcustomerorigin']) ->where($where) @@ -65,7 +66,7 @@ class Firmcustomer extends Backend ->paginate($limit); foreach ($list as $row) { - $row->visible(['id','customer_name','age','phone','rel_wx','rel_group','firmtags_ids','headimage','remark','responsible_pm','return_visit_content','status','create_time','admin_id']); + $row->visible(['id','name','firmcustomer_id','age','phone','rel_wx','rel_group','firmtags_ids','headimage','remark','responsible_pm','return_visit_content','status','create_time','admin_id']); $row->visible(['firmstoreprojectstwo']); $row->getRelation('firmstoreprojectstwo')->visible(['name']); $row->visible(['firmcustomerorigin']); @@ -194,4 +195,12 @@ class Firmcustomer extends Backend //cache('cache_ai_customer_config_'.session_admin_firm_id(),$ai_config,86400); return json(Tools::set_ok('设置成功')); } + + function firmcustomerGetList(){ + + $data = Db::table('fa_firmcustomer') + ->where('firm_id',session_admin_firm_id()) + ->select(); + return json(['list' => $data, 'total' => count($data)]); + } } diff --git a/admin/application/admin/controller/Firmcustomerfollowuprecord.php b/admin/application/admin/controller/Firmcustomerfollowuprecord.php index 1dcd3ea..469dee1 100755 --- a/admin/application/admin/controller/Firmcustomerfollowuprecord.php +++ b/admin/application/admin/controller/Firmcustomerfollowuprecord.php @@ -3,6 +3,10 @@ namespace app\admin\controller; use app\common\controller\Backend; +use think\Db; +use think\Exception; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 客户回访记录 @@ -11,6 +15,7 @@ use app\common\controller\Backend; */ class Firmcustomerfollowuprecord extends Backend { + //protected $selectpageFields = 'name,store_project_name'; /** * Firmcustomerfollowuprecord模型对象 @@ -41,6 +46,8 @@ class Firmcustomerfollowuprecord extends Backend */ public function index() { + $ids = input('ids'); + $this->assignconfig('firmcustomer_id',$ids); //当前是否为关联查询 $this->relationSearch = false; //设置过滤方法 @@ -52,6 +59,10 @@ class Firmcustomerfollowuprecord extends Backend } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $firmcustomer_id = input('firmcustomer_id'); + if($firmcustomer_id){ + $this->model->where('firmcustomer_id',$firmcustomer_id); + } $list = $this->model ->where($where) @@ -59,8 +70,7 @@ class Firmcustomerfollowuprecord extends Backend ->paginate($limit); foreach ($list as $row) { - $row->visible(['id','name','store_project_name','remark','notes','visit_msg','feedback','send_time','status','create_time']); - + $row->visible(['id','name','firmcustomer_id','store_project_name','remark','notes','visit_msg','feedback','send_time','status','create_time']); } $result = array("total" => $list->total(), "rows" => $list->items()); @@ -70,4 +80,120 @@ class Firmcustomerfollowuprecord extends Backend return $this->view->fetch(); } + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + $firmcustomer_id = input('ids'); + $this->assign('firmcustomer_id',$firmcustomer_id); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $params['name'] = Db::table('fa_firmcustomer') + ->where('id',$params['firmcustomer_id']) + ->value('name'); + $title_one = Db::table('fa_firmstoreprojectsone') + ->where('id',$params['firmstoreprojectsone_id']) + ->value('name'); + $title_two = Db::table('fa_firmstoreprojectstwo') + ->where('id',$params['firmstoreprojectstwo_id']) + ->value('name'); + $params['store_project_name'] = $title_one . ' - ' .$title_two; + $params['notes'] = Db::table('fa_firmnotespoints') + ->where('id',$params['firmnotespoints_id']) + ->value('name'); + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + 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) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params['name'] = Db::table('fa_firmcustomer') + ->where('id',$params['firmcustomer_id']) + ->value('name'); + $title_one = Db::table('fa_firmstoreprojectsone') + ->where('id',$params['firmstoreprojectsone_id']) + ->value('name'); + $title_two = Db::table('fa_firmstoreprojectstwo') + ->where('id',$params['firmstoreprojectstwo_id']) + ->value('name'); + $params['store_project_name'] = $title_one . ' - ' .$title_two; + $params['notes'] = Db::table('fa_firmnotespoints') + ->where('id',$params['firmnotespoints_id']) + ->value('name'); + $params = $this->preExcludeFields($params); + $result = false; + Db::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()->validate($validate); + } + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } } diff --git a/admin/application/admin/controller/Firmcustomerfollowuptimelist.php b/admin/application/admin/controller/Firmcustomerfollowuptimelist.php index d15d9f6..022fb96 100755 --- a/admin/application/admin/controller/Firmcustomerfollowuptimelist.php +++ b/admin/application/admin/controller/Firmcustomerfollowuptimelist.php @@ -3,6 +3,10 @@ namespace app\admin\controller; use app\common\controller\Backend; +use think\Db; +use think\Exception; +use think\exception\PDOException; +use think\exception\ValidateException; /** * 回访发送时间列管理 @@ -12,6 +16,7 @@ use app\common\controller\Backend; class Firmcustomerfollowuptimelist extends Backend { + //protected $selectpageFields = 'name,store_project_name'; /** * Firmcustomerfollowuptimelist模型对象 * @var \app\admin\model\Firmcustomerfollowuptimelist @@ -50,6 +55,10 @@ class Firmcustomerfollowuptimelist extends Backend } list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + $record_id = input('record_id'); + if ($record_id){ + $this->model->where('firmcustomerfollowuprecord_id',$record_id); + } $list = $this->model ->with(['firmcustomerfollowuprecord']) ->where($where) @@ -60,13 +69,107 @@ class Firmcustomerfollowuptimelist extends Backend $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); } + + $ids = input('ids'); + $this->assignconfig('record_id',$ids); return $this->view->fetch(); } + /** + * 添加 + * + * @return string + * @throws \think\Exception + */ + public function add() + { + if (false === $this->request->isPost()) { + $ids = input('ids'); + $this->assign('record_id',$ids); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + + if ($this->dataLimit && $this->dataLimitFieldAutoFill) { + $params[$this->dataLimitField] = $this->auth->id; + } + $result = false; + Db::startTrans(); + try { + //是否采用模型验证 + if ($this->modelValidate) { + $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); + $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate; + $this->model->validateFailException()->validate($validate); + } + $result = $this->model->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if ($result === false) { + $this->error(__('No rows were inserted')); + } + $this->success(); + } + + /** + * 编辑 + * + * @param $ids + * @return string + * @throws DbException + * @throws \think\Exception + */ + 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) && !in_array($row[$this->dataLimitField], $adminIds)) { + $this->error(__('You have no permission')); + } + if (false === $this->request->isPost()) { + $this->view->assign('row', $row); + return $this->view->fetch(); + } + $params = $this->request->post('row/a'); + if (empty($params)) { + $this->error(__('Parameter %s can not be empty', '')); + } + $params = $this->preExcludeFields($params); + $result = false; + Db::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()->validate($validate); + } + $result = $row->allowField(true)->save($params); + Db::commit(); + } catch (ValidateException|PDOException|Exception $e) { + Db::rollback(); + $this->error($e->getMessage()); + } + if (false === $result) { + $this->error(__('No rows were updated')); + } + $this->success(); + } } diff --git a/admin/application/admin/controller/Firmduty.php b/admin/application/admin/controller/Firmduty.php index ffe331a..c72163d 100755 --- a/admin/application/admin/controller/Firmduty.php +++ b/admin/application/admin/controller/Firmduty.php @@ -12,6 +12,7 @@ use app\common\controller\Backend; class Firmduty extends Backend { + protected $noNeedRight = ['firmdutyGetList']; /** * Firmduty模型对象 * @var \app\admin\model\Firmduty @@ -23,7 +24,6 @@ class Firmduty extends Backend parent::_initialize(); $this->model = new \app\admin\model\Firmduty; $this->model->where('firm_id',session_admin_firm_id()); - $this->model->where('firmstore_id',session_admin_firmstore_id()); } diff --git a/admin/application/admin/controller/Firmstore.php b/admin/application/admin/controller/Firmstore.php index 89e0364..50e5c0f 100755 --- a/admin/application/admin/controller/Firmstore.php +++ b/admin/application/admin/controller/Firmstore.php @@ -12,6 +12,7 @@ use think\Db; */ class Firmstore extends Backend { + protected $noNeedRight = ['firmstoreGetList']; /** * Firmstore模型对象 diff --git a/admin/application/admin/controller/Firmstoreprojectsone.php b/admin/application/admin/controller/Firmstoreprojectsone.php index b82cf7c..a37dd7d 100755 --- a/admin/application/admin/controller/Firmstoreprojectsone.php +++ b/admin/application/admin/controller/Firmstoreprojectsone.php @@ -24,7 +24,7 @@ class Firmstoreprojectsone extends Backend $this->model = new \app\admin\model\Firmstoreprojectsone; $this->model->where('firm_id',session_admin_firm_id()); - $this->model->where('firmstore_id',session_admin_firmstore_id()); + //$this->model->where('firmstore_id',session_admin_firmstore_id()); } diff --git a/admin/application/admin/controller/Firmstoreprojectstwo.php b/admin/application/admin/controller/Firmstoreprojectstwo.php index 9794611..ebf8b6d 100755 --- a/admin/application/admin/controller/Firmstoreprojectstwo.php +++ b/admin/application/admin/controller/Firmstoreprojectstwo.php @@ -51,7 +51,7 @@ class Firmstoreprojectstwo extends Backend list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $this->model->where('firmstoreprojectstwo.firm_id',session_admin_firm_id()); - $this->model->where('firmstoreprojectstwo.firmstore_id',session_admin_firmstore_id()); + //$this->model->where('firmstoreprojectstwo.firmstore_id',session_admin_firmstore_id()); $list = $this->model ->with(['firmstoreprojectsone']) ->where($where) diff --git a/admin/application/admin/controller/Firmtags.php b/admin/application/admin/controller/Firmtags.php index 03f43bc..1457f68 100755 --- a/admin/application/admin/controller/Firmtags.php +++ b/admin/application/admin/controller/Firmtags.php @@ -15,6 +15,7 @@ use think\exception\ValidateException; */ class Firmtags extends Backend { + protected $noNeedRight=['firmtagsGetList']; /** * Firmtags模型对象 @@ -127,4 +128,11 @@ class Firmtags extends Backend //将转义的代码还原 return json(['html'=>($html)]); } + + function firmtagsGetList(){ + $data = Db::table('fa_firmtags') + ->where('firm_id',session_admin_firm_id()) + ->select(); + return json(['list' => $data, 'total' => count($data)]); + } } diff --git a/admin/application/admin/controller/general/Profile.php b/admin/application/admin/controller/general/Profile.php index cd6eef6..9d873d2 100755 --- a/admin/application/admin/controller/general/Profile.php +++ b/admin/application/admin/controller/general/Profile.php @@ -40,6 +40,9 @@ class Profile extends Backend return json($result); } + + $admin = Admin::get($this->auth->id); + $this->assign('admin', $admin); return $this->view->fetch(); } @@ -53,7 +56,7 @@ class Profile extends Backend $params = $this->request->post("row/a"); $params = array_filter(array_intersect_key( $params, - array_flip(array('email', 'nickname', 'password', 'avatar')) + array_flip(array('email', 'nickname', 'password', 'avatar','firm_id','firmstore_id','firmduty_id')) )); unset($v); if (!Validate::is($params['email'], "email")) { diff --git a/admin/application/admin/view/firmcustomer/add.html b/admin/application/admin/view/firmcustomer/add.html index 5d7b9c1..6c0285f 100755 --- a/admin/application/admin/view/firmcustomer/add.html +++ b/admin/application/admin/view/firmcustomer/add.html @@ -19,7 +19,7 @@
-
@@ -27,7 +27,7 @@
- +
@@ -69,7 +69,7 @@
diff --git a/admin/application/admin/view/firmcustomer/edit.html b/admin/application/admin/view/firmcustomer/edit.html index fbf659e..81ac44a 100755 --- a/admin/application/admin/view/firmcustomer/edit.html +++ b/admin/application/admin/view/firmcustomer/edit.html @@ -10,7 +10,7 @@
- +
@@ -41,7 +41,9 @@
- +
diff --git a/admin/application/admin/view/firmcustomerfollowuprecord/add.html b/admin/application/admin/view/firmcustomerfollowuprecord/add.html index ba6db26..f52969c 100755 --- a/admin/application/admin/view/firmcustomerfollowuprecord/add.html +++ b/admin/application/admin/view/firmcustomerfollowuprecord/add.html @@ -1,9 +1,17 @@
+ + + + + +
- +
- +
@@ -58,12 +66,12 @@
-
- -
- -
-
+ + + + + + diff --git a/admin/application/admin/view/firmcustomerfollowuprecord/edit.html b/admin/application/admin/view/firmcustomerfollowuprecord/edit.html index 363ee56..50e6b58 100755 --- a/admin/application/admin/view/firmcustomerfollowuprecord/edit.html +++ b/admin/application/admin/view/firmcustomerfollowuprecord/edit.html @@ -1,9 +1,18 @@ + + + + + + +
- +
- +
diff --git a/admin/application/admin/view/firmcustomerfollowuprecord/index.html b/admin/application/admin/view/firmcustomerfollowuprecord/index.html index b24dc9e..bdee717 100755 --- a/admin/application/admin/view/firmcustomerfollowuprecord/index.html +++ b/admin/application/admin/view/firmcustomerfollowuprecord/index.html @@ -17,19 +17,19 @@
- {:__('Add')} - {:__('Edit')} - {:__('Delete')} - + + + + - + + + + + + + +
diff --git a/admin/application/admin/view/firmcustomerfollowuptimelist/add.html b/admin/application/admin/view/firmcustomerfollowuptimelist/add.html index 20ecc63..9b4b61b 100755 --- a/admin/application/admin/view/firmcustomerfollowuptimelist/add.html +++ b/admin/application/admin/view/firmcustomerfollowuptimelist/add.html @@ -3,7 +3,10 @@
- +
diff --git a/admin/application/admin/view/firmcustomerfollowuptimelist/index.html b/admin/application/admin/view/firmcustomerfollowuptimelist/index.html index 45b9d18..9209181 100755 --- a/admin/application/admin/view/firmcustomerfollowuptimelist/index.html +++ b/admin/application/admin/view/firmcustomerfollowuptimelist/index.html @@ -7,9 +7,9 @@
- {:__('Add')} - {:__('Edit')} - {:__('Delete')} + + + diff --git a/admin/application/admin/view/firmstoreprojectsone/add.html b/admin/application/admin/view/firmstoreprojectsone/add.html index 5f68602..6781fe7 100755 --- a/admin/application/admin/view/firmstoreprojectsone/add.html +++ b/admin/application/admin/view/firmstoreprojectsone/add.html @@ -10,7 +10,6 @@
diff --git a/admin/application/admin/view/firmstoreprojectsone/edit.html b/admin/application/admin/view/firmstoreprojectsone/edit.html index 256de0e..dde0950 100755 --- a/admin/application/admin/view/firmstoreprojectsone/edit.html +++ b/admin/application/admin/view/firmstoreprojectsone/edit.html @@ -10,7 +10,6 @@
diff --git a/admin/application/admin/view/general/profile/index.html b/admin/application/admin/view/general/profile/index.html index 7295bcd..39dca49 100755 --- a/admin/application/admin/view/general/profile/index.html +++ b/admin/application/admin/view/general/profile/index.html @@ -85,7 +85,7 @@ + name="row[firmstore_id]" type="text" value="{$admin.firmstore_id}">
diff --git a/admin/application/api/controller/Wxgroup.php b/admin/application/api/controller/Wxgroup.php index f0a0ae7..af7655e 100755 --- a/admin/application/api/controller/Wxgroup.php +++ b/admin/application/api/controller/Wxgroup.php @@ -48,7 +48,7 @@ class Wxgroup extends BaseHttpApi * * 【所有字段说明】(可能有部分额外字段未在此体现): * id ID - * customer_name 客户 + * name 客户 * age 年龄 * phone 手机号 * aicustomerservice_ids AI客服(可多选) diff --git a/admin/public/assets/js/backend/firmcustomer.js b/admin/public/assets/js/backend/firmcustomer.js index 716c265..573ac3a 100755 --- a/admin/public/assets/js/backend/firmcustomer.js +++ b/admin/public/assets/js/backend/firmcustomer.js @@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin [ {checkbox: true}, {field: 'id', title: __('Id')}, - {field: 'customer_name', title: __('Customer_name'), operate: 'LIKE'}, + {field: 'name', title: __('Customer_name'), operate: 'LIKE'}, {field: 'age', title: __('Age')}, {field: 'phone', title: __('Phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'rel_wx', title: __('Rel_wx'), operate: 'LIKE'}, @@ -75,21 +75,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin 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: __('查看发送时间'), diff --git a/admin/public/assets/js/backend/firmcustomerfollowuprecord.js b/admin/public/assets/js/backend/firmcustomerfollowuprecord.js index 0bb30eb..12ac9d9 100755 --- a/admin/public/assets/js/backend/firmcustomerfollowuprecord.js +++ b/admin/public/assets/js/backend/firmcustomerfollowuprecord.js @@ -2,10 +2,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var Controller = { index: function () { + let firmcustomer_id = Config.firmcustomer_id; // 初始化表格参数配置 Table.api.init({ extend: { - index_url: 'firmcustomerfollowuprecord/index' + location.search, + index_url: 'firmcustomerfollowuprecord/index?firmcustomer_id='+firmcustomer_id + location.search, add_url: 'firmcustomerfollowuprecord/add', edit_url: 'firmcustomerfollowuprecord/edit', del_url: 'firmcustomerfollowuprecord/del', @@ -56,6 +57,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 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: 'planList', text: __('计划列表'), diff --git a/admin/public/assets/js/backend/firmcustomerfollowuptimelist.js b/admin/public/assets/js/backend/firmcustomerfollowuptimelist.js index ef3feeb..d4d199c 100755 --- a/admin/public/assets/js/backend/firmcustomerfollowuptimelist.js +++ b/admin/public/assets/js/backend/firmcustomerfollowuptimelist.js @@ -2,10 +2,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin var Controller = { index: function () { + let record_id = Config.record_id; + let index_url = ''; + if(location.search){ + index_url = location.search+'&record_id='+record_id; + }else{ + index_url = '?record_id='+record_id+location.search; + } // 初始化表格参数配置 Table.api.init({ extend: { - index_url: 'firmcustomerfollowuptimelist/index' + location.search, + index_url: 'firmcustomerfollowuptimelist/index' + index_url, add_url: 'firmcustomerfollowuptimelist/add', edit_url: 'firmcustomerfollowuptimelist/edit', del_url: 'firmcustomerfollowuptimelist/del', @@ -25,10 +32,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin columns: [ [ {checkbox: true}, - {field: 'id', title: __('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: 'id', title: __('Id'), operate:false}, + {field: 'day', title: __('Day'), operate:false}, + {field: 'followup_time', title: __('Followup_time'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, + {field: 'firmcustomerfollowuprecord.name', title: __('Firmcustomerfollowuprecord.name'), operate: false, 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} ] ]