diff --git a/application/admin/controller/oa/Task.php b/application/admin/controller/oa/Task.php index 38ff2c6..b8d3a81 100644 --- a/application/admin/controller/oa/Task.php +++ b/application/admin/controller/oa/Task.php @@ -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(); + } + } diff --git a/public/assets/js/backend/oa/doc.js b/public/assets/js/backend/oa/doc.js index 19dd754..9dc128a 100644 --- a/public/assets/js/backend/oa/doc.js +++ b/public/assets/js/backend/oa/doc.js @@ -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 + '"'; } diff --git a/public/assets/js/backend/oa/task.js b/public/assets/js/backend/oa/task.js index 85c95b3..de3aa51 100644 --- a/public/assets/js/backend/oa/task.js +++ b/public/assets/js/backend/oa/task.js @@ -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: "审核",