From cf2a2892b54049808ef9dc10fcb88d3afdcb6fb8 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 19 Mar 2025 17:07:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E7=B1=BB=E5=B7=A5=E5=8D=95=E5=9F=BA?= =?UTF-8?q?=E7=A1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controller/Repair.php | 2 + .../src/controller/Ticket.php | 2 +- .../src/controller/Verify.php | 2 + .../src/controller/View.php | 4 +- .../src/model/TicketTicket.php | 18 ++++- .../src/view/repair/index.html | 72 +++++++++++++++++++ .../src/view/repair/index_search.html | 42 +++++++++++ .../src/view/ticket/index.html | 64 ++++++++--------- .../src/view/verify/index.html | 72 +++++++++++++++++++ .../src/view/verify/index_search.html | 42 +++++++++++ .../src/view/view/index.html | 72 +++++++++++++++++++ .../src/view/view/index_search.html | 42 +++++++++++ 12 files changed, 398 insertions(+), 36 deletions(-) create mode 100644 plugs/think-plugs-ticket/src/view/repair/index.html create mode 100644 plugs/think-plugs-ticket/src/view/repair/index_search.html create mode 100644 plugs/think-plugs-ticket/src/view/verify/index.html create mode 100644 plugs/think-plugs-ticket/src/view/verify/index_search.html create mode 100644 plugs/think-plugs-ticket/src/view/view/index.html create mode 100644 plugs/think-plugs-ticket/src/view/view/index_search.html diff --git a/plugs/think-plugs-ticket/src/controller/Repair.php b/plugs/think-plugs-ticket/src/controller/Repair.php index 0a6df9f..9e30e02 100644 --- a/plugs/think-plugs-ticket/src/controller/Repair.php +++ b/plugs/think-plugs-ticket/src/controller/Repair.php @@ -3,6 +3,7 @@ namespace plugin\ticket\controller; use plugin\ticket\model\TicketRepair; +use plugin\ticket\model\TicketType; use think\admin\Controller; use think\admin\helper\QueryHelper; @@ -23,6 +24,7 @@ class Repair extends Controller public function index() { $this->title = '维修工单管理'; + $this->type_list = TicketType::getList(); TicketRepair::mQuery()->layTable(function () { }, static function (QueryHelper $query) { $query->equal('status')->like('title'); diff --git a/plugs/think-plugs-ticket/src/controller/Ticket.php b/plugs/think-plugs-ticket/src/controller/Ticket.php index e567189..248971a 100644 --- a/plugs/think-plugs-ticket/src/controller/Ticket.php +++ b/plugs/think-plugs-ticket/src/controller/Ticket.php @@ -41,7 +41,7 @@ class Ticket extends Controller $query->like(['title|content|contact_name|ticket_address|contact_phone#keyword']) ->dateBetween(['create_at']) ->equal(['status', 'type_id']); - $query->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with('approval'); + $query->append(['imgs_arr', 'source_type_name', 'type_name', 'last_reply'])->with(['views', 'repairs', 'verifys']); }); } diff --git a/plugs/think-plugs-ticket/src/controller/Verify.php b/plugs/think-plugs-ticket/src/controller/Verify.php index 6f73948..0076ed9 100644 --- a/plugs/think-plugs-ticket/src/controller/Verify.php +++ b/plugs/think-plugs-ticket/src/controller/Verify.php @@ -2,6 +2,7 @@ namespace plugin\ticket\controller; +use plugin\ticket\model\TicketType; use plugin\ticket\model\TicketVerify; use think\admin\Controller; use think\admin\helper\QueryHelper; @@ -23,6 +24,7 @@ class Verify extends Controller public function index() { $this->title = '验收工单管理'; + $this->type_list = TicketType::getList(); TicketVerify::mQuery()->layTable(function () { }, static function (QueryHelper $query) { $query->equal('status')->like('title'); diff --git a/plugs/think-plugs-ticket/src/controller/View.php b/plugs/think-plugs-ticket/src/controller/View.php index dbe73a9..2cb45a1 100644 --- a/plugs/think-plugs-ticket/src/controller/View.php +++ b/plugs/think-plugs-ticket/src/controller/View.php @@ -2,6 +2,7 @@ namespace plugin\ticket\controller; +use plugin\ticket\model\TicketType; use plugin\ticket\model\TicketView; use think\admin\Controller; use think\admin\helper\QueryHelper; @@ -23,8 +24,9 @@ class View extends Controller public function index() { $this->title = '查看工单管理'; + $this->type_list = TicketType::getList(); TicketView::mQuery()->layTable(function () { - }, static function (QueryHelper $query) { + }, function (QueryHelper $query) { $query->equal('status')->like('title'); $query->timeBetween('create_at'); }); diff --git a/plugs/think-plugs-ticket/src/model/TicketTicket.php b/plugs/think-plugs-ticket/src/model/TicketTicket.php index 1f8eb16..7352be5 100644 --- a/plugs/think-plugs-ticket/src/model/TicketTicket.php +++ b/plugs/think-plugs-ticket/src/model/TicketTicket.php @@ -99,12 +99,12 @@ class TicketTicket extends Model return $this->belongsTo(SystemUser::class, 'fz_user_id'); } - public function verify() + public function verifys() { return $this->hasMany(TicketVerify::class, 'ticket_id')->order('create_at', 'desc'); } - public function repair() + public function repairs() { return $this->hasMany(TicketRepair::class, 'ticket_id')->order('create_at', 'desc'); } @@ -113,6 +113,20 @@ class TicketTicket extends Model return $this->hasMany(TicketView::class, 'ticket_id')->order('create_at', 'desc'); } + public function view_process() { + return $this->belongsTo(ApprovalInstance::class, 'view_pid', 'id'); + } + + public function repair_process() + { + return $this->belongsTo(ApprovalInstance::class, 'repair_pid', 'id'); + } + + public function verify_process() + { + return $this->belongsTo(ApprovalInstance::class, 'verify_pid', 'id'); + } + public function repair_accept() { return $this->hasMany(TicketRepairAccept::class, 'ticket_id')->order('create_at', 'desc'); diff --git a/plugs/think-plugs-ticket/src/view/repair/index.html b/plugs/think-plugs-ticket/src/view/repair/index.html new file mode 100644 index 0000000..d2bd49d --- /dev/null +++ b/plugs/think-plugs-ticket/src/view/repair/index.html @@ -0,0 +1,72 @@ +{extend name="table"} + +{block name="button"} +{/block} + +{block name="content"} +