This commit is contained in:
xman 2025-03-10 17:53:16 +08:00
parent d81a1a14b7
commit 74da2843ad
2 changed files with 30 additions and 2 deletions

View File

@ -201,6 +201,8 @@ class Dispatch extends Backend
} }
$list = $this->model->where($pk, 'in', $ids)->whereIn('status',$this->model->deleteStatusList())->select(); $list = $this->model->where($pk, 'in', $ids)->whereIn('status',$this->model->deleteStatusList())->select();
$remark = $this->request->param('remark','');
$count = 0; $count = 0;
Db::startTrans(); Db::startTrans();
try { try {
@ -211,7 +213,7 @@ class Dispatch extends Backend
$this->error('订单状态已变更,请刷新后操作'); $this->error('订单状态已变更,请刷新后操作');
} }
//取消 //取消
$item->update(['status'=>OrderDispatch::STATUS_CANCEL]); $item->update(['status'=>OrderDispatch::STATUS_CANCEL,'remark'=>$remark]);
//回退订单状态 //回退订单状态
$order->update(['status'=>Order::STATUS_DISPATCHING]); $order->update(['status'=>Order::STATUS_DISPATCHING]);
@ -219,6 +221,9 @@ class Dispatch extends Backend
$params['role'] = 1; $params['role'] = 1;
$params['auth'] = $this->auth; $params['auth'] = $this->auth;
$params['remark'] = '派单被取消[ID'.$item->id.'],订单状态回退'; $params['remark'] = '派单被取消[ID'.$item->id.'],订单状态回退';
if(!empty($remark)){
$params['remark'] .= ',操作备注:'.$remark;
}
Hook::listen('order_change',$params); Hook::listen('order_change',$params);
} }
Db::commit(); Db::commit();

View File

@ -1,4 +1,4 @@
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($, undefined, Backend, Table, Form) {
var Controller = { var Controller = {
index: function () { index: function () {
@ -87,6 +87,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
//title: __('Del'), //title: __('Del'),
extend: 'data-toggle="tooltip" data-container="body"', extend: 'data-toggle="tooltip" data-container="body"',
classname: 'btn btn-xs btn-danger btn-delone', classname: 'btn btn-xs btn-danger btn-delone',
click: function (data, row) {
layer.prompt({
formType: 2,
value: '',
title: '请输入备注',
maxlength: 140,
},function(value, index, elem) {
var url = 'orders/dispatch/del' + row.id;
var options = {url: url, data: {remark: value}};
Fast.api.ajax(options, function (data, ret) {
// table.trigger("uncheckbox");
table.bootstrapTable('refresh');
})
},function (data, ret) {
var error = $(this).data("error") || $.noop;
if (typeof error === 'function') {
if (false === error.call(this, data, ret)) {
return false;
}
}
});
layer.close(index);
},
visible:function(row){ visible:function(row){
if(row.btn_cancel){ if(row.btn_cancel){
return true; return true;