From 27e70a514892acf1e2b3eb1d73c7fcd67d7cb0af Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Sun, 16 Mar 2025 14:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controller/Ticket.php | 9 +++ .../src/view/ticket/detail.html | 67 +++++++++++++++++++ .../src/view/ticket/index.html | 2 +- 3 files changed, 77 insertions(+), 1 deletion(-) diff --git a/plugs/think-plugs-ticket/src/controller/Ticket.php b/plugs/think-plugs-ticket/src/controller/Ticket.php index 7edc50b..2c67668 100644 --- a/plugs/think-plugs-ticket/src/controller/Ticket.php +++ b/plugs/think-plugs-ticket/src/controller/Ticket.php @@ -80,6 +80,14 @@ class Ticket extends Controller $this->title = '工单详情'; ['id' => $id] = $this->_vali(['id.require' => '请指定工单ID!']); $this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply'])->find($id); + $process = ApprovalProcess::where('type', '=', 'GDSH')->order('id', 'asc')->findOrEmpty(); + $instance = ApprovalInstance::query()->with(['steps.approver', 'logs'])->where('process_id', '=', $process->id)->where('oid', '=', $id)->findOrEmpty(); + $this->instance = $instance; + if ($instance->isEmpty()) { + $this->step_index = -1; + } else { + $this->step_index = $instance->current_step; + } $this->fetch(); } @@ -301,6 +309,7 @@ class Ticket extends Controller if ($instance->current_step >= count($instance->steps)) { $instance->status = 1; $ticket->status = 0; + $ticket->save(); } else { $step = $instance->steps[$instance->current_step]; if ($step['approver_type'] == 3) { diff --git a/plugs/think-plugs-ticket/src/view/ticket/detail.html b/plugs/think-plugs-ticket/src/view/ticket/detail.html index 7d378e6..af6337a 100644 --- a/plugs/think-plugs-ticket/src/view/ticket/detail.html +++ b/plugs/think-plugs-ticket/src/view/ticket/detail.html @@ -1,6 +1,7 @@
+ {$step.title} +
+ {if $step_index >= $index} + {if $step.status == 2} +