This commit is contained in:
2024-12-03 10:18:07 +08:00
parent 6fcd8f7ce2
commit a6c7d1de15
14 changed files with 236 additions and 20 deletions

View File

@ -2,11 +2,13 @@
namespace plugin\ticket\controller;
use plugin\ticket\model\TicketDept;
use plugin\ticket\model\TicketReply;
use plugin\ticket\model\TicketTicket;
use plugin\ticket\model\TicketType;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
use think\admin\model\SystemUser;
/**
* 工单管理
@ -127,4 +129,34 @@ class Ticket extends Controller
$data['contact'] = $adminInfo['contact_phone'];
}
}
public function move()
{
$this->title = "工单分配";
if ($this->request->isPost()) {
// 提交
$data = $this->_vali([
'id.require' => '请指定工单ID!',
'type.require' => '请指定分配类型!',
'dept_id.require' => '请指定处理部门!',
'user_id.require' => '请指定负责人员!',
]);
$ticket = TicketTicket::mk()->where('id', '=', $data['id'])->findOrEmpty();
if ($ticket->isEmpty()) $this->error('工单不存在!');
$ticket->fz_user_id = $data['user_id'];
$ticket->fz_dept_id = $data['dept_id'];
if ($data['type'] == 1) {
// 内部
$ticket->state = 1;
} else {
// 外部
$ticket->state = 2;
}
$ticket->save();
} else {
$this->dept_list = TicketDept::query()->scope('avail')->select();
$this->user_list = SystemUser::query()->select();
$this->fetch();
}
}
}