diff --git a/plugs/think-plugs-inspection/src/controller/api/auth/TicketVerify.php b/plugs/think-plugs-inspection/src/controller/api/auth/TicketVerify.php index db981d9..ad4820b 100644 --- a/plugs/think-plugs-inspection/src/controller/api/auth/TicketVerify.php +++ b/plugs/think-plugs-inspection/src/controller/api/auth/TicketVerify.php @@ -4,6 +4,8 @@ namespace plugin\inspection\controller\api\auth; use plugin\inspection\controller\api\Auth; use plugin\ticket\model\ApprovalInstance as Model; +use plugin\ticket\model\ApprovalProcess; + //use plugin\ticket\model\TicketVerify as Model; class TicketVerify extends Auth @@ -11,9 +13,9 @@ class TicketVerify extends Auth public function list() { - $query = Model::query()->where("type", '=', "YSSH")->with(['ticket']) - ->whereIn("ticket_id", \plugin\ticket\model\TicketRepair::query()->where('staff_id', '=', $this->staff->id)->column('ticket_id')); - $query->order('create_at', 'desc'); + $query = Model::query()->whereIn("process_id", ApprovalProcess::query()->where('type', '=', "YSSH")->column('id'))->with(['ticket']) + ->whereIn("oid", \plugin\ticket\model\TicketRepair::query()->where('staff_id', '=', $this->staff->id)->column('ticket_id')); + $query->order('id', 'desc'); $status = $this->request->get('status/i', null); if (is_numeric($status)) { $query->where('status', '=', $status); @@ -22,6 +24,7 @@ class TicketVerify extends Auth if ($keyword) { $query->where('title', 'like', "%{$keyword}%"); } + $query->field("*, create_time as create_at, create_time as update_at"); $pageData = $query->paginate(); $this->success('获取工单列表', $pageData); } @@ -29,7 +32,7 @@ class TicketVerify extends Auth public function detail() { $id = $this->request->get('id', null); - $data = Model::query()->with(['ticket'])->where('staff_id', '=', $this->staff->id)->where(['id'=>$id])->find(); + $data = Model::query()->with(['ticket'])->where(['id'=>$id])->find(); if (!$data) { $this->error('工单不存在'); } diff --git a/plugs/think-plugs-inspection/src/view/record/detail.html b/plugs/think-plugs-inspection/src/view/record/detail.html index 3c3a33f..5d831ea 100644 --- a/plugs/think-plugs-inspection/src/view/record/detail.html +++ b/plugs/think-plugs-inspection/src/view/record/detail.html @@ -56,8 +56,8 @@ id: 'polyline_' + index, styleId: 'style_red', paths: [ + new TMap.LatLng(points[index + 1].lat, points[index + 1].lng), new TMap.LatLng(point.lat, point.lng), - new TMap.LatLng(points[index + 1].lat, points[index + 1].lng) ] }); }) diff --git a/plugs/think-plugs-ticket/src/controller/TicketInter.php b/plugs/think-plugs-ticket/src/controller/TicketInter.php index e105c35..3f00d38 100644 --- a/plugs/think-plugs-ticket/src/controller/TicketInter.php +++ b/plugs/think-plugs-ticket/src/controller/TicketInter.php @@ -254,7 +254,6 @@ class TicketInter extends Controller $adminInfo = $this->request->session('user'); $instance_data = $this->_vali([ 'staff_id.require'=>'请指定维修人员!', - 'kj_user_id.default'=>'0', ]); $staff = InspectionStaff::query()->where('id', '=', $instance_data['staff_id'])->findOrEmpty(); if ($staff->isEmpty()) { @@ -278,7 +277,6 @@ class TicketInter extends Controller 'type' => 'TICKET_REPAIR', 'oid' => $view->id, ]); - $ticket->kj_user_id = $instance_data['kj_user_id']; $this->success('创建成功!', $view); } else { $this->vo = $ticket; @@ -289,33 +287,6 @@ class TicketInter extends Controller } - public function repair_ticket_modify() - { - $data = $this->_vali([ - 'ticket_id.require'=>'请指定工单ID!', - ]); - $repair = TicketRepair::query()->where('id', '=', $data['ticket_id'])->findOrEmpty(); - if ($repair->isEmpty()) { - $this->error('未找到工单信息'); - } - if ($repair->ticket === null) { - $this->error('未找到主工单信息'); - } - if ($repair->status === 1) { - $this->error('该工单已维修完成,无法操作!'); - } - $adminInfo = $this->request->session('user'); - if ($repair->ticket->kj_user_id != $adminInfo['id']) { - $this->error('您不是该工单的控价人员,无法操作!'); - } - if ($this->request->isPost()) { - - } else { - $this->vo = $repair; - $this->fetch(); - } - } - public function verify_process_create() { $data = $this->_vali([ diff --git a/plugs/think-plugs-ticket/src/view/ticket_outer/detail.html b/plugs/think-plugs-ticket/src/view/ticket_outer/detail.html index 1501a2d..439f083 100644 --- a/plugs/think-plugs-ticket/src/view/ticket_outer/detail.html +++ b/plugs/think-plugs-ticket/src/view/ticket_outer/detail.html @@ -1,7 +1,8 @@
@@ -50,62 +51,107 @@
- {if $vo.lat && $vo.lng} - - 位置 - -
- - - {/if}
- {if $vo.lat && $vo.lng} - - - {/if}
- {include file="common/ticket_flow" /} +
+
现场核实情况
+ {if $vo.verify} +
+ {foreach $vo.verify as $verify} + + + + + + + + + + + + + + + + + + + + + + + +
提交时间{$verify.create_at|default=""}
核实人{$verify.staff.name|default=""}【联系方式:{$verify.staff.phone|default=""}】
核实结果{$verify.content|default=""}
图片 +
+ {foreach $verify.imgs_arr as $img} + image +   + {/foreach} +
+
预估工作量{$verify.work_days|default=""}
+ {/foreach} +
+ {else /} +
+
+ 暂无核实记录 +
+
+ {/if} +
+
+
+
+
工单维修情况
+ {if $vo.repair} +
+ {foreach $vo.repair as $repair} + + + + + + + + + + + + + + + + + + + + + + + +
提交时间{$repair.create_at|default=""}
维修人{$repair.staff.name|default=""}【联系方式:{$repair.staff.phone|default=""}】
维修结果{$repair.content|default=""}
图片 +
+ {foreach $repair.imgs_arr as $img} + image +   + {/foreach} +
+
预估工作量{$verify.work_days|default=""}
+ {/foreach} +
+ {else /} +
+
+ 暂无维修记录 +
+
+ {/if} +
- + \ No newline at end of file