feature: 面板
This commit is contained in:
parent
088aab8f3c
commit
5979ce5abf
|
|
@ -140,18 +140,24 @@ class Task extends Backend
|
||||||
$this->success();
|
$this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function review($ids)
|
public function review($ids = null)
|
||||||
{
|
{
|
||||||
|
$row = $this->model->get($ids);
|
||||||
|
if (!$row) {
|
||||||
|
$this->error(__('No Results were found'));
|
||||||
|
}
|
||||||
if (false === $this->request->isPost()) {
|
if (false === $this->request->isPost()) {
|
||||||
$this->error(__("Invalid parameters"));
|
$this->view->assign('row', $row);
|
||||||
|
return $this->view->fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($ids)) {
|
$params = $this->request->post('row/a');
|
||||||
$this->error(__('Parameter %s can not be empty', 'id'));
|
if (empty($params)) {
|
||||||
|
$this->error(__('Parameter %s can not be empty', ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
$status = $this->request->post('status');
|
$status = $params['status'];
|
||||||
$reason = $this->request->post('remark');
|
$reason = $params['remark'] ?? '';
|
||||||
|
|
||||||
if ($status == 5) {
|
if ($status == 5) {
|
||||||
if (empty($reason)) {
|
if (empty($reason)) {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ return [
|
||||||
'Type 3' => '每月任务',
|
'Type 3' => '每月任务',
|
||||||
'Title' => '任务标题',
|
'Title' => '任务标题',
|
||||||
'Desc' => '任务描述',
|
'Desc' => '任务描述',
|
||||||
|
'Prove_desc' => '完成描述',
|
||||||
'Status' => '状态',
|
'Status' => '状态',
|
||||||
'Status 1' => '待完成',
|
'Status 1' => '待完成',
|
||||||
'Set status to 1' => '设为待完成',
|
'Set status to 1' => '设为待完成',
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
<form id="task_complete-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
<form id="task_complete-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
<h1>任务详情</h1>
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">标题:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
{$row->title|htmlentities}
|
<input id="c-title" class="form-control" readonly="readonly" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">描述:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
{$row->desc|htmlentities}
|
<input id="c-desc" class="form-control" readonly="readonly" type="text" value="{$row.desc|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
72
application/admin/view/oa/task/review.html
Normal file
72
application/admin/view/oa/task/review.html
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
<form id="review-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-title" class="form-control" readonly="readonly" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-desc" class="form-control" readonly="readonly" name="row[desc]" type="text" value="{$row.desc|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" id="status" style="display:none;">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-status" class="form-control" readonly="readonly" name="row[status]" type="text" value="{$row.status|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Exec_admin_id')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-exec_admin_id" data-rule="required" readonly="readonly" data-source="auth/admin/selectpage" data-field="nickname" class="form-control selectpage" name="row[exec_admin_id]" type="text" value="{$row.exec_admin_id|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Expire_start_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-expire_start_time" data-rule="required" readonly="readonly" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[expire_start_time]" type="text" value="{$row.expire_start_time|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Expire_end_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-expire_end_time" data-rule="required" readonly="readonly" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[expire_end_time]" type="text" value="{$row.expire_end_time|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Prove_desc')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-prove_desc" class="form-control" readonly="readonly" name="row[prove_desc]" type="text" value="{$row.prove_desc|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-3">完成附件:</label>
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-prove_file_path" class="form-control" size="50" readonly="readonly" name="row[prove_file_path]" type="text" value="">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
{if $row.prove_file_path}
|
||||||
|
<span><a href="{$row.url}" class="btn btn-primary btn-info btn-preview" data-type="{$row.filetype}">预览</a></span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-prove_file_path"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group" id="reason-group" style="display:none;">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">驳回理由:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea name="row[remark]" id="reason" class="form-control" placeholder="请输入驳回理由"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="button" class="btn btn-success" id="btn-approve">通过</button>
|
||||||
|
<button type="button" class="btn btn-danger" id="btn-reject">驳回</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
@ -33,25 +33,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'title', title: __('Title'), operate: 'LIKE'},
|
{field: 'title', title: __('Title'), operate: 'LIKE'},
|
||||||
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'desc', title: __('Desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6')}, formatter: Table.api.formatter.status},
|
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5'),"6":__('Status 6')}, formatter: Table.api.formatter.status},
|
||||||
{
|
|
||||||
field: 'buttons',
|
|
||||||
width: "120px",
|
|
||||||
title: __('附件'),
|
|
||||||
table: table,
|
|
||||||
events: Table.api.events.operate,
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
name: 'detail',
|
|
||||||
text: __('查看附件'),
|
|
||||||
title: __('查看附件'),
|
|
||||||
classname: 'btn btn-xs btn-primary btn-preview',
|
|
||||||
extend: function(row) {
|
|
||||||
return 'data-type="' + row.filetype + '" data-url="' + row.url + '"';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
formatter: Table.api.formatter.buttons
|
|
||||||
},
|
|
||||||
{field: 'prove_desc', title: __('Prove_desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'prove_desc', title: __('Prove_desc'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'refuse_reason', title: __('Refuse_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'refuse_reason', title: __('Refuse_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'expire_start_time', title: __('Expire_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
{field: 'expire_start_time', title: __('Expire_start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
|
@ -60,79 +41,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||||
buttons:[
|
buttons:[
|
||||||
{
|
{
|
||||||
name: 'pass',
|
name: '审核',
|
||||||
text:"通过",
|
title: __('审核'),
|
||||||
title: '通过',
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||||
classname: 'btn btn-xs btn-success btn-click',
|
icon: 'fa fa-list',
|
||||||
icon: 'fa fa-magic',
|
url: 'oa/task/review'
|
||||||
click: function (e, row) {
|
|
||||||
Layer.confirm("确定通过?", {
|
|
||||||
}, function (index) {
|
|
||||||
Fast.api.ajax({
|
|
||||||
url: "oa/task/review/ids/"+ row.id,
|
|
||||||
data: {status:4}
|
|
||||||
}, function (data) {
|
|
||||||
Layer.closeAll();
|
|
||||||
$(".btn-refresh").trigger("click");
|
|
||||||
});
|
|
||||||
layer.close(index);
|
|
||||||
}, function (index) {
|
|
||||||
layer.close(index);
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
visible:function(row){
|
|
||||||
if (row.status != 3) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!Config.review) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'abort',
|
|
||||||
text:"驳回",
|
|
||||||
title: '驳回',
|
|
||||||
classname: 'btn btn-xs btn-info btn-click',
|
|
||||||
icon: 'fa fa-magic',
|
|
||||||
click: function (e, row) {
|
|
||||||
Layer.prompt({
|
|
||||||
title: "填写驳回原因",
|
|
||||||
success: function (layero) {
|
|
||||||
$("input", layero).prop("placeholder", "填写驳回原因");
|
|
||||||
}
|
|
||||||
}, function (value) {
|
|
||||||
Fast.api.ajax({
|
|
||||||
url: "oa/task/review/ids/"+ row.id,
|
|
||||||
data: {status:5, remark: value},
|
|
||||||
}, function (data, ret) {
|
|
||||||
Layer.closeAll();
|
|
||||||
$(".btn-refresh").trigger("click");
|
|
||||||
//return false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
|
|
||||||
visible:function(row){
|
|
||||||
if (row.status != 3) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!Config.review) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
]}
|
]}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
review: function () {
|
||||||
|
|
||||||
$(document).on('click', '.btn-preview', function (e) {
|
$(document).on('click', '.btn-preview', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
@ -166,13 +95,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 为表格绑定事件
|
// 点击通过按钮
|
||||||
Table.api.bindevent(table);
|
$("#btn-approve").click(function () {
|
||||||
},
|
$("#c-status").val("4");
|
||||||
add: function () {
|
$("#review-form").submit(); // 提交表单
|
||||||
Controller.api.bindevent();
|
});
|
||||||
},
|
|
||||||
edit: function () {
|
// 点击驳回按钮,弹出 Layer.prompt 收理由
|
||||||
|
$("#btn-reject").click(function () {
|
||||||
|
Layer.prompt({
|
||||||
|
title: '请输入驳回理由',
|
||||||
|
formType: 2 // 多行输入框
|
||||||
|
}, function (value, index) {
|
||||||
|
if (!value.trim()) {
|
||||||
|
Layer.msg("驳回理由不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#c-status").val("5");
|
||||||
|
$("#reason").val(value.trim());
|
||||||
|
$("#review-form").submit(); // 提交
|
||||||
|
Layer.close(index);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user