cqpCow vor 2 Jahren
Ursprung
Commit
b136fef377

+ 6 - 1
app/Service/DispatchService.php

@@ -221,7 +221,7 @@ class DispatchService extends Service
         if(! $status) return [false, $msg];
 
         $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','crt_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','crt_id','dispatch_complete_quantity')
             ->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]])
             ->whereIn('id',$msg)
             ->orderBy('id','desc');
@@ -336,6 +336,11 @@ class DispatchService extends Service
             $data['data'][$key]['dispatch_quantity'] = $map[$value['id']] ?? 0;
             $data['data'][$key]['not_dispatch_quantity'] = $value['production_quantity'] - ($map[$value['id']] ?? 0);
             $data['data'][$key]['order_product_man'] = $emp_map[$value['crt_id']] ?? '';
+            if($value['dispatch_complete_quantity'] >= $value['production_quantity']){
+                $data['data'][$key]['is_create'] = 1;
+            }else{
+                $data['data'][$key]['is_create'] = 0;
+            }
         }
         $data['production_quantity'] = array_sum(array_column($data['data'], 'production_quantity'));
         $data['dispatch_quantity'] = array_sum(array_column($data['data'], 'dispatch_quantity'));

+ 5 - 0
app/Service/FyyOrderService.php

@@ -165,6 +165,11 @@ class FyyOrderService extends Service
             $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]['product_quantity_on_hand'] = $detailMap[$keys] ?? 0;
+            if($value['production_quantity'] >= $value['order_quantity']){
+                $data['data'][$key]['is_create'] = 1;
+            }else{
+                $data['data'][$key]['is_create'] = 0;
+            }
         }
         $data['order_quantity'] = array_sum(array_column($data['data'], 'order_quantity'));
         $data['finished_num'] = array_sum(array_column($data['data'], 'finished_num'));

+ 6 - 2
app/Service/ProductionOrderService.php

@@ -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;