From 483bcfd6d8fb47474abebef08cdaa5d6fe5b5437 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 19 Mar 2025 11:04:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E4=BD=8D=E7=BD=AE=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controller/InspectionShare.php | 2 - .../src/controller/Repair.php | 83 +++++++++++++++++++ .../src/controller/UserShare.php | 2 - .../src/controller/Verify.php | 83 +++++++++++++++++++ .../src/controller/View.php | 83 +++++++++++++++++++ .../src/view/ticket/detail.html | 48 +++++++++++ 6 files changed, 297 insertions(+), 4 deletions(-) create mode 100644 plugs/think-plugs-ticket/src/controller/Repair.php create mode 100644 plugs/think-plugs-ticket/src/controller/Verify.php create mode 100644 plugs/think-plugs-ticket/src/controller/View.php diff --git a/plugs/think-plugs-ticket/src/controller/InspectionShare.php b/plugs/think-plugs-ticket/src/controller/InspectionShare.php index e374289..5a586ba 100644 --- a/plugs/think-plugs-ticket/src/controller/InspectionShare.php +++ b/plugs/think-plugs-ticket/src/controller/InspectionShare.php @@ -78,14 +78,12 @@ class InspectionShare extends Controller case 'new': $data = $this->_vali([ 'type_id.require' => '类型不能为空', - 'user_id.require' => '请选择处理人员', ]); $ticket = TicketTicket::mk()->create([ 'source_type' => 2, 'type_id' => $data['type_id'], 'user_type' => 'staff', 'user_id' => $share->user_id, - 'current_admin_id' => $data['user_id'], 'title' => $share->title, 'content' => $share->content, 'ticket_region' => $share->ticket_region, diff --git a/plugs/think-plugs-ticket/src/controller/Repair.php b/plugs/think-plugs-ticket/src/controller/Repair.php new file mode 100644 index 0000000..0a6df9f --- /dev/null +++ b/plugs/think-plugs-ticket/src/controller/Repair.php @@ -0,0 +1,83 @@ +title = '维修工单管理'; + TicketRepair::mQuery()->layTable(function () { + }, static function (QueryHelper $query) { + $query->equal('status')->like('title'); + $query->timeBetween('create_at'); + }); + } + + /** + * 添加维修工单 + * @auth true + * @menu true + * @return void + */ + public function add() + { + $this->title = '添加维修工单'; + TicketRepair::mForm('form'); + } + + /** + * 编辑维修工单 + * @auth true + * @menu true + * @return void + */ + public function edit() + { + $this->title = '编辑维修工单'; + $this->id = $this->request->param('id'); + TicketRepair::mForm('form', 'id'); + } + + /** + * 删除维修工单 + * @auth true + * @menu true + * @return void + */ + public function remove() + { + TicketRepair::mDelete('id'); + } + + /** + * 修改维修工单状态 + * @auth true + * @menu true + * @return void + */ + public function status() + { + TicketRepair::mSave($this->_vali([ + 'id.require' => '工单ID不能为空', + 'status.in:0,1' => '状态值范围异常!', + 'status.require' => '状态值不能为空!', + ]), 'id'); + } +} \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/controller/UserShare.php b/plugs/think-plugs-ticket/src/controller/UserShare.php index 7487368..f529661 100644 --- a/plugs/think-plugs-ticket/src/controller/UserShare.php +++ b/plugs/think-plugs-ticket/src/controller/UserShare.php @@ -82,14 +82,12 @@ class UserShare extends Controller case 'new': $data = $this->_vali([ 'type_id.require' => '类型不能为空', - 'user_id.require' => '请选择处理人员', ]); $ticket = TicketTicket::mk()->create([ 'source_type' => 1, 'type_id' => $data['type_id'], 'user_type' => 'user', 'user_id' => $userShare->user_id, - 'current_admin_id' => $data['user_id'], 'title' => $userShare->title, 'content' => $userShare->content, 'ticket_region' => $userShare->ticket_region, diff --git a/plugs/think-plugs-ticket/src/controller/Verify.php b/plugs/think-plugs-ticket/src/controller/Verify.php new file mode 100644 index 0000000..6f73948 --- /dev/null +++ b/plugs/think-plugs-ticket/src/controller/Verify.php @@ -0,0 +1,83 @@ +title = '验收工单管理'; + TicketVerify::mQuery()->layTable(function () { + }, static function (QueryHelper $query) { + $query->equal('status')->like('title'); + $query->timeBetween('create_at'); + }); + } + + /** + * 添加验收工单 + * @auth true + * @menu true + * @return void + */ + public function add() + { + $this->title = '添加验收工单'; + TicketVerify::mForm('form'); + } + + /** + * 编辑验收工单 + * @auth true + * @menu true + * @return void + */ + public function edit() + { + $this->title = '编辑验收工单'; + $this->id = $this->request->param('id'); + TicketVerify::mForm('form', 'id'); + } + + /** + * 删除验收工单 + * @auth true + * @menu true + * @return void + */ + public function remove() + { + TicketVerify::mDelete('id'); + } + + /** + * 修改验收工单状态 + * @auth true + * @menu true + * @return void + */ + public function status() + { + TicketVerify::mSave($this->_vali([ + 'id.require' => '工单ID不能为空', + 'status.in:0,1' => '状态值范围异常!', + 'status.require' => '状态值不能为空!', + ]), 'id'); + } +} \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/controller/View.php b/plugs/think-plugs-ticket/src/controller/View.php new file mode 100644 index 0000000..dbe73a9 --- /dev/null +++ b/plugs/think-plugs-ticket/src/controller/View.php @@ -0,0 +1,83 @@ +title = '查看工单管理'; + TicketView::mQuery()->layTable(function () { + }, static function (QueryHelper $query) { + $query->equal('status')->like('title'); + $query->timeBetween('create_at'); + }); + } + + /** + * 添加查看工单 + * @auth true + * @menu true + * @return void + */ + public function add() + { + $this->title = '添加查看工单'; + TicketView::mForm('form'); + } + + /** + * 编辑查看工单 + * @auth true + * @menu true + * @return void + */ + public function edit() + { + $this->title = '编辑查看工单'; + $this->id = $this->request->param('id'); + TicketView::mForm('form', 'id'); + } + + /** + * 删除查看工单 + * @auth true + * @menu true + * @return void + */ + public function remove() + { + TicketView::mDelete('id'); + } + + /** + * 修改查看工单状态 + * @auth true + * @menu true + * @return void + */ + public function status() + { + TicketView::mSave($this->_vali([ + 'id.require' => '工单ID不能为空', + 'status.in:0,1' => '状态值范围异常!', + 'status.require' => '状态值不能为空!', + ]), 'id'); + } +} \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/view/ticket/detail.html b/plugs/think-plugs-ticket/src/view/ticket/detail.html index 7a5248f..2977f2d 100644 --- a/plugs/think-plugs-ticket/src/view/ticket/detail.html +++ b/plugs/think-plugs-ticket/src/view/ticket/detail.html @@ -52,9 +52,57 @@ + {if $vo.lat && $vo.lng} +