From 75a6472987e50233220d2e1f81561d5140595698 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 25 Apr 2025 10:06:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controller/TicketInter.php | 45 ++++++++++++++++++- .../view/ticket_inter/view_ticket_create.html | 19 ++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 plugs/think-plugs-ticket/src/view/ticket_inter/view_ticket_create.html 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 @@ +