优化体验打开的tab为16个,系统主题功能修改为关联用户(需要升级用户表数据结构),客户转入废弃池bug修正,各个审核模块的消息发送优化
This commit is contained in:
parent
65595068a5
commit
133b2656fa
@ -439,8 +439,10 @@ class Index extends BaseController
|
||||
add_log('check', $param['id'], $param);
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'create_time'=>time(),
|
||||
'action_id'=>$id
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$id,
|
||||
'title' => Db::name('FlowType')->where('id',$checkData['type'])->value('title'),
|
||||
'from_uid'=>$detail['admin_id']
|
||||
];
|
||||
if($param['check_status'] == 1){
|
||||
$users = $param['check_admin_ids'];
|
||||
@ -514,7 +516,9 @@ class Index extends BaseController
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||
'action_id'=>$detail['id']
|
||||
'action_id'=>$detail['id'],
|
||||
'title' => Db::name('FlowType')->where('id',$checkData['type'])->value('title'),
|
||||
'from_uid'=>$detail['admin_id']
|
||||
];
|
||||
$users = $detail['admin_id'];
|
||||
sendMessage($users,($type*10+13),$msg);
|
||||
|
@ -508,7 +508,7 @@ function sendMessage($user_id, $template, $data=[])
|
||||
$title = str_replace('{' . $key . '}', $val, $title);
|
||||
$content = str_replace('{' . $key . '}', $val, $content);
|
||||
}
|
||||
if(isSet($data['from_uid'])){
|
||||
if(isset($data['from_uid'])){
|
||||
$title = str_replace('{from_user}', get_admin($data['from_uid'])['name'], $title);
|
||||
$content = str_replace('{from_user}', get_admin($data['from_uid'])['name'], $content);
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class Api extends BaseController
|
||||
$data['belong_did'] = $params['did'];
|
||||
$data['distribute_time'] = time();
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('allot', $data['id']);
|
||||
add_log('allot', $data['id'],[],'客户');
|
||||
to_log($this->uid,0,$data,['belong_uid'=>0]);
|
||||
return to_assign(0, "操作成功");
|
||||
} else {
|
||||
@ -44,75 +44,6 @@ class Api extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
//删除客户
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$params = get_params();
|
||||
//是否是客户管理员
|
||||
$auth = isAuth($this->uid,'customer_admin');
|
||||
if($auth==0){
|
||||
return to_assign(1, "只有客户管理员才有权限操作");
|
||||
}
|
||||
$data['id'] = $params['id'];
|
||||
$log_data = array(
|
||||
'field' => 'del',
|
||||
'action' => 'delete',
|
||||
'type' => 0,
|
||||
'customer_id' => $params['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time(),
|
||||
);
|
||||
if($params['type'] ==1){
|
||||
$data['delete_time'] = time();
|
||||
$log_data['action'] = 'totrash';
|
||||
}
|
||||
else{
|
||||
$data['delete_time'] = -1;
|
||||
}
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('delete', $params['id'],[],'客户');
|
||||
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
//还原客户
|
||||
public function revert()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$params = get_params();
|
||||
//是否是客户管理员
|
||||
$auth = isAuth($this->uid,'customer_admin');
|
||||
if($auth==0){
|
||||
return to_assign(1, "只有客户管理员才有权限操作");
|
||||
}
|
||||
$data['id'] = $params['id'];
|
||||
$data['delete_time'] = 0;
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('recovery', $params['id'],[],'客户');
|
||||
$log_data = array(
|
||||
'field' => 'del',
|
||||
'action' => 'recovery',
|
||||
'type' => 0,
|
||||
'customer_id' => $params['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//跟进记录列表
|
||||
public function get_trace()
|
||||
{
|
||||
@ -154,7 +85,7 @@ class Api extends BaseController
|
||||
}
|
||||
$res = CustomerTrace::strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_log('edit', $param['id'], $param,'客户跟进记录');
|
||||
to_log($this->uid,1,$param,$old);
|
||||
return to_assign();
|
||||
} else {
|
||||
@ -165,7 +96,7 @@ class Api extends BaseController
|
||||
$param['admin_id'] = $this->uid;
|
||||
$tid = CustomerTrace::strict(false)->field(true)->insertGetId($param);
|
||||
if ($tid) {
|
||||
add_log('add', $tid, $param);
|
||||
add_log('add', $tid, $param,'客户跟进记录');
|
||||
$log_data = array(
|
||||
'field' => 'new',
|
||||
'action' => 'add',
|
||||
@ -220,7 +151,7 @@ class Api extends BaseController
|
||||
$param['delete_time'] = time();
|
||||
$res = CustomerTrace::strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_log('delete', $param['id'], $param,'客户跟进记录');
|
||||
to_log($this->uid,1,$param,['delete_time'=>0]);
|
||||
return to_assign();
|
||||
} else {
|
||||
@ -273,7 +204,7 @@ class Api extends BaseController
|
||||
}
|
||||
$res = CustomerChance::strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_log('edit', $param['id'], $param,'客户销售机会');
|
||||
to_log($this->uid,3,$param,$old);
|
||||
return to_assign();
|
||||
} else {
|
||||
@ -284,7 +215,7 @@ class Api extends BaseController
|
||||
$param['admin_id'] = $this->uid;
|
||||
$tid = CustomerChance::strict(false)->field(true)->insertGetId($param);
|
||||
if ($tid) {
|
||||
add_log('add', $tid, $param);
|
||||
add_log('add', $tid, $param,'客户销售机会');
|
||||
$log_data = array(
|
||||
'field' => 'new',
|
||||
'action' => 'add',
|
||||
@ -339,7 +270,7 @@ class Api extends BaseController
|
||||
$param['delete_time'] = time();
|
||||
$res = CustomerChance::strict(false)->field(true)->update($param);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_log('delete', $param['id'], $param,'客户销售机会');
|
||||
to_log($this->uid,3,$param,['delete_time'=>0]);
|
||||
return to_assign();
|
||||
} else {
|
||||
@ -378,7 +309,7 @@ class Api extends BaseController
|
||||
CustomerContact::where(['cid' => $detail['cid']])->strict(false)->field(true)->update(['is_default'=>0]);
|
||||
$res = CustomerContact::where(['id' => $param['id']])->update(['is_default'=>1]);
|
||||
if ($res) {
|
||||
add_log('edit', $param['id'], $param);
|
||||
add_log('edit', $param['id'], $param,'客户联系人');
|
||||
to_log($this->uid,2,$param,$detail);
|
||||
return to_assign();
|
||||
} else {
|
||||
|
@ -416,6 +416,94 @@ class Index extends BaseController
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//客户移入废弃池
|
||||
public function to_trash()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$params = get_params();
|
||||
$data['id'] = $params['id'];
|
||||
$log_data = array(
|
||||
'field' => 'del',
|
||||
'action' => 'delete',
|
||||
'type' => 0,
|
||||
'customer_id' => $params['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time(),
|
||||
);
|
||||
$data['delete_time'] = time();
|
||||
$log_data['action'] = 'totrash';
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('totrash', $params['id']);
|
||||
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//还原客户
|
||||
public function revert()
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$params = get_params();
|
||||
$data['id'] = $params['id'];
|
||||
$data['delete_time'] = 0;
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('recovery', $params['id']);
|
||||
$log_data = array(
|
||||
'field' => 'del',
|
||||
'action' => 'recovery',
|
||||
'type' => 0,
|
||||
'customer_id' => $params['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time(),
|
||||
);
|
||||
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
//彻底删除客户
|
||||
public function delete()
|
||||
{
|
||||
if (request()->isDelete()) {
|
||||
$params = get_params();
|
||||
//是否是客户管理员
|
||||
$auth = isAuth($this->uid,'customer_admin');
|
||||
if($auth==0){
|
||||
return to_assign(1, "只有客户管理员才有权限操作");
|
||||
}
|
||||
$data['id'] = $params['id'];
|
||||
$data['delete_time'] = -1;
|
||||
$log_data = array(
|
||||
'field' => 'del',
|
||||
'action' => 'delete',
|
||||
'type' => 0,
|
||||
'customer_id' => $params['id'],
|
||||
'admin_id' => $this->uid,
|
||||
'create_time' => time()
|
||||
);
|
||||
if (Db::name('Customer')->update($data) !== false) {
|
||||
add_log('delete', $params['id']);
|
||||
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
|
||||
return to_assign();
|
||||
} else {
|
||||
return to_assign(1, "操作失败");
|
||||
}
|
||||
} else {
|
||||
return to_assign(1, "错误的请求");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -170,7 +170,7 @@
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/customer/api/delete", {id: data.id,type:1}, callback);
|
||||
tool.delete("/customer/index/to_trash", {id: data.id,type:1}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
|
@ -117,7 +117,7 @@
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.post("/customer/api/revert", {id: data.id}, callback);
|
||||
tool.post("/customer/index/revert", {id: data.id}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
@ -132,7 +132,7 @@
|
||||
obj.del();
|
||||
}
|
||||
}
|
||||
tool.delete("/customer/api/delete", {id: data.id,type:2}, callback);
|
||||
tool.delete("/customer/index/delete", {id: data.id}, callback);
|
||||
layer.close(index);
|
||||
});
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ class Api extends BaseController
|
||||
$detail = Expense::where(['id' => $param['id']])->find();
|
||||
$msg=[
|
||||
'create_time'=>date('Y-m-d H:i:s',(int)$detail['create_time']),
|
||||
'title'=>'报销',
|
||||
'action_id'=>$detail['id']
|
||||
];
|
||||
$users = $detail['admin_id'];
|
||||
|
@ -293,6 +293,7 @@ class Expense extends BaseController
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,
|
||||
'title'=>'报销',
|
||||
'action_id'=>$param['id']
|
||||
];
|
||||
$users = $param['check_admin_ids'];
|
||||
@ -394,6 +395,7 @@ class Expense extends BaseController
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,
|
||||
'title'=>'报销',
|
||||
'action_id'=>$exid
|
||||
];
|
||||
$users = $param['check_admin_ids'];
|
||||
|
@ -226,6 +226,7 @@ class Invoice extends BaseController
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,
|
||||
'title'=>'发票',
|
||||
'action_id'=>$param['id']
|
||||
];
|
||||
$users = $param['check_admin_ids'];
|
||||
@ -306,6 +307,7 @@ class Invoice extends BaseController
|
||||
//发送消息通知
|
||||
$msg=[
|
||||
'from_uid'=>$this->uid,
|
||||
'title'=>'发票',
|
||||
'action_id'=>$exid
|
||||
];
|
||||
$users = $param['check_admin_ids'];
|
||||
|
@ -24,7 +24,7 @@ class Index extends BaseController
|
||||
$invoice_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")];
|
||||
$invoice_map_check[] = ['delete_time', '=', 0];
|
||||
$invoice_count_check = Db::name('Invoice')->where($invoice_map_check)->count();
|
||||
$statistics['invoice_html_check'] = '<a data-id="130" class="side-menu-item" data-href="/finance/invoice/list" class="menu-active"> 您有<font style="color:#FF0000">' . $invoice_count_check . '</font>条发票申请待审核</a>';
|
||||
$statistics['invoice_html_check'] = '<a class="tab-a" data-title="待审核的发票" data-href="/finance/invoice/list" class="menu-active"> 您有<font style="color:#FF0000">' . $invoice_count_check . '</font>条发票申请待审核</a>';
|
||||
if ($invoice_count_check == 0) {
|
||||
$statistics['invoice_html_check'] = '';
|
||||
}
|
||||
@ -34,7 +34,7 @@ class Index extends BaseController
|
||||
$invoice_map_open[] = ['open_admin_id', '=', $admin_id];
|
||||
$invoice_map_open[] = ['delete_time', '=', 0];
|
||||
$invoice_count_open = Db::name('Invoice')->where($invoice_map_open)->count();
|
||||
$statistics['invoice_html_open'] = '<a data-id="131" class="side-menu-item" data-href="/finance/invoice/checkedlist">您有<font style="color:#FF0000">' . $invoice_count_open . '</font>条发票待开具</a>';
|
||||
$statistics['invoice_html_open'] = '<a class="tab-a" data-title="待开具的发票" data-href="/finance/invoice/checkedlist">您有<font style="color:#FF0000">' . $invoice_count_open . '</font>条发票待开具</a>';
|
||||
if ($invoice_count_open == 0) {
|
||||
$statistics['invoice_html_open'] = '';
|
||||
}
|
||||
@ -44,7 +44,7 @@ class Index extends BaseController
|
||||
$expense_map_check[] = ['', 'exp', Db::raw("FIND_IN_SET('{$admin_id}',check_admin_ids)")];
|
||||
$expense_map_check[] = ['delete_time', '=', 0];
|
||||
$expense_count_check = Db::name('Expense')->where($expense_map_check)->count();
|
||||
$statistics['expense_html_check'] = '<a data-id="121" class="side-menu-item" data-title="待我审批的报销" data-href="/finance/expense/list">您有<font style="color:#FF0000">' . $expense_count_check . '</font>条报销单待审核</a>';
|
||||
$statistics['expense_html_check'] = '<a class="tab-a" data-title="待我审批的报销" data-href="/finance/expense/list">您有<font style="color:#FF0000">' . $expense_count_check . '</font>条报销单待审核</a>';
|
||||
if ($expense_count_check == 0) {
|
||||
$statistics['expense_html_check'] = '';
|
||||
}
|
||||
@ -54,7 +54,7 @@ class Index extends BaseController
|
||||
$msg_map[] = ['read_time', '=', 0];
|
||||
$msg_map[] = ['status', '=', 1];
|
||||
$msg_count = Db::name('Message')->where($msg_map)->count();
|
||||
$statistics['msg_html'] = '<a data-id="78" class="side-menu-item" data-title="消息中心" data-href="/message/index/inbox" >您有<font style="color:#FF0000">' . $msg_count . '</font>条未读消息</a>';
|
||||
$statistics['msg_html'] = '<a class="tab-a" data-title="消息中心" data-href="/message/index/inbox" >您有<font style="color:#FF0000">' . $msg_count . '</font>条未读消息</a>';
|
||||
$statistics['msg_num'] = $msg_count;
|
||||
if ($msg_count == 0) {
|
||||
$statistics['msg_html'] = '';
|
||||
@ -84,7 +84,14 @@ class Index extends BaseController
|
||||
\think\facade\Cache::tag('adminMenu')->set('menu' . $admin['id'], $list);
|
||||
}
|
||||
View::assign('menu', $list);
|
||||
View::assign('theme', get_system_config('other','theme'));
|
||||
//View::assign('theme', get_system_config('other','theme'));
|
||||
$user = Db::name('Admin')->where('id',$this->uid)->find();
|
||||
if(isset($user['theme'])){
|
||||
View::assign('theme',$user['theme']);
|
||||
}
|
||||
else{
|
||||
View::assign('theme', 'black');
|
||||
}
|
||||
return View();
|
||||
}
|
||||
}
|
||||
@ -206,7 +213,8 @@ class Index extends BaseController
|
||||
{
|
||||
if (request()->isAjax()) {
|
||||
$param = get_params();
|
||||
set_system_config('other','theme',$param['theme']);
|
||||
//set_system_config('other','theme',$param['theme']);
|
||||
Db::name('Admin')->where('id',$this->uid)->update(['theme'=>$param['theme']]);
|
||||
return to_assign();
|
||||
}
|
||||
else{
|
||||
|
@ -126,7 +126,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-tab gg-admin-tab" lay-unauto lay-allowClose="true" lay-filter="gg-admin-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<ul class="layui-tab-title" id="pageTabUl">
|
||||
<li lay-id="0" lay-attr="view/home/index.html" class="layui-this"><i class="iconfont icon-xueshuguanli"></i></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -33,6 +33,7 @@ CREATE TABLE `oa_admin` (
|
||||
`sex` int(255) NOT NULL DEFAULT 0 COMMENT '性别1男,2女',
|
||||
`nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '昵称',
|
||||
`thumb` varchar(255) NOT NULL COMMENT '头像',
|
||||
`theme` varchar(255) NOT NULL DEFAULT 'black' COMMENT '系统主题',
|
||||
`did` int(11) NOT NULL DEFAULT 0 COMMENT '部门id',
|
||||
`position_id` int(11) NOT NULL DEFAULT 0 COMMENT '职位id',
|
||||
`type` int(1) NOT NULL DEFAULT 0 COMMENT '员工类型:0未设置,1正式,2试用,3实习',
|
||||
|
@ -239,7 +239,6 @@ class Api extends BaseController
|
||||
$schedule['end_time_1'] = date('H:i', $schedule['end_time']);
|
||||
$schedule['start_time'] = date('Y-m-d', $schedule['start_time']);
|
||||
$schedule['end_time'] = date('Y-m-d', $schedule['end_time']);
|
||||
// $schedule['create_time'] = date('Y-m-d H:i:s', $schedule['create_time']);
|
||||
$schedule['user'] = Db::name('Admin')->where(['id' => $schedule['admin_id']])->value('name');
|
||||
$schedule['department'] = Db::name('Department')->where(['id' => $schedule['did']])->value('title');
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ return [
|
||||
'allot' => '分配',
|
||||
'remove' => '移除',
|
||||
'tosea' => '公海移入',
|
||||
'totrash' => '废弃池移入',
|
||||
'reset' => '重新设置',
|
||||
'install' => '安装',
|
||||
'uninstall' => '卸载',
|
||||
|
@ -7,6 +7,14 @@ layui.define(['element'], function (exports) {
|
||||
* @name,tab页面标题,
|
||||
*/
|
||||
tabAdd: function (id, url, title) {
|
||||
var thetabs = $('#pageTabUl').find('li');
|
||||
if (thetabs.length > 12) {
|
||||
layer.tips('点击LOGO快速关闭已开的TAB页面', $('.layui-logo'));
|
||||
}
|
||||
if (thetabs.length > 16) {
|
||||
layer.msg('你已打开了太多TAB页面了,请关闭部分TAB再使用');
|
||||
return false;
|
||||
}
|
||||
element.tabAdd('gg-admin-tab', {
|
||||
id: id,
|
||||
title: '<span class="gg-tab-active"></span>' + title,
|
||||
@ -14,10 +22,6 @@ layui.define(['element'], function (exports) {
|
||||
});
|
||||
$('#GouguAppBody').append('<div class="gg-tab-page" title="'+title+'" id="tabItem' + id + '"><iframe id="' + id + '" data-frameid="' + id + '" src="' + url + '" frameborder="0" align="left" width="100%" height="100%" scrolling="yes"></iframe></div>');
|
||||
this.tabChange(id);
|
||||
var thetabs = $('#pageTabs .layui-tab-title').find('li');
|
||||
if (thetabs.length > 12) {
|
||||
layer.tips('点击LOGO快速关闭打开的TAB', $('[event-logo]'));
|
||||
}
|
||||
},
|
||||
//从子页面打开新的Tab页面,防止id重复,使用时间戳作为唯一标识
|
||||
sonAdd: function (url, title) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user