From 646b58c8514174cfa9c449040c33fdea58306952 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com> Date: Thu, 26 Jun 2025 18:16:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B7=A5=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/workorder/controller/Index.php | 28 ++- app/workorder/view/index/add.html | 225 +++++++++++--------- app/workorder/view/index/edit.html | 305 +++++++++++++++++----------- app/workorder/view/index/index.html | 56 +---- app/workorder/view/index/view.html | 156 ++++++++++++++ 5 files changed, 494 insertions(+), 276 deletions(-) create mode 100644 app/workorder/view/index/view.html diff --git a/app/workorder/controller/Index.php b/app/workorder/controller/Index.php index bae2cb4..426982b 100644 --- a/app/workorder/controller/Index.php +++ b/app/workorder/controller/Index.php @@ -25,7 +25,7 @@ class Index extends BaseController $list = WorkOrderList::withoutField('') ->where('delete_time', null) - ->order('status asc') + ->order(['status' => 'asc', 'id' => 'desc']) ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $wo = WorkOrderList::where(['id' => $item->id])->find(); @@ -141,14 +141,26 @@ class Index extends BaseController { $param = get_params(); $id = isset($param['id']) ? $param['id'] : 0; - $detail = (new WorkOrderList())->detail($id); - // print_r($id); - if (empty($detail)) { - return to_assign(1, '2.信息不存在'); - } else { - View::assign('detail', $detail); - // print_r($detail); + if (empty($id)) { + return to_assign(1, '参数错误,缺少ID'); + } + $view = WorkOrderList::where('id', $id)->find(); + if ($view) { + $projectName = Db::name('Project')->where('id', $view['project_id'])->value('name_short'); + $view['project_id'] = $projectName ?: '-'; + if (!empty($view['contact'])) { + $view->contact = $view['contact']; + } else { + $view->contact = Db::name('Admin')->where('id', $view['creater'])->value('mobile') ?: '-'; + } + $adminName = Db::name('Admin')->where('id', $view['creater'])->value('name'); + $view->creater = $adminName ?: '-'; + $solveName = Db::name('Admin')->where('id', $view['solve'])->value('name'); + $view->solve = $solveName ?: '-'; + View::assign('view', $view); return view(); + } else { + return to_assign(1, '信息不存在'); } } diff --git a/app/workorder/view/index/add.html b/app/workorder/view/index/add.html index 23c7a82..3fcacfe 100644 --- a/app/workorder/view/index/add.html +++ b/app/workorder/view/index/add.html @@ -1,100 +1,129 @@
- - \ No newline at end of file + + + + +