feat: 工作流程负责人新增剔除模式(改变任务负责人并保留操作状态的人员)
This commit is contained in:
parent
a98e4dbcd4
commit
4a42ce87a2
@ -1677,6 +1677,9 @@ class ProjectController extends AbstractController
|
||||
if ($usertype == 'replace' && empty($userids)) {
|
||||
throw new ApiException("状态[{$item['name']}]设置错误,设置流转模式时必须填写状态负责人");
|
||||
}
|
||||
if ($usertype == 'merge' && empty($userids)) {
|
||||
throw new ApiException("状态[{$item['name']}]设置错误,设置剔除模式时必须填写状态负责人");
|
||||
}
|
||||
if ($userlimit && empty($userids)) {
|
||||
throw new ApiException("状态[{$item['name']}]设置错误,设置限制负责人时必须填写状态负责人");
|
||||
}
|
||||
|
@ -541,13 +541,18 @@ class ProjectTask extends AbstractModel
|
||||
if ($newFlowItem->userids) {
|
||||
// 判断自动添加负责人
|
||||
$flowData['owner'] = $data['owner'] = $this->taskUser->where('owner', 1)->pluck('userid')->toArray();
|
||||
if ($newFlowItem->usertype == "replace") {
|
||||
// 流转模式
|
||||
if (in_array($newFlowItem->usertype, ["replace", "merge"])) {
|
||||
// 流转模式、剔除模式
|
||||
if ($this->parent_id === 0) {
|
||||
$flowData['assist'] = $data['assist'] = $this->taskUser->where('owner', 0)->pluck('userid')->toArray();
|
||||
$data['assist'] = array_merge($data['assist'], $data['owner']);
|
||||
}
|
||||
$data['owner'] = $newFlowItem->userids;
|
||||
// 判断剔除模式:保留操作状态的人员
|
||||
if ($newFlowItem->usertype == "merge") {
|
||||
$data['assist'] = array_diff($data['assist'], [User::userid()]);
|
||||
$data['owner'] = array_merge($data['owner'], [User::userid()]);
|
||||
}
|
||||
} else {
|
||||
// 添加模式
|
||||
$data['owner'] = array_merge($data['owner'], $newFlowItem->userids);
|
||||
|
@ -149,8 +149,10 @@
|
||||
<RadioGroup v-model="userData.usertype">
|
||||
<Radio label="add">{{$L('添加模式')}}</Radio>
|
||||
<Radio label="replace">{{$L('流转模式')}}</Radio>
|
||||
<Radio label="merge">{{$L('剔除模式')}}</Radio>
|
||||
</RadioGroup>
|
||||
<div v-if="userData.usertype=='replace'" class="form-tip">{{$L('流转到此状态时改变任务负责人为状态负责人,原本的任务负责人移至协助人员。')}}</div>
|
||||
<div v-else-if="userData.usertype=='merge'" class="form-tip">{{$L('流转到此状态时改变任务负责人为状态负责人(并保留操作状态的人员),原本的任务负责人移至协助人员。')}}</div>
|
||||
<div v-else class="form-tip">{{$L('流转到此状态时添加状态负责人至任务负责人。')}}</div>
|
||||
</FormItem>
|
||||
<FormItem prop="userlimit" :label="$L('限制负责人')">
|
||||
|
Loading…
x
Reference in New Issue
Block a user