feature: task notice
This commit is contained in:
parent
3c1221db58
commit
b8313ec13a
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\controller\oa;
|
||||
|
||||
use app\admin\model\Message;
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
use think\exception\DbException;
|
||||
|
|
@ -243,4 +244,24 @@ class Task extends Backend
|
|||
$this->success();
|
||||
}
|
||||
|
||||
|
||||
public function notice($ids = null)
|
||||
{
|
||||
$row = $this->model->get($ids);
|
||||
if (!$row) {
|
||||
$this->error(__('No Results were found'));
|
||||
}
|
||||
|
||||
$execAdminId = $row['exec_admin_id'];
|
||||
|
||||
Message::create([
|
||||
'to_id' => $execAdminId,
|
||||
'type' => 1,
|
||||
'title' => '完成任务提醒',
|
||||
'content' => "【完成任务提醒】:您有一条{$row['title']}的任务还未完成,请立即处理!"
|
||||
]);
|
||||
|
||||
$this->success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
text: "详情",
|
||||
title: __('查看详情'),
|
||||
classname: 'btn btn-xs btn-primary btn-preview',
|
||||
icon: 'fa fa-list',
|
||||
icon: 'fa fa-file-text-o',
|
||||
extend: function(row) {
|
||||
return 'data-filetype="' + row.filetype + '" data-fileurl="' + row.fileurl + '"';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,32 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
{field: 'complete_time', title: __('Complete_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
name: 'notice',
|
||||
text:"催完成",
|
||||
title:"催完成",
|
||||
icon: 'fa fa-bell-o',
|
||||
extend: 'data-toggle="tooltip" data-container="body"',
|
||||
classname: 'btn btn-xs btn-success btn-magic btn-ajax',
|
||||
url: 'oa/task/notice',
|
||||
confirm: '确认发送',
|
||||
refresh: true,
|
||||
success: function (data, ret) {
|
||||
Layer.alert("发送成功");
|
||||
return false;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
if (row.status != 1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'review',
|
||||
text: "审核",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user