feat(admin): 优化仓库补货订单处理逻辑
- 在预订单列表中添加"无须出库"标识,方便区分仓库补货订单 - 优化订单处理逻辑,禁止为仓库补货订单创建出库单 - 增加未设置商品提示,提高用户体验
This commit is contained in:
parent
f93a8d8a1f
commit
0cfe453652
@ -10,6 +10,7 @@ use app\common\model\auth\Admin;
|
||||
use app\common\model\purchase_product_offer\PurchaseProductOffer;
|
||||
use app\common\model\system_store\SystemStore;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\beforehand_order_cart_info\BeforehandOrderCartInfo;
|
||||
|
||||
/**
|
||||
* 预订单表列表
|
||||
@ -51,6 +52,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($item){
|
||||
$item['outbound']='';
|
||||
if($item->admin_id){
|
||||
$item->admin_name=Admin::where(['id'=>$item->admin_id])->value('name');
|
||||
}else{
|
||||
@ -66,6 +68,7 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
$item->order_type_name='线上订单';
|
||||
}elseif($item->order_type==5){
|
||||
$item->order_type_name='仓库补货';
|
||||
$item->outbound='无须出库';
|
||||
}elseif($item->order_type==6){
|
||||
$item->order_type_name='往期补单';
|
||||
}
|
||||
@ -79,8 +82,13 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
$item->msg='商品没有入库';
|
||||
}
|
||||
}
|
||||
if($item->msg==''){
|
||||
$count=BeforehandOrderCartInfo::where('is_buyer',0)->count('id');
|
||||
if($count>0){
|
||||
$item->msg='有'.$count.'个商品未设置';
|
||||
}
|
||||
}
|
||||
$item['warehousing']='';
|
||||
$item['outbound']='';
|
||||
$item['system_store']='';
|
||||
if($item['warehousing_id']>0){
|
||||
$item->warehousing='已入库|'.$item['warehousing_id'];
|
||||
|
@ -345,6 +345,9 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
if (!$order) {
|
||||
throw new BusinessException('该订单不存在');
|
||||
}
|
||||
if($order['order_type']==5){
|
||||
throw new BusinessException('仓库补货,不用出库');
|
||||
}
|
||||
if ($order['outbound_id'] > 0) {
|
||||
throw new BusinessException('该订单已创建出库单');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user