|
@@ -151,7 +151,7 @@ class ProductionOrderService extends Service
|
|
|
|
|
|
public function orderList($data){
|
|
|
$model = OrdersProduct::where('del_time',0)
|
|
|
- ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id')
|
|
|
+ ->select('id','order_no','out_order_no','out_order_no_time','customer_no','customer_name','table_header_mark','product_no','product_title','product_size','product_unit','order_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','out_crt_man','out_checker_man','out_checker_time','production_quantity','production_time','production_no','status','sale_orders_product_id','dispatch_complete_quantity')
|
|
|
->orderBy('id','desc');
|
|
|
|
|
|
if(! empty($data['order_no'])) $model->where('order_no', 'LIKE', '%'.$data['order_no'].'%');
|
|
@@ -210,12 +210,16 @@ class ProductionOrderService extends Service
|
|
|
$sale_orders_product_id = array_unique(array_column($data['data'],'sale_orders_product_id'));
|
|
|
$production_map = $this->getProductionOrderQuantity($sale_orders_product_id);
|
|
|
|
|
|
-
|
|
|
foreach ($data['data'] as $key => $value){
|
|
|
$data['data'][$key]['out_order_no_time'] = $value['out_order_no_time'] ? date('Y-m-d',$value['out_order_no_time']) : '';
|
|
|
$data['data'][$key]['out_checker_time'] = $value['out_checker_time'] ? date('Y-m-d',$value['out_checker_time']) : '';
|
|
|
$data['data'][$key]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
|
|
|
$data['data'][$key]['not_production'] = $value['order_quantity'] - ($production_map[$value['sale_orders_product_id']] ?? 0);
|
|
|
+ if($value['dispatch_complete_quantity'] >= $value['production_quantity']){
|
|
|
+ $data['data'][$key]['is_create'] = 1;
|
|
|
+ }else{
|
|
|
+ $data['data'][$key]['is_create'] = 0;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return $data;
|