后台核验工单创建

This commit is contained in:
2025-03-20 11:42:01 +08:00
parent 4046811b6d
commit 6acf1cf237
20 changed files with 343 additions and 131 deletions

View File

@ -10,6 +10,7 @@ use plugin\ticket\model\TicketDept;
use plugin\ticket\model\TicketReply;
use plugin\ticket\model\TicketTicket;
use plugin\ticket\model\TicketType;
use plugin\ticket\model\TicketView;
use think\admin\Controller;
use think\admin\helper\QueryHelper;
use think\admin\model\SystemUser;
@ -354,6 +355,34 @@ class Ticket extends Controller
}
}
public function view_ticket_create()
{
$data = $this->_vali([
'ticket_id.require'=>'请指定工单ID!',
]);
$ticket = TicketTicket::query()->with(['view_process'])->append(['imgs_arr', 'type_name'])->where('id', '=', $data['ticket_id'])->findOrEmpty();
$staffs = InspectionStaff::query()->field('id,name,phone')->select();
if ($ticket->isEmpty()) {
$this->error('未找到工单信息');
}
if ($this->request->isPost()) {
$adminInfo = $this->request->session('user');
$instance_data = $this->_vali([
'staff_id.require'=>'请指定维修人员!',
]);
$view = $ticket->views()->save([
'staff_id'=>$instance_data['staff_id'],
'status'=>0,
'create_by'=>$adminInfo['id'],
]);
$this->success('创建成功!', $view);
} else {
$this->vo = $ticket;
$this->staffs = $staffs;
$this->fetch();
}
}
public function repair_process_create()
{
$data = $this->_vali([