Accept Merge Request #66: (feature/zy -> develop)
Merge Request: feature: 面板 Created By: @zhuyu Accepted By: @zhuyu URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/66?initial=true
This commit is contained in:
commit
1a0061cb71
|
|
@ -140,18 +140,24 @@ class Task extends Backend
|
|||
$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()) {
|
||||
$this->error(__("Invalid parameters"));
|
||||
$this->view->assign('row', $row);
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
if (empty($ids)) {
|
||||
$this->error(__('Parameter %s can not be empty', 'id'));
|
||||
$params = $this->request->post('row/a');
|
||||
if (empty($params)) {
|
||||
$this->error(__('Parameter %s can not be empty', ''));
|
||||
}
|
||||
|
||||
$status = $this->request->post('status');
|
||||
$reason = $this->request->post('remark');
|
||||
$status = $params['status'];
|
||||
$reason = $params['remark'] ?? '';
|
||||
|
||||
if ($status == 5) {
|
||||
if (empty($reason)) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ return [
|
|||
'Type 3' => '每月任务',
|
||||
'Title' => '任务标题',
|
||||
'Desc' => '任务描述',
|
||||
'Prove_desc' => '完成描述',
|
||||
'Status' => '状态',
|
||||
'Status 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="">
|
||||
|
||||
<h1>任务详情</h1>
|
||||
<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">
|
||||
{$row->title|htmlentities}
|
||||
<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">描述:</label>
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
|
||||
<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>
|
||||
|
||||
|
|
@ -27,7 +26,7 @@
|
|||
<div class="input-group">
|
||||
<input id="c-prove_file_path" class="form-control" size="50" name="row[prove_file_path]" type="text" value="">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-prove_file_path" data-mimetype="*" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-prove_file_path" data-mimetype="*" data-multiple="false" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-prove_file_path"></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
<div class="input-group">
|
||||
<input id="c-path" data-rule="required" class="form-control" size="50" name="row[path]" type="text" value="">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="false" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="fachoose-path" class="btn btn-primary fachoose" data-input-id="c-path" data-mimetype="*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-path"></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="input-group">
|
||||
<input id="c-path" data-rule="required" class="form-control" size="50" name="row[path]" type="text" value="{$row.path|htmlentities}">
|
||||
<div class="input-group-addon no-border no-padding">
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="true" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><button type="button" id="plupload-path" class="btn btn-danger plupload" data-input-id="c-path" data-mimetype="*" data-multiple="false" data-preview-id="p-path"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||
<span><a href="{$row.url}" class="btn btn-primary btn-info btn-preview" data-type="{$row.filetype}">预览</a></span>
|
||||
</div>
|
||||
<span class="msg-box n-right" for="c-path"></span>
|
||||
|
|
|
|||
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: '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: '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: '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},
|
||||
|
|
@ -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,
|
||||
buttons:[
|
||||
{
|
||||
name: 'pass',
|
||||
text:"通过",
|
||||
title: '通过',
|
||||
classname: 'btn btn-xs btn-success btn-click',
|
||||
icon: 'fa fa-magic',
|
||||
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;
|
||||
},
|
||||
name: '审核',
|
||||
title: __('审核'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: 'oa/task/review'
|
||||
}
|
||||
|
||||
]}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
review: function () {
|
||||
|
||||
$(document).on('click', '.btn-preview', function (e) {
|
||||
e.preventDefault();
|
||||
|
|
@ -166,13 +95,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
// 点击通过按钮
|
||||
$("#btn-approve").click(function () {
|
||||
$("#c-status").val("4");
|
||||
$("#review-form").submit(); // 提交表单
|
||||
});
|
||||
|
||||
// 点击驳回按钮,弹出 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();
|
||||
},
|
||||
api: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user