feature: 排班优化
This commit is contained in:
parent
837d41d1d6
commit
8d7aceaf70
|
|
@ -83,7 +83,7 @@ class CustomSchedule extends Backend
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($adminIds as $adminId) {
|
foreach ($adminIds as $adminId) {
|
||||||
$res[$adminId][$tmpDate] = '无';
|
$res[$adminId][$tmpDate] = '';
|
||||||
$res[$adminId]['admin_id'] = $adminId;
|
$res[$adminId]['admin_id'] = $adminId;
|
||||||
$res[$adminId]['name'] = $adminNames[$adminId];
|
$res[$adminId]['name'] = $adminNames[$adminId];
|
||||||
$res[$adminId]['editable'] = $this->auth->check('oa/custom_schedule/edit') ? 1 : 0;
|
$res[$adminId]['editable'] = $this->auth->check('oa/custom_schedule/edit') ? 1 : 0;
|
||||||
|
|
@ -117,7 +117,7 @@ class CustomSchedule extends Backend
|
||||||
$type = $queryDatum['type'];
|
$type = $queryDatum['type'];
|
||||||
|
|
||||||
if (isset($res[$adminId][$date])) {
|
if (isset($res[$adminId][$date])) {
|
||||||
$res[$adminId][$date] = $this->model->getTypeList()[$type];
|
$res[$adminId][$date] = $type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -271,21 +271,14 @@ class CustomSchedule extends Backend
|
||||||
$date = $params['field'];
|
$date = $params['field'];
|
||||||
$adminId = $params['admin_id'];
|
$adminId = $params['admin_id'];
|
||||||
|
|
||||||
$value = $params[$date] ?? '无';
|
$value = $params[$date] ?? '';
|
||||||
$valueMap = [
|
|
||||||
'无' => 0,
|
|
||||||
'早班' => 1,
|
|
||||||
'中班' => 2,
|
|
||||||
'晚班' => 3,
|
|
||||||
'行政班' => 4,
|
|
||||||
];
|
|
||||||
|
|
||||||
if ($value == '无') {
|
if (empty($value)) {
|
||||||
$this->model->where('exec_admin_id', $adminId)->delete();
|
$this->model->where('exec_admin_id', $adminId)->delete();
|
||||||
$this->success();
|
$this->success();
|
||||||
}
|
}
|
||||||
|
|
||||||
$dbValue = $valueMap[$value];
|
$dbValue = $value;
|
||||||
|
|
||||||
$data = $this->model
|
$data = $this->model
|
||||||
->where('date', '=', $date)
|
->where('date', '=', $date)
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<div class="widget-body no-padding">
|
<div class="widget-body no-padding">
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('oa/custom_schedule/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('oa/custom_schedule/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i>批量排班</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,13 +44,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'editable'], function
|
||||||
"field": tmpDate,
|
"field": tmpDate,
|
||||||
"editable" :{
|
"editable" :{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
emptytext: '_',
|
||||||
pk: 1,
|
pk: 1,
|
||||||
source: [
|
source: [
|
||||||
{value: '无', text: '无'},
|
{value: '0', text: ''},
|
||||||
{value: '早班', text: '早班'},
|
{value: '1', text: '早班'},
|
||||||
{value: '中班', text: '中班'},
|
{value: '2', text: '中班'},
|
||||||
{value: '晚班', text: '晚班'},
|
{value: '3', text: '晚班'},
|
||||||
{value: '行政班', text: '行政班'},
|
{value: '4', text: '行政班'},
|
||||||
],
|
],
|
||||||
noeditFormatter: function (value, row, index) {
|
noeditFormatter: function (value, row, index) {
|
||||||
if (row.editable === 1) {
|
if (row.editable === 1) {
|
||||||
|
|
@ -102,13 +103,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'editable'], function
|
||||||
"field": tmpDate,
|
"field": tmpDate,
|
||||||
"editable" :{
|
"editable" :{
|
||||||
type: 'select',
|
type: 'select',
|
||||||
|
emptytext: '_',
|
||||||
pk: 1,
|
pk: 1,
|
||||||
source: [
|
source: [
|
||||||
{value: '无', text: '无'},
|
{value: '0', text: ''},
|
||||||
{value: '早班', text: '早班'},
|
{value: '1', text: '早班'},
|
||||||
{value: '中班', text: '中班'},
|
{value: '2', text: '中班'},
|
||||||
{value: '晚班', text: '晚班'},
|
{value: '3', text: '晚班'},
|
||||||
{value: '行政班', text: '行政班'},
|
{value: '4', text: '行政班'},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user