Browse Source

Merge branch 'master' of ssh://47.103.131.176:10022/var/git/bswas

zhouzhendong 4 years ago
parent
commit
d8344b4532
34 changed files with 2082 additions and 14 deletions
  1. 47 0
      app/Console/Commands/EndReceivingTask.php
  2. 3 0
      app/Console/Kernel.php
  3. 86 0
      app/Filters/ReceivingTaskFilters.php
  4. 35 0
      app/Http/Controllers/OracleDOCAsnHeaderController.php
  5. 75 0
      app/Http/Controllers/ReceivingTaskController.php
  6. 85 0
      app/Http/Controllers/ReceivingTaskItemController.php
  7. 2 0
      app/Http/Controllers/TestController.php
  8. 61 0
      app/Http/Requests/Api/ReceivingTaskRequest.php
  9. 1 1
      app/OracleDOCASNDetail.php
  10. 11 3
      app/OracleDOCASNHeader.php
  11. 5 1
      app/Providers/AppServiceProvider.php
  12. 63 0
      app/ReceivingTask.php
  13. 27 0
      app/ReceivingTaskItem.php
  14. 7 0
      app/Services/AuthorityService.php
  15. 4 0
      app/Services/OracleDocAsnDetailService.php
  16. 13 2
      app/Services/OracleDocAsnHerderService.php
  17. 6 5
      app/Services/OrderService.php
  18. 1 1
      app/Services/OwnerService.php
  19. 27 0
      app/Services/ReceivingTaskItemService.php
  20. 134 0
      app/Services/ReceivingTaskService.php
  21. 44 0
      app/Utils/IdCreate.php
  22. 0 1
      app/WorkOrder.php
  23. 12 0
      database/factories/ReceivingTaskFactory.php
  24. 11 0
      database/factories/ReceivingTaskItemFactory.php
  25. 49 0
      database/migrations/2021_12_22_153152_create_receiving_tasks_table.php
  26. 33 0
      database/migrations/2021_12_22_163154_create_receiving_task_items_table.php
  27. 16 0
      database/seeds/ReceivingTaskItemSeeder.php
  28. 16 0
      database/seeds/ReceivingTaskSeeder.php
  29. 18 0
      resources/views/store/receivingTasks/_clodop_print.blade.php
  30. 55 0
      resources/views/store/receivingTasks/_receiving_task_print.blade.php
  31. 766 0
      resources/views/store/receivingTasks/create.blade.php
  32. 348 0
      resources/views/store/receivingTasks/index.blade.php
  33. 13 0
      routes/apiLocal.php
  34. 8 0
      routes/web.php

+ 47 - 0
app/Console/Commands/EndReceivingTask.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Console\Commands;
+
+use App\Services\ReceivingTaskService;
+use Carbon\Carbon;
+use Illuminate\Console\Command;
+
+class EndReceivingTask extends Command
+{
+    /**
+     * The name and signature of the console command.
+     *
+     * @var string
+     */
+    protected $signature = 'receivingTask:batch end';
+
+    /**
+     * The console command description.
+     *
+     * @var string
+     */
+    protected $description = '延时完结 入库开单任务';
+
+    /**
+     * Create a new command instance.
+     *
+     * @return void
+     */
+    public function __construct()
+    {
+        parent::__construct();
+    }
+
+    /**
+     * Execute the console command.
+     *
+     * @return int
+     */
+    public function handle(): int
+    {
+        /** @var ReceivingTaskService $service */
+        $service = app(ReceivingTaskService::class);
+        $service->overtimeToCompleteTask();
+        return 1;
+    }
+}

+ 3 - 0
app/Console/Kernel.php

@@ -6,6 +6,7 @@ use App\Console\Commands\BeforeCreateOwnerReport;
 use App\Console\Commands\ClearCancelledOrderTask;
 use App\Console\Commands\CreateProcurementTotalBill;
 use App\Console\Commands\CreateWeightStatistic;
+use App\Console\Commands\EndReceivingTask;
 use App\Console\Commands\FluxOrderFix;
 use App\Console\Commands\InventoryDailyLoggingOwner;
 use App\Console\Commands\LogExpireDelete;
@@ -55,6 +56,7 @@ class  Kernel extends ConsoleKernel
         CreateProcurementTotalBill::class,
         SyncCarrier::class,
         ReceiveRecord::class,
+        EndReceivingTask::class,
     ];
 
     /**
@@ -95,6 +97,7 @@ class  Kernel extends ConsoleKernel
         $schedule->job(new CalculationArrivedManNumJob(now()->subDays(2)->startOfDay()))->dailyAt('01:01')->runInBackground();//生成实际到岗人数数据
 
         $schedule->command("record:scan")->hourlyAt(1);//退件信息标记
+        $schedule->command("receivingTask:batchEnd")->dailyAt('0:15')->runInBackground();   //批量完成入库单任务
     }
 
     /**

+ 86 - 0
app/Filters/ReceivingTaskFilters.php

@@ -0,0 +1,86 @@
+<?php
+
+
+namespace App\Filters;
+
+use App\DeliveryAppointmentCar;
+use App\Traits\ModelSearchWay;
+use Illuminate\Database\Eloquent\Builder;
+use Illuminate\Http\Request;
+
+class ReceivingTaskFilters{
+    use ModelSearchWay;
+
+
+    protected $request;
+    protected $queryBuilder;
+    protected $deliveryAppointmentCarQuery;
+    protected $receiving;
+    protected $filters = [
+        'id','owner_id','warehouse_id','appointment_number','created_at_start','created_at_end','number'
+    ];
+    protected $params = [];
+
+    public function __construct(Request $request)
+    {
+        $this->request = $request;
+        $this->params = $request->all();
+    }
+
+    public function apply($builder)
+    {
+        $this->queryBuilder = $builder;
+        $filters = array_filter($this->request->only($this->filters));
+
+        foreach ($filters as $filter => $value) {
+            if (method_exists($this, $filter)) {
+                $this->$filter($value, $this->queryBuilder);
+            }
+        }
+        $this->afterApply();
+        return $this->queryBuilder;
+    }
+
+    public function getDeliveryAppointmentCarQuery(): Builder
+    {
+        if (!$this->deliveryAppointmentCarQuery){
+            $this->deliveryAppointmentCarQuery = DeliveryAppointmentCar::query()->select('id');
+        }
+        return $this->deliveryAppointmentCarQuery;
+    }
+
+    public function afterApply(){
+        if ($this->deliveryAppointmentCarQuery){
+            $this->queryBuilder->whereIn('delivery_appointment_car_id',$this->deliveryAppointmentCarQuery);
+        }
+    }
+
+    public function id($ids){
+        $this->searchWay($this->queryBuilder,$ids,'id');
+    }
+
+    public function owner_id($owner_id){
+        $this->searchWay($this->queryBuilder,$owner_id,'owner_id');
+    }
+
+    public function warehouse_id($warehouse_id){
+        $this->searchWay($this->queryBuilder,$warehouse_id,'warehouse_id');
+    }
+
+    public function appointment_number($appointment_number){
+        $this->searchWay($this->getDeliveryAppointmentCarQuery(),$appointment_number,'appointment_number');
+    }
+
+    public function number($number){
+        $this->searchWay($this->queryBuilder,$number,'number');
+    }
+
+    public function created_at_start($created_at_start){
+        $this->queryBuilder->where('created_at','>=',$created_at_start." 00:00:00");
+    }
+
+    public function created_at_end($created_at_end){
+        $this->queryBuilder->where('created_at','<=',$created_at_end." 23:59:59");
+    }
+
+}

+ 35 - 0
app/Http/Controllers/OracleDOCAsnHeaderController.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Services\OracleDocAsnHerderService;
+use App\Services\OwnerService;
+use Illuminate\Http\Request;
+
+class OracleDOCAsnHeaderController extends Controller
+{
+
+    /**
+     * @var OracleDocAsnHerderService $service
+     * @var OwnerService $ownerService
+     */
+    private $service;
+    private $ownerService;
+
+    public function __construct()
+    {
+        $this->service = app(OracleDocAsnHerderService::class);
+        $this->ownerService = app(OwnerService::class);
+    }
+
+    public function getToBeProcessAsnHeaderDetailsApi(Request $request): array
+    {
+        $customer_id = $request->input('customer_id',null);
+        if (!$customer_id){
+            return ['success'=> false,'message' => '参数错误'];
+        }
+        $data = $this->service->getToBeProcessAsnDetailsByCustomId($customer_id);
+        return ['success' => true,'data' => $data];
+    }
+
+}

+ 75 - 0
app/Http/Controllers/ReceivingTaskController.php

@@ -0,0 +1,75 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\DeliveryAppointmentCar;
+use App\Filters\ReceivingTaskFilters;
+use App\Http\Requests\Api\ReceivingTaskRequest;
+use App\ReceivingTask;
+use App\Services\OwnerService;
+use App\Services\ReceivingTaskService;
+use App\Warehouse;
+use Illuminate\Support\Facades\Gate;
+use Illuminate\Support\Facades\Request;
+
+class ReceivingTaskController extends Controller
+{
+    /**
+     * @var ReceivingTaskService $service
+     * @var OwnerService $ownerService
+     */
+    private $service;
+    private $ownerService;
+
+    public function __construct()
+    {
+        $this->service = app(ReceivingTaskService::class);
+        $this->ownerService = app(OwnerService::class);
+    }
+
+    public function index(Request $request,ReceivingTaskFilters $filter)
+    {
+        if (Gate::denies('入库管理-开单入库-查询')) {
+            return redirect('/');
+        }
+        $receivingTasks = ReceivingTask::query()->with(['items','owner','wareHouse','file','deliveryAppointmentCar'])->filter($filter)->orderByDesc('created_at')->paginate(50);
+        $owners = $this->ownerService->getQuery()->select('id','name')->get();
+        $warehouses  = Warehouse::query()->get();
+        return view("store.receivingTasks.index",compact('receivingTasks','owners','warehouses'));
+    }
+
+
+    public function create()
+    {
+        if (Gate::denies('入库管理-开单入库-创建')) {
+            return redirect('/');
+        }
+        $wareHouse = Warehouse::query()->get();
+        $owners = $this->ownerService->getQuery()->select("id","code","name")->get();
+        return view("store.receivingTasks.create",compact('wareHouse','owners'));
+    }
+
+
+    public function storeApi(ReceivingTaskRequest $request): array
+    {
+        if(Gate::denies('入库管理-开单入库-创建')){
+            return ['success' => false,'message' => '没有对应权限'];
+        }
+        $appointment_number = $request->input('appointment_number',null);
+
+        $delivery_appointment_car = DeliveryAppointmentCar::query()->where('appointment_number',$appointment_number)->first();
+
+        if (!$delivery_appointment_car) return ['success' => false,'errors' =>['appointment_number' => ['对应预约号未找到']]];
+
+        if (ReceivingTask::query()->where('delivery_appointment_car_id',$delivery_appointment_car->id)->exists())
+            return ['success' => false, 'errors' =>['appointment_number' => ['预约号已有对应的任务']]];
+        try {
+            $receiving_task = $this->service->createReceivingTask($delivery_appointment_car, $request->all());
+            if (!$receiving_task->id) return ['success' => false, 'message' => '生成入库单任务失败,请重新尝试'];
+            $receiving_task->loadMissing(['wareHouse','owner','deliveryAppointmentCar']);
+            return ['success' => true, 'data' => $receiving_task];
+        } catch (\Exception $e) {
+            return ['success' => false, 'message' => '生成入库单任务失败,请重新尝试'];
+        }
+    }
+}

