From d3d63f4872c608fbb5c2bb0c8ee5b83aef5fec49 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Sat, 29 Mar 2025 20:54:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BE=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/orders/Dispatch2.php | 19 +++- application/admin/lang/en/orders/income.php | 2 +- .../admin/lang/zh-cn/aftersales/aftersale.php | 2 +- application/admin/lang/zh-cn/order.php | 2 +- .../admin/lang/zh-cn/orders/abnormal.php | 2 +- .../admin/lang/zh-cn/orders/auditorder.php | 4 +- .../admin/lang/zh-cn/orders/configorder.php | 4 +- .../admin/lang/zh-cn/orders/dispatch.php | 4 +- .../admin/lang/zh-cn/orders/dispatch2.php | 6 +- .../admin/lang/zh-cn/orders/income.php | 2 +- .../admin/lang/zh-cn/orders/movelog.php | 2 +- .../admin/lang/zh-cn/orders/revisitorder.php | 4 +- application/admin/model/OrderDispatch.php | 6 +- .../admin/view/aftersales/aftersale/edit.html | 2 +- .../admin/view/orders/dispatch2/edit.html | 105 ++++++++++-------- application/index/lang/zh-cn.php | 2 +- public/assets/js/backend/orders/abnormal.js | 24 ++-- public/assets/js/backend/orders/dispatch2.js | 22 +++- 18 files changed, 127 insertions(+), 87 deletions(-) diff --git a/application/admin/controller/orders/Dispatch2.php b/application/admin/controller/orders/Dispatch2.php index 94eb748..03eda33 100644 --- a/application/admin/controller/orders/Dispatch2.php +++ b/application/admin/controller/orders/Dispatch2.php @@ -14,8 +14,6 @@ use think\exception\DbException; use think\exception\PDOException; use think\exception\ValidateException; use think\Hook; -use think\Lang; -use think\Loader; /** * 派单列管理 @@ -188,12 +186,20 @@ class Dispatch2 extends Backend if (!$row) { $this->error(__('No Results were found')); } + + $order = Order::where('id',$row->id)->with(['area'])->find(); + + if(empty($order)){ + $this->error(__('未找到关联订单')); + } + $adminIds = $this->getDataLimitAdminIds(); if (is_array($adminIds) && !in_array($row[$this->dataLimitField], $adminIds)) { $this->error(__('You have no permission')); } if (false === $this->request->isPost()) { $this->view->assign('row', $row); + $this->view->assign('order', $order); return $this->view->fetch(); } @@ -207,6 +213,10 @@ class Dispatch2 extends Backend if (empty($params)) { $this->error(__('Parameter %s can not be empty', '')); } + + if(!in_array($row->status ,$this->model->btnActiveStatusList('btn_edit'))){ + $this->error(__('任务状态已变更,请刷新后再操作')); + } $params = $this->preExcludeFields($params); $result = false; Db::startTrans(); @@ -216,8 +226,13 @@ class Dispatch2 extends Backend $name = str_replace("\\model\\", "\\validate\\", get_class($this->model)); $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate; $row->validateFailException()->validate($validate); + } + if($row->worker_id != $params['worker_id']){ //更换了师傅 + + } $result = $row->allowField(true)->save($params); + Db::commit(); } catch (ValidateException | PDOException | Exception $e) { Db::rollback(); diff --git a/application/admin/lang/en/orders/income.php b/application/admin/lang/en/orders/income.php index c3ceab9..2b58ba9 100644 --- a/application/admin/lang/en/orders/income.php +++ b/application/admin/lang/en/orders/income.php @@ -3,7 +3,7 @@ return [ 'Id' => 'ID', 'Order_id' => '订单ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Tel' => '客户手机', 'Item_type' => '收款事项', 'Item_type 1' => '定金', diff --git a/application/admin/lang/zh-cn/aftersales/aftersale.php b/application/admin/lang/zh-cn/aftersales/aftersale.php index 140d077..5ca10f3 100644 --- a/application/admin/lang/zh-cn/aftersales/aftersale.php +++ b/application/admin/lang/zh-cn/aftersales/aftersale.php @@ -45,7 +45,7 @@ return [ 'Handle_admin_user' => '处理人', 'Star' => '评分', 'Order.id' => 'ID', - 'Order.order_no' => '订单号', + 'Order.order_no' => '订单编号', 'Order.customer' => '客户姓名', 'Order.tel' => '客户电话', 'Order.status' => '订单状态', diff --git a/application/admin/lang/zh-cn/order.php b/application/admin/lang/zh-cn/order.php index e670f8d..4232711 100644 --- a/application/admin/lang/zh-cn/order.php +++ b/application/admin/lang/zh-cn/order.php @@ -2,7 +2,7 @@ return [ 'Id' => 'ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Customer' => '客户姓名', 'Tel' => '客户电话', 'Status' => '订单状态', diff --git a/application/admin/lang/zh-cn/orders/abnormal.php b/application/admin/lang/zh-cn/orders/abnormal.php index 460cdcf..e980510 100644 --- a/application/admin/lang/zh-cn/orders/abnormal.php +++ b/application/admin/lang/zh-cn/orders/abnormal.php @@ -21,7 +21,7 @@ return [ 'Create_time' => '创建时间', 'Update_time' => '编辑时间', 'Order.id' => 'ID', - 'Order.order_no' => '订单号', + 'Order.order_no' => '订单编号', 'Order.customer' => '客户姓名', 'Order.tel' => '客户电话', 'Order.status' => '订单状态', diff --git a/application/admin/lang/zh-cn/orders/auditorder.php b/application/admin/lang/zh-cn/orders/auditorder.php index 16f856f..8cb14e3 100644 --- a/application/admin/lang/zh-cn/orders/auditorder.php +++ b/application/admin/lang/zh-cn/orders/auditorder.php @@ -3,7 +3,7 @@ return [ 'Id' => 'ID', 'User_id' => '用户ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Customer' => '客户姓名', 'Tel' => '客户电话', 'Status' => '订单状态', @@ -36,7 +36,7 @@ return [ 'Detail' => '订单详情', 'Remark' => '订单备注', 'Images' => '图片', - 'Plan_time' => '客户预约时间', + 'Plan_time' => '预约时间', 'Admin_id' => '录单员ID', 'Total' => '总收款', 'Online_amount' => '线上收款', diff --git a/application/admin/lang/zh-cn/orders/configorder.php b/application/admin/lang/zh-cn/orders/configorder.php index 1ef9259..ce888c7 100644 --- a/application/admin/lang/zh-cn/orders/configorder.php +++ b/application/admin/lang/zh-cn/orders/configorder.php @@ -2,7 +2,7 @@ return [ 'Id' => 'ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Customer' => '客户姓名', 'Tel' => '客户电话', 'Status' => '订单状态', @@ -35,7 +35,7 @@ return [ 'Detail' => '订单详情', 'Remark' => '订单备注', 'Images' => '图片', - 'Plan_time' => '客户预约时间', + 'Plan_time' => '预约时间', 'Admin_id' => '录单员ID', 'Coupon_id' => '优惠码id', 'Total' => '总收款', diff --git a/application/admin/lang/zh-cn/orders/dispatch.php b/application/admin/lang/zh-cn/orders/dispatch.php index c516811..279701f 100644 --- a/application/admin/lang/zh-cn/orders/dispatch.php +++ b/application/admin/lang/zh-cn/orders/dispatch.php @@ -36,7 +36,7 @@ return [ 'Create_time' => '派单时间', 'Update_time' => '编辑时间', 'Order.id' => 'ID', - 'Order.order_no' => '订单号', + 'Order.order_no' => '订单编号', 'Order.customer' => '客户姓名', 'Order.tel' => '客户电话', 'Order.status' => '订单状态', @@ -61,7 +61,7 @@ return [ 'Order.detail' => '订单详情', 'Order.remark' => '订单备注', 'Order.images' => '图片', - 'Order.plan_time' => '客户预约时间', + 'Order.plan_time' => '预约时间', 'Order.admin_id' => '录单员ID', 'Order.coupon_id' => '优惠码id', 'Order.total' => '总收款', diff --git a/application/admin/lang/zh-cn/orders/dispatch2.php b/application/admin/lang/zh-cn/orders/dispatch2.php index 4f886f2..23b36fb 100644 --- a/application/admin/lang/zh-cn/orders/dispatch2.php +++ b/application/admin/lang/zh-cn/orders/dispatch2.php @@ -34,9 +34,9 @@ return [ 'Admin_id' => '派单人ID', 'Admin_user' => '派单人', 'Create_time' => '派单时间', - 'Update_time' => '编辑时间', + 'Update_time' => '更新时间', 'Order.id' => 'ID', - 'Order.order_no' => '订单号', + 'Order.order_no' => '订单编号', 'Order.customer' => '客户姓名', 'Order.tel' => '客户电话', 'Order.status' => '订单状态', @@ -61,7 +61,7 @@ return [ 'Order.detail' => '订单详情', 'Order.remark' => '订单备注', 'Order.images' => '图片', - 'Order.plan_time' => '客户预约时间', + 'Order.plan_time' => '预约时间', 'Order.admin_id' => '录单员ID', 'Order.coupon_id' => '优惠码id', 'Order.total' => '总收款', diff --git a/application/admin/lang/zh-cn/orders/income.php b/application/admin/lang/zh-cn/orders/income.php index 051ddc1..ffaca18 100644 --- a/application/admin/lang/zh-cn/orders/income.php +++ b/application/admin/lang/zh-cn/orders/income.php @@ -3,7 +3,7 @@ return [ 'Id' => 'ID', 'Order_id' => '订单ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Tel' => '客户手机', 'Item_type' => '收款事项', 'Item_type 1' => '定金', diff --git a/application/admin/lang/zh-cn/orders/movelog.php b/application/admin/lang/zh-cn/orders/movelog.php index 57c5f60..6b30dd2 100644 --- a/application/admin/lang/zh-cn/orders/movelog.php +++ b/application/admin/lang/zh-cn/orders/movelog.php @@ -12,7 +12,7 @@ return [ 'Remark' => '备注', 'Create_time' => '创建时间', 'Order.id' => 'ID', - 'Order.order_no' => '订单号', + 'Order.order_no' => '订单编号', 'Order.customer' => '客户姓名', 'Order.tel' => '客户电话', 'Order.status' => '订单状态', diff --git a/application/admin/lang/zh-cn/orders/revisitorder.php b/application/admin/lang/zh-cn/orders/revisitorder.php index 428b6cf..a238d49 100644 --- a/application/admin/lang/zh-cn/orders/revisitorder.php +++ b/application/admin/lang/zh-cn/orders/revisitorder.php @@ -2,7 +2,7 @@ return [ 'Id' => 'ID', - 'Order_no' => '订单号', + 'Order_no' => '订单编号', 'Customer' => '客户姓名', 'Tel' => '客户电话', 'Status' => '订单状态', @@ -35,7 +35,7 @@ return [ 'Detail' => '订单详情', 'Remark' => '订单备注', 'Images' => '图片', - 'Plan_time' => '客户预约时间', + 'Plan_time' => '预约时间', 'Admin_id' => '录单员ID', 'Total' => '总收款', 'Cost' => '师傅成本', diff --git a/application/admin/model/OrderDispatch.php b/application/admin/model/OrderDispatch.php index 983f7e0..005252f 100644 --- a/application/admin/model/OrderDispatch.php +++ b/application/admin/model/OrderDispatch.php @@ -38,7 +38,7 @@ class OrderDispatch extends Model const STATUS_CLOCK = 30; //已打卡 const STATUS_FINISH = 60; //完成 const STATUS_REFUSED = -10; //拒绝 - const STATUS_MOVE = -20; //中转 + const STATUS_MOVE = -20; //中转(状态废弃) const STATUS_CANCEL = -30; //取消 @@ -49,7 +49,9 @@ class OrderDispatch extends Model public function getStatusList() { - return ['0' => __('Status 0'), '10' => __('Status 10'), '20' => __('Status 20'),'25' => __('Status 25'), '30' => __('Status 30'), '60' => __('Status 60'), '-10' => __('Status -10'), '-20' => __('Status -20'), '-30' => __('Status -30')]; + return ['0' => __('Status 0'), '10' => __('Status 10'), '20' => __('Status 20'),'25' => __('Status 25'), '30' => __('Status 30'), '60' => __('Status 60'), '-10' => __('Status -10'), + // '-20' => __('Status -20'), + '-30' => __('Status -30')]; } public function getIsNoticeList() diff --git a/application/admin/view/aftersales/aftersale/edit.html b/application/admin/view/aftersales/aftersale/edit.html index f56e3a4..b0afe98 100644 --- a/application/admin/view/aftersales/aftersale/edit.html +++ b/application/admin/view/aftersales/aftersale/edit.html @@ -3,7 +3,7 @@