sth
This commit is contained in:
parent
d81a1a14b7
commit
74da2843ad
|
|
@ -201,6 +201,8 @@ class Dispatch extends Backend
|
|||
}
|
||||
$list = $this->model->where($pk, 'in', $ids)->whereIn('status',$this->model->deleteStatusList())->select();
|
||||
|
||||
$remark = $this->request->param('remark','');
|
||||
|
||||
$count = 0;
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
|
@ -211,7 +213,7 @@ class Dispatch extends Backend
|
|||
$this->error('订单状态已变更,请刷新后操作');
|
||||
}
|
||||
//取消
|
||||
$item->update(['status'=>OrderDispatch::STATUS_CANCEL]);
|
||||
$item->update(['status'=>OrderDispatch::STATUS_CANCEL,'remark'=>$remark]);
|
||||
//回退订单状态
|
||||
$order->update(['status'=>Order::STATUS_DISPATCHING]);
|
||||
|
||||
|
|
@ -219,6 +221,9 @@ class Dispatch extends Backend
|
|||
$params['role'] = 1;
|
||||
$params['auth'] = $this->auth;
|
||||
$params['remark'] = '派单被取消[ID:'.$item->id.'],订单状态回退';
|
||||
if(!empty($remark)){
|
||||
$params['remark'] .= ',操作备注:'.$remark;
|
||||
}
|
||||
Hook::listen('order_change',$params);
|
||||
}
|
||||
Db::commit();
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
index: function () {
|
||||
|
|
@ -87,6 +87,29 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
//title: __('Del'),
|
||||
extend: 'data-toggle="tooltip" data-container="body"',
|
||||
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){
|
||||
if(row.btn_cancel){
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user