|
@@ -23,6 +23,7 @@ use App\Model\SeeRange;
|
|
use App\Model\SportsBag;
|
|
use App\Model\SportsBag;
|
|
use App\Model\SportsBagProductInfo;
|
|
use App\Model\SportsBagProductInfo;
|
|
use App\Model\WxEmployee;
|
|
use App\Model\WxEmployee;
|
|
|
|
+use App\Service\Weixin\WxSendMessageService;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -686,7 +687,7 @@ class SalesOrderService extends Service
|
|
public function salesOrderList($data,$user){
|
|
public function salesOrderList($data,$user){
|
|
$model = SalesOrder::Clear($user,$data);
|
|
$model = SalesOrder::Clear($user,$data);
|
|
$model = $model->where('del_time',0)
|
|
$model = $model->where('del_time',0)
|
|
- ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact')
|
|
|
|
|
|
+ ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact','is_confirm')
|
|
->orderby('id', 'desc');
|
|
->orderby('id', 'desc');
|
|
|
|
|
|
if(! empty($data['order_number'])) $model->where('order_number','LIKE', '%'.$data['order_number'].'%');
|
|
if(! empty($data['order_number'])) $model->where('order_number','LIKE', '%'.$data['order_number'].'%');
|
|
@@ -948,6 +949,7 @@ class SalesOrderService extends Service
|
|
$data['data'][$key]['state_title'] = SalesOrder::$state2[$value['state']] ?? '';
|
|
$data['data'][$key]['state_title'] = SalesOrder::$state2[$value['state']] ?? '';
|
|
}
|
|
}
|
|
$data['data'][$key]['invoice_state_name'] = SalesOrder::$invoice_state[$value['invoice_state']] ?? '';
|
|
$data['data'][$key]['invoice_state_name'] = SalesOrder::$invoice_state[$value['invoice_state']] ?? '';
|
|
|
|
+ $data['data'][$key]['is_confirm_title'] = $value['is_confirm'] ? "已接收" : "未接收" ;
|
|
$tmp = $invoiceData[$value['id']] ?? [];
|
|
$tmp = $invoiceData[$value['id']] ?? [];
|
|
$data['data'][$key]['invoice_arr'] = implode(',', $tmp);
|
|
$data['data'][$key]['invoice_arr'] = implode(',', $tmp);
|
|
$data['data'][$key]['dispatch_company'] = $dispatch[$value['id']] ?? '';
|
|
$data['data'][$key]['dispatch_company'] = $dispatch[$value['id']] ?? '';
|
|
@@ -1134,6 +1136,27 @@ class SalesOrderService extends Service
|
|
return [false,$exception->getMessage()];
|
|
return [false,$exception->getMessage()];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ $depart_id = $data['dispatch_depart_two'][0] ?? 0;
|
|
|
|
+ if(! empty($depart_id) && $depart_id != $msg['top_depart_id']){
|
|
|
|
+ //发送消息
|
|
|
|
+ $notify_id = Depart::where('id',$depart_id)->value('notify_id');
|
|
|
|
+ if(! empty($notify_id)){
|
|
|
|
+ $emp_name = Employee::whereIn('id',[$msg['crt_id'], $notify_id])->pluck('emp_name','id')->toArray();
|
|
|
|
+ $tmp_data = [
|
|
|
|
+ $msg['order_number'],
|
|
|
|
+ $emp_name[$msg['crt_id']] ?? "",
|
|
|
|
+ $emp_name[$notify_id] ?? "",
|
|
|
|
+ date('Y-m-d H:i:s'),
|
|
|
|
+ ];
|
|
|
|
+ (new OaService())->sendWxMsg($notify_id,1,1,37,$tmp_data);
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ //直接确认
|
|
|
|
+ SalesOrder::where('del_time',0)->where('id',$msg['id'])->update([
|
|
|
|
+ 'is_confirm' => 1,
|
|
|
|
+ ]);
|
|
|
|
+ }
|
|
|
|
+
|
|
return [true,''];
|
|
return [true,''];
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1185,7 +1208,7 @@ class SalesOrderService extends Service
|
|
|
|
|
|
public function salesOrderListsalesOrderWxList($data,$user){
|
|
public function salesOrderListsalesOrderWxList($data,$user){
|
|
$model = SalesOrder::where('del_time',0)
|
|
$model = SalesOrder::where('del_time',0)
|
|
- ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact')
|
|
|
|
|
|
+ ->select('id','sales_order_type','model_type','order_number','selling_price','vin_no','car_type','order_type','customer_id','sign_time','crt_id','crt_time','mark','product_total','rate','construction_time','handover_time','other_fee','discount_fee','contract_fee','pay_way','car_type','year','mileage','color','original_set','processing','state','invoice_state','plat_type','plat_order','install_method','install_position','customer_contact','is_confirm')
|
|
->orderby('id', 'desc');
|
|
->orderby('id', 'desc');
|
|
|
|
|
|
if(! empty($data['openid'])){
|
|
if(! empty($data['openid'])){
|