Accept Merge Request #91: (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/91?initial=true
This commit is contained in:
zhuyu 2025-06-02 11:18:14 +08:00 committed by Coding
commit ca93a9e071
10 changed files with 22 additions and 49 deletions

View File

@ -62,30 +62,6 @@ class Task extends Backend
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$dateTime = date('Y-m-d');
foreach ($where as $k => $item) {
if ($item[0] != 'task.status') {
continue;
}
if (in_array($item[2], [1, 4])) {
$where[] = ['expire_end_time', '<=', $dateTime];
continue;
}
if ($item[2] == 2) {
$where[$k][2] = 4;
$where[] = ['expire_end_time', '>', $dateTime];
continue;
}
if ($item[2] == 6) {
$where[$k][2] = 1;
$where[] = ['expire_end_time', '>', $dateTime];
continue;
}
}
$list = $this->model
->with(['exec'])
@ -95,16 +71,6 @@ class Task extends Backend
foreach ($list as $k => $row) {
if (strtotime($row['expire_end_time']) > time()) {
if ($row['status'] == 1) {
$list[$k]['status'] = 6;
}
if ($row['status'] == 4) {
$list[$k]['status'] = 2;
}
}
$list[$k]['refuse_reason'] = $row['refuse_reason'] ?? '';
$list[$k]['fileurl'] = cdnurl($row['prove_file_path']);
$list[$k]['filetype'] = pathinfo($list[$k]['fileurl'], PATHINFO_EXTENSION);

View File

@ -2,7 +2,7 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人id',
'Admin_id' => '创建人',
'Admin.nickname' => '创建人',
'AuthGroup.name' => '角色',
'Score' => '指标分',

View File

@ -2,7 +2,7 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人id',
'Admin_id' => '创建人',
'Admin.nickname' => '创建人',
'AuthGroup.name' => '角色',
'Name' => '名称',

View File

@ -2,7 +2,7 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人ID',
'Admin_id' => '创建人',
'Type' => '培训资料类型',
'Type 1' => '视频',
'Type 2' => '图片',

View File

@ -2,8 +2,8 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人ID',
'Exec_admin_id' => '执行人ID',
'Admin_id' => '创建人',
'Exec_admin_id' => '执行人',
'Type' => '任务类型',
'Type 1' => '早班',
'Type 2' => '中班',

View File

@ -2,8 +2,8 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人id',
'Exec_admin_id' => '执行人ID',
'Admin_id' => '创建人',
'Exec_admin_id' => '执行人',
'Type' => '任务类型',
'Type 1' => '每日任务',
'Type 2' => '每周任务',

View File

@ -2,8 +2,8 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人id',
'Target_admin_id' => '工资归属人id',
'Admin_id' => '创建人',
'Target_admin_id' => '工资归属人',
'Item_id' => '指标id',
'Item_value' => '值',
'Salary_month' => '工资月份',

View File

@ -2,7 +2,7 @@
return [
'Id' => 'ID',
'Admin_id' => '创建人id',
'Admin_id' => '创建人',
'Name' => '名称',
'Desc' => '描述',
'Type 1' => '加',

View File

@ -38,7 +38,7 @@ class Task extends Model
public function getStatusList()
{
return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6')];
return ['1' => __('Status 1'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5')];
}

View File

@ -32,7 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2'),"3":__('Type 3')}, formatter: Table.api.formatter.normal},
{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: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"3":__('Status 3'),"4":__('Status 4'),"5":__('Status 5')}, formatter: Table.api.formatter.status},
{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},
@ -41,11 +41,18 @@ 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: '审核',
title: __('审核'),
name: 'review',
text: "审核",
title: "审核",
classname: 'btn btn-xs btn-primary btn-dialog',
icon: 'fa fa-list',
url: 'oa/task/review'
url: 'oa/task/review',
visible:function(row){
if (row.status != 3) {
return false;
}
return true;
}
},
{
name: 'edit',