This commit is contained in:
2025-03-23 13:21:35 +08:00
parent b173667c49
commit b6ff9b1a6e
10 changed files with 863 additions and 345 deletions

View File

@ -148,6 +148,15 @@ class Ticket extends Controller
}
}
/**
* 工单分配
* @auth true
* @menu true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function move()
{
$this->title = "工单分配";
@ -170,19 +179,12 @@ class Ticket extends Controller
// 外部
$ticket->state = 2;
}
if ($ticket->fz_user_id) {
$staff = InspectionStaff::query()->find($ticket->fz_user_id);
$staff->messages()->save([
'title' => "您有新的工单待处理",
'content' => "您有新的工单待处理,请及时处理。",
]);
}
$ticket->status = 1;
$ticket->save();
$this->success('工单分配成功!');
} else {
$this->dept_list = TicketDept::query()->scope('avail')->select();
$this->user_list = InspectionStaff::query()->select();
$this->user_list = SystemUser::query()->select();
$this->fetch();
}
}