Merge pull request 'feat(admin): 优化仓库产品列表和提前订单列表' (#354) from dev into main

Reviewed-on: #354
This commit is contained in:
mkm 2024-11-21 15:59:15 +08:00
commit a86b4c18ce
3 changed files with 15 additions and 2 deletions

View File

@ -11,6 +11,7 @@ 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;
use app\common\model\warehouse_order\WarehouseOrder;
/**
* 预订单表列表
@ -49,6 +50,8 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
public function lists(): array
{
$warehouse_type = $this->request->get('warehouse_type', 0);
$order_rk = $this->request->get('order_rk', '');
$order_ck = $this->request->get('order_ck', '');
switch ($warehouse_type) {
case 1:
@ -67,6 +70,13 @@ class BeforehandOrderLists extends BaseAdminDataLists implements ListsSearchInte
default:
break;
}
if ($order_rk!='') {
$oid=WarehouseOrder::where('financial_pm',1)->where('code','like','%'.$order_rk)->column('id');
$this->searchWhere[] = ['warehousing_id','in',$oid];
}elseif ($order_ck!='') {
$oid=WarehouseOrder::where('financial_pm',0)->where('code','like','%'.$order_ck)->column('oid');
$this->searchWhere[] = ['outbound_id','in',$oid];
}
return BeforehandOrder::where($this->searchWhere)
->field(['id', 'order_id', 'order_sn','store_id', 'order_type', 'total_num', 'total_price', 'outbound_id', 'admin_id', 'create_time', 'status', 'mark', 'warehousing_id', 'file'])
->limit($this->limitOffset, $this->limitLength)

View File

@ -73,7 +73,7 @@ class WarehouseProductLists extends BaseAdminDataLists implements ListsSearchInt
}
}
return WarehouseProduct::where($this->searchWhere)
->field(['id', 'oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay'])
->field(['id', 'pay_type','oid','admin_id','supplier_id', 'store_id', 'warehouse_id', 'product_id', 'financial_pm', 'batch', 'nums', 'price', 'purchase', 'cost', 'total_price', 'manufacture', 'expiration_date', 'status', 'mark', 'create_time','is_pay'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->withTrashed()

View File

@ -188,7 +188,7 @@ class WarehouseProductLogic extends BaseLogic
* @author admin
* @date 2024/07/31 16:55
*/
public static function edit(array $params): bool
public static function edit(array $params)
{
Db::startTrans();
@ -219,6 +219,9 @@ class WarehouseProductLogic extends BaseLogic
$after_nums = bcsub($warehouseProductStorege['nums'], $params['nums'], 2);
}
WarehouseProduct::where('id', $params['id'])->update([
'nums' => $params['nums'],
'supplier_id' => $params['supplier_id'],
'pay_type' => $params['pay_type'],
'nums' => $params['nums'],
'purchase' => $params['purchase'],
'before_nums' => $before_nums,