+ 85 - 0
app/Http/Controllers/ReceivingTaskItemController.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\ReceivingTaskItem;
+use Illuminate\Http\Request;
+
+class ReceivingTaskItemController extends Controller
+{
+    /**
+     * Display a listing of the resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function index()
+    {
+        //
+    }
+
+    /**
+     * Show the form for creating a new resource.
+     *
+     * @return \Illuminate\Http\Response
+     */
+    public function create()
+    {
+        //
+    }
+
+    /**
+     * Store a newly created resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @return \Illuminate\Http\Response
+     */
+    public function store(Request $request)
+    {
+        //
+    }
+
+    /**
+     * Display the specified resource.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function show(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Show the form for editing the specified resource.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function edit(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Update the specified resource in storage.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function update(Request $request, ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+
+    /**
+     * Remove the specified resource from storage.
+     *
+     * @param  \App\ReceivingTaskItem  $receivingTaskItem
+     * @return \Illuminate\Http\Response
+     */
+    public function destroy(ReceivingTaskItem $receivingTaskItem)
+    {
+        //
+    }
+}

+ 2 - 0
app/Http/Controllers/TestController.php

@@ -10,6 +10,7 @@ use App\CommodityMaterialBoxModel;
 use App\Components\AsyncResponse;
 use App\Components\Database;
 use App\Components\ErrorPush;
+use App\DeliveryAppointmentCar;
 use App\ErrorTemp;
 use App\Feature;
 use App\Http\ApiControllers\LoginController;
@@ -96,6 +97,7 @@ use App\Services\OwnerPriceOperationService;
 use App\Services\OwnerService;
 use App\Services\OwnerStoreFeeReportService;
 use App\Services\OwnerStoreOutFeeReportService;
+use App\Services\ReceivingTaskService;
 use App\Services\ReplenishmentService;
 use App\Services\ReviewService;
 use App\Services\StationService;

+ 61 - 0
app/Http/Requests/Api/ReceivingTaskRequest.php

@@ -0,0 +1,61 @@
+<?php
+
+namespace App\Http\Requests\Api;
+
+use App\Traits\RequestApiFormValidation;
+use Illuminate\Foundation\Http\FormRequest;
+
+class ReceivingTaskRequest extends FormRequest
+{
+    use RequestApiFormValidation;
+
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        return true;
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            'warehouse_id' => 'required',
+            'owner_id' => 'required',
+            'appointment_number' => ['required'],
+            'driver_name' => 'required',
+            'driver_phone' => 'required',
+            'for_single_member' => 'required',
+            'provide_list' => 'required',
+            'receiving_type' => 'required',
+            'driving_license_image' => 'required|image',
+            'asn_nos' => 'required|array'
+        ];
+    }
+
+    public function messages(): array
+    {
+        return [
+            'warehouse_id.required' => "仓库为必选项",
+            'owner_id.required' => "货主为必选",
+            'appointment_number.exists' => "预约单号不存在",
+            'appointment_number.required' => "预约单号不能为空",
+            'driver_name.required' => "司机不能为空",
+            'driver_phone.required' => "司机联系号码不能为空",
+            'for_single_member.required' => "投单员不能为空",
+            'provide_list.required' => "选择是否提供清单",
+            'receiving_type.required' => "收货类型为必选项",
+            'driving_license_image.required' => "驾驶证扫描件不能为空",
+            'driving_license_image.image' => "驾驶证扫描件格式错误",
+            'asn_nos.required' => "勾选入库单",
+            'asn_nos.array' => "入库单号参数类型错误"
+        ];
+    }
+}

+ 1 - 1
app/OracleDOCASNDetail.php

@@ -33,7 +33,7 @@ class OracleDOCASNDetail extends Model
     public function basSku()
     {
         return $this->hasOne(OracleBasSKU::class,['customerid','sku'],['customerid','sku'])
-            ->select('customerid','sku','lotid','alternate_sku1','alternate_sku2','alternate_sku3');
+            ->select('customerid','sku','lotid','alternate_sku1','alternate_sku2','alternate_sku3','descr_c','alternate_sku1','alternate_sku2','alternate_sku3');
 
     }
 }

+ 11 - 3
app/OracleDOCASNHeader.php

@@ -5,6 +5,8 @@ namespace App;
 use App\Traits\ModelTimeFormat;
 use Illuminate\Database\Eloquent\Model;
 use App\Traits\ModelLogChanging;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
 
 class OracleDOCASNHeader extends Model
 {
@@ -14,19 +16,25 @@ class OracleDOCASNHeader extends Model
     protected $connection="oracle";
     protected $table="Doc_ASN_Header";
 
-    public function asnType()
+    public function asnType(): HasOne
     {
         return $this->hasOne(OracleBasCode::class,'code','asntype')
             ->where('codeid','ASN_TYP');
     }
 
-    public function asnStatus()
+    public function asnStatus(): HasOne
     {
         return $this->hasOne(OracleBasCode::class,'code','asnstatus')
             ->where('codeid','ASN_STS');
     }
 
-    public function asnDetails()
+    public function basCustomer(): HasOne
+    {
+        return $this->hasOne(OracleBasCustomer::class,'customerid','customerid')
+            ->where('customer_type','OW');
+    }
+
+    public function asnDetails(): HasMany
     {
         return $this->hasMany(OracleDOCASNDetail::class,'asnno','asnno')
             ->select('asnno','asnlineno','customerid','sku','skudescrc','linestatus','lotatt08','lotatt05','receivedqty','receivedqty_each','expectedqty','addtime','edittime');

+ 5 - 1
app/Providers/AppServiceProvider.php

@@ -204,6 +204,8 @@ use App\Services\WorkOrderDamageService;
 use App\Services\WorkOrderLossService;
 use App\Services\AndroidInventoryService;
 use App\Services\WorkOrderCancelInterceptService;
+use App\Services\ReceivingTaskService;
+use App\Services\ReceivingTaskItemService;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -232,7 +234,6 @@ class AppServiceProvider extends ServiceProvider
 
     private function loadingService(){
         app()->singleton('AllInventoryService',AllInventoryService::class);
-        app()->singleton('InventoryAccountService',InventoryAccountService::class);
         app()->singleton('AndroidInventoryService',AndroidInventoryService::class);
         app()->singleton('AuthorityService',AuthorityService::class);
         app()->singleton('BatchService',BatchService::class);
@@ -268,6 +269,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('HengLiWeightService',HengLiWeightService::class);
         app()->singleton('InventoryAccountMissionService', InventoryAccountMissionService::class);
         app()->singleton('InventoryAccountMissionService',InventoryAccountMissionService::class);
+        app()->singleton('InventoryAccountService',InventoryAccountService::class);
         app()->singleton('InventoryCompareService', InventoryCompareService::class);
         app()->singleton('InventoryDailyLogService', InventoryDailyLogService::class);
         app()->singleton('JDDeliveryService',JDDeliveryService::class);
@@ -359,6 +361,8 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('ProcurementWeiXinSendMessageService', ProcurementWeiXinSendMessageService::class);
         app()->singleton('ProvinceService', ProvinceService::class);
         app()->singleton('RealtimePendingOrdersService', RealtimePendingOrdersService::class);
+        app()->singleton('ReceivingTaskItemService',ReceivingTaskItemService::class);
+        app()->singleton('ReceivingTaskService',ReceivingTaskService::class);
         app()->singleton('RegionService', RegionService::class);
         app()->singleton('RejectedBillItemService', RejectedBillItemService::class);
         app()->singleton('RejectedBillService', RejectedBillService::class);

+ 63 - 0
app/ReceivingTask.php

@@ -0,0 +1,63 @@
+<?php
+
+namespace App;
+
+use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Model;
+
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+
+class ReceivingTask extends Model
+{
+    use ModelTimeFormat;
+
+    protected $fillable = [
+        'number',
+        'warehouse_id',
+        'owner_id',
+        'delivery_appointment_car_id',
+        'driver_name',
+        'driver_phone',
+        "for_single_member",
+        'plate_number',
+        'driving_license_no',
+        'logistics_single_number',
+        'provide_list',
+        'receiving_type',
+        'status',
+    ];
+
+    public function scopeFilter($query, $filters)
+    {
+        return $filters->apply($query);
+    }
+
+    public function wareHouse(): BelongsTo
+    {
+        return $this->belongsTo(Warehouse::class,'warehouse_id','id');
+    }
+
+    public function owner(): BelongsTo
+    {
+        return $this->belongsTo(Owner::class);
+    }
+
+    public function deliveryAppointmentCar(): BelongsTo
+    {
+        return $this->belongsTo(DeliveryAppointmentCar::class);
+    }
+
+    public function items(): HasMany
+    {
+        return $this->hasMany(ReceivingTaskItem::class);
+    }
+
+    public function file(): HasOne
+    {
+        return $this->hasOne(UploadFile::class,'table_id','id')->where('table_name','receiving_tasks');
+    }
+
+
+}

+ 27 - 0
app/ReceivingTaskItem.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasOne;
+
+class ReceivingTaskItem extends Model
+{
+
+    protected $fillable = [
+        'receiving_task_id','asn_no',
+    ];
+
+    public function receivingTask(): BelongsTo
+    {
+        return $this->belongsTo(ReceivingTask::class);
+    }
+
+    public function docASNHeader(): HasOne
+    {
+        return $this->hasOne(OracleDOCASNHeader::class,'asn_no','asnno');
+    }
+
+}

+ 7 - 0
app/Services/AuthorityService.php

@@ -12,6 +12,8 @@ use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Cache;
 use App\Traits\ServiceAppAop;
 use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Gate;
+
 
 
 class AuthorityService
@@ -149,4 +151,9 @@ class AuthorityService
             });
         })->orWhereIn("name",config("users.superAdmin"))->get();
     }
