sth
This commit is contained in:
parent
eb7e22ca40
commit
54d79c0197
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\admin\controller\orders;
|
||||
|
||||
use app\admin\model\Order;
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
|
|
@ -41,6 +42,9 @@ class Dispatch extends Backend
|
|||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$orderModel = new Order();
|
||||
|
||||
//当前是否为关联查询
|
||||
$this->relationSearch = true;
|
||||
//设置过滤方法
|
||||
|
|
@ -61,6 +65,8 @@ class Dispatch extends Backend
|
|||
foreach ($list as $row) {
|
||||
$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_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());
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ return [
|
|||
'Customer' => '客户姓名',
|
||||
'Tel' => '客户电话',
|
||||
'Status' => '订单状态',
|
||||
'Status 0' => '草稿',
|
||||
'Set status to 0' => '设为草稿',
|
||||
'Status 10' => '未派单',
|
||||
'Set status to 10' => '设为未派单',
|
||||
'Status 20' => '已派单',
|
||||
|
|
|
|||
|
|
@ -41,11 +41,21 @@ class Order extends Model
|
|||
|
||||
const TAB_REVIEW = 'review'; //回访
|
||||
|
||||
const STATUS_DRAFT = 0; //草稿
|
||||
const STATUS_DISPATCHING = 10; //待派单
|
||||
const STATUS_DISPATCHED = 20; //已派单
|
||||
const STATUS_ING = 30; //进行中
|
||||
const STATUS_CHECKING = 40; //待派单
|
||||
const STATUS_AUDITING = 50; //审核中
|
||||
const STATUS_FINISHED = 60; //已完成
|
||||
const STATUS_CANCEL = -10; //取消
|
||||
|
||||
|
||||
|
||||
|
||||
public function getStatusList()
|
||||
{
|
||||
return ['10' => __('Status 10'), '20' => __('Status 20'), '30' => __('Status 30'), '40' => __('Status 40'), '41' => __('Status 41'), '50' => __('Status 50'), '60' => __('Status 60'), '-10' => __('Status -10')];
|
||||
return ['0' => __('Status 0'),'10' => __('Status 10'), '20' => __('Status 20'), '30' => __('Status 30'), '40' => __('Status 40'), '50' => __('Status 50'), '60' => __('Status 60'), '-10' => __('Status -10')];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -90,15 +100,32 @@ class Order extends Model
|
|||
|
||||
public function tabStatus($tab){
|
||||
$tabStatus = [
|
||||
self::TAB_DISPATCH => [10,20], //派单管理状态
|
||||
self::TAB_PENDING => [20,30,40,41], //订单跟进状态
|
||||
self::TAB_AUDIT => [50,60], //待审核
|
||||
self::TAB_REVIEW => [60],
|
||||
self::TAB_DISPATCH => [
|
||||
self::STATUS_DISPATCHING,
|
||||
self::STATUS_DISPATCHED,
|
||||
self::STATUS_CANCEL
|
||||
], //派单管理状态
|
||||
self::TAB_PENDING => [
|
||||
self::STATUS_DISPATCHED,
|
||||
self::STATUS_ING,
|
||||
self::STATUS_CHECKING,
|
||||
], //订单跟进状态
|
||||
self::TAB_AUDIT => [
|
||||
self::STATUS_AUDITING,
|
||||
self::STATUS_FINISHED
|
||||
], //待审核
|
||||
self::TAB_REVIEW => [
|
||||
self::STATUS_FINISHED
|
||||
],
|
||||
];
|
||||
return $tabStatus[$tab] ?? [];
|
||||
}
|
||||
|
||||
|
||||
public function incomeBtnStatus(){
|
||||
return array_merge($this->tabStatus('pending'),[self::STATUS_AUDITING]);
|
||||
}
|
||||
|
||||
public function user(){
|
||||
return $this->belongsTo(Admin::class,'admin_id',);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,19 @@ class OrderDispatch extends Model
|
|||
self::STATUS_PLANIT,
|
||||
self::STATUS_CLOCK,
|
||||
],
|
||||
'btn_abnormal' => [ //添加异常按钮
|
||||
self::STATUS_TOGET,
|
||||
self::STATUS_GOTIT,
|
||||
self::STATUS_PLANIT,
|
||||
self::STATUS_CLOCK,
|
||||
],
|
||||
'btn_income' => [
|
||||
self::STATUS_TOGET,
|
||||
self::STATUS_GOTIT,
|
||||
self::STATUS_PLANIT,
|
||||
self::STATUS_CLOCK,
|
||||
self::STATUS_FINISH
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,36 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||
}
|
||||
return false;
|
||||
},
|
||||
},
|
||||
{
|
||||
name:"income",
|
||||
text:"新增收款",
|
||||
title:"新增收款",
|
||||
classname:"btn-view btn-dialog",
|
||||
icon:'fa fa-money',
|
||||
url: function(row){
|
||||
return 'orders/income/add?order_id='+row.order_id;
|
||||
},
|
||||
dropdown:"更多",
|
||||
visible:function(row){
|
||||
return true;
|
||||
},
|
||||
refresh:true,
|
||||
},
|
||||
{
|
||||
name:"abnormal",
|
||||
text:"创建异常",
|
||||
title:"创建异常",
|
||||
classname:"btn-add btn-dialog",
|
||||
icon:'fa fa-add',
|
||||
url:function(row) {
|
||||
return "orders/abnormal/add?order_id="+row.order_id
|
||||
},
|
||||
dropdown:"更多",
|
||||
visible:function(row){
|
||||
return true;
|
||||
},
|
||||
//refresh:true,
|
||||
}
|
||||
],
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user