From dbfc1cc1457317aa74ebbefd1146665db67b760b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=9F=E5=B7=9D=E4=B8=9C?= Date: Wed, 28 May 2025 15:51:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E3=80=90=E5=90=8E=E7=AB=AFAPI?= =?UTF-8?q?=E3=80=91=E6=96=B0=E5=A2=9E=E6=9B=B4=E6=96=B0=E8=BF=9B=E5=BA=A6?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/services/OrderDispatchService.php | 18 ++++++++++++++++++ .../worker/controller/OrderDispatch.php | 16 ++++++++++++++++ application/worker/validate/OrderDispatch.php | 5 +++++ 3 files changed, 39 insertions(+) diff --git a/application/services/OrderDispatchService.php b/application/services/OrderDispatchService.php index 23ddf93..64fb368 100644 --- a/application/services/OrderDispatchService.php +++ b/application/services/OrderDispatchService.php @@ -245,6 +245,9 @@ class OrderDispatchService extends BaseService 'image', 'finish_time', 'offline_total_type', + 'is_finish_today', + 'estimated_finish_time', + 'work_progress', ]; $res = $this->getOrderDispatchModel() ->with(['orderInfo' => function ($query) use ($orderFields) { @@ -431,6 +434,21 @@ class OrderDispatchService extends BaseService return true; } + + public function updateProgress(int $workerId, array $params) + { + $orderDispatch = $this->getOrderDispatchInfo($workerId, $params['order_dispatch_id']); + $orderDispatch->is_finish_today = $params['is_finish_today']; + $orderDispatch->estimated_finish_time = $params['estimated_finish_time']; + + if ($params['is_finish_today'] == 0) { + $orderDispatch->work_progress = $params['work_progress']; + } + + $orderDispatch->save(); + + return true; + } } diff --git a/application/worker/controller/OrderDispatch.php b/application/worker/controller/OrderDispatch.php index 5e9f151..7aec6cd 100644 --- a/application/worker/controller/OrderDispatch.php +++ b/application/worker/controller/OrderDispatch.php @@ -94,6 +94,22 @@ class OrderDispatch extends WorkerApi $this->success('操作成功', $res); } + /** + * 更新施工进度 + * @return void + */ + public function updateProgress() + { + $params = $this->request->request(); + $validate = $this->validate($params, \app\worker\validate\OrderDispatch::class . '.updateProgress'); + if ($validate !== true) { + $this->error($validate); + } + + $res = $this->getOrderDispatchService()->updateProgress($this->user['id'], $params); + $this->success('操作成功', $res); + } + /** * 修改上门时间 * @return void diff --git a/application/worker/validate/OrderDispatch.php b/application/worker/validate/OrderDispatch.php index 95e8039..4e5553e 100644 --- a/application/worker/validate/OrderDispatch.php +++ b/application/worker/validate/OrderDispatch.php @@ -23,6 +23,10 @@ class OrderDispatch extends Validate 'reject_reason|拒接原因' => 'max:100', 'worker_remark|备注信息' => 'max:500', + + 'is_finish_today|今日完成' => 'require|in:0,1', + 'estimated_finish_time|完成时间' => 'require|date', + 'work_progress|当前施工进度' => 'max:200', ]; protected $message = [ @@ -37,5 +41,6 @@ class OrderDispatch extends Validate 'arrivedOnSite' => ['order_dispatch_id', 'images'], 'completeService' => ['order_dispatch_id', 'complete_images', 'offline_total_type', 'amount', 'payment_image', 'offline_total_type'], 'saveWorkerRemark' => ['order_dispatch_id', 'worker_remark'], + 'updateProgress' => ['order_dispatch_id', 'is_finish_today', 'estimated_finish_time', 'work_progress'], ]; } From d9e862abe6e77fff2145fdaa9d7fa32ca2287bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=9F=E5=B7=9D=E4=B8=9C?= Date: Fri, 30 May 2025 14:04:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E3=80=90=E5=90=8E=E7=AB=AFAPI?= =?UTF-8?q?=E3=80=91=E5=B0=8F=E7=A8=8B=E5=BA=8F=E4=BB=85=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=B4=BE=E5=8D=95=E7=9A=84=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=EF=BC=9B=E5=90=8E=E5=8F=B0=E8=B7=9F=E8=BF=9B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BD=93=E5=89=8D=E8=BF=9B=E5=BA=A6=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/services/OrderDispatchService.php | 2 ++ public/assets/js/backend/orders/dispatch2.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/application/services/OrderDispatchService.php b/application/services/OrderDispatchService.php index 64fb368..d7e7cc1 100644 --- a/application/services/OrderDispatchService.php +++ b/application/services/OrderDispatchService.php @@ -26,6 +26,7 @@ class OrderDispatchService extends BaseService )->field('id,order_no,item_id,item_title,receive_type,address,lng,lat,plan_time,online_amount,discount_amount,area_id,status,coupon_id'); }]) ->where('status', OrderDispatch::STATUS_TOGET) + ->where('type', '<>', 1) ->where('worker_id', $workerId) ->field(['id', 'order_id', 'status', 'remark', 'create_time']) ->order('id desc') @@ -88,6 +89,7 @@ class OrderDispatchService extends BaseService } ])->field('id,order_no,item_id,item_title,receive_type,address,lng,lat,plan_time,online_amount,discount_amount,area_id,customer,tel,status,coupon_id'); }]) + ->where('type', '<>', 1) ->where('worker_id', $workerId); switch ($type) { diff --git a/public/assets/js/backend/orders/dispatch2.js b/public/assets/js/backend/orders/dispatch2.js index 8b229e9..3be37b6 100644 --- a/public/assets/js/backend/orders/dispatch2.js +++ b/public/assets/js/backend/orders/dispatch2.js @@ -109,6 +109,21 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($, // {field: 'is_notice', title: __('Is_notice'), searchList: {"0":__('Is_notice 0'),"1":__('Is_notice 1')}, formatter: Table.api.formatter.normal}, // {field: 'admin_id', title: __('Admin_id')}, + { + field: 'is_finish_today', + title: '今日完成', + searchList: { + '0':'不能', + "1": '能', + }, + formatter: Table.api.formatter.label, + custom: { + '0': 'warning', + '1': 'success', + }, + }, + {field: 'estimated_finish_time', title: __('师傅预估完成时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, + {field: 'work_progress', title: __('当前施工进度'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'admin_user', title: __('Admin_user'), operate: 'LIKE'}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'update_time', title: __('Update_time'), operate:false, addclass:'datetimerange', autocomplete:false},