+
+    public function checkAllOwner(): bool
+    {
+        return Gate::allows("货主-可见全部");
+    }
 }

+ 4 - 0
app/Services/OracleDocAsnDetailService.php

@@ -3,7 +3,9 @@
 namespace App\Services;
 
 use App\OracleDOCASNDetail;
+use App\OracleDOCASNHeader;
 use App\Traits\ServiceAppAop;
+use Illuminate\Database\Eloquent\Builder;
 
 
 class OracleDocAsnDetailService
@@ -40,4 +42,6 @@ class OracleDocAsnDetailService
         }
         return $query->get();
     }
+
+
 }

+ 13 - 2
app/Services/OracleDocAsnHerderService.php

@@ -9,6 +9,7 @@ use App\Traits\ServiceAppAop;
 class OracleDocAsnHerderService
 {
     use ServiceAppAop;
+
 //    protected $modelClass=OracleDocAsnHerder::class;
 
     public function getWmsAsnOnStartDateCreate($startDate)
@@ -16,7 +17,7 @@ class OracleDocAsnHerderService
         if (!$startDate) return null;
         return OracleDOCASNHeader::query()
             ->with(['asnType', 'asnStatus'])
-            ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
+            ->select('asnno', 'asnstatus', 'asntype', 'addtime', 'edittime', 'customerid', 'notes', 'warehouseid', 'asnreference3', 'asnreference2')
             ->where('addTime', '>=', $startDate)
             ->whereColumn('edittime', '=', 'addTime')
             ->orderByDesc('addtime')
@@ -28,11 +29,21 @@ class OracleDocAsnHerderService
         if (!$startDate) return null;
         return OracleDOCASNHeader::query()
             ->with(['asnType', 'asnStatus'])
-            ->select('asnno','asnstatus','asntype','addtime','edittime','customerid','notes','warehouseid','asnreference3','asnreference2')
+            ->select('asnno', 'asnstatus', 'asntype', 'addtime', 'edittime', 'customerid', 'notes', 'warehouseid', 'asnreference3', 'asnreference2')
             ->where('EditTime', '>=', $startDate)
             ->whereColumn('EditTime', '<>', 'addTime')
             ->orderByDesc('EditTime')
             ->get();
     }
 
+    public function getToBeProcessAsnDetailsByCustomId($customId)
+    {
+        return OracleDOCASNHeader::query()
+            ->with(['asnType', 'asnStatus', 'basCustomer','asnDetails' => function ($query) {
+                $query->with(['lineStatus', 'qualityStatus', 'basSku']);
+            }])
+            ->whereIn("AsnStatus", ['00', '30'])
+            ->where('CustomerId', $customId)->get();
+    }
+
 }

+ 6 - 5
app/Services/OrderService.php

@@ -327,19 +327,19 @@ SQL;
             else return null;
         }
         $sql = "SELECT * FROM (select ACT_ALLOCATION_DETAILS.CHECKTIME,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.MANUALFLAG,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID as header_customer_id
-        ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.C_Tel1,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,DOC_ORDER_HEADER.EDIREMARKS2,
+        ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.C_Tel1,logistic.descr_c as CarrierName,DOC_ORDER_HEADER.IssuePartyName,DOC_ORDER_HEADER.EDIREMARKS2,
        DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1, DOC_ORDER_HEADER.SOREFERENCE5 as code5
         ,NVL(ACT_ALLOCATION_DETAILS.PICKTOTRACEID,DOC_ORDER_HEADER.soreference5) as soreference5,DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
        DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
         ,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,DOC_ORDER_HEADER.OrderTime,DOC_Order_Details.CustomerID,
        DOC_Order_Details.SKU,DOC_Order_Details.QtyOrdered,DOC_Order_Details.LOTNUM,DOC_Order_Details.LineStatus,DOC_Order_Details.OrderLineNo,order_code.codename_c as orderCodeName,
-       order_detail_code.codename_c as orderDetailCodeName,BAS_Customer.descr_c as customer_descr_c,
+       order_detail_code.codename_c as orderDetailCodeName,owner.descr_c as customer_descr_c,
        BAS_SKU.Alternate_SKU1,BAS_SKU.Descr_C,(select count(*) from DOC_ORDER_HEADER WHERE 1=1";
         $sql = $this->preciseQuery($params, $sql);;
         $sql .= " ) as counted from (";
         if ($paginate && $page) $sql .= " select * from (";
         $sql .= " select ROWNUM as rn,DOC_ORDER_HEADER.addtime,DOC_ORDER_HEADER.C_PROVINCE,DOC_ORDER_HEADER.C_CITY,DOC_ORDER_HEADER.MANUALFLAG,DOC_ORDER_HEADER.C_DISTRICT,DOC_ORDER_HEADER.C_CONTACT,DOC_ORDER_HEADER.OrderNo,DOC_ORDER_HEADER.SOStatus,DOC_ORDER_HEADER.WAREHOUSEID,DOC_ORDER_HEADER.CustomerID
-                          ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.C_Tel1,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.IssuePartyName,
+                          ,DOC_ORDER_HEADER.C_Tel2,DOC_ORDER_HEADER.C_Tel1,DOC_ORDER_HEADER.CarrierName,DOC_ORDER_HEADER.USERDEFINE1,DOC_ORDER_HEADER.IssuePartyName,
                          DOC_ORDER_HEADER.WaveNo,DOC_ORDER_HEADER.SOReference1
                           ,DOC_ORDER_HEADER.soreference5,nvl( DOC_ORDER_HEADER.EDISENDFLAG2, DOC_ORDER_HEADER.edisendflag3 ) as EDISENDFLAG2,nvl( DOC_ORDER_HEADER.EDISendTime2, DOC_ORDER_HEADER.EDISENDTIME3 ) EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
                          DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG
@@ -365,7 +365,8 @@ SQL;
         $sql .= ")DOC_ORDER_HEADER left join DOC_ORDER_DETAILS on DOC_ORDER_DETAILS.ORDERNO=DOC_ORDER_HEADER.ORDERNO
                       left join BAS_CODES  order_code on order_code.CODE=DOC_ORDER_HEADER.sostatus and order_code.codeid='SO_STS'
                       left join BAS_CODES  order_detail_code on order_detail_code.CODE=DOC_ORDER_DETAILS.linestatus and order_detail_code.codeid='SO_STS'
-                      left join BAS_Customer on BAS_Customer.customerid=DOC_ORDER_HEADER.customerid
+                      left join BAS_Customer owner on owner.customerid=DOC_ORDER_HEADER.customerid
+                      left join BAS_Customer logistic on logistic.customerid=DOC_ORDER_HEADER.USERDEFINE1
                       left join  BAS_SKU on DOC_Order_Details.CustomerID=BAS_SKU.CustomerID and DOC_Order_Details.SKU=BAS_SKU.SKU
                       left join  ACT_ALLOCATION_DETAILS on DOC_Order_Details.orderno = ACT_ALLOCATION_DETAILS.orderno
                       and DOC_Order_Details.ORDERLINENO = ACT_ALLOCATION_DETAILS.ORDERLINENO
@@ -376,7 +377,7 @@ SQL;
                       DOC_ORDER_HEADER.EDISENDFLAG2,DOC_ORDER_HEADER.EDISendTime2,DOC_ORDER_HEADER.Notes,DOC_ORDER_HEADER.ERPCANCELFLAG,
                       DOC_ORDER_HEADER.Picking_Print_Flag,DOC_ORDER_HEADER.EDISENDFLAG,DOC_ORDER_HEADER.ReleaseStatus,DOC_ORDER_HEADER.C_Address1,
                       DOC_ORDER_HEADER.OrderTime,DOC_Order_Details.CustomerID,DOC_Order_Details.SKU,DOC_Order_Details.QtyOrdered,DOC_Order_Details.LOTNUM,
-                      DOC_Order_Details.LineStatus,DOC_Order_Details.OrderLineNo,order_code.codename_c,order_detail_code.codename_c,BAS_Customer.descr_c,
+                      DOC_Order_Details.LineStatus,DOC_Order_Details.OrderLineNo,order_code.codename_c,order_detail_code.codename_c,owner.descr_c,logistic.descr_c,
                       BAS_SKU.Alternate_SKU1,BAS_SKU.Descr_C ORDER BY DOC_ORDER_HEADER.ADDTIME desc)";
         return $sql;
 

+ 1 - 1
app/Services/OwnerService.php

