From 51b3dec40cf480986b66a0c59100adee0e232528 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Mon, 2 Jun 2025 15:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AE=A2=E5=8D=95=E9=87=8D?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/orders/Dispatchlog.php | 14 ++- application/admin/model/OrderLog.php | 12 --- .../admin/view/orders/dispatchlog/index.html | 98 ++++++++++++------- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/application/admin/controller/orders/Dispatchlog.php b/application/admin/controller/orders/Dispatchlog.php index ec2a273..a6c8f19 100644 --- a/application/admin/controller/orders/Dispatchlog.php +++ b/application/admin/controller/orders/Dispatchlog.php @@ -2,6 +2,8 @@ namespace app\admin\controller\orders; +use app\admin\model\OrderDispatch; +use app\admin\model\OrderLog; use app\common\controller\Backend; use think\exception\DbException; use think\response\Json; @@ -53,14 +55,22 @@ class Dispatchlog extends Backend if (false === $this->request->isAjax()) { //page2变更日志 - + $dispatch = OrderDispatch::where('id',$dispatch_id)->find(); + $orderLogs = OrderLog::where('order_id',$dispatch->order_id)->order('id','desc')->select(); $logs = $this->model ->where('dispatch_id',$dispatch_id) ->order('id','desc') ->select(); - $this->view->assign('logs',json_encode($logs)); + $firstLog = end($logs); + foreach ($orderLogs as $item) { + if($item->order_status == 20 && $item->create_time <= $firstLog->create_time){ + $item->progress_logs = $logs; + break; + } + } + $this->view->assign('logs',json_encode($orderLogs)); return $this->view->fetch(); } //如果发送的来源是 Selectpage,则转发到 Selectpage diff --git a/application/admin/model/OrderLog.php b/application/admin/model/OrderLog.php index 86a64e1..d136bfa 100644 --- a/application/admin/model/OrderLog.php +++ b/application/admin/model/OrderLog.php @@ -24,11 +24,6 @@ class OrderLog extends Model protected $updateTime = false; protected $deleteTime = false; - // 追加属性 - protected $append = [ - 'order_status_text' - ]; - public function getOrderStatusList() @@ -37,13 +32,6 @@ class OrderLog extends Model } - public function getOrderStatusTextAttr($value, $data) - { - $value = $value ?: ($data['order_status'] ?? ''); - $list = $this->getOrderStatusList(); - return $list[$value] ?? ''; - } - diff --git a/application/admin/view/orders/dispatchlog/index.html b/application/admin/view/orders/dispatchlog/index.html index 1299795..be68c98 100644 --- a/application/admin/view/orders/dispatchlog/index.html +++ b/application/admin/view/orders/dispatchlog/index.html @@ -62,66 +62,96 @@ margin-top: 8px; } + /* 内层进度日志样式 */ + .timeline-progress { + margin-top: 10px; + border-left: 2px solid #d0d4db; + padding-left: 15px; + } + + .timeline-progress-item { + margin-bottom: 8px; + } + + .progress-time { + font-size: 11px; + color: #888; + margin-right: 8px; + } + + .progress-user { + font-weight: 600; + color: #409EFF; + margin-right: 6px; + } + + .progress-remark { + color: #555; + }
- -
- - -
- -
-
- -
-
-
- - - -
-
+
-