|
@@ -227,7 +227,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','dispatch_complete_quantity')
|
|
|
+ ->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','pre_shipment_time')
|
|
|
->whereBetween('out_order_no_time',[$data['out_order_no_time'][0],$data['out_order_no_time'][1]])
|
|
|
->whereIn('id',$msg)
|
|
|
->orderBy('id','desc');
|
|
@@ -248,6 +248,7 @@ class DispatchService extends Service
|
|
|
if(! empty($data['out_crt_man'])) $model->where('out_crt_man', 'LIKE', '%'.$data['out_crt_man'].'%');
|
|
|
if(! empty($data['out_checker_time'][0]) && ! empty($data['out_checker_time'][1])) $model->whereBetween('out_checker_time',[$data['out_checker_time'][0],$data['out_checker_time'][1]]);
|
|
|
if(! empty($data['production_time'][0]) && ! empty($data['production_time'][1])) $model->whereBetween('production_time',[$data['production_time'][0],$data['production_time'][1]]);
|
|
|
+ if(! empty($data['pre_shipment_time'][0]) && ! empty($data['pre_shipment_time'][1])) $model->whereBetween('pre_shipment_time',[$data['pre_shipment_time'][0],$data['pre_shipment_time'][1]]);
|
|
|
if(isset($data['status'])) $model->where('status',$data['status']);
|
|
|
if(isset($data['is_create'])) {
|
|
|
if($data['is_create']){
|
|
@@ -269,7 +270,6 @@ class DispatchService extends Service
|
|
|
$bool = $this->is_same_month($data['out_order_no_time'][0],$data['out_order_no_time'][1]);
|
|
|
if(! $bool) return [false,'制单日期必须同月!'];
|
|
|
|
|
|
-
|
|
|
$time = date("Ymd",$data['out_order_no_time'][0]);
|
|
|
$process_model = new OrdersProductProcess(['channel' => $time]);
|
|
|
if(! $process_model->is_table_isset()) return [true, []];//不存在process子表 返回空数据
|
|
@@ -294,7 +294,7 @@ class DispatchService extends Service
|
|
|
if(! isset($data['is_split'])) return [false,'是否拆分标识不能为空!'];
|
|
|
|
|
|
$result = OrdersProduct::whereIn('id',$data['id'])
|
|
|
- ->select('id as order_product_id','sale_orders_product_id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','production_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','sale_orders_product_id','out_order_no_time','price','customer_name','out_order_no','customer_no')
|
|
|
+ ->select('id as order_product_id','sale_orders_product_id','order_no','table_header_mark','product_no','product_title','product_size','product_unit','production_quantity','technology_material','technology_name','wood_name','process_mark','table_body_mark','sale_orders_product_id','out_order_no_time','price','customer_name','out_order_no','customer_no','pre_shipment_time')
|
|
|
->orderBy('id','desc')
|
|
|
->get()->toArray();
|
|
|
$result_map = array_column($result,null,'order_product_id');
|
|
@@ -339,6 +339,7 @@ class DispatchService 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]['production_time'] = $value['production_time'] ? date('Y-m-d',$value['production_time']) : '';
|
|
|
+ $data['data'][$key]['pre_shipment_time'] = $value['pre_shipment_time'] ? date('Y-m-d',$value['pre_shipment_time']) : '';
|
|
|
$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']] ?? '';
|
|
@@ -536,7 +537,6 @@ class DispatchService extends Service
|
|
|
public function fillDispatchMobileOrderList($data){
|
|
|
if(empty($data)) return $data;
|
|
|
|
|
|
-
|
|
|
foreach ($data as $key => $value){
|
|
|
$data[$key]['un_finished_quantity'] = $value['dispatch_quantity'] - $value['finished_num'] - $value['waste_num'];
|
|
|
}
|