@@ -582,7 +582,7 @@ sql;
     {
         if (!$userId)$userId = Auth::id();
         $query = Owner::query()->select("owners.id");
-        if (!app("UserService")->checkAdminIdentity($userId)){
+        if (!app("UserService")->checkAdminIdentity($userId) && !app("AuthorityService")->checkAllOwner()){
             $query->whereHas("roles",function ($query)use($userId){
                 $query->whereHas("users",function ($query)use($userId){
                     $query->where("users.id",$userId);

+ 27 - 0
app/Services/ReceivingTaskItemService.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Services;
+
+use App\ReceivingTask;
+use App\Traits\ServiceAppAop;
+use App\ReceivingTaskItem;
+
+class ReceivingTaskItemService
+{
+    use ServiceAppAop;
+
+    protected $modelClass = ReceivingTaskItem::class;
+
+    public function createItems($task, $asn_nos)
+    {
+        if (is_array($asn_nos)) {
+            foreach ($asn_nos as $no) {
+                $task->items()->create(['asn_no' => $no]);
+            }
+        } else if (is_string($asn_nos)){
+            $task->items()->create(['asn_no' => $asn_nos]);
+        }
+
+    }
+
+}

+ 134 - 0
app/Services/ReceivingTaskService.php

@@ -0,0 +1,134 @@
+<?php
+
+namespace App\Services;
+
+use App\DeliveryAppointment;
+use App\DeliveryAppointmentCar;
+use App\Traits\ServiceAppAop;
+use App\ReceivingTask;
+use App\Utils\IdCreate;
+use Illuminate\Support\Carbon;
+use Illuminate\Support\Facades\DB;
+use Ramsey\Uuid\Uuid;
+
+class ReceivingTaskService
+{
+    use ServiceAppAop;
+
+    protected $modelClass = ReceivingTask::class;
+
+    private $itemService;
+
+    public function __construct()
+    {
+        $this->itemService =app(ReceivingTaskItemService::class);
+    }
+
+    // 完结工单
+    public function endTask($receivingTaskNumber)
+    {
+        ReceivingTask::query()->where('number', $receivingTaskNumber)->update(['status' => '完成','end_at' => now()]);
+    }
+
+    // 延时完成
+    public function overtimeToComplete($receivingTaskNumber)
+    {
+        ReceivingTask::query()->where('number', $receivingTaskNumber)->update(['status' => '延时完结']);
+    }
+
+    // 标记任务进行中
+    public function executionTask($receivingTaskNumber)
+    {
+        ReceivingTask::query()->where('number', $receivingTaskNumber)->update(['status' => '进行中']);
+    }
+
+    /**
+     * 生成入库任务号
+     * @param DeliveryAppointmentCar $deliveryAppointmentCar
+     * @param $params
+     * @return ReceivingTask
+     */
+    public function createReceivingTask(DeliveryAppointmentCar $deliveryAppointmentCar, $params): ReceivingTask
+    {
+        // 生成入库任务号
+        $task_number = $this->buildTaskNumber();
+        $params['number'] = $task_number;
+        $params['delivery_appointment_car_id'] = $deliveryAppointmentCar->id;         // 预约号
+        $receivingTask = new ReceivingTask($params);
+        DB::transaction(function () use ($deliveryAppointmentCar, $params, &$receivingTask) {
+            $receivingTask->save();
+            if ($receivingTask->id) {
+                try {
+                    $this->itemService->createItems($receivingTask,$params['asn_nos'] ?? []);
+                    $this->saveImage($receivingTask, $params['driving_license_image']);
+                    DB::commit();
+                } catch (\Exception $e) {
+                    DB::rollBack();
+                }
+            }
+        });
+        return $receivingTask;
+    }
+
+    // 保存图片
+    public function saveImage(ReceivingTask $receivingTask, $image): bool
+    {
+        if (!$this->checkImage($image)) return false;
+        $tmpFile = $image->getRealPath();
+        $fileSuffix = $image->getClientOriginalExtension();
+        $dirPath = $this->getStorageDirPath();
+        $fileName = date('ymd') . '-' . Uuid::uuid1();
+        $pathName = $dirPath . $fileName . '.' . $fileSuffix;
+        $result = move_uploaded_file($tmpFile, $pathName);
+        if (!$result) return false;
+        $receivingTask->file()->create(
+            ['url' => '/files/receivingTask/' . $fileName, 'type' => $fileSuffix, 'table_name' => $receivingTask->getTable()]
+        );
+        return true;
+    }
+
+
+    public function checkImage($image): bool
+    {
+        $tmpFile = $image->getRealPath();
+        $fileSuffix = $image->getClientOriginalExtension();
+        if (!is_uploaded_file($tmpFile)) return false;
+        if ($image->getSize() > 5 * 1024 * 1024) return false;
+        if (!in_array($fileSuffix, ['gif', 'image', 'jpeg', 'jpg', 'png', 'svg'])) return false;
+        return true;
+    }
+
+
+    public function getStorageDirPath(): string
+    {
+        $path = ['app', 'public', 'files', 'receivingTask'];
+        $path = join(DIRECTORY_SEPARATOR, $path);
+        $dirPath = storage_path($path);
+        if (!file_exists($dirPath)) {
+            mkdir($dirPath);
+        }
+        return $dirPath . DIRECTORY_SEPARATOR;
+    }
+
+    /**
+     * 雪花算法生成任务号
+     * @return string
+     */
+    public function buildTaskNumber(): string
+    {
+        return 'SH'.IdCreate::createOnlyId();
+    }
+
+    /**
+     * 延时完成昨天未完成的工单
+     */
+    public function overtimeToCompleteTask(){
+        $yesterday = Carbon::now()->subDays(1)->format("Y-m-d");
+        ReceivingTask::query()
+            ->where('created_at', '>=', $yesterday . ' 00:00:00')
+            ->where('created_at', '<=', $yesterday . ' 23.59.59')
+            ->whereIn('status',['创建','进行中'])
+            ->update(['status'=>'延时完成']);
+
+    }
+}

+ 44 - 0
app/Utils/IdCreate.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace App\Utils;
+
+/**
+ * Class IdCreate
+ * @package App\Utils
+ * 雪花算法 生成 id
+ */
+class IdCreate
+{
+    const EPOCH = 1479533469598;    //开始时间,固定一个小于当前时间的毫秒数
+    const max12bit = 4095;
+    const max41bit = 1099511627775;
+
+    static $machineId = null;      // 机器id
+
+    public static function machineId($mId = 0)
+    {
+        self::$machineId = $mId;
+    }
+
+    public static function createOnlyId()
+    {
+        // 时间戳 42字节
+        $time = floor(microtime(true) * 1000);
+        // 当前时间 与 开始时间 差值
+        $time -= self::EPOCH;
+        // 二进制的 毫秒级时间戳
+        $base = decbin(self::max41bit + $time);
+        // 机器id  10 字节
+        if (!self::$machineId) {
+            $machineid = self::$machineId;
+        } else {
+            $machineid = str_pad(decbin(self::$machineId), 10, "0", STR_PAD_LEFT);
+        }
+        // 序列数 12字节
+        $random = str_pad(decbin(mt_rand(0, self::max12bit)), 12, "0", STR_PAD_LEFT);
+        // 拼接
+        $base = $base . $machineid . $random;
+        // 转化为 十进制 返回
+        return bindec($base);
+    }
+}

+ 0 - 1
app/WorkOrder.php

@@ -178,7 +178,6 @@ class WorkOrder extends Model
         return $this->belongsTo(User::class, 'reviewer_id');
     }
 
-
     // 生成问题件类型
     public function issueType(): BelongsTo
     {

+ 12 - 0
database/factories/ReceivingTaskFactory.php

@@ -0,0 +1,12 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\ReceivingTask;
+use Faker\Generator as Faker;
+
+$factory->define(ReceivingTask::class, function (Faker $faker) {
+    return [
+        //
+    ];
+});

+ 11 - 0
database/factories/ReceivingTaskItemFactory.php

@@ -0,0 +1,11 @@
+<?php
+
+/** @var \Illuminate\Database\Eloquent\Factory $factory */
+
+use App\ReceivingTaskItem;
+use Faker\Generator as Faker;
+
+$factory->define(ReceivingTaskItem::class, function (Faker $faker) {
+    return [
+    ];
+});

+ 49 - 0
database/migrations/2021_12_22_153152_create_receiving_tasks_table.php

@@ -0,0 +1,49 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateReceivingTasksTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('receiving_tasks', function (Blueprint $table) {
+            $table->id();
+            $table->String('number')->unique()->comment('收货任务清单');
+            $table->integer('warehouse_id')->index()->comment('仓库');
+            $table->integer('owner_id')->index()->comment('货主');
+            $table->String("for_single_member")->comment('投单员');
+            $table->integer('delivery_appointment_car_id')->unique()->comment('预约号');
+
+            $table->String('driver_name')->comment('司机姓名');
+            $table->String('driver_phone')->comment('司机号码');
+
+            $table->String('plate_number')->comment('车牌号');
+            $table->String('driving_license_no')->comment('驾驶证号');
+            $table->String('logistics_single_number')->comment('物流单号');
+
+            $table->enum('provide_list',['是','否'])->comment("是否提供清单");
+            $table->enum('receiving_type',['正常','盲收'])->comment("收货类型");
+            $table->enum('status',['创建','进行中','完成','超时完成'])->comment('状态');
+
+            $table->dateTime('end_at')->comment('完结时间');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('receiving_tasks');
+    }
+}

+ 33 - 0
database/migrations/2021_12_22_163154_create_receiving_task_items_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreateReceivingTaskItemsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('receiving_task_items', function (Blueprint $table) {
+            $table->id();
+            $table->integer('receiving_task_id')->index()->comment('收货任务');
+            $table->String('asn_no')->comment('asn单号');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('receiving_task_items');
+    }
+}

+ 16 - 0
database/seeds/ReceivingTaskItemSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class ReceivingTaskItemSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}

+ 16 - 0
database/seeds/ReceivingTaskSeeder.php

@@ -0,0 +1,16 @@
+<?php
+
+use Illuminate\Database\Seeder;
+
+class ReceivingTaskSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        //
+    }
+}

+ 18 - 0
resources/views/store/receivingTasks/_clodop_print.blade.php

@@ -0,0 +1,18 @@
+<el-dialog
+    title="打印"
+    :visible.sync="clodopPrintDialogVisible"
+    width="45%"
+    center>
+    <el-form ref="form" :model="print_setting" label-width="80px" class="demo-form-inline" size="small">
+        <el-form-item label="打印机" size="small">
+            <el-select v-model="print_setting.printer_index" placeholder="请选择打印机" >
+                <el-option v-for="printer in printerList" :label="printer.name" :value="printer.value"></el-option>
+            </el-select>
+        </el-form-item>
+    </el-form>
+
+    <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogShowOrderWorkVisible = false">关 闭</el-button>
+        <el-button type="primary" @click="clodopPrint">打 印</el-button>
+    </span>
+</el-dialog>

+ 55 - 0
resources/views/store/receivingTasks/_receiving_task_print.blade.php

@@ -0,0 +1,55 @@
+{{--<div id="print-receiving-task" class=" container print"--}}
+{{--     style="min-height: 450px;min-width: 750px;max-height: 450px;max-width: 750px">--}}
+{{--    <div id="receiving-task-print" class="d-none print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">--}}
+{{--        <table class="table table-sm table-bordered text-center print" style="min-height: 100mm;min-width: 170mm;max-height: 100mm;max-width: 170mm">--}}
+{{--            <tr>--}}
+{{--                <td rowspan="2" colspan="4" class="">--}}
+{{--                    <div style="min-width: 100mm;min-height: 25mm">--}}
+{{--                        <svg id="receiving-task-print-code" style="width: 100%;height: 100%" preserveAspectRatio="none">--}}
+{{--                        </svg>--}}
+{{--                    </div>--}}
+
+{{--                </td>--}}
+{{--            </tr>--}}
+{{--            <tr></tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">收货任务号</td>--}}
+{{--                <td colspan="3" rowspan="1" v-text="receiving_task_print.number" class="text-left"></td>--}}
+{{--            </tr>--}}
+
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">仓库</td>--}}
+{{--                <td v-text="receiving_task_print.warehouse" class="text-left" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">投单员</td>--}}
+{{--                <td v-text="receiving_task_print.for_single_member" class="text-left" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">司机姓名</td>--}}
+{{--                <td v-text="receiving_task_print.driver_name" class="text-left" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">司机电话</td>--}}
+{{--                <td v-text="receiving_task_print.driver_phone" class="text-left" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">车号牌</td>--}}
+{{--                <td v-text="receiving_task_print.plate_number" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">驾驶证号</td>--}}
+{{--                <td v-text="receiving_task_print.driving_license_no" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">是否提供清单</td>--}}
+{{--                <td v-text="receiving_task_print.provide_list" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">收货类型</td>--}}
+{{--                <td v-text="receiving_task_print.receiving_type" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--            <tr>--}}
+{{--                <td style="max-width: 120px;width:120px">货主</td>--}}
+{{--                <td v-text="receiving_task_print.owner" class="text-left"></td>--}}
+{{--                <td style="max-width: 120px;width:120px">预约号</td>--}}
+{{--                <td v-text="receiving_task_print.appointment_number" class="text-left"></td>--}}
+{{--            </tr>--}}
+{{--        </table>--}}
+{{--    </div>--}}
+{{--    <div style="width: 100%;height: 100%;" class="d-none" id="receiving-task-print-image">--}}
+{{--        <img src="" alt="">--}}
+{{--    </div>--}}
+{{--</div>--}}

+ 766 - 0
resources/views/store/receivingTasks/create.blade.php

@@ -0,0 +1,766 @@
+@extends('layouts.app')
+@section('title')开单入库-创建@endsection
+@section('head')
+    <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
+    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+@endsection
+
+@section('content')
+    <div id="list" class="d-none">
+        <div class="container-fluid ">
+            <div class="card">
+                <div class="card-body">
+                    <form name="receiving-task-form" id="receiving-task-form">
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="warehouse_id">
+                                    <span class="text-danger">*</span>
+                                    仓库
+                                </label>
+                                <div class="form-inline col-8">
+                                    <select class="form-control form-control-sm col-12" name="warehouse_id"
+                                            @change="clearError('warehouse_id')"
+                                            id="warehouse_id"
+                                            :class="{'is-invalid':errors.warehouse_id}"
+                                            v-model="receiving_task.warehouse_id">
+                                        <option v-for="item in ware_house"
+                                                :value="item.value"
+                                                v-text="item.name"></option>
+                                    </select>
+                                    <div id="validation-warehouse" class="invalid-feedback"
+                                         v-show="errors.warehouse_id">
+                                        <span v-text="errors.warehouse_id"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="for_single_member">
+                                    <span class="text-danger">*</span>
+                                    投单员</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           id="for_single_member" name="for_single_member"
+                                           :class="{'is-invalid':errors.for_single_member}"
+                                           @change="clearError('for_single_member')"
+
+                                           v-model="receiving_task.for_single_member">
+                                    <div id="validation-for-single-member" class="invalid-feedback"
+                                         v-show="errors.for_single_member">
+                                        <span v-text="errors.for_single_member"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="owner_id">
+                                    <span class="text-danger">*</span>
+                                    货主</label>
+                                <div class="form-inline col-8">
+                                    <select class="form-control form-control-sm col-12" name="owner_id" id="owner_id"
+                                            :class="{'is-invalid':errors.owner_id}"
+                                            @change="getASNDetails"
+                                            @input="clearError('owner_id')"
+                                            v-model="receiving_task.owner_id">
+                                        <option v-for="item in owners" :value="item.id" v-text="item.name"></option>
+                                    </select>
+                                    <div id="validation-owner-id" class="invalid-feedback" v-show="errors.owner_id">
+                                        <span v-text="errors.owner_id"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="driver_name">
+                                    <span class="text-danger">*</span>
+                                    司机姓名</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="driver_name" id="driver_name"
+                                           :class="{'is-invalid':errors.driver_name}"
+                                           @change="clearError('driver_name')"
+                                           v-model="receiving_task.driver_name">
+                                    <div id="validation-driver-name" class="invalid-feedback"
+                                         v-show="errors.driver_name">
+                                        <span v-text="errors.driver_name"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="driver-phone">
+                                    <span class="text-danger">*</span>
+                                    司机电话</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="driver_phone" id="driver-phone"
+                                           :class="{'is-invalid':errors.driver_phone}"
+                                           @change="clearError('driver_phone')"
+                                           v-model="receiving_task.driver_phone">
+                                    <div id="validation-driver-phone" class="invalid-feedback"
+                                         v-show="errors.driver_name">
+                                        <span v-text="errors.driver_phone"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="appointment_number">
+                                    <span class="text-danger">*</span>
+                                    预约单号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="appointment_number" id="appointment_number"
+                                           :class="{'is-invalid':errors.appointment_number}"
+                                           @change="clearError('appointment_number')"
+                                           v-model="receiving_task.appointment_number">
+                                    <div id="validation-delivery-appointment-number" class="invalid-feedback"
+                                         v-show="errors.appointment_number">
+                                        <span v-text="errors.appointment_number"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right d-inline-block" for="plate_number">
+                                    <span class="text-danger">*</span>
+                                    车牌号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="plate_number" id="plate_number"
+                                           :class="{'is-invalid':errors.plate_number}"
+                                           @change="clearError('plate_number')"
+                                           :disabled="receiving_task.logistics_single_number"
+                                           v-model="receiving_task.plate_number">
+                                    <div id="validation-plate-number" class="invalid-feedback"
+                                         v-show="errors.plate_number">
+                                        <span v-text="errors.plate_number"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right d-inline-block" for="driving_license_no">
+                                    <span class="text-danger">*</span>
+                                    驾驶证号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="driving_license_no" id="driving_license_no"
+                                           :class="{'is-invalid':errors.driving_license_no}"
+                                           @change="clearError('driving_license_no')"
+                                           :disabled="receiving_task.logistics_single_number"
+                                           v-model="receiving_task.driving_license_no">
+                                    <div id="validation-driving-license-no" class="invalid-feedback"
+                                         v-show="errors.driving_license_no">
+                                        <span v-text="errors.driving_license_no"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right d-inline-block"
+                                       for="logistics_single_number">
+                                    <span class="text-danger">*</span>
+                                    物流单号</label>
+                                <div class="form-inline col-8">
+                                    <input type="text" class="form-control form-control-sm col-12" placeholder=""
+                                           name="logistics_single_number" id="logistics_single_number"
+                                           :class="{'is-invalid':errors.logistics_single_number}"
+                                           @change="clearError('logistics_single_number')"
+                                           :disabled="checkLogisticsSingleIsWrite()"
+                                           v-model="receiving_task.logistics_single_number">
+                                    <div id="validation-driving-license-no" class="invalid-feedback"
+                                         v-show="errors.logistics_single_number">
+                                        <span v-text="errors.logistics_single_number"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right d-inline-block text-primary"
+                                       for="plate_number">
+                                    <span class="text-danger">*</span>
+                                    是否提供清单</label>
+                                <div class="form-inline col-8">
+                                    <select name="provide_list" id="provide_list"
+                                            class="form-control form-control-sm col-12"
+                                            :class="{'is-invalid':errors.provide_list}"
+                                            @change="clearError('provide_list')"
+                                            v-model="receiving_task.provide_list">
+                                        <option v-for="item in provide_lists" :value="item" v-text="item"></option>
+                                    </select>
+                                    <div id="validation-provide_list" class="invalid-feedback"
+                                         v-show="errors.provide_list">
+                                        <span v-text="errors.provide_list"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right  d-inline-block  text-primary"
+                                       for="receiving_type">
+                                    <span class="text-danger">*</span>
+                                    收货类型</label>
+                                <div class="form-inline col-8">
+                                    <select name="receiving_type" id="receiving_type"
+                                            class="form-control form-control-sm col-12"
+                                            :class="{'is-invalid':errors.receiving_type}"
+                                            @change="clearError('provide_list')"
+                                            v-model="receiving_task.receiving_type">
+                                        <option v-for="item in receiving_types" :value="item" v-text="item"></option>
+                                    </select>
+                                    <div id="validation-receiving-type" class="invalid-feedback"
+                                         v-show="errors.receiving_type">
+                                        <span v-text="errors.receiving_type"></span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                        <div class="form-group row">
+                            <div class="form-inline col-4 row">
+                                <label class="col-4 col-form-label text-right d-inline-block text-primary"
+                                       for="driving_license_image">
+                                    <span class="text-danger">*</span>
+                                    驾驶证扫描件</label>
+                                <div class="form-inline col-8">
+                                    <input type="file" class="form-control form-control-file col-12" placeholder=""
+                                           name="driving_license_image" id="driving_license_image">
+                                </div>
+                            </div>
+                        </div>
+                    </form>
+                </div>
+
+                <div class="card-body mb-0 pt-0 pm-0">
+                    <el-table
+                        :key="asn_headers_table_key"
+                        size="small"
+                        highlight-current-row
+                        ref="asn_headers_table"
+                        :data="asn_headers"
+                        height="350"
+                        border
+                        @row-click="showAsnDetails"
+                        row-key="asn_no"
+                        @selection-change="handleSelectionChange"
+                        style="width: 100%">
+
+                        <el-table-column
+                            type="selection"
+                            width="55">
+                        </el-table-column>
+
+                        <el-table-column
+                            prop="customer_id" label="货主">
+                        </el-table-column>
+
+                        <el-table-column
+                            sortable
+                            prop="asn_no" label="ASN号">
+                        </el-table-column>
+
+                        <el-table-column
+                            prop="asn_type" label="ASN类型">
+                        </el-table-column>
+
+                        <el-table-column
+                            sortable
+                            prop="asn_status" label="订单状态">
+                        </el-table-column>
+
+                        <el-table-column
+                            prop="up_stream_number"
+                            label="上游单号">
+                        </el-table-column>
+                        <el-table-column
+                            prop="anticipated_sum_number"
+                            label="预期总数">
+                        </el-table-column>
+                        <el-table-column
+                            prop="number1"
+                            label="参考编号1"
+                        >
+                        </el-table-column>
+                        <el-table-column
+                            prop="number2"
+                            label="参考编号2">
+                        </el-table-column>
+                        <el-table-column
+                            prop="number3"
+                            label="参考编号3">
+                        </el-table-column>
+                        <el-table-column
+                            sortable
+                            prop="receiving_time"
+                            label="接收时间">
+                        </el-table-column>
+                    </el-table>
+                </div>
+                <div class="card-body mt-0 pt-0 pm-0">
+                    <el-table
+                        ref="asn_details_table"
+                        size="small"
+                        border
+                        :data="asn_details"
+                        style="width: 100%"
+                        height="300">
+
+                        <el-table-column
+                            prop="line_status"
+                            label="行状态"
+                            width="180">
+                        </el-table-column>
+                        <el-table-column
+                            prop="name"
+                            label="产品名称">
+                        </el-table-column>
+                        <el-table-column
+                            prop="code1"
+                            label="条码1"
+                            width="180">
+                        </el-table-column>
+                        <el-table-column
+                            prop="code2"
+                            label="条码2"
+                            width="180">
+                        </el-table-column>
+                        <el-table-column
+                            prop="code3"
+                            label="条码3">
+                        </el-table-column>
+                        <el-table-column
+                            prop="anticipated_number"
+                            label="预期数量"
+                            width="180">
+                        </el-table-column>
+                        <el-table-column
+                            prop="number"
+                            label="已收取"
+                            width="180">
+                        </el-table-column>
+                    </el-table>
+                </div>
+                <div class="form-group">
+                    <el-button type="primary" class="col-12" @click="submit" v-if="!submit_loading">提 交</el-button>
+                    <el-button type="primary" class="col-12" :loading="true" v-if="submit_loading">提 交 中</el-button>
+                </div>
+                <div class="form-group">
+                    @can('入库管理-开单入库-打印任务单')
+                    <el-button type="primary" class="col-12" @click="printLodop">打  印</el-button>
+                    @endcan
+                </div>
+                @include("store.receivingTasks._receiving_task_print")
+                @include("store.receivingTasks._clodop_print")
+            </div>
+        </div>
+
+    </div>
+@endsection
+@section('lastScript')
+
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{ mix('js/element-ui.js') }}"></script>
+    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
+    <script type="text/javascript" src="{{mix('js/lodop/LodopFuncs.js')}}"></script>
+
+    <script src='http://localhost:18000/CLodopfuncs.js?name=CLODOPA'></script>
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                receiving_task: {
+                    warehouse_id: null,
+                    owner_id: null,
+                    appointment_number: null,
+                    driver_name: null,
+                    driver_phone: null,
+                    for_single_member: null,
+                    plate_number: null,
+                    driving_license_no: null,
+                    logistics_single_number: null,
+                    provide_list: null,
+                    receiving_type: null,
+                },
+                provide_lists: ['是', '否'],
+                receiving_types: ['正常', '盲收'],
+                owners: [
+                        @foreach($owners as $owner)
+                    {
+                        name: '{{$owner->name}}', value: '{{$owner->code}}', id: '{{$owner->id}}'
+                    },
+                    @endforeach
+                ],
+                ware_house: [
+                        @foreach($wareHouse as $item)
+                    {
+                        name: '{{$item->name}}', value: '{{$item->id}}'
+                    },
+                    @endforeach
+                ],
+                driving_license_image: null,
+                asn_headers: [],
+                asn_details: [],
+                asn_detail: [],
+                loading_tag: false,
+                not_found_tag: false,
+                asn_headers_table_key: 1,
+                errors: {
+                    warehouse_id: '',
+                    owner_id: '',
+                    appointment_number: '',
+                    driver_name: '',
+                    driver_phone: '',
+                    for_single_member: '',
+                    plate_number: '',
+                    driving_license_no: '',
+                    logistics_single_number: '',
+                    provide_list: '',
+                    receiving_type: '',
+                },
+                error_message: null,
+                selected_asn_nos: [],
+                submit_loading: false,
+                receiving_task_print: {
+                    number: null,               // 收货任务号
+                    warehouse: null,             // 仓库
+                    for_single_member: null,    // 投单员
+                    driver_name: null,          // 司机姓名
+                    driver_phone: null,         // 司机电话
+                    plate_number: null,          // 车号牌
+                    driving_license_no: null,    // 驾驶证号
+                    provide_list: null,         // 是否提供清单
+                    receiving_type: null,       // 收货类型
+                    owner: null,                // 货主
+                    appointment_number: null, // 预约号
+                },
+                clodop:null,
+                clodopPrintDialogVisible: false,
+                printerList: [],
+                print_setting: {
+                    printer_index: 0,
+                }
+            },
+            mounted() {
+                $("#list").removeClass('d-none');
+            },
+            methods: {
+                waitingTempTip(message) {
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.waitingTip(message);
+                },
+                successTempTip(message) {
+                    window.tempTip.setDuration(1500);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.showSuccess(message);
+                },
+                errorTempTip(message) {
+                    window.tempTip.setDuration(2000);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.show(message);
+                },
+                submit() {
+                    let result = this.checkSubmitData();
+                    if (!result.success) {
+                        this.error_message = result.message;
+                        this.errors[result.field] = result.message;
+                        this.errorTempTip(result.message);
+                        this.scrollToTop();
+                        return;
+                    }
+                    let url = "{{route("store.receivingMask.storeApi")}}";
+                    let form = document.getElementById("receiving-task-form");
+                    let formData = new FormData(form);
+                    this.selected_asn_nos.forEach(e => {
+                        if (e) formData.append('asn_nos[]', e);
+                    });
+                    this.submit_loading = true;
+                    window.axios.post(url, formData, {
+                        'Content-Type': 'multipart/form-data'
+                    }).then(res => {
+                        this.submit_loading = false;
+                        if (res.data.success) {
+                            this.successTempTip("创建成功");
+                            this.conversion(res.data.data);
+                        } else {
+                            if (res.data.errors) {
+                                let error = null;
+                                for (const key in res.data.errors) {
+                                    this.errors[key] = res.data.errors[key].find(e => e);
+                                    if (!error) error = res.data.errors[key].find(e => e);
+                                }
+                                this.errorTempTip(error ? error : "创建异常请检查后提交");
+                                this.scrollToTop();
+                            } else if (res.data.message) {
+                                this.errorTempTip(res.data.message ? res.data.message : '提交异常,请刷新重试');
+                            }
+                        }
+                    }).catch(err => {
+                        this.errorTempTip(err);
+                        this.submit_loading = false;
+                    })
+                },
+                getASNDetails() {
+                    let {owner_id} = this.receiving_task;
+                    let owner = this.owners.filter(e => e.id === owner_id).find(e => e);
+                    if (!owner) return;
+                    let url = '{{route('oracle.asn.getToBeProcessApi')}}';
+                    let data = {customer_id: owner.value};
+                    window.axios.post(url, data).then(res => {
+                        if (res.data.success) {
+                            this.asn_headers = this.formatAsnHeaderDetails(res.data.data);
+                        }
+                    }).catch(err => {
+                        this.errorTempTip(err);
+                    });
+                 },
+                formatAsnHeaderDetails(asnHeaderDetails) {
+                    return asnHeaderDetails.map(e => this.formatAsnHeaderDetail(e));
+                },
+                formatAsnHeaderDetail(asnHeaderDetail) {
+                    let asn_details = asnHeaderDetail.asn_details ? asnHeaderDetail.asn_details : [];
+                    let anticipated_sum_number = this.getAnticipatedSumNumber(asn_details);
+                    return {
+                        customer_id: asnHeaderDetail.bas_customer ? asnHeaderDetail.bas_customer.descr_c : '',
+                        asn_no: asnHeaderDetail.asnno ? asnHeaderDetail.asnno : '',
+                        asn_type: asnHeaderDetail.asn_type ? asnHeaderDetail.asn_type.codename_c : '',
+                        asn_status: asnHeaderDetail.asn_status ? asnHeaderDetail.asn_status.codename_c : '',
+                        up_stream_number: asnHeaderDetail.asnreference1 ? asnHeaderDetail.asnreference1 : '',
+                        anticipated_sum_number: anticipated_sum_number,
+                        number1: asnHeaderDetail.asnreference1 ? asnHeaderDetail.asnreference1 : '',
+                        number2: asnHeaderDetail.asnreference2 ? asnHeaderDetail.asnreference2 : '',
+                        number3: asnHeaderDetail.asnreference3 ? asnHeaderDetail.asnreference3 : '',
+                        receiving_time: asnHeaderDetail.asncreationtime ? asnHeaderDetail.asncreationtime : '',
+                        details: this.formatAsnDetails(asn_details),
+                    };
+                },
+                formatAsnDetails(asnDetails) {
+                    return asnDetails.map(e => this.formatAsnDetail(e));
+                },
+                formatAsnDetail(asnDetail) {
+                    return {
+                        line_status: asnDetail.line_status ? asnDetail.line_status.codename_c : '',
+                        name: asnDetail.bas_sku ? asnDetail.bas_sku.descr_c : '',
+                        code1: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku1 : '',
+                        code2: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku2 : '',
+                        code3: asnDetail.bas_sku ? asnDetail.bas_sku.alternate_sku3 : '',
+                        anticipated_number: asnDetail.expectedqty ? asnDetail.expectedqty : '',
+                        number: asnDetail.receivedqty ? asnDetail.receivedqty : 0,
+                    }
+                },
+                getAnticipatedSumNumber(asnDetails) {
+                    if (asnDetails.length === 0) return 0;
+                    let sum = asnDetails.reduce((total, e) => {
+                        return total + Number(e.expectedqty);
+                    }, 0);
+                    return sum ? sum : 0;
+                },
+                showAsnDetails(row, column, event) {
+                    this.$refs.asn_headers_table.setCurrentRow(row);
+                    this.asn_details = row.details;
+                },
+                handleSelectionChange(val) {
+                    this.selected_asn_nos = val.map(e => e.asn_no);
+                },
+                checkSubmitData() {
+                    let result = {success: true, message: '', field: '',};
+                    let {
+                        warehouse_id, owner_id,
+                        driver_name, driver_phone, for_single_member,
+                        plate_number, driving_license_no, logistics_single_number,
+                        provide_list, receiving_type, appointment_number
+                    } = this.receiving_task;
+
+                    if (!warehouse_id) {
+                        result = {success: false, message: "仓库为必选项", field: 'warehouse_id'};
+                    } else if (!for_single_member) {
+                        result = {success: false, message: "投单员不能为空", field: 'for_single_member'};
+                    } else if (!owner_id) {
+                        result = {success: false, message: "货主为必选项", field: 'owner_id'};
+                    } else if (!driver_name) {
+                        result = {success: false, message: "司机姓名不能为空", field: 'driver_name'};
+                    } else if (!driver_phone) {
+                        result = {success: false, message: "司机电话不能为空", field: 'driver_phone'};
+                    } else if (!appointment_number) {
+                        result = {success: false, message: "预约单号不能为空", field: 'appointment_number'};
+                    }
+                    if (!result.success) return result;
+                    if (!logistics_single_number) {
+                        if (!plate_number) {
+                            result = {success: false, message: "车牌号不能为空", field: 'plate_number'};
+                        } else if (!driving_license_no) {
+                            result = {success: false, message: "驾驶证号", field: 'driving_license_no'};
+                        }
+                    }
+                    if (!result.success) return result;
+                    if (!provide_list) {
+                        result = {success: false, message: "是否提供清单为必填项", field: 'provide_list'};
+                    } else if (!receiving_type) {
+                        result = {success: false, message: "收货类型不能为空", field: 'provide_list'};
+                    }
+
+                    return result;
+                },
+                clearError(field) {
+                    this.errors[field] ? this.errors[field] = '' : null;
+                },
+                checkLogisticsSingleIsWrite() {
+                    if (this.receiving_task.plate_number) return true;
+                    else if (this.receiving_task.driving_license_no) return true;
+                    return false;
+                },
+                checkLogisticsSingleNumber() {
+                    if (this.receiving_task.plate_number) return true;
+                    else if (this.receiving_task.driving_license_no) return true;
+                    return false;
+                },
+                scrollToTop() {
+                    const c = document.documentElement.scrollTop || document.body.scrollTop;
+                    if (c > 0) {
+                        window.requestAnimationFrame(this.scrollToTop);
+                        window.scrollTo(0, c - c / 8);
+                    }
+                },
+                conversion(receivingTask) {
+                    this.receiving_task_print = {
+                        number: receivingTask.number,
+                        warehouse: receivingTask.warehouse ? receivingTask.warehouse.name : '',
+                        for_single_member: receivingTask.for_single_member,
+                        driver_name: receivingTask.driver_name,
+                        driver_phone: receivingTask.driver_phone,
+                        plate_number: receivingTask.plate_number,
+                        driving_license_no: receivingTask.driving_license_no,
+                        provide_list: receivingTask.provide_list,
+                        receiving_type: receivingTask.receiving_type,
+                        owner: receivingTask.owner ? receivingTask.owner.name : '',
+                        appointment_number: receivingTask.delivery_appointment_car ? receivingTask.delivery_appointment_car.appointment_number : ''
+                    };
+                },
+                printLodop() {
+                    this.clodop = null;
+                    try {
+                        this.clodop = getLodop();
+                        if ((this.clodop != null) && (typeof (this.clodop.VERSION) != "undefined")) {
+                            this.showPrintDialog();
+                        } else {
+                            this.downloadClodopConfirm();
+                        }
+                    } catch (err) {
+                        this.errorTempTip('getLodop error');
+                    }
+                },
+                downloadClodopConfirm() {
+                    this.$confirm('打印组件确实,是否下在?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        // 下载
+                        this.downloadLodop();
+                    }).catch(() => {
+                        // 取消下载
+                    });
+                },
+                downloadLodop() {
+                    let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
+                    window.open(url, '_target');
+                },
+                showPrintDialog() { //
+                    this.getPrinterList();
+                    this.clodopPrintDialogVisible = true;
+                },
+                getPrinterList() {  // 获取打印机列表
+                    this.printerList = [];
+                    let count = this.clodop.GET_PRINTER_COUNT();
+                    for (let i = 0; i < count; i++) {
+                        this.printerList.push({
+                            name: this.clodop.GET_PRINTER_NAME(i),
+                            value: i,
+                        });
+                    }
+                },
+                clodopPrint(){
+                    let {
+                        number,               // 收货任务号
+                        warehouse,             // 仓库
+                        for_single_member,    // 投单员
+                        driver_name,          // 司机姓名
+                        driver_phone,         // 司机电话
+                        plate_number,          // 车号牌
+                        driving_license_no,    // 驾驶证号
+                        provide_list,         // 是否提供清单
+                        receiving_type,       // 收货类型
+                        owner,                // 货主
+                        appointment_number, // 预约号
+                    } = this.receiving_task_print;
+                    this.clodop.PRINT_INITA(2,0,0,0,"");
+                    this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
+                    this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39",number);
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,number); // number
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,warehouse);  // warehouse
+                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,driver_name); //driver_name
+                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,plate_number);  //plate_number
+                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,provide_list); //provide_list
+                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,owner);  // owner
+                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,for_single_member);  // for_single_member
+                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,driver_phone); // driver_phone
+                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,driving_license_no); // driving_license_no
+                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,receiving_type);  // receiving_type
+                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,appointment_number); //appointment_number
+                    this.clodop.PREVIEW();
+                }
+            }
+        })
+    </script>
+    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
+        <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
+    </object>
+@endsection

+ 348 - 0
resources/views/store/receivingTasks/index.blade.php

@@ -0,0 +1,348 @@
+@extends('layouts.app')
+@section('title')开单入库-查询@endsection
+@section('head')
+    <link href="{{ mix('css/element-ui.css') }}" rel="stylesheet">
+    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
+@endsection
+
+
+@section('content')
+    <div id="list" class="container-fluid d-none">
+        <div >
+            <div id="form_div" style="min-width: 1220px;"></div>
+            <div class="ml-3 form-inline" id="btn">
+                @can('入库管理-开单入库-打印任务单')
+                <button type="button"
+                        class="ml-2 btn btn-sm btn-outline-success "
+                        @click="printReceivingTask" >打印任务清单
+                </button>
+                @endcan
+            </div>
+            <div>
+                <table class="table table-sm table-striped table-hover table-bordered  " id="table">
+                    <tr v-for="(item,i) in receiving_tasks" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
+                        <td>
+                            <label><input type="checkbox" :value="item.id"></label>
+                        </td>
+                        <td v-text="i+1"></td>
+                        <td v-text="item.number"></td>
+                        <td v-text="item.status"></td>
+                        <td >
+                            <template v-for="(asn_no,i) in item.asn_nos">
+                               <div >
+                                   <span v-text="asn_no"></span>
+                               </div>
+                            </template>
+                        </td>
+                        <td v-text="item.created_at"></td>
+                        <td v-text="item.warehouse"></td>
+                        <td v-text="item.appointment_number"></td>
+                        <td v-text="item.driving_license_no"></td>
+                        <td v-text="item.receiving_type"></td>
+                    </tr>
+                </table>
+                <div class="text-info h5 btn btn">{{$receivingTasks->count()}}/@{{ total }}</div>
+                {{ $receivingTasks->withQueryString()->links() }}
+            </div>
+        </div>
+        @include('store.receivingTasks._clodop_print')
+    </div>
+@endsection
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>
+    <script type="text/javascript" src="{{ mix('js/element-ui.js') }}"></script>
+    <script type="text/javascript" src="{{mix('js/lodop/LodopFuncs.js')}}"></script>
+    <script src='http://localhost:18000/CLodopfuncs.js?name=CLODOPA'></script>
+
+    <script>
+        let vue = new Vue({
+            el: "#list",
+            data: {
+                receiving_tasks: [],
+                total: 0,
+                selectTr:0,
+                owners: [
+                        @foreach($owners as $owner)
+                    {
+                        name: '{{$owner->id}}', value: '{{$owner->name}}'
+                    },
+                    @endforeach
+                ],
+                warehouses: [
+                        @foreach($warehouses as $warehouse)
+                    {
+                        name: '{{$warehouse->id}}', value: '{{$warehouse->name}}'
+                    },
+                    @endforeach
+                ],
+                receiving_task_print:{
+                    number:null,
+                    warehouse:null,
+                    for_single_member:null,
+                    driver_name:null,
+                    driver_phone:null,
+                    plate_number:null,
+                    driving_license_no:null,
+                    provide_list:null,
+                    receiving_type:null,
+                    owner:null,
+                    appointment_number:null,
+                },
+                clodop:null,
+                clodopPrintDialogVisible: false,
+                printerList: [],
+                print_setting: {
+                    printer_index: 0,
+                }
+            },
+            mounted() {
+                let receiving_tasks = {!! $receivingTasks->toJson() !!}['data'];
+                this.total = {!! $receivingTasks->toJson() !!}['total'];
+                $("#list").removeClass('d-none');
+                this.receiving_tasks = this.sortReceivingTasks(receiving_tasks);
+
+                let data = [[
+                    {name: 'created_at_start', type: 'dateTime', tip: '选择显示指定日期的起始时间', placeholder: ''},
+                    {name: 'created_at_end', type: 'dateTime', tip: '选择显示指定日期的结束时间', placeholder: ''},
+                    {name: 'number', type: 'input', tip: '任务号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: '任务号'},
+                    {name: 'appointment_number', type: 'input', tip: '预约号:如模糊搜索需要在条件前后输入%号,回车提交', placeholder: '预约号'},
+                ],[
+                    {
+                        name: 'owner_id',
+                        type: 'select_multiple_select',
+                        data: this.owners,
+                        tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的货主'],
+                        placeholder: ['货主', '定位或多选货主']
+                    },
+                    {
+                        name: 'warehouse_id',
+                        type: 'select_multiple_select',
+                        data: this.warehouses,
+                        tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的仓库'],
+                        placeholder: ['仓库', '定位或多选仓库']
+                    },
+                ]];
+                this.form = new query({
+                    el: '#form_div',
+                    condition: data,
+                });
+                this.form.init();
+
+                let column = [
+                    {name:'id',value: '序号', neglect: true},
+                    {name:'number',value: '收货任务号'},
+                    {name:'status',value: '状态', neglect: true},
+                    {name:'asn_nos',value: 'ASN单号', neglect: true},
+                    {name:'created_at',value: '投单时间'},
+                    {name:'warehouse',value: '仓库'},
+                    {name:'appointment_number',value: '预约号'},
+                    {name:'driving_license_no',value: '驾驶证号'},
+                    {name:'receiving_type',value: '收货类型'},
+                ];
+                new Header({
+                    el: "table",
+                    name: "receiving_tasks",
+                    column: column,
+                    data: this.receiving_tasks,
+                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
+                }).init();
+            },
+            methods: {
+                waitingTempTip(message) {
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.waitingTip(message);
+                },
+                successTempTip(message) {
+                    window.tempTip.setDuration(1500);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.showSuccess(message);
+                },
+                errorTempTip(message) {
+                    window.tempTip.setDuration(2000);
+                    window.tempTip.setIndex(2005);
+                    window.tempTip.show(message);
+                },
+                sortReceivingTasks(tasks) {
+                    return tasks.map(e => this.sortReceivingTask(e));
+                },
+                sortReceivingTask(task) {
+                    let asn_nos = this.sortAsnNos(task);
+                    let driving_license_no = this.getDrivingLicenseNo(task);
+                    let appointment_number = this.getAppointmentNumber(task);
+                    let warehouse = this.getWarehouseName(task);
+                    let owner = this.getOwnerName(task);
+                    return {
+                        number: task.number,
+                        status: task.status,
+                        asn_nos: asn_nos,
+                        created_at: task.created_at,
+                        warehouse: warehouse,
+                        for_single_member: task.for_single_member,
+                        driver_name: task.driver_name,
+                        driver_phone: task.driver_phone,
+                        plate_number: task.plate_number,
+                        provide_list: task.provide_list,
+                        owner: owner,
+                        appointment_number: appointment_number,
+                        driving_license_no: driving_license_no,
+                        receiving_type: task.receiving_type,
+                    };
+                },
+                sortAsnNos(task) {
+                    let items = task.items;
+                    return items.map(e => e.asn_no);
+                },
+                getDrivingLicenseNo(task) {
+                    let {delivery_appointment_car, driving_license_no} = task;
+                    let license_plate_number = delivery_appointment_car ? delivery_appointment_car.license_plate_number : '';
+                    return driving_license_no ? driving_license_no : license_plate_number;
+                },
+                getAppointmentNumber(task) {
+                    let {delivery_appointment_car} = task;
+                    return delivery_appointment_car ? delivery_appointment_car.appointment_number : '';
+                },
+                getWarehouseName(task) {
+                    let {ware_house} = task;
+                    return ware_house ? ware_house.name : '';
+                },
+                getOwnerName(task) {
+                    let {owner} = task;
+                    return owner ? owner.name : '';
+                },
+                printReceivingTask(){
+                    let message =null;
+                    if (checkData.length > 1){
+                        message = '进行单个任务打印';
+                    }else if (checkData.length === 1){
+                        message = '请勾选收货任务';
+                    }
+                    if (message){
+                        this.errorTempTip(message);
+                        return ;
+                    }
+                    let id = checkData[0];
+                    this.receiving_task_print = this.receiving_tasks.find(e=>e.id===id);
+                    this.printLodop();
+                },
+                printLodop() {
+                    this.clodop = null;
+                    try {
+                        this.clodop = getLodop();
+                        if ((this.clodop != null) && (typeof (this.clodop.VERSION) != "undefined")) {
+                            this.showPrintDialog();
+                        } else {
+                            this.downloadClodopConfirm();
+                        }
+                    } catch (err) {
+                        this.errorTempTip('getLodop error');
+                    }
+                },
+                downloadClodopConfirm() {
+                    this.$confirm('打印组件确实,是否下在?', '提示', {
+                        confirmButtonText: '确定',
+                        cancelButtonText: '取消',
+                        type: 'warning'
+                    }).then(() => {
+                        // 下载
+                        this.downloadLodop();
+                    }).catch(() => {
+                        // 取消下载
+                    });
+                },
+                downloadLodop() {
+                    let url = "{{mix('/js/lodop/CLodop_Setup_for_Win32NT.exe')}}"
+                    window.open(url, '_target');
+                },
+                showPrintDialog() { //
+                    this.getPrinterList();
+                    this.clodopPrintDialogVisible = true;
+                },
+                getPrinterList() {  // 获取打印机列表
+                    this.printerList = [];
+                    let count = this.clodop.GET_PRINTER_COUNT();
+                    for (let i = 0; i < count; i++) {
+                        this.printerList.push({
+                            name: this.clodop.GET_PRINTER_NAME(i),
+                            value: i,
+                        });
+                    }
+                },
+                clodopPrint(){
+                    let {
+                        number,               // 收货任务号
+                        warehouse,             // 仓库
+                        for_single_member,    // 投单员
+                        driver_name,          // 司机姓名
+                        driver_phone,         // 司机电话
+                        plate_number,          // 车号牌
+                        driving_license_no,    // 驾驶证号
+                        provide_list,         // 是否提供清单
+                        receiving_type,       // 收货类型
+                        owner,                // 货主
+                        appointment_number, // 预约号
+                    } = this.receiving_task_print;
+                    this.clodop.PRINT_INITA(2,0,0,0,"");
+                    this.clodop.SET_PRINT_PAGESIZE(2,'76mm','130mm');
+                    this.clodop.ADD_PRINT_BARCODE(20,70,350,50,"Code39",number);
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.ADD_PRINT_TEXT(100,15,100,20,"收货任务号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,15,100,20,"仓库");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,15,100,20,"司机姓名");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,15,100,20,"车牌号");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,15,100,20,"是否提供清单");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,15,100,20,"货主");
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,245,100,20,"投单员");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(160,245,100,20,"司机电话");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(190,245,100,20,"驾驶证号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(220,245,100,20,"收货类型");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(250,245,100,20,"预约号");
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(100,115,250,20,number); // number
+                    this.clodop.SET_PRINT_STYLEA(0,"FontSize",10);
+                    this.clodop.SET_PRINT_STYLEA(0,"Alignment",2);
+                    this.clodop.SET_PRINT_STYLEA(0,"Bold",1);
+                    this.clodop.ADD_PRINT_TEXT(130,115,130,20,warehouse);  // warehouse
+                    this.clodop.ADD_PRINT_TEXT(160,115,100,20,driver_name); //driver_name
+                    this.clodop.ADD_PRINT_TEXT(190,115,130,20,plate_number);  //plate_number
+                    this.clodop.ADD_PRINT_TEXT(220,115,100,20,provide_list); //provide_list
+                    this.clodop.ADD_PRINT_TEXT(250,115,130,20,owner);  // owner
+                    this.clodop.ADD_PRINT_TEXT(130,345,100,20,for_single_member);  // for_single_member
+                    this.clodop.ADD_PRINT_TEXT(160,345,140,20,driver_phone); // driver_phone
+                    this.clodop.ADD_PRINT_TEXT(190,345,140,20,driving_license_no); // driving_license_no
+                    this.clodop.ADD_PRINT_TEXT(220,345,100,20,receiving_type);  // receiving_type
+                    this.clodop.ADD_PRINT_TEXT(250,345,140,20,appointment_number); //appointment_number
+                    this.clodop.PREVIEW();
+                    this.clodopPrintDialogVisible = false;
+                }
+            },
+        })
+    </script>
+@endsection

+ 13 - 0
routes/apiLocal.php

@@ -62,6 +62,19 @@ Route::group(['prefix' => 'personnel'], function () {
         });
     });
 });
+// 开单入库
+Route::prefix('store')->group(function(){
+    Route::prefix('receivingMask')->group(function(){
+        Route::post("/createApi","ReceivingTaskController@storeApi")->name("store.receivingMask.storeApi");
+    });
+});
+Route::prefix('oracle')->group(function(){
+    Route::prefix('asn')->group(function(){
+        Route::post("/toBeProcess/CustomerId","OracleDOCAsnHeaderController@getToBeProcessAsnHeaderDetailsApi")
+            ->name("oracle.asn.getToBeProcessApi");
+    });
+});
+
 
 Route::group(['prefix' => 'order'], function () {
     Route::group(['prefix'=>'issue'],function(){

+ 8 - 0
routes/web.php

@@ -32,6 +32,14 @@ Route::post('package/weigh/measureMonitor/data', 'MeasureMonitorController@data'
 Route::get('package/measureMonitor', 'MeasureMonitorController@index');
 Route::get('package/weigh/measureMonitor', 'MeasureMonitorController@index');
 
+// 开单入库
+Route::prefix('store')->group(function(){
+    Route::prefix('receivingTask')->group(function(){
+        Route::get("/index","ReceivingTaskController@index");
+        Route::get("/create","ReceivingTaskController@create");
+    });
+});
+
 //入库预约终端
 Route::get('store/deliveryAppointment/exhibition', 'DeliveryAppointmentController@exhibition');
 //入库预约预约码输入