You've already forked guangan
全流程
This commit is contained in:
@ -81,7 +81,8 @@ class Ticket extends Controller
|
||||
{
|
||||
$this->title = '工单详情';
|
||||
['id' => $id] = $this->_vali(['id.require' => '请指定工单ID!']);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type', 'reply'])->append(['imgs_arr', 'type_name', 'last_reply'])->find($id);
|
||||
$this->vo = TicketTicket::mk()->with(['user', 'type'])->append(['imgs_arr', 'type_name'])->find($id);
|
||||
$this->ticket = $this->vo;
|
||||
$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;
|
||||
@ -433,7 +434,7 @@ class Ticket extends Controller
|
||||
'status' => 0,
|
||||
]);
|
||||
}
|
||||
$ticket->view_pid = $instance->id;
|
||||
$ticket->repair_pid = $instance->id;
|
||||
$ticket->save();
|
||||
ApprovalInstance::mk()->commit();
|
||||
} catch (HttpResponseException $e) {
|
||||
@ -454,6 +455,34 @@ class Ticket extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function repair_ticket_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'ticket_id.require'=>'请指定工单ID!',
|
||||
]);
|
||||
$ticket = TicketTicket::query()->with(['repair_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->repairs()->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 verify_process_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
@ -504,7 +533,7 @@ class Ticket extends Controller
|
||||
'status' => 0,
|
||||
]);
|
||||
}
|
||||
$ticket->view_pid = $instance->id;
|
||||
$ticket->verify_pid = $instance->id;
|
||||
$ticket->save();
|
||||
ApprovalInstance::mk()->commit();
|
||||
} catch (HttpResponseException $e) {
|
||||
@ -525,6 +554,34 @@ class Ticket extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function verify_ticket_create()
|
||||
{
|
||||
$data = $this->_vali([
|
||||
'ticket_id.require'=>'请指定工单ID!',
|
||||
]);
|
||||
$ticket = TicketTicket::query()->with(['repair_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->verifys()->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 my() {
|
||||
|
Reference in New Issue
Block a user