diff --git a/plugs/think-plugs-ticket/src/controller/TicketInter.php b/plugs/think-plugs-ticket/src/controller/TicketInter.php index 3f00d38..13f3c9d 100644 --- a/plugs/think-plugs-ticket/src/controller/TicketInter.php +++ b/plugs/think-plugs-ticket/src/controller/TicketInter.php @@ -168,6 +168,50 @@ class TicketInter extends Controller $this->success('创建成功!'); } + 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'=>'请指定维修人员!', + ]); + $staff = InspectionStaff::query()->where('id', '=', $instance_data['staff_id'])->findOrEmpty(); + if ($staff->isEmpty()) { + $this->error('未找到维修人员信息'); + } + $ticket->gc_content = ''; + $ticket->zf_content = ''; + $ticket->ys_content = ''; + $ticket->work_days = null; + $view = $ticket->views()->save([ + 'staff_id'=>$instance_data['staff_id'], + 'status'=>0, + 'create_id'=>$adminInfo['id'], + ]); + $staff->messages()->save([ + 'status'=>0, + 'title'=>'您有新的核验工单需要处理', + 'content'=>'您有新的核验工单需要处理,请及时处理。', + 'type' => 'TICKET_VIEW', + 'oid' => $view->id, + ]); + $ticket->save(); + $this->success('创建成功!', $view); + } else { + $this->vo = $ticket; + $this->staffs = $staffs; + $this->fetch(); + } + } + public function repair_process_create() { $data = $this->_vali([ @@ -286,7 +330,6 @@ class TicketInter extends Controller } } - public function verify_process_create() { $data = $this->_vali([ diff --git a/plugs/think-plugs-ticket/src/view/ticket_inter/view_ticket_create.html b/plugs/think-plugs-ticket/src/view/ticket_inter/view_ticket_create.html new file mode 100644 index 0000000..f560c83 --- /dev/null +++ b/plugs/think-plugs-ticket/src/view/ticket_inter/view_ticket_create.html @@ -0,0 +1,19 @@ +
+ + +
+ +
+ +
+
+
+ + +
+