Accept Merge Request #92: (feature/zy -> develop)
Merge Request: feature: taskk Created By: @zhuyu Accepted By: @zhuyu URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/92
This commit is contained in:
commit
aaec2f15f9
|
|
@ -88,9 +88,20 @@ class Doc extends Backend
|
|||
->order($sort, $order)
|
||||
->paginate($limit);
|
||||
|
||||
$groupName = AuthGroup::column('id,name');
|
||||
|
||||
foreach ($list as $k => $row) {
|
||||
$list[$k]['fileurl'] = cdnurl($row['path']);
|
||||
$list[$k]['filetype'] = pathinfo($list[$k]['fileurl'], PATHINFO_EXTENSION);
|
||||
|
||||
$groupIds = $row['group_ids'];
|
||||
$groupIds = json_decode($groupIds);
|
||||
$groupText = '';
|
||||
foreach ($groupIds as $groupId) {
|
||||
$groupText .= $groupName[$groupId] ?? '';
|
||||
$groupText .= ',';
|
||||
}
|
||||
$list[$k]['group_text'] = $groupText;
|
||||
}
|
||||
|
||||
$result = ['total' => $list->total(), 'rows' => $list->items()];
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{
|
||||
field: 'group_text',
|
||||
title: '角色组',
|
||||
operate: false,
|
||||
formatter: Table.api.formatter.label
|
||||
},
|
||||
{field: 'title', title: __('Title'), operate: 'LIKE'},
|
||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
|
|
@ -37,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: "审核",
|
||||
|
|
@ -48,7 +74,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
icon: 'fa fa-list',
|
||||
url: 'oa/task/review',
|
||||
visible:function(row){
|
||||
if (row.status != 3) {
|
||||
if (row.status != 3 && row.status != 5) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user