diff --git a/application/admin/controller/orders/Dispatch2.php b/application/admin/controller/orders/Dispatch2.php index 9df5649..f8d4129 100644 --- a/application/admin/controller/orders/Dispatch2.php +++ b/application/admin/controller/orders/Dispatch2.php @@ -79,6 +79,8 @@ class Dispatch2 extends Backend $row->btn_edit = (in_array($row->status, $this->model->btnActiveStatusList('btn_edit'))) ? true : false; $row->btn_cancel = (in_array($row->status, $this->model->btnActiveStatusList('btn_cancel'))) ? true : false; $row->btn_abnormal = (in_array($row->status, $this->model->btnActiveStatusList('btn_abnormal'))) ? true : false; + $row->btn_finished = (in_array($row->status, $this->model->btnActiveStatusList('btn_finished'))) ? true : false; + $row->is_disabled = (in_array($row->status, $this->model->btnActiveStatusList('disabled_status'))) ? true : false; // $row->btn_income = (in_array($row->status, $this->model->btnActiveStatusList('btn_income')) && in_array($row->order->status, $orderModel->incomeBtnStatus())) ? true : false; } $result = array("total" => $list->total(), "rows" => $list->items()); diff --git a/application/admin/lang/zh-cn/orders/dispatch2.php b/application/admin/lang/zh-cn/orders/dispatch2.php index 9fc67a1..a5663e2 100644 --- a/application/admin/lang/zh-cn/orders/dispatch2.php +++ b/application/admin/lang/zh-cn/orders/dispatch2.php @@ -13,7 +13,7 @@ return [ 'Set status to 0' => '设为待接单', 'Status 10' => '已接单', 'Set status to 10' => '设为已接单', - 'Status 25' => '已开始', + 'Status 25' => '任务超时', 'Set status to 25' => '设为已开始', 'Status 20' => '已预约', 'Set status to 20' => '设为已预约', diff --git a/application/admin/model/OrderDispatch.php b/application/admin/model/OrderDispatch.php index 00cec31..983f7e0 100644 --- a/application/admin/model/OrderDispatch.php +++ b/application/admin/model/OrderDispatch.php @@ -34,6 +34,7 @@ class OrderDispatch extends Model const STATUS_TOGET = 0; //待接 const STATUS_GOTIT = 10; //已接 const STATUS_PLANIT = 20; //已预约 + const STATUS_OVERTIME = 25; //超时(过了预约时间) const STATUS_CLOCK = 30; //已打卡 const STATUS_FINISH = 60; //完成 const STATUS_REFUSED = -10; //拒绝 @@ -86,6 +87,7 @@ class OrderDispatch extends Model self::STATUS_TOGET, self::STATUS_GOTIT, self::STATUS_PLANIT, + self::STATUS_OVERTIME, self::STATUS_CLOCK, ]; } @@ -112,27 +114,37 @@ class OrderDispatch extends Model self::STATUS_TOGET, self::STATUS_GOTIT, self::STATUS_PLANIT, + self::STATUS_OVERTIME, self::STATUS_CLOCK, ], 'btn_cancel' => [ //取消按钮 self::STATUS_TOGET, self::STATUS_GOTIT, self::STATUS_PLANIT, + self::STATUS_OVERTIME, self::STATUS_CLOCK, ], 'btn_abnormal' => [ //添加异常按钮 self::STATUS_TOGET, self::STATUS_GOTIT, self::STATUS_PLANIT, + self::STATUS_OVERTIME, self::STATUS_CLOCK, ], 'btn_finished' => [ self::STATUS_TOGET, self::STATUS_GOTIT, self::STATUS_PLANIT, + self::STATUS_OVERTIME, self::STATUS_CLOCK, - self::STATUS_FINISH + //self::STATUS_FINISH ], + 'disabled_status' => [ + self::STATUS_FINISH, + self::STATUS_CANCEL, + self::STATUS_REFUSED, + self::STATUS_MOVE + ] ]; return $btns[$btn]??[]; diff --git a/public/assets/js/backend/orders/dispatch2.js b/public/assets/js/backend/orders/dispatch2.js index 86fae35..d5fa767 100644 --- a/public/assets/js/backend/orders/dispatch2.js +++ b/public/assets/js/backend/orders/dispatch2.js @@ -26,7 +26,18 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($, fixedRightNumber: 1, columns: [ [ - {checkbox: true}, + //{checkbox: true}, + {checkbox: true, formatter: function (value, row, index) { + // 根据 is_selectable 字段控制是否禁用 +// return row.is_selectable ? '' : {disabled: true}; + if(row.is_disabled === true){ + return { + disabled: true + }; + } + return ''; + }}, + {field: 'id', title: __('Id')}, //{field: 'order_id', title: __('Order_id')},