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} +