Bläddra i källkod

Merge branch 'master' into zzd

# Conflicts:
#	app/Http/Controllers/WeighController.php
#	app/Services/CacheShelfService.php
dream 4 år sedan
förälder
incheckning
9d607f5300
100 ändrade filer med 2351 tillägg och 1575 borttagningar
  1. 1 0
      .gitignore
  2. 6 6
      app/Console/Commands/SyncWMSOrderTask.php
  3. 2 1
      app/Events/BroadcastToStation.php
  4. 1 1
      app/Http/Controllers/OrderController.php
  5. 76 4
      app/Http/Controllers/PackageLogisticController.php
  6. 66 0
      app/Http/Controllers/PrintPartController.php
  7. 49 0
      app/Http/Controllers/PrintTemplateController.php
  8. 2 2
      app/Http/Controllers/ProcurementController.php
  9. 14 5
      app/Http/Controllers/StationController.php
  10. 117 169
      app/Http/Controllers/TestController.php
  11. 2 1
      app/Http/Controllers/WaybillController.php
  12. 10 5
      app/Http/Controllers/api/thirdPart/haiq/HaiRoboticsController.php
  13. 15 2
      app/Http/Controllers/api/thirdPart/haiq/StorageController.php
  14. 1 1
      app/Http/Controllers/api/thirdPart/weight/WeightBaseController.php
  15. 3 0
      app/MaterialBox.php
  16. 5 0
      app/OracleActAllocationDetails.php
  17. 24 0
      app/OracleDocOrderSubSerialNo.php
  18. 10 4
      app/OrderPackage.php
  19. 3 3
      app/OrderPackageCommoditySerialNumber.php
  20. 15 0
      app/PrintPart.php
  21. 14 0
      app/PrintTemplate.php
  22. 6 0
      app/Providers/AppServiceProvider.php
  23. 12 9
      app/Services/BatchService.php
  24. 0 1
      app/Services/CacheShelfService.php
  25. 64 13
      app/Services/ForeignHaiRoboticsService.php
  26. 41 0
      app/Services/ForeignZhenCangService.php
  27. 2 2
      app/Services/LogisticYTOService.php
  28. 2 2
      app/Services/OracleDOCOrderHeaderService.php
  29. 28 13
      app/Services/OrderPackageCommoditySerialNumberService.php
  30. 10 2
      app/Services/OrderPackageReceivedSyncService.php
  31. 35 1
      app/Services/OrderPackageService.php
  32. 0 5
      app/Services/OrderTrackingService.php
  33. 13 0
      app/Services/PrintPartService.php
  34. 13 0
      app/Services/PrintTemplateService.php
  35. 3 3
      app/Services/StationRuleBatchService.php
  36. 1 0
      app/Services/StationTaskBatchService.php
  37. 3 3
      app/Services/StationTaskCommodityService.php
  38. 23 0
      app/Services/StationTaskService.php
  39. 4 3
      app/Services/WaybillService.php
  40. 8 0
      app/Station.php
  41. 1 1
      config/haiRou.php
  42. 13 0
      database/factories/PrintPartFactory.php
  43. 13 0
      database/factories/PrintTemplateFactory.php
  44. 33 0
      database/migrations/2021_02_07_095609_create_print_parts_table.php
  45. 33 0
      database/migrations/2021_02_07_095839_create_print_templates_table.php
  46. 34 0
      database/migrations/2021_05_21_131520_add_order_packages_logistic_number_unique.php
  47. 18 0
      database/seeds/PrintPartSeeder.php
  48. 18 0
      database/seeds/PrintTemplateSeeder.php
  49. 1 0
      package.json
  50. 2 24
      public/t.php
  51. 3 1
      resources/js/queryForm/queryForm.js
  52. 11 0
      resources/js/utilities/html2canvas.js
  53. 121 90
      resources/views/inventory/stockInventory/inventoryMission.blade.php
  54. 1 1
      resources/views/layouts/menu.blade.php
  55. 12 0
      resources/views/maintenance/expressPrinting/menu.blade.php
  56. 19 0
      resources/views/maintenance/expressPrinting/part/_table.blade.php
  57. 213 0
      resources/views/maintenance/expressPrinting/part/create.blade.php
  58. 37 0
      resources/views/maintenance/expressPrinting/part/index.blade.php
  59. 12 0
      resources/views/maintenance/expressPrinting/part/menu.blade.php
  60. 149 0
      resources/views/maintenance/expressPrinting/print/index.blade.php
  61. 9 0
      resources/views/maintenance/expressPrinting/print/menu.blade.php
  62. 85 0
      resources/views/maintenance/expressPrinting/template/_compile.blade.php
  63. 35 0
      resources/views/maintenance/expressPrinting/template/_produce.blade.php
  64. 11 0
      resources/views/maintenance/expressPrinting/template/_select.blade.php
  65. 177 0
      resources/views/maintenance/expressPrinting/template/create.blade.php
  66. 52 0
      resources/views/maintenance/expressPrinting/template/index.blade.php
  67. 12 0
      resources/views/maintenance/expressPrinting/template/menu.blade.php
  68. 6 1
      resources/views/maintenance/menu.blade.php
  69. 39 31
      resources/views/order/issue/index.blade.php
  70. 3 3
      resources/views/order/tracking/index.blade.php
  71. 113 66
      resources/views/package/logistic/index.blade.php
  72. 1 1
      resources/views/package/measureMonitor/index.blade.php
  73. 2 2
      resources/views/procurement/procurement/index.blade.php
  74. 2 1
      resources/views/rejected/importRejectedNumber.blade.php
  75. 179 34
      resources/views/station/monitor/show.blade.php
  76. 44 905
      resources/views/test.blade.php
  77. 1 1
      resources/views/transport/waybill/_dailyBilling.blade.php
  78. 3 0
      routes/api/thirdPart/haiq.php
  79. 15 0
      routes/apiLocal.php
  80. 11 1
      routes/web.php
  81. 9 6
      tests/Services/BatchService/AssignTasksTest.php
  82. 16 16
      tests/Services/CacheShelfService/ProcessTest.php
  83. 4 4
      tests/Services/ForeignHaiRoboticsService/PutBinToStoreFromCacheShelfTest.php
  84. 3 3
      tests/Services/ForeignHaiRoboticsService/TaskUpdateTest.php
  85. 0 32
      tests/Services/LogisticQiaoSFService/LogisticQiaoSFServiceTest.php
  86. 1 1
      tests/Services/LogisticService/GetLogisticByCodeTest.php
  87. 1 1
      tests/Services/LogisticService/GetLogisticByCodesTest.php
  88. 0 1
      tests/Services/LogisticYTOService/QueryTest.php
  89. 6 2
      tests/Services/NewOrderCountingRecordService/GetFromCacheTest.php
  90. 5 1
      tests/Services/NewOrderCountingRecordService/GetFromLowerUnitTest.php
  91. 7 2
      tests/Services/NewOrderCountingRecordService/GetOrderCountingRecordsTest.php
  92. 3 1
      tests/Services/NewOrderCountingRecordService/OrderCountingRecordsTest.php
  93. 30 30
      tests/Services/NewOrderCountingRecordService/TransfersToConditionsTest.php
  94. 1 0
      tests/Services/OracleDOCOrderHeaderService/GetWMSOrderOnStartDateTest.php
  95. 1 0
      tests/Services/OracleDOCOrderHeaderService/GetWmsOrderOnStartDateEditTest.php
  96. 1 0
      tests/Services/OracleDOCOrderHeaderService/GetWmsOrderOnstartDateCreateTest.php
  97. 2 2
      tests/Services/OrderCommodityService/SyncOrderCommodityTest.php
  98. 8 2
      tests/Services/OrderIssueService/GetRecycleBinPaginateTest.php
  99. 0 47
      tests/Services/OrderIssueService/OrderIssueTagTest.php
  100. 5 0
      tests/Services/OrderIssueService/RecoverOrderIssueTest.php

+ 1 - 0
.gitignore

@@ -29,3 +29,4 @@ yarn-error.log
 /public/phpMyAdmin4.8.5/
 /public/fonts
 /phpunit.xml
+/laravel-echo-server.lock

+ 6 - 6
app/Console/Commands/SyncWMSOrderTask.php

@@ -86,13 +86,13 @@ class SyncWMSOrderTask extends Command
             ->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
             ->whereColumn('DOC_Order_Header.editTime','=','DOC_Order_Header.addTime')
             ->where('addTime','>=',$last_date)
-            ->orderByDesc('DOC_Order_Header.addTime')->get();
+            ->orderBy('DOC_Order_Header.addTime')->get();
 
         if($orderHeaders->count()==0)return;
         $orderHeaderList = $orderHeaders->chunk(1000);
         foreach ($orderHeaderList as $item) {
             $item = $oracleDOCOrderHeaderService->loadMissing($item);
-            $last_order = $item->first();                                                               // 时间点靠后的
+            $last_order = $item->last();                                                               // 时间点靠后的
             $newest_orders = $item->where('addtime',$last_order->addtime);
             $orderHeaders = $this->service->filterOrderByCache($item,$newest_list_key);                  // 对比缓存
             if(count($newest_orders)>0 && count($orderHeaders) >0){
@@ -118,18 +118,18 @@ class SyncWMSOrderTask extends Command
         ini_set('memory_limit', '1024M');
         $last_date = $this->service->getOrderSyncAt($renewal_key,'renewal');                               // 获取更新时间点
 
-        $orderHeaders = OracleDOCOrderHeader::query()->where('editTime',">=",$last_date)
+        $orderHeaders = OracleDOCOrderHeader::query()
             ->selectRaw(implode(',',OracleDOCOrderHeaderService::$columns))
             ->whereColumn('DOC_Order_Header.editTime','!=','DOC_Order_Header.addTime')
-            ->orderByDesc('editTime')
-            ->get();
+            ->where('editTime',">=",$last_date)
+            ->orderBy('editTime')->get();
 
         if($orderHeaders->count()==0)return;
 
         $orderHeaderList = $orderHeaders->chunk(1000);
         foreach ($orderHeaderList as $item) {
             $item  = $oracleDOCOrderHeaderService->loadMissing($item);
-            $renewal_order = $item->first();                                                            // 时间点靠后的
+            $renewal_order = $item->last();                                                            // 时间点靠后的
             $renewal_orders =  $item->where('edittime',$renewal_order->edittime);
             $orderHeaders = $this->service->filterOrderByCache($orderHeaders,$renewal_list_key);                     // 对比缓存
             if(count($renewal_orders)>0 && count($orderHeaders)>0){

+ 2 - 1
app/Events/BroadcastToStation.php

@@ -9,6 +9,7 @@ class BroadcastToStation implements ShouldBroadcastNow
 {
     public $json;
     private $id;
+    const ALL_STATION=0;
     /**
      * Create a new event instance.
      *
@@ -18,7 +19,7 @@ class BroadcastToStation implements ShouldBroadcastNow
      */
     public function __construct(int $id, string $json)
     {
-        $this->id = $id;
+        $this->id = $id;// 0意味着通用站,所有站都需要收发的意思
         $this->json = $json;
     }
 

+ 1 - 1
app/Http/Controllers/OrderController.php

@@ -344,7 +344,7 @@ sql;
             ->whereIn('orderno',$orderno)
             ->where('sostatus','99')
             ->whereIn('edisendflag',['R','W'])
-                ->where('addwho','!=','EDI')
+                ->where('addwho','==','EDI')
             ->update(['edisendflag'=>'N']);
 
         $failedOrdernos =OracleDOCOrderHeader::query()

+ 76 - 4
app/Http/Controllers/PackageLogisticController.php

@@ -3,12 +3,13 @@
 namespace App\Http\Controllers;
 
 use App\Events\UpdateOrderPackageExceptionListenerEvent;
+use App\Exceptions\Exception;
 use App\Filters\OrderPackageFilters;
 use App\Logistic;
 use App\OrderPackage;
 use App\Owner;
+use App\Services\common\ExportService;
 use App\Services\UserService;
-use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Http\Request;
 
 class PackageLogisticController extends Controller
@@ -30,7 +31,7 @@ class PackageLogisticController extends Controller
         $orderPackages = OrderPackage::query()
             ->filter($filters)
             ->whereIn('owner_id', $owner_ids)->with(['order.logistic', 'order.owner', 'order.issue' => function ($query) {
-                $query->with(['issueType', 'logs'=>function($query) {
+                $query->with(['issueType', 'logs' => function ($query) {
                     $query->with('user')->orderBy('created_at', 'DESC');
                 }]);
             }])->orderByDesc('id')->paginate($request->paginate ?? 50);
@@ -56,14 +57,14 @@ class PackageLogisticController extends Controller
     public function batchUpdate(Request $request)
     {
         $data = [];
-        if (array_key_exists('exception_type',$request->all())) {
+        if (array_key_exists('exception_type', $request->all())) {
             if ('无' == $request->input('exception_type')) {
                 $data['exception_type'] = $request->input('exception_type');
                 $data['exception'] = "否";
             } else {
                 $data['exception_type'] = $request->input('exception_type');
             }
-        }else if (array_key_exists('status',$request->all())) {
+        } else if (array_key_exists('status', $request->all())) {
             $data['status'] = $request->input('status');
         }
         $logistic_numbers = $request->input('logistic_numbers');
@@ -71,4 +72,75 @@ class PackageLogisticController extends Controller
         //更新统计数据
         event(new UpdateOrderPackageExceptionListenerEvent($logistic_numbers));
     }
+
+    /**
+     * @throws Exception
+     */
+    public function export(Request $request, OrderPackageFilters $filters)
+    {
+        /** @var UserService $userService */
+        $userService = app('UserService');
+        $owner_ids = $userService->getPermittingOwnerIds(auth()->user());
+        $query = OrderPackage::query()
+            ->filter($filters)
+            ->whereIn('owner_id', $owner_ids)
+            ->with(['order.logistic', 'order.owner', 'order.issue' => function ($query) {
+                $query->with(['issueType', 'logs' => function ($query) {
+                    $query->with('user')->orderBy('created_at', 'DESC');
+                }]);
+            }]);
+        if ($request->exists('checkAllSign')) {
+            $orderPackages = $query->orderByDesc('id')->get();
+        } else {
+            $orderPackages = $query
+                ->whereIn('logistic_number', explode(',', $request['data']))
+                ->orderByDesc('id')->get();
+        }
+        $row = ["异常类型", "单号", "状态", "快递公司", "货主", "省份", "发出日期", "收货日期", "称重日期", "快递路由", "客服备注", "情况说明", "问题类别", "说明", "操作者", "时间",];
+        $json = [];
+        foreach ($orderPackages as $orderPackage) {
+            $transfer_status = "";
+            if (is_array($orderPackage->transfer_status) && !empty($orderPackage->transfer_status)) {
+                foreach ($orderPackage->transfer_status as $transfer) {
+                    $transferItemStr = "";
+                    $transferItemStr = $transferItemStr . $transfer['accept_address'] . "   " . $transfer['remark'] . "   " . $transfer['accept_time'];
+                    $transfer_status = $transfer_status . $transferItemStr . ",\r\n";
+                }
+            }
+            $remark = "";
+            if (is_array($orderPackage->remark) && !empty($orderPackage->remark)) {
+                foreach ($orderPackage->remark as $remarkItem) {
+                    $remark = $remark . $remarkItem . ",\r\n";
+                }
+            }
+            $logsContent = "";
+            $users = "";
+            $logCreatedAt = "";
+            if ($orderPackage->order && $orderPackage->order->issue) {
+                foreach ($orderPackage->order->issue->logs as $log) {
+                    $logsContent = $logsContent . $log->content . ",\r\n";
+                    $users = $users . $log->user->name . ",\r\n";
+                    $logCreatedAt = $logCreatedAt . $log->created_at . ",\r\n";
+                }
+            }
+            $data = [
+                $orderPackage->exception_type,
+                $orderPackage->logistic_number,
+                $orderPackage->status,
+                $orderPackage->order->logistic->name,
+                $orderPackage->order->owner->name,
+                $orderPackage->order->province,
+                $orderPackage->sent_at,
+                $orderPackage->received_at,
+                $orderPackage->weighed_at,
+                $transfer_status,
+                $remark,
+                $logsContent,
+                $users,
+                $logCreatedAt,
+            ];
+            $json[] = $data;
+        }
+        return app(ExportService::class)->json($row, $json, "包裹快递");
+    }
 }

+ 66 - 0
app/Http/Controllers/PrintPartController.php

@@ -0,0 +1,66 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Components\AsyncResponse;
+use App\Order;
+use App\PrintPart;
+use App\PrintTemplate;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\Http;
+
+class PrintPartController extends Controller
+{
+    use AsyncResponse;
+    public function index(Request $request)
+    {
+        $printParts = PrintPart::query()->paginate($request['paginate'] ?? 50);
+        return view('/maintenance/expressPrinting/part/index',compact('printParts'));
+    }
+
+    public function create(Request $request)
+    {
+        return view('/maintenance/expressPrinting/part/create');
+    }
+
+    public function storeApi(Request $request): \Illuminate\Http\RedirectResponse
+    {
+        PrintPart::query()->create($request->all());
+        $this->success('添加成功');
+    }
+
+    public function destroyApi(Request $request)
+    {
+        $printPart = PrintPart::query()->find($request['id']);
+        $printPart->delete();
+        $this->success('删除成功');
+    }
+
+    public function print(Request $request)
+    {
+        $template = PrintTemplate::query()->where('name','test-快递单号打印')->first();
+        $items = Order::query()->whereIn('code',["SO190628000378","SO190628000347"])->with('packages')->get();
+        return view("maintenance.expressPrinting.print.index",compact("template",'items'));
+    }
+
+    public function printTemplateApi(Request $request)
+    {
+        $file = $request->file("blob");
+        $content = $file->getContent();
+        $content = base64_encode($content);
+        $files = $request->file("blobs");
+
+        $content = [
+            "type" => "print",
+            "aliasName"=>"admin",
+            "printerName"=>"admin123",
+            "content" => $content
+        ];
+        if(!$files)return Http::post("http://127.0.0.1:3000",$content);
+        $contents = [];
+        foreach ($files as $item) {
+            $contents[] = base64_encode($item->getContent());
+        }
+        return Http::post("http://127.0.0.1:3000",['file'=>$content,'files'=>$contents]);
+    }
+}

+ 49 - 0
app/Http/Controllers/PrintTemplateController.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Components\AsyncResponse;
+use App\PrintPart;
+use App\PrintTemplate;
+use Illuminate\Http\Request;
+
+class PrintTemplateController extends Controller
+{
+    use AsyncResponse;
+    public function index(Request $request)
+    {
+        $templates = PrintTemplate::all();
+        return view('/maintenance/expressPrinting/template/index',compact('templates'));
+    }
+
+    public function create(Request $request)
+    {
+        $printParts = PrintPart::all();
+        return view('/maintenance/expressPrinting/template/create',compact('printParts'));
+    }
+
+
+    public function storeApi(Request $request)
+    {
+        $data = [
+            'name' =>$request['name'],
+            'value'=>json_encode($request['value'])
+        ];
+        $printTemplate = PrintTemplate::query()->create($data);
+        $this->success(['data' => $printTemplate]);
+    }
+
+    public function updateApi(Request $request)
+    {
+
+    }
+
+    public function destroyApi(Request $request)
+    {
+        $printTemplate = PrintTemplate::query()->find($request['id']);
+        $printTemplate->delete();
+        $this->success('删除成功');
+    }
+
+
+}

+ 2 - 2
app/Http/Controllers/ProcurementController.php

@@ -398,7 +398,7 @@ class ProcurementController extends Controller
         }
         $procurementStatus=Procurement::status;
         $procurementType=Procurement::type;
-        $row = ['采购编号','项目','单据类型','采购公司','耗材编号','耗材','尺寸大小','特殊要求','材质规格','采购数量','销售单价(元)','送货数量','销售总价(元)','采购单状态','联系方式'];
+        $row = ['采购编号','项目','单据类型','采购公司','耗材编号','耗材','尺寸大小','特殊要求','材质规格','采购数量','销售单价(元)','送货数量','销售总价(元)','采购单状态','供应商联系方式'];
         $list = [];
         foreach ($procurements as $procurement){
             $list[] = [
@@ -416,7 +416,7 @@ class ProcurementController extends Controller
                 $procurement->deliver_amount ?  $procurement->deliver_amount :'',//送货数量
                 $procurement->unit_price*$procurement->amount,//销售总价=销售数量*销售单价
                 is_null($procurement->status) ? '' :$procurementStatus[$procurement->status],
-                $procurement->ownerMaterial->owner->customer ? $procurement->ownerMaterial->owner->customer->phone :'',
+                $procurement->supplier->phone ? $procurement->supplier->phone :'',
             ];
         }
         return Export::make($row,$list,"采购管理-采购报表记录");

+ 14 - 5
app/Http/Controllers/StationController.php

@@ -54,12 +54,12 @@ class StationController extends Controller
     }
     public function monitorShow(Station $station)
     {
-        $stationTypeBinMonitor = StationTypeBinMonitor::query()->where("station_id",$station->id)->first();
+//        $stationTypeBinMonitor = StationTypeBinMonitor::query()->where("station_id",$station->id)->first();
         $station->loadMissing([
-            "currentStationTask.stationTaskCommodities.commodity.barcodes",
-            "currentStationTask.stationTaskCommodities.materialBox",
-            "currentStationTask.stationTaskBatches.batch",
-            "currentStationTask.stationTaskMaterialBoxes.materialBox",
+            "stationTasks_today.stationTaskCommodities.commodity.barcodes",
+            "stationTasks_today.stationTaskCommodities.materialBox",
+            "stationTasks_today.stationTaskBatches.batch.owner",
+            "stationTasks_today.stationTaskMaterialBoxes.materialBox",
             "stationTypeBinMonitor",
         ]);
         if (!$station['stationTypeBinMonitor']){
@@ -71,6 +71,15 @@ class StationController extends Controller
             ]);
             $station->load("stationTypeBinMonitor");
         }
+//        dd(
+//            data_get($station['stationTasks_today'],'*.id')
+//            ,data_get($station['stationTasks_today'],'*.stationTaskBatches.*.batch.code')
+//            ,data_get($station['stationTasks_today'],'*.stationTaskBatches.*.id')
+//            ,data_get($station['stationTasks_today'],'*.stationTaskBatches.*.batch.id')
+//            ,data_get(data_get($station['stationTasks_today'],'*.stationTaskCommodities')[7],'*.id')
+//            ,data_get(data_get($station['stationTasks_today'],'*.stationTaskCommodities')[9],'*.id')
+//        );
+//        $station=$station->toJson();
         return view('station.monitor.show',compact('station'));
     }
 

+ 117 - 169
app/Http/Controllers/TestController.php

@@ -2,38 +2,20 @@
 
 namespace App\Http\Controllers;
 
-
 use App\Authority;
 use App\Batch;
-use App\Carrier;
-use App\CarType;
 use App\City;
 use App\Commodity;
-use App\CommodityBarcode;
 use App\Console\Commands\CreateOwnerAreaReport;
 use App\Console\Commands\CreateOwnerBillReport;
 use App\Console\Commands\CreateOwnerReport;
-use App\Console\Commands\SyncBatchTask;
-use App\Console\Commands\SyncWmsCommoditiesInformation;
-use App\Console\Commands\SyncWMSOrderTask;
 use App\Console\Commands\WasSyncWmsAsnInformation;
-use App\DeliveryAppointment;
-use App\Events\BroadcastToStation;
-use App\DeliveryAppointmentCar;
-use App\Events\DeliveryAppointmentEvent;
-use App\Exceptions\ErrorException;
-use App\Events\CancelOrder;
 use App\Events\SendEmailEvent;
 use App\Exceptions\Exception;
 use App\Feature;
 use App\Http\Controllers\api\thirdPart\haiq\PickStationController;
 use App\Http\Controllers\api\thirdPart\hengli\PackageController;
 use App\Http\Controllers\api\thirdPart\weight\WeightBaseController;
-use App\Http\Requests\ForeignHaiRobotic_taskUpdateRequest;
-use App\Http\Requests\TestAaRequest;
-use App\Imports\OrderTrackingImport;
-use App\InventoryAccount;
-use App\Jobs\BatchTaskJob;
 use App\Jobs\DeleteRepetitionSkuItem;
 use App\Jobs\LogisticYTOSync;
 use App\Jobs\OrderCreateInstantBill;
@@ -49,16 +31,7 @@ use App\MeasuringMachine;
 use App\Menu;
 use App\Notifications\SendEmailNotification;
 use App\OracleActAllocationDetails;
-use App\OracleBasCustomer;
-use App\OracleBasSKU;
 use App\OracleDOCASNHeader;
-use App\OracleDOCOrderDetail;
-use App\OracleDOCOrderHeader;
-use App\OracleDocOrderPackingSummary;
-use App\OracleDocOrderSerialNo;
-use App\OracleDOCWaveDetails;
-use App\OracleDOCWaveHeader;
-use App\OracleInvLotLocId;
 use App\Order;
 use App\OrderBin;
 use App\OrderCommodity;
@@ -66,28 +39,13 @@ use App\OrderIssue;
 use App\OrderPackage;
 use App\Owner;
 use App\OwnerAreaReport;
-use App\OwnerBillReport;
-use App\OwnerFeeDetail;
-use App\OwnerFeeDetailLogistic;
 use App\OwnerMaterial;
-use App\OwnerPriceExpress;
-use App\OwnerPriceOperation;
-use App\OwnerPriceOperationItem;
-use App\OwnerPriceSystem;
-use App\OwnerReport;
-use App\OwnerStoragePriceModel;
 use App\Package;
-use App\Process;
-use App\ProcessDaily;
-use App\ProcessStatistic;
 use App\Procurement;
 use App\ProcurementCheckSheet;
 use App\ProcurementDeliverie;
 use App\ProcurementQuotation;
 use App\ProcurementTotalBill;
-use App\Province;
-use App\Region;
-use App\RejectedBill;
 use App\RejectedBillItem;
 use App\Services\CacheService;
 use App\Services\CommodityService;
@@ -101,9 +59,6 @@ use App\Services\InventoryCompareService;
 use App\Services\LogisticService;
 use App\Services\LogisticZopService;
 use App\Services\LogService;
-use App\Services\OracleActAllocationDetailService;
-use App\Services\OracleBasSkuService;
-use App\Services\OracleDocAsnHerderService;
 use App\Services\OracleDOCOrderHeaderService;
 use App\Services\OracleDocWaveDetailService;
 use App\Services\OrderCommodityService;
@@ -111,37 +66,19 @@ use App\Services\OrderPackageExceptionTypeCountingRecordService;
 use App\Services\OrderPackageReceivedSyncService;
 use App\Services\OrderPackageService;
 use App\Services\OrderService;
-use App\Services\OrderTrackingOwnerService;
 use App\Services\OrderTrackingService;
-use App\Services\OwnerPriceOperationService;
-use App\Services\OwnerService;
-use App\Services\ProcurementService;
-use App\Services\RegionService;
 use App\Services\RejectedBillService;
-use App\Services\ShopService;
 use App\Services\StoreService;
 use App\Services\SupplierService;
-use App\Services\WarehouseService;
 use App\Station;
-use App\StationRuleBatch;
 use App\StationTask;
 use App\StationTaskMaterialBox;
-use App\StationType;
 use App\Store;
 use App\StationTaskBatch;
-use App\StoreCheckingReceiveItem;
 use App\StoreItem;
-use App\StoreItems;
-use App\Supplier;
-use App\Traits\ModelLogChanging;
-use App\Unit;
-use App\User;
 use App\UserDetail;
 use App\UserDutyCheck;
 use App\ValueStore;
-use App\Warehouse;
-use App\Waybill;
-use App\WaybillPriceModel;
 use Carbon\Carbon;
 use Carbon\CarbonPeriod;
 use ChangeColumnOrderIdToOrderIssues;
@@ -505,8 +442,7 @@ class TestController extends Controller
     public function ld()
     {
         dd(
-            json_encode(collect(collect(collect([City::query()->first()]))))
-
+            Carbon::now()->format('Y-m-d')
         );
     }
 
@@ -693,36 +629,6 @@ class TestController extends Controller
 //        ]))->save();
     }
 
-
-    public function changeOrder()
-    {
-        /**
-         * @var OrderService $orderService
-         */
-        $carbon = Carbon::now()->subMinutes(30);
-        var_dump('$orderHeader', new Carbon());
-        $orderHeader_start = OracleDOCOrderHeader::query()->selectRaw(implode(',', OracleDOCOrderHeaderService::$columns))
-            ->with(['oracleBASCustomer' => function ($query) {
-                $query->selectRaw('BAS_CUSTOMER.CustomerID,BAS_CUSTOMER.Customer_Type,BAS_CUSTOMER.Descr_C,BAS_CUSTOMER.Active_Flag');
-            }, 'oracleDOCOrderDetails' => function ($query) {
-                $query->selectRaw('doc_order_details.orderNo,doc_order_details.customerid,doc_order_details.sku,doc_order_details.QtyOrdered');
-            }, 'actAllocationDetails' => function ($query) {
-                $query->selectRaw('ACT_Allocation_Details.AllocationDetailsID,ACT_Allocation_Details.OrderNo,ACT_Allocation_Details.Qty_Each,ACT_Allocation_Details.PickToTraceID,ACT_Allocation_Details.CustomerID,ACT_Allocation_Details.Sku');
-            }, 'oracleBASCode' => function ($query) {
-                $query->selectRaw('BAS_Codes.CodeID,BAS_Codes.CodeName_C,BAS_Codes.Code');
-            }])
-            ->where('DOC_Order_Header.addTime', '>=', $carbon)
-//            ->where('DOC_Order_Header.editTime','>=',$carbon)
-            ->get();
-        var_dump((string)Carbon::now());
-
-        $orderService = app('OrderService');
-        $orderService->syncOrder($orderHeader_start);
-//      $orderService->syncOrder($orderHeader_edit);
-        var_dump((string)Carbon::now());
-//      orderService  getCreateOrderModelsByWMSOrderHeaders
-    }
-
     public function cleanOrderRepeat()
     {
 
@@ -839,7 +745,7 @@ class TestController extends Controller
 
     public function reNewBatches3()
     {
-        $batches = Batch::query()->where('id', '>', 111090)->get('code');
+        $batches = Batch::query()->where('id', '>', 97397)->get('code');
         $batchCodes = $batches->map(function ($batch) {
             return $batch['code'];
         })->toArray();
@@ -866,7 +772,7 @@ class TestController extends Controller
 //        dd($logs);
         foreach ($batchCodes as $code) {
 //            $request=Cache::get('temp'.$code)['description'];
-            $request = Log::query()->select('description')->where('CREATED_AT', '>=', '2021-05-18 15:00')
+            $request = Log::query()->select('description')->where('CREATED_AT', '>=', '2021-04-14')
                 ->where('method', "issued_newBatch")
                 ->where('description', 'like', "%{$code}%")
                 ->first();
@@ -1018,14 +924,13 @@ class TestController extends Controller
 
     public function ld2()
     {
-        $m=MaterialBox::query()->first();
-        dump($m);
-        $m['status'] = '在缓存架';
-        dump($m['status']);
-        $m->update();
-        $m=MaterialBox::query()->first();
-        dump($m['status']);
-
+        $r=new \Illuminate\Support\Collection();
+        $sb = StationTaskBatch::query()->limit(3)->get();
+        dump(data_get($sb,'*.id'));
+        foreach ($sb as $s) {
+            $r->push($s);
+        }
+        dump(data_get($sb,'*.id'));
     }
     public function y111()
     {
@@ -1468,16 +1373,6 @@ where purch.islower=1 and deliver.id>'.$id);
         }
     }
 
-    public function firstAndCreated()
-    {
-        $arr = ['name' => '缓存货架3'];
-        $created = ['name'=>'缓存货架3','station_type_id' => (function(){
-            $type =StationType::query()->where('name','缓存架')->first();
-            return $type['id'];
-        })()];
-        $station = Station::query()->firstOrCreate($arr,$created);
-        dd($station);
-    }
 
 
     public function syncOrderTracking()
@@ -1490,20 +1385,6 @@ where purch.islower=1 and deliver.id>'.$id);
         $service->updateByWmsOrderHeaders($orderHeaders);
     }
 
-    public function testArr()
-    {
-        $serialNos = OracleDocOrderSerialNo::query()->selectRaw('OrderNo')->get();
-        $orderNos  = data_get($serialNos,'*.orderno');
-        $service = app(OrderTrackingService::class);
-        $orderHeadService = app(OracleDOCOrderHeaderService::class);
-        $orderHeaders = $orderHeadService->getOrderTracking()->whereIn('DOC_Order_Header.OrderNo',$orderNos)->get();
-        app(OrderService::class)->syncOrderByWMSOrderHeaders($orderHeaders);
-        app("OrderCommodityService")->syncOrderCommodity($orderHeaders);
-        app('OrderPackageService')->syncOrderPackage($orderHeaders);
-        app("OrderPackageCommoditiesService")->syncOrderPackageCommodities($orderHeaders);
-        app('OrderPackageCommoditySerialNumberService')->syncOrderPackageCommoditySerialNumbers($orderHeaders);
-        $service->createByWmsOrderHeader($orderHeaders);
-    }
     public function addHaiBox(Request $request)
     {
         echo <<<TEXT
@@ -1523,10 +1404,6 @@ TEXT;
     }
 
 
-    public function order(){
-        MeasuringMachine::query()->firstOrCreate(['code'=>'hengli003'],['name'=>'hengli003']);
-    }
-
     public function testProcurement()
     {
         $procurementTotals = ProcurementTotalBill::query()
@@ -1550,46 +1427,54 @@ TEXT;
         return view('httpTest');
     }
 
-    public function updateStation()
-    {
-//        $hid = 'hengli004';
-//        $measuringMachine = MeasuringMachine::query()->firstOrCreate(['code' => $hid],['name' => $hid]); // 称重设备
-        StationTask::query()->where('id',709)->update(
-            ['status'=>'完成']
-        );
-//        StationTaskMaterialBox::query()->where('id',7033)->delete();
-//        Station::query()->where('id',9)->delete();
-//        Station::query()->where('code' ,'缓存架01')->update(['code' => 'B1']);
-//        Station::query()->where('code' ,'缓存架02')->update(['code' => 'B2']);
-//        Station::query()->where('name' ,'HAI缓存架01-03-03')->update(['name' => 'HAIB1-03-03']);
-    }
-
     public function orderPackageUnique()
     {
-        // select logistic_number,count(1) counts from order_packages where id >= 1590001   GROUP BY logistic_number HAVING counts > 1;
-        $orderPackages = OrderPackage::query()->selectRaw('count(1) counts,logistic_number')->where('id','>=','1590000')->groupBy('logistic_number')->having('counts','>','1')->get();
-        dd($orderPackages);
+        /** @var OrderService $orderService */
+        /** @var OracleDOCOrderHeaderService $orderHeaderService */
+        $orderService = app(OrderService::class);
+        $orderHeaderService = app(OracleDOCOrderHeaderService::class);
+
+        $orderPackages = OrderPackage::query()->selectRaw('count(1) counts,logistic_number')->where('created_at','>=','2020-01-01')->groupBy('logistic_number')->having('counts','>','1')->get();
+
+
+        $updateParams = [];
+        $deleteParams = [];
         foreach ($orderPackages as $orderPackage) {
-            $items = OrderPackage::query()->where('logistic_number',$orderPackage['logistic_number'])->get();
-            $orderPackage = $items->first();
+            $items = OrderPackage::query()->with('order')->where('logistic_number',$orderPackage['logistic_number'])->with('order')->get();
+            $actAllocationDetails = OracleActAllocationDetails::query()->selectRaw('orderno')->where('PICKTOTRACEID',$orderPackage['logistic_number'])->get();
+
+            $oracleOrderNos = array_unique(data_get($actAllocationDetails,'*.orderno'));
+            $diffOrderNos = array_diff($oracleOrderNos,data_get($items,'*.order.code'));
+            if(count($diffOrderNos) != 0){
+                $orderHeaders = $orderHeaderService->getQuery()->whereIn('DOC_Order_Header.OrderNo',$diffOrderNos)->get();
+                $orderService->syncOrderInfo($orderHeaders);
+            }
+
+            $items = OrderPackage::query()->with('order')->where('logistic_number',$orderPackage['logistic_number'])->with('order')->get();
+            if($order = Order::query()->whereIn('id',data_get($items,'*.id'))->where('wms_status','!=','订单取消')->first()){
+                $saveOrderPackage = OrderPackage::query()->where('order_id',$order['id'])->where('logistic_number',$orderPackage['logistic_number'])->first();
+            }else{
+                $saveOrderPackage = $items->first();
+            }
+
             foreach ($items as $item) {
-                $orderPackage['batch_number'] = $item['batch_number'] ?? $orderPackage['batch_number'];
-                $orderPackage['batch_rule'] = $item['batch_rule'] ?? $orderPackage['batch_rule'];
-                $orderPackage['bulk'] = $item['bulk'] ?? $orderPackage['bulk'];
-                $orderPackage['weight'] = $item['weight'] ?? $orderPackage['weight'];
-                $orderPackage['length'] = $item['length'] ?? $orderPackage['length'];
-                $orderPackage['width'] = $item['width'] ?? $orderPackage['width'];
-                $orderPackage['height'] = $item['height'] ?? $orderPackage['height'];
-                $orderPackage['measuring_machine_id'] = $item['measuring_machine_id'] ?? $orderPackage['measuring_machine_id'];
-                $orderPackage['weighed_at'] = $item['weighed_at'] ?? $orderPackage['weighed_at'];
-                $orderPackage['owner_id'] = $item['owner_id'] ?? $orderPackage['owner_id'];
-                $orderPackage['received_at'] = $item['received_at'] ?? $orderPackage['received_at'];
-                $orderPackage['transfer_status'] = $item['transfer_status'] ?? $orderPackage['transfer_status'];
-                $orderPackage['status'] = $item['status'] != '无' ? $item['status'] : $orderPackage['transfer_status'];
-                $orderPackage['uploaded_to_wms'] = $item['uploaded_to_wms'] != '否' ? $item['uploaded_to_wms'] : $orderPackage['transfer_status'];
+                $saveOrderPackage['batch_number'] = $item['batch_number'] ?? $saveOrderPackage['batch_number'];
+                $saveOrderPackage['batch_rule'] = $item['batch_rule'] ?? $saveOrderPackage['batch_rule'];
+                $saveOrderPackage['bulk'] = $item['bulk'] ?? $saveOrderPackage['bulk'];
+                $saveOrderPackage['weight'] = $item['weight'] ?? $saveOrderPackage['weight'];
+                $saveOrderPackage['weighed_at'] = $item['weighed_at'] ?? $saveOrderPackage['weighed_at'];
+                $saveOrderPackage['length'] = $item['length'] ?? $saveOrderPackage['length'];
+                $saveOrderPackage['width'] = $item['width'] ?? $saveOrderPackage['width'];
+                $saveOrderPackage['height'] = $item['height'] ?? $saveOrderPackage['height'];
+                $saveOrderPackage['measuring_machine_id'] = $item['measuring_machine_id'] ?? $saveOrderPackage['measuring_machine_id'];
+                $saveOrderPackage['owner_id'] = $item['owner_id'] ?? $saveOrderPackage['owner_id'];
+                $saveOrderPackage['received_at'] = $item['received_at'] ?? $saveOrderPackage['received_at'];
+                $saveOrderPackage['transfer_status'] = $item['transfer_status'] ?? $saveOrderPackage['transfer_status'];
+                $saveOrderPackage['status'] = $item['status'] != '无' ? $item['status'] : $saveOrderPackage['transfer_status'];
+                $saveOrderPackage['uploaded_to_wms'] = $item['uploaded_to_wms'] != '否' ? $item['uploaded_to_wms'] : $saveOrderPackage['uploaded_to_wms'];
             }
-            $orderPackages_filter = $items->filter(function($item)use($orderPackage){
-                if($orderPackage['id'] === $item['id'])return false;
+            $orderPackages_filter = $items->filter(function($item)use($saveOrderPackage){
+                if($saveOrderPackage['id'] === $item['id'])return false;
                 return true;
             });
             $ids = $orderPackages_filter->map(function($item){
@@ -1597,8 +1482,11 @@ TEXT;
             });
             LogService::log('order_packages','order_packages_logistic_number_unique_delete',json_encode($orderPackages_filter));
             OrderPackage::query()->whereIn('id',$ids)->delete();
-            $orderPackage->save();
+            $updateParams[] = $saveOrderPackage;
+            $deleteParams[]  = $orderPackages_filter;
+            $saveOrderPackage->save();
         }
+        dd($updateParams,$deleteParams);
     }
 
     public function endStationTask()
@@ -1615,4 +1503,64 @@ TEXT;
         $service = app('OrderPackageExceptionTypeCountingRecordService');
         $service->updateOrCreate(30);
     }
+    public function testForeignZhenCang($batches)
+    {
+
+        $batches=Batch::query()
+            ->with(['orders.orderCommodities.commodity.barcodes'])
+            ->find(111953);
+        $body=[];
+        $body['id']=$batches->code;
+        $body['orders'] = [];
+        foreach ($batches->orders as $order){
+            $orderArr = [];
+            $orderArr['id']=$order->code??'';
+            $orderArr['createdAt']=Carbon::parse($order->created_at)->toDateTimeString()??'';
+            $orderArr['barcodes'] = [];
+            foreach ($order->orderCommodities as $orderCommodity){
+                $barcode=[];
+                $barcode['id']=$orderCommodity->id;
+                $barcode['barcode']=$orderCommodity->commodity ? ($orderCommodity->commodity->barcodes?$orderCommodity->commodity->barcodes->first()['code']:'') : '';
+                $barcode['name']=$orderCommodity->commodity->name??'';
+                $barcode['sku']=$orderCommodity->commodity->sku??'';
+                $barcode['amount']=$orderCommodity->amount??'';
+                $barcode['location']=$orderCommodity->location??'';
+                $orderArr['barcodes'][]=$barcode;
+            }
+            $body['orders'][] = $orderArr;
+        }
+        $response = Http::withHeaders([
+            'Host' => 'zc-it.com',
+        ])->post('http://1.116.164.201:8080/api/createBatch',$body);
+        dd(json_decode($response->body()));
+    }
+
+    public function updateBulk()
+    {
+        $orderPackages=OrderPackage::query()->where('measuring_machine_id',16)->get();
+        foreach ($orderPackages as $orderPackage){
+            $orderPackage->update([
+                'bulk'=>$orderPackage['length']*$orderPackage['width']*$orderPackage['height']
+            ]);
+        }
+    }
+
+    public function testPrint(Request $request)
+    {
+        return (new PrintPartController())->print($request);
+    }
+
+    public function testSendCon(Request $request)
+    {
+        $content = [
+            "type" => "getClients",
+            "aliasName" => "test",
+            "printerName" => "打印机5",
+        ];
+        $post = Http::post("http://127.0.0.1:3000", $content);
+        $body = json_decode($post->body(),true);
+        $body['msg'] = json_decode($body['msg'],true);
+        dd(json_decode($post->body()),$post->body(),$body);
+    }
+
 }

+ 2 - 1
app/Http/Controllers/WaybillController.php

@@ -969,10 +969,11 @@ class WaybillController extends Controller
         if(!Gate::allows('运输管理-运单-按日计算专线费')){return ['success'=>false,'message'=>'没有权限'];}
         $dailyBilling=$request->input('param');
         $waybills=app('waybillService')->dailyBilling($dailyBilling);
+        if ($waybills==false)return ['success'=>false,'message'=>'当前选定发货日期没有任何记录'];
         if (!isset($waybills))return ['success'=>false,'message'=>'该日有记录未填写重量'];
         return ['success'=>true,'data'=>$waybills];
     }
-    public function countPickUpFee(Request $request)
+    public function countPickUpFee(Request $request): array
     {
         if(!Gate::allows('运输管理-运单-查询')){ return ['success'=>false,'message'=>'没有权限'];  }
         $param=$request->input('param');

+ 10 - 5
app/Http/Controllers/ForeignHaiRoboticsController.php → app/Http/Controllers/api/thirdPart/haiq/HaiRoboticsController.php

@@ -1,25 +1,30 @@
 <?php
 
 
-namespace App\Http\Controllers;
+namespace App\Http\Controllers\api\thirdPart\haiq;
 
 
 use App\Services\StationTaskBatchService;
 use App\StationTaskBatch;
 use Illuminate\Http\Request;
 use App\Traits\TestableInstant;
-class ForeignHaiRoboticsController
+class HaiRoboticsController
 {
     use TestableInstant;
 
     /** @var StationTaskBatchService $stationTaskBatchService */
     private $stationTaskBatchService=null;
 
-    function runBatch(Request $request){
+    function runTaskBatch(Request $request){
+        $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
         $request->validate(
-            ['id'=>'required|exists:station_task_batches,id']
+            ['station_task_batch_id'=>'required|exists:station_task_batches,id']
         );
-        $batchTask=StationTaskBatch::query()->first($request['id']);
+        if(!$request['station_task_batch_id'])return [
+            'success'=>false,
+            'errorMsg'=>'波次任务不能为空'
+        ];
+        $batchTask=StationTaskBatch::query()->find($request['station_task_batch_id']);
         $batchesFailed=$this->stationTaskBatchService->runMany(collect([$batchTask]));//执行波次任务
         if($batchesFailed && $batchesFailed->isNotEmpty()){
             return [

+ 15 - 2
app/Http/Controllers/api/thirdPart/haiq/StorageController.php

@@ -322,11 +322,24 @@ class StorageController
         }
         $response = Http::post(config('api.haiq.storage.moveBin'),$post);
         $responseBody = $response->body();
+        $result = ['status'=>'失败'];
         LogService::log(__CLASS__,__METHOD__,$responseBody);
-        $responseBody = strstr($responseBody,'200')?'请求出库料箱"'.implode(',',$codes).'"成功':$responseBody;
+        if(strstr($responseBody,'200')){
+            $responseJson=json_decode($responseBody,true);
+            $result = ['status'=>'成功'];
+            $responseBody = '取料箱成功:' . implode(',', $codes);
+            $data0part = $responseJson['data'][0]??[];
+            if(($data0part['code']??'')==10007
+                && count($data0part['datas']??[])>0){
+                $responseBody = '以下料箱不在库内,无法取出:' . implode(',', $data0part['datas']??[]).
+                '| 成功取出料箱:'.implode(',', array_diff($codes, $data0part['datas']??[]));
+                $result = ['status'=>'部分成功'];
+            }
+        }
         if(strstr($responseBody,'成功')){
             MaterialBox::query()->whereIn('code',$codes)->update(['status'=>'在出库中']);
         }
-        return ['result'=> $responseBody];
+        $result['result']=$responseBody;
+        return $result;
     }
 }

+ 1 - 1
app/Http/Controllers/api/thirdPart/weight/WeightBaseController.php

@@ -257,7 +257,7 @@ class WeightBaseController
         $orderPackage['width'] = $edges[1];
         $orderPackage['height'] = $edges[2];
         $orderPackage['weighed_at'] = $req_date;
-        $orderPackage['bulk'] = $edges[0] * $edges[1] * $edges[2] / 1000;
+        $orderPackage['bulk'] = $edges[0] * $edges[1] * $edges[2] ;
         return $orderPackage->save();
     }
 

+ 3 - 0
app/MaterialBox.php

@@ -14,6 +14,7 @@ class MaterialBox extends Model
 
     static public $enums=[
         'status'=>[
+            ''=>0,
             '在库外'=>1,
             '在U型线'=>2,
             '在缓存架'=>3,
@@ -34,10 +35,12 @@ class MaterialBox extends Model
 
     public function getStatusAttribute($value)
     {
+        if(!$value)return '';
         return self::$enums['status'][$value];
     }
     public function setStatusAttribute($value)
     {
+        if(!$value)return 0;
         $this->attributes['status']=self::$enums['status'][$value];
     }
 

+ 5 - 0
app/OracleActAllocationDetails.php

@@ -30,4 +30,9 @@ class OracleActAllocationDetails extends Model
         return $this->hasMany(OracleDocOrderSerialNo::class,'allocationdetailsid','allocationdetailsid');
     }
 
+    public function oracleDocOrderSubSerialNos(): HasMany
+    {
+        return $this->hasMany(OracleDocOrderSubSerialNo::class,'allocationdetailsid','allocationdetailsid');
+    }
+
 }

+ 24 - 0
app/OracleDocOrderSubSerialNo.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App;
+
+use App\Traits\ModelTimeFormat;
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class OracleDocOrderSubSerialNo extends Model
+{
+    use ModelLogChanging;
+
+    use ModelTimeFormat;
+    protected $connection="oracle";
+    protected $table="DOC_Order_SubSerialNO";
+    public $timestamps=false;
+
+    public function getIncrementing(): bool
+    {
+        return false;
+    }
+
+}

+ 10 - 4
app/OrderPackage.php

@@ -10,6 +10,8 @@ use App\Traits\ModelTimeFormat;
 use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\BelongsTo;
+use Illuminate\Database\Eloquent\Relations\HasMany;
+use Illuminate\Database\Eloquent\Relations\HasOne;
 use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
@@ -34,16 +36,20 @@ class OrderPackage extends Model
         'remark' => 'array',
     ];
 
-    public function commodities(){
+    public function commodities(): HasMany
+    {
         return $this->hasMany('App\OrderPackageCommodities','order_package_id','id');
     }
-    public function paperBox(){
+    public function paperBox(): HasOne
+    {
         return $this->hasOne('App\PaperBox','id','paper_box_id');
     }
-    public function measuringMachine(){
+    public function measuringMachine(): HasOne
+    {
         return $this->hasOne('App\MeasuringMachine','id','measuring_machine_id');
     }
-    public function WMSReflectPackage(){
+    public function WMSReflectPackage(): HasOne
+    {
         return $this->hasOne('App\WMSReflectPackage','SOReference5','logistic_number');
     }
 

+ 3 - 3
app/OrderPackageCommoditySerialNumber.php

@@ -6,6 +6,7 @@ use App\Traits\ModelTimeFormat;
 use App\Traits\ModelLogChanging;
 
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use Illuminate\Database\Eloquent\Relations\HasOne;
 
 class OrderPackageCommoditySerialNumber extends Model
@@ -14,10 +15,9 @@ class OrderPackageCommoditySerialNumber extends Model
     use ModelTimeFormat;
 
     protected $fillable = ['order_package_commodity_id','serial_number'];
-    //
 
-    public function orderPackageCommodity(): HasOne
+    public function orderPackageCommodity(): BelongsTo
     {
-        return $this->hasOne(OrderPackageCommodities::class);
+        return $this->belongsTo(OrderPackageCommodities::class);
     }
 }

+ 15 - 0
app/PrintPart.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class PrintPart extends Model
+{
+    use ModelLogChanging;
+
+    //
+    protected $fillable = ['name','value'];
+}

+ 14 - 0
app/PrintTemplate.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class PrintTemplate extends Model
+{
+    use ModelLogChanging;
+
+    protected $fillable = ['name','value'];
+}

+ 6 - 0
app/Providers/AppServiceProvider.php

@@ -104,6 +104,8 @@ use App\Services\UserWorkgroupService;
 use App\Services\DischargeTaskService;
 use App\Services\DeliveryAppointmentService;
 use App\Services\StationCacheShelfGridService;
+use App\Services\PrintPartService;
+use App\Services\PrintTemplateService;
 use Illuminate\Queue\Events\JobFailed;
 use Illuminate\Support\Facades\Queue;
 use Illuminate\Support\Facades\Schema;
@@ -115,6 +117,7 @@ use App\Services\SupplierService;
 use App\Services\OrderPackageCommoditySerialNumberService;
 use App\Services\OrderPackageExceptionTypeCountingRecordService;
 use App\Services\LogisticYDService;
+use App\Services\ForeignZhenCangService;
 
 class AppServiceProvider extends ServiceProvider
 {
@@ -182,6 +185,7 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('FacilitatorService',FacilitatorService::class);
         app()->singleton('FeatureService',FeatureService::class);
         app()->singleton('ForeignHaiRoboticsService',ForeignHaiRoboticsService::class);
+        app()->singleton('ForeignZhenCangService',ForeignZhenCangService::class);
         app()->singleton('InventoryAccountMissionService',InventoryAccountMissionService::class);
         app()->singleton('InventoryCompareService',InventoryCompareService::class);
         app()->singleton('InventoryDailyLogService',InventoryDailyLogService::class);
@@ -228,6 +232,8 @@ class AppServiceProvider extends ServiceProvider
         app()->singleton('OwnerStoragePriceModelService',OwnerStoragePriceModelService::class);
         app()->singleton('PackageService',PackageService::class);
         app()->singleton('PackageStatisticsService',PackageStatisticsService::class);
+        app()->singleton('PrintPartService',PrintPartService::class);
+        app()->singleton('PrintTemplateService',PrintTemplateService::class);
         app()->singleton('ProcessMethodService',ProcessMethodService::class);
         app()->singleton('ProcessService',ProcessService::class);
         app()->singleton('ProcessStatisticService',ProcessStatisticService::class);

+ 12 - 9
app/Services/BatchService.php

@@ -3,12 +3,14 @@
 namespace App\Services;
 
 use App\Batch;
+use App\Events\BroadcastToStation;
 use App\Exceptions\ErrorException;
 use App\Jobs\BatchTaskJob;
 use App\OracleActAllocationDetails;
 use App\Order;
 use App\OrderCommodity;
 use App\Owner;
+use App\Station;
 use Exception;
 use Illuminate\Support\Collection;
 use Illuminate\Support\Facades\Cache;
@@ -64,7 +66,6 @@ class BatchService
     public function assignTasks($batches)
     {
         try{
-            LogService::log(__METHOD__,'assignTasks','波次任务分配1:'.json_encode($batches));
             $batches = collect($batches);
 
             $this->instant($this->stationTaskBatchService,'StationTaskBatchService');
@@ -74,11 +75,10 @@ class BatchService
             $this->instant($this->stationTaskMaterialBoxService,'StationTaskMaterialBoxService');
 
             $stationTaskBatches=null;
+            $stationTasks=null;
             $batches_shouldProcess = $this->stationRuleBatchService->getBatches_shouldProcess($batches); //按规则过滤需要的波次
             if($batches_shouldProcess->isEmpty()) return;
-            LogService::log(__METHOD__,'assignTasks','波次任务分配2:'.json_encode($batches));
             $stationTaskMaterialBoxes_occupied = $this->stationTaskMaterialBoxService->getOccupied_byBatches($batches_shouldProcess); //按规则过滤需要的波次
-            LogService::log(__METHOD__,'assignTasks','波次任务分配2b:'.json_encode($batches));
             if($stationTaskMaterialBoxes_occupied->isNotEmpty()) {
                 foreach ($batches_shouldProcess as $batch){
                     Cache::tags(['波次防重叠'.$batch['id']])->flush();
@@ -87,19 +87,22 @@ class BatchService
                     ->delay(now()->addMinutes(1));    //因为料箱被占用了,所以将任务推迟1分钟后尝试
                 return;
             }
-            DB::transaction(function ()use($batches,&$stationTaskBatches,&$batches_shouldProcess){
+            DB::transaction(function ()use($batches,&$stationTaskBatches,&$batches_shouldProcess,&$stationTasks){
                 $stationTasks =  $this->stationTaskService->create($batches_shouldProcess->count()); //生成总任务
-                LogService::log(__METHOD__,'assignTasks','波次任务分配3:'.json_encode($batches));
                 $stationTaskBatches=$this->stationTaskBatchService->createByBatches($batches_shouldProcess,$stationTasks); //注册波次任务
-                LogService::log(__METHOD__,'assignTasks','波次任务分配4:'.json_encode($batches));
                 $stationTaskMaterialBoxes=$this->stationTaskMaterialBoxService->createByBatches($batches_shouldProcess,$stationTasks); //注册料箱任务
-                LogService::log(__METHOD__,'assignTasks','波次任务分配5:'.json_encode($stationTaskMaterialBoxes).json_encode($batches));
                 $stationTaskCommodities=$this->stationTaskCommodityService->createByBatches($batches_shouldProcess,$stationTasks); //注册商品任务
-                LogService::log(__METHOD__,'assignTasks','波次任务分配6:'.json_encode($batches));
             });
 
+            $stationTasks->loadMissing([
+                "stationTaskCommodities.commodity.barcodes",
+                "stationTaskCommodities.materialBox",
+                "stationTaskBatches.batch.owner",
+                "stationTaskMaterialBoxes.materialBox",
+            ]);
+            $jsonStationTasks=json_encode($stationTasks);
+            broadcast(new BroadcastToStation(BroadcastToStation::ALL_STATION, $jsonStationTasks));
 //            $ran=$this->stationTaskBatchService->runMany($stationTaskBatches);//执行波次任务
-            LogService::log(__METHOD__,'assignTasks','波次任务分配7:'.json_encode($batches));
         }catch(Exception $e){
             $batchesJson='';
             foreach ($batches as $batch){

+ 0 - 1
app/Services/CacheShelfService.php

@@ -205,7 +205,6 @@ class   CacheShelfService
                 "uomDesc02" => "uo"
             ],
         ];
-        //return new MaterialBox(['code' => 200]);
         $response = Http::post(config('api.haiq.storage.light'), $params);
         return json_decode($response->body());
     }

+ 64 - 13
app/Services/ForeignHaiRoboticsService.php

@@ -5,6 +5,7 @@ namespace App\Services;
 
 
 use App\Exceptions\ErrorException;
+use App\Exceptions\Exception;
 use App\MaterialBox;
 use App\Station;
 use App\StationCacheShelfGrid;
@@ -63,16 +64,7 @@ class ForeignHaiRoboticsService
     ): array
     {
         $timestampSuffix = microtime(true);
-        $taskMode=(function()use($modeName){
-            switch ($modeName){
-                case '输送线入立架': return 1;
-                case '立架出至输送线': return 2;
-                case '移动立架内位置': return 3;
-                case '缓存架入立架':
-                case '立架出至缓存架': return 6;
-                default: throw new \Exception('发至海柔的移料箱请求,模式不存在');
-            }
-        })();
+        $taskMode=$this->getTaskMode($modeName);
         $bins=$taskMaterialBoxes->map(function (StationTaskMaterialBox $taskMaterialBox)use($timestampSuffix,$fromLocation,$toLocation){
             return [
                 "taskCode"  =>$taskMaterialBox['id'].'_'.$timestampSuffix,
@@ -90,10 +82,50 @@ class ForeignHaiRoboticsService
         ]];
     }
 
+    private function makeJson_move_multi(
+        Collection $taskMaterialBoxes,
+        string $modeName,
+        string $fromLocation='',
+        Collection $toLocations=null,
+        $groupId=''
+        , $priority=10
+        , $isSequenced=1
+    ): array
+    {
+        if(!$toLocations||($toLocations->count()!=$taskMaterialBoxes->count()))throw new Exception('toLocation中的元素数量必须和料箱任务一致');
+        $timestampSuffix = microtime(true);
+        $taskMode=$this->getTaskMode($modeName);
+        $bins=$taskMaterialBoxes->map(function (StationTaskMaterialBox $taskMaterialBox,$i)use($timestampSuffix,$fromLocation,$toLocations){
+            return [
+                "taskCode"  =>$taskMaterialBox['id'].'_'.$timestampSuffix,
+                "binCode"   => $taskMaterialBox['materialBox']['code'],
+                "fromLocCode" => $fromLocation??'',
+                "toLocCode" => $toLocations[$i],
+            ];
+        });
+        return [[
+            "taskMode"  =>$taskMode,
+            "bins"=>$bins,
+            "groupCode"=>$groupId.'_'.$timestampSuffix,
+            "priority"=>$priority,
+            "sequenceFlag"=>$isSequenced,
+        ]];
+    }
+
+    private function getTaskMode($modeName){
+        switch ($modeName){
+            case '输送线入立架': return 1;
+            case '立架出至输送线': return 2;
+            case '立架出至缓存架':
+            case '移动立架内位置': return 3;
+            case '缓存架入立架':return 6;
+            default: throw new \Exception('发至海柔的移料箱请求,模式不存在');
+        }
+    }
+
+
     public function fetchGroup($toLocation, Collection $taskMaterialBoxes, $groupIdPrefix='',$mode='立架出至输送线'): bool
     {
-        LogService::log(__METHOD__,'runMany','波次任务分配6.r5f0:');
-        LogService::log(__METHOD__,'runMany','波次任务分配6.r5f1:'.json_encode($toLocation).json_encode($taskMaterialBoxes).json_encode($groupIdPrefix));
         $dataToPost=$this->makeJson_move(
             $taskMaterialBoxes,
             $mode,
@@ -101,7 +133,26 @@ class ForeignHaiRoboticsService
             $toLocation??'',
             $groupIdPrefix
         );
-        LogService::log(__METHOD__,'runMany','波次任务分配6.r5f2:'.json_encode($dataToPost));
+        return $this->controlHaiRobot($dataToPost,$taskMaterialBoxes,$mode);
+    }
+
+    /**
+     * @param Collection $toLocations   //库位和料箱任务一一对应,一个库位对应一个料箱
+     * @param Collection $taskMaterialBoxes
+     * @param string $groupIdPrefix
+     * @param string $mode
+     * @return bool
+     * @throws ErrorException
+     */
+    public function fetchGroup_multiLocation(Collection $toLocations, Collection $taskMaterialBoxes, $groupIdPrefix='',$mode='立架出至输送线'): bool
+    {
+        $dataToPost=$this->makeJson_move_multi(
+            $taskMaterialBoxes,
+            $mode,
+            '',
+            $toLocations,
+            $groupIdPrefix
+        );
         return $this->controlHaiRobot($dataToPost,$taskMaterialBoxes,$mode);
     }
 

+ 41 - 0
app/Services/ForeignZhenCangService.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Services;
+
+use App\Traits\ServiceAppAop;
+use App\ForeignZhenCang;
+use Carbon\Carbon;
+use Illuminate\Support\Facades\Http;
+
+class ForeignZhenCangService
+{
+    use ServiceAppAop;
+//    protected $modelClass=ForeignZhenCang::class;
+
+    public function broadcastBatch($batches)
+    {
+        $body=[];
+        $body['id']=$batches->code;
+        $body['orders'] = [];
+        foreach ($batches->orders as $order){
+            $orderArr = [];
+            $orderArr['id']=$order->code??'';
+            $orderArr['createdAt']=Carbon::parse($order->created_at)->toDateTimeString()??'';
+            $orderArr['barcodes'] = [];
+            foreach ($order->orderCommodities as $orderCommodity){
+                $barcode=[];
+                $barcode['id']=$orderCommodity->id;
+                $barcode['barcode']=$orderCommodity->commodity ? ($orderCommodity->commodity->barcodes?$orderCommodity->commodity->barcodes->first()['code']:'') : '';
+                $barcode['name']=$orderCommodity->commodity->name??'';
+                $barcode['sku']=$orderCommodity->commodity->sku??'';
+                $barcode['amount']=$orderCommodity->amount??'';
+                $barcode['location']=$orderCommodity->location??'';
+                $orderArr['barcodes'][]=$barcode;
+            }
+            $body['orders'][] = $orderArr;
+        }
+        $response = Http::withHeaders([
+            'Host' => 'zc-it.com',
+        ])->post('http://1.116.164.201:8080/api/createBatch',$body);
+    }
+}

+ 2 - 2
app/Services/LogisticYTOService.php

@@ -48,11 +48,11 @@ class LogisticYTOService
         if (is_object($response) && $response->code=='1001') {return [];}
         else {
             try {
-                $result['logistic_number'] = $response[0]->waybill_No;
+                if (is_array($response))$result['logistic_number'] = $response[0]->waybill_No;
             } catch (\Exception $e) {
                 LogService::log(LogisticYTOService::class, "YTO快递信息异常", $response);
             }
-            if (!empty($response)) {
+            if (!empty($response) && is_array($response)) {
                 $lastNativeRoute = $response[count($response) - 1];
                 $result['status'] = $this->getStatus($lastNativeRoute);
                 if ($result['status'] == '已收件') $result['received_at'] = $lastNativeRoute->upload_Time;

+ 2 - 2
app/Services/OracleDOCOrderHeaderService.php

@@ -76,7 +76,7 @@ class OracleDOCOrderHeaderService
         /** @var Owner $owners */
         $owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();
         return OracleDOCOrderHeader::query()
-            ->with(['oracleDOCOrderDetails', 'actAllocationDetails','oracleBASCode','oracleBASCustomer'])
+            ->with(['oracleDOCOrderDetails', 'actAllocationDetails.oracleDocOrderSubSerialNos','oracleBASCode','oracleBASCustomer'])
             ->where('DOC_Order_Header.addTime','>=',$startDate)
             ->whereIn('DOC_Order_Header.customerID',data_get($owners,'*.code'))
             ->get();
@@ -86,7 +86,7 @@ class OracleDOCOrderHeaderService
         /** @var Owner $owners */
         $owners = app(OrderTrackingOwnerService::class)->getTrackingOrderOwner();
         return OracleDOCOrderHeader::query()
-            ->with(['oracleDOCOrderDetails', 'actAllocationDetails','oracleBASCode','oracleBASCustomer'])
+            ->with(['oracleDOCOrderDetails', 'actAllocationDetails.oracleDocOrderSubSerialNos','oracleBASCode','oracleBASCustomer'])
             ->where('DOC_Order_Header.EditTime','>=',$startDate)
             ->whereColumn('DOC_Order_Header.EditTime','<>','DOC_Order_Header.addTime')
             ->whereIn('DOC_Order_Header.customerID',data_get($owners,'*.code'))

+ 28 - 13
app/Services/OrderPackageCommoditySerialNumberService.php

@@ -28,7 +28,7 @@ class OrderPackageCommoditySerialNumberService
             $query->with('commodity', 'serialNumbers');
         }])->whereIn('order_id', $orderQuery)->get();
 
-        $createdModels = $this->getCreateModelBy($orderHeaders, $orderPackages);
+        $createdModels = $this->getCreateParamsBy($orderHeaders, $orderPackages);
 
         $regroupParams = $this->regroupOrderPackage($orderPackages);
 
@@ -97,7 +97,7 @@ class OrderPackageCommoditySerialNumberService
         if($delete>0)LogService::log(__CLASS__,'Delete OrderPackageCommoditySerialNumber',json_encode($deleteParams));
     }
 
-    public function getCreateModelBy($orderHeaders, $orderPackages): array
+    public function getCreateParamsBy($orderHeaders, $orderPackages): array
     {
         /** @var DataHandlerService $dataHandlerService */
         $dataHandlerService = app(DataHandlerService::class);
@@ -110,7 +110,6 @@ class OrderPackageCommoditySerialNumberService
             if(!isset($orderHeader['actAllocationDetails']))continue;
             foreach ($orderHeader['actAllocationDetails'] as $actAllocationDetail) {
                 $logisticNumber = $actAllocationDetail['picktotraceid'];
-
                 if (!$logisticNumber) continue;
                 $orderPackage = $dataHandlerService->getKeyValue(['logistic_number' => $logisticNumber], $orderPackageMaps) ??
                     $dataHandlerService->getKeyValue(['logistic_number' => $orderHeader['soreference5']], $orderPackageMaps);
@@ -118,32 +117,48 @@ class OrderPackageCommoditySerialNumberService
                 if (!$orderPackage) continue;
                 $orderPackageCommodityMap = [];
                 if(!isset($orderPackage['commodities']))continue;
+
                 foreach ($orderPackage['commodities'] as $orderPackageCommodity) {
                     $sku = $orderPackageCommodity['commodity']['sku'] ?? '';
                     if($sku === '')continue;
                     $orderPackageCommodityMap[$sku] = $orderPackageCommodity;
                 }
-                foreach ($actAllocationDetail['oracleDocOrderSerialNos'] as $oracleDocOrderSerialNo) {
-                    $sku = $oracleDocOrderSerialNo['sku'];
-                    $createParams = $this->getCreateModel($oracleDocOrderSerialNo, $orderPackageCommodityMap);
-                    if (count($createParams) == 0) continue;
-                    if (!isset($orderPackageSerialNumbers[$logisticNumber])) $orderPackageSerialNumbers[$logisticNumber] = [];
-                    if (!isset($orderPackageSerialNumbers[$logisticNumber][$sku])) $orderPackageSerialNumbers[$logisticNumber][$sku] = [];
-                    $orderPackageSerialNumbers[$logisticNumber][$sku][$createParams['serial_number']] = $createParams;
+
+                $oracleDocOrderSubSerialNos = $actAllocationDetail['oracleDocOrderSubSerialNos'];
+                $createParams = $this->getCreateModelsBy($oracleDocOrderSubSerialNos,$orderPackageCommodityMap);
+                if (!isset($orderPackageSerialNumbers[$logisticNumber])) $orderPackageSerialNumbers[$logisticNumber] = [];
+                foreach ($createParams as $sku => $createParam) {
+                    if(!isset($orderPackageSerialNumbers[$logisticNumber][$sku])){
+                        foreach ($createParam as $serialNumber=>$item) {
+                            $orderPackageSerialNumbers[$logisticNumber][$sku][$serialNumber] = $item;
+                        }
+                    }
+                    else $orderPackageSerialNumbers[$logisticNumber][$sku] = $createParam;
                 }
             }
         }
         return $orderPackageSerialNumbers;
     }
 
-    public function getCreateModel($oracleDocOrderSerialNo, $orderPackageCommodityMap)
+    public function getCreateModelsBy($oracleDocOrderSubSerialNos,$orderPackageCommodityMap): array
+    {
+        $createdParams = [];
+        foreach ($oracleDocOrderSubSerialNos as $oracleDocOrderSubSerialNo) {
+            $model = $this->getCreateModel($oracleDocOrderSubSerialNo,$orderPackageCommodityMap);
+            $sku = $oracleDocOrderSubSerialNo['sku'];
+            $createdParams[$sku][$model['serial_number']] =$model;
+        }
+        return $createdParams;
+    }
+
+    public function getCreateModel($oracleDocOrderSubSerialNo, $orderPackageCommodityMap): array
     {
-        $orderPackageCommodity = $orderPackageCommodityMap[$oracleDocOrderSerialNo['sku']] ?? null;
+        $orderPackageCommodity = $orderPackageCommodityMap[$oracleDocOrderSubSerialNo['sku']] ?? null;
         if (!$orderPackageCommodity) return [];
         $created_At = Carbon::now()->format(Carbon::DEFAULT_TO_STRING_FORMAT);
         return [
             'order_package_commodity_id' => $orderPackageCommodity['id'],
-            'serial_number' => $oracleDocOrderSerialNo['serialno'],
+            'serial_number' => $oracleDocOrderSubSerialNo['subserialno'],
             'created_at' => $created_At,
             'updated_at' => $created_At
         ];

+ 10 - 2
app/Services/OrderPackageReceivedSyncService.php

@@ -135,10 +135,18 @@ class OrderPackageReceivedSyncService
         foreach ($orderPackages as $data) {
             if (empty($data)) continue;
             $orderPackage = OrderPackage::query()->where('logistic_number', $data['logistic_number'])->first();
+            try {
+                if ($orderPackage->order && $orderPackage->order->issue) {
+                    unset($data['exception_type']);
+                    unset($data['exception']);
+                }
+            } catch (Exception $e) {
+                LogService::log(OrderPackageReceivedSyncService::class, "标记问题件不需要更新异常状态失败", $data['logistic_number'].'-'.json_encode($e));
+            }
             if (isset($data['status'])) $orderPackage->status = $data['status'];
             if (isset($data['received_at'])) $orderPackage->received_at = $data['received_at'];
             if (isset($data['exception'])) $orderPackage->exception = $data['exception'];
-            if (isset($data['transfer_status'])) $orderPackage->transfer_status = $data['transfer_status'];
+            if (isset($data['transfer_status'])&&!empty($data['transfer_status'])) $orderPackage->transfer_status = $data['transfer_status'];
             if (isset($data['exception_type'])) $orderPackage->exception_type = $data['exception_type'];
             $orderPackage->save();
         }
@@ -288,7 +296,7 @@ class OrderPackageReceivedSyncService
             $conclusion |= ($last_routed_duration > $SHORT_RESPONSE_HOURS && $last_routed_duration < $LONG_RESPONSE_HOURS) ? $IS_SHORT_NO_RESPONSE : 0;
             $conclusion |= ($last_routed_duration > $LONG_RESPONSE_HOURS) ? $IS_LONG_NO_RESPONSE : 0;
             $conclusion |= ($last_routed_duration > $SENDING_RESPONSE_HOURS && $data['status'] == '派送中') ? $IS_SENDING_NO_RESPONSE : 0;
-            $conclusion |= ($delivered_duration > $HAVEN_SECOND_GOT_HOURS && $data['routes_length'] < 2) ? $IS_SECOND_ROUTE_HAVE : 0;//超过指定时间,路由信息小于两条
+            $conclusion |= ($delivered_duration > $HAVEN_SECOND_GOT_HOURS && $data['routes_length'] < 3) ? $IS_SECOND_ROUTE_HAVE : 0;//超过指定时间,路由信息小于两条
             return $conclusion;
         })();
         switch ($conclusion) {

+ 35 - 1
app/Services/OrderPackageService.php

@@ -14,6 +14,7 @@ use App\Services\common\BatchUpdateService;
 use App\Services\common\DataHandlerService;
 use Carbon\Carbon;
 use App\Traits\ServiceAppAop;
+use Illuminate\Database\Eloquent\Builder;
 
 
 class OrderPackageService
@@ -24,6 +25,8 @@ class OrderPackageService
         return app(BatchUpdateService::class)->batchUpdate('order_packages',$params);
     }
 
+    /** @var OrderTrackingService $orderTrackingService */
+    public $orderTrackingService;
 
     /**
      * @param string $logistic_number
@@ -114,6 +117,7 @@ class OrderPackageService
         $orderService = app('OrderService');
         if(!$orderHeaders)return;
         $orders = $orderService->getByWmsOrders($orderHeaders);
+        $this->processCancelOrderPackages($orderHeaders);                           // 取消订单操作 及 过滤
         $packages = $this->getByOrderNos(data_get($orderHeaders,'*.orderno'));          // 已有
         $this->createOrderPackage($orderHeaders,$orders,$packages);                     // 创建package
         $this->updatePackage($orderHeaders,$packages);
@@ -139,7 +143,7 @@ class OrderPackageService
         foreach ($orders as $order){
             $orderHeader = $dataHandlerService->getKeyValue(['orderno'=>$order->code],$orderHeaders_map);
             if(!$orderHeader)continue;
-            if($orderHeader->sotatus == 90)continue;
+            if($orderHeader->sostatus == 90)continue;
             $params = $this->getInnerParams($orderHeader,$order,$packages_maps,$logistic);
             $inner_params = array_merge($inner_params,$params);
         }
@@ -304,4 +308,34 @@ class OrderPackageService
         return $map;
     }
 
+    /**
+     * 删除取消的订单
+     * @param $orderHeaders
+     */
+    public function processCancelOrderPackages(&$orderHeaders)
+    {
+        $this->instant($this->orderTrackingService,'OrderTrackingService');
+
+        $cancelOrder = $orderHeaders->filter(function($orderHeader){
+            return $orderHeader->sostatus == '90';
+        });
+
+        $orderPackages = OrderPackage::query()->whereIn('order_id',function($query)use($cancelOrder){
+            /** @var Builder $query */
+            $query->from((new Order())->getTable())->selectRaw('id')->whereIn('code',data_get($cancelOrder,'*.orderno'));
+        })->get();
+
+        if($orderPackages->count() == 0)return ;
+
+        $orderPackage_list = $orderPackages->chunk(200);
+        foreach ($orderPackage_list as $orderPackageSet){
+            OrderPackage::query()->whereIn('id',data_get($orderPackageSet,'*.id'))->delete();
+            $items = OrderTracking::query()->whereIn('order_package_commodity_id',function($query)use($orderPackages){
+                /** @var Builder $query */
+                $query->from((new OrderPackageCommodities)->getTable())->selectRaw('id')->whereIn('order_package_id',data_get($orderPackages,'*.id'));
+            })->get();
+            $this->orderTrackingService->deleteOrderTracings($items);
+        }
+
+    }
 }

+ 0 - 5
app/Services/OrderTrackingService.php

@@ -2,17 +2,12 @@
 
 namespace App\Services;
 
-use App\OracleBasSKU;
-use App\OracleDOCOrderHeader;
-use App\Order;
 use App\OrderPackageCommodities;
 use App\OrderTracking;
 use App\Services\common\BatchUpdateService;
 use App\Services\common\DataHandlerService;
-use App\Services\common\QueryService;
 use Illuminate\Support\Carbon;
 use Illuminate\Support\Collection;
-use Illuminate\Support\Facades\Auth;
 use App\Traits\ServiceAppAop;
 
 

+ 13 - 0
app/Services/PrintPartService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services;
+
+use App\Traits\ServiceAppAop;
+use App\PrintPart;
+
+class PrintPartService
+{
+    use ServiceAppAop;
+    protected $modelClass=PrintPart::class;
+
+}

+ 13 - 0
app/Services/PrintTemplateService.php

@@ -0,0 +1,13 @@
+<?php 
+
+namespace App\Services;
+
+use App\Traits\ServiceAppAop;
+use App\PrintTemplate;
+
+class PrintTemplateService
+{
+    use ServiceAppAop;
+    protected $modelClass=PrintTemplate::class;
+
+}

+ 3 - 3
app/Services/StationRuleBatchService.php

@@ -61,9 +61,9 @@ class StationRuleBatchService
     {
         LogService::log(__METHOD__,'shouldProcess','波次任务分配1.1:'.json_encode($batches));
         $batches_toProcess=collect();
-        $batches_inTask=StationTaskBatch::query()->whereIn('batch_id',data_get($batches,'*.id'))->get();
-        LogService::log(__METHOD__,'shouldProcess','波次任务分配1.2:'.json_encode($batches_inTask));
-        $batches=$batches->whereNotIn('id',data_get($batches_inTask,'*.id')??[]);
+        $stationTaskBatches_inTask=StationTaskBatch::query()->whereIn('batch_id',data_get($batches,'*.id'))->get();
+        LogService::log(__METHOD__,'shouldProcess','波次任务分配1.2:'.json_encode($stationTaskBatches_inTask));
+        $batches=$batches->whereNotIn('id',data_get($stationTaskBatches_inTask,'*.batch_id')??[]);
         foreach ($batches as $batch){
             $stationRuleBatch=$this->getByBatch($batch);
             if(!$stationRuleBatch)continue;

+ 1 - 0
app/Services/StationTaskBatchService.php

@@ -75,6 +75,7 @@ class StationTaskBatchService
             }
         }
         $this->batchService->updateWhereIn('id', data_get($batches_handled, '*.id'), ['status' => '处理中']);
+        $stationTaskBatches_toCreate=$stationTaskBatches_toCreate->reverse();//这里的波次顺序是反的,不知为什么,所以反向一次就好了。其他解耦的地方都是正序,必须保持一致
         $this->insert($stationTaskBatches_toCreate->toArray());
 
         $stationTaskBatches_toCreate=$this->getAndAttachIds($stationTaskBatches_toCreate);

+ 3 - 3
app/Services/StationTaskCommodityService.php

@@ -51,17 +51,17 @@ class StationTaskCommodityService
     function createByBatches(Collection $batches,Collection $stationTasks_toAttach): Collection
     {
         $this->instant($this->stationTaskService,'StationTaskService');
-        $stationTaskCommodities_listByBatch=new Collection();
+        $stationTaskCommodities_lists_ByBatch=new Collection();
         $stationTaskCommodities=new Collection();
         foreach ($batches as $batch){
             $taskCommodities = $this->createByBatch($batch);
             $stationTaskCommodities= $stationTaskCommodities->merge($taskCommodities);
-            $stationTaskCommodities_listByBatch->push($taskCommodities);
+            $stationTaskCommodities_lists_ByBatch->push($taskCommodities);
         }
 //        $stationTaskCommodities=$this->getAndAttachIds($stationTaskCommodities);
         $this->stationTaskService->registerSubTasks(
             $stationTasks_toAttach,
-            $stationTaskCommodities_listByBatch);
+            $stationTaskCommodities_lists_ByBatch);
         return $stationTaskCommodities;
 
     }

+ 23 - 0
app/Services/StationTaskService.php

@@ -45,6 +45,29 @@ class StationTaskService
      * @param Collection $subTaskLists 二维数组,第一维是对应注册的任务
      */
     function registerSubTasks(Collection $tasks, iterable $subTaskLists)
+    {
+        $this->instant($this->stationTaskChildService,'StationTaskChildService');
+        $taskChildren_toInsert=collect();
+        foreach ($subTaskLists as $i=>$subTaskList){
+            foreach ($subTaskList as $subTask){
+                $subTaskId = $subTask['id'];
+                $subTaskClass = get_class($subTask);
+                $paramToInsert = [
+                    'station_task_id' => $tasks[$i]['id'],
+                    'station_taskable_type' => $subTaskClass,
+                    'station_taskable_id' => $subTaskId,
+                ];
+                $taskChild_existed=$this->stationTaskChildService->get($paramToInsert)->first();
+                if(!$taskChild_existed){
+                    $taskChildren_toInsert->push($paramToInsert);
+                    $subTask['station_task_id']=$tasks[$i]['id'];
+                    $subTask->save();
+                }
+            }
+        }
+        $this->stationTaskChildService->insert($taskChildren_toInsert->toArray());
+    }
+    function registerCommoditiesSubTasks(Collection $tasks, iterable $subTaskLists)
     {
         $this->instant($this->stationTaskChildService,'StationTaskChildService');
         $taskChildren_toInsert=collect();

+ 4 - 3
app/Services/WaybillService.php

@@ -170,13 +170,14 @@ class WaybillService
             ->whereNull('waybill_on_tops.deleted_at')
             ->orderBy('waybill_on_tops.updated_at','desc')
             ->orderBy('waybills.id','desc')
-            ->where('waybills.created_at','like',$param['screenDate'].'%')
+//            ->where('waybills.created_at','like',$param['screenDate'].'%')
             ->where('waybills.type','专线')
-            ->whereNotNull('waybills.deliver_at')
+            ->where('waybills.deliver_at','like',$param['screenDate'].'%')
             ->get();
+        if ($waybills->isEmpty()) return false;
         foreach ($waybills as $waybill){
             if (!$waybill['carrier_weight_other'] && !$waybill['carrier_weight']) return null;
-            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=($waybill['carrier_weight']/0.4);
+            if (!$waybill['carrier_weight_other']) $waybill['carrier_weight_other']=($waybill['carrier_weight']/0.004);
         }
         $daily_total_weight=$waybills->sum('carrier_weight_other');
         $updateParams = [['id','pick_up_fee','updated_at']];

+ 8 - 0
app/Station.php

@@ -3,6 +3,7 @@
 namespace App;
 
 use App\Traits\ModelTimeFormat;
+use Carbon\Carbon;
 use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\Relations\HasOne;
 use App\Traits\ModelLogChanging;
@@ -27,6 +28,13 @@ class Station extends Model
         return $this->hasOne(StationTask::class)
             ->where('status','=','处理中');
     }
+    public function stationTasks_today(){
+        return $this->hasMany(StationTask::class)
+            ->where('created_at','>=',now()->format('Y-m-d'))
+            ->orderBy('status')
+            ->orderByDesc('id')
+            ;
+    }
     public function stationTasks()
     {   //站任务
         return $this->hasMany(StationTask::class,"id","station_type_id");

+ 1 - 1
config/haiRou.php

@@ -1,5 +1,5 @@
 <?php
 
 return [
-    "波次防重叠时间_秒" => 1200,
+    "波次防重叠时间_秒" => 1800,
 ];

+ 13 - 0
database/factories/PrintPartFactory.php

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

+ 13 - 0
database/factories/PrintTemplateFactory.php

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

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

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePrintPartsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('print_parts', function (Blueprint $table) {
+            $table->id();
+            $table->string('name');
+            $table->text('value');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('print_parts');
+    }
+}

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

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class CreatePrintTemplatesTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('print_templates', function (Blueprint $table) {
+            $table->id();
+            $table->string('name')->index();
+            $table->text('value')->comment('组件id,坐标 等集合');
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('print_templates');
+    }
+}

+ 34 - 0
database/migrations/2021_05_21_131520_add_order_packages_logistic_number_unique.php

@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddOrderPackagesLogisticNumberUnique extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('order_packages', function (Blueprint $table) {
+            //
+            $table->string('logistic_number')->unique()->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('order_packages', function (Blueprint $table) {
+            //
+            $table->dropUnique(['logistic_number']);
+        });
+    }
+}

+ 18 - 0
database/seeds/PrintPartSeeder.php

@@ -0,0 +1,18 @@
+<?php
+
+use Illuminate\Database\Seeder;
+use App\PrintPart;
+
+class PrintPartSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        $printParts = factory(PrintPart::class)->times(100)->make()->toArray();
+        PrintPart::query()->insert($printParts);
+    }
+}

+ 18 - 0
database/seeds/PrintTemplateSeeder.php

@@ -0,0 +1,18 @@
+<?php
+
+use Illuminate\Database\Seeder;
+use App\PrintTemplate;
+
+class PrintTemplateSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     *
+     * @return void
+     */
+    public function run()
+    {
+        $printTemplate = factory(PrintTemplate::class)->times(100)->make()->toArray();
+        PrintTemplate::query()->insert($printTemplate);
+    }
+}

+ 1 - 0
package.json

@@ -29,6 +29,7 @@
     "davidshimjs-qrcodejs": "0.0.2",
     "echarts": "^4.9.0",
     "element-ui": "^2.14.1",
+    "html2canvas": "^1.0.0-rc.7",
     "jquery.cookie": "^1.4.1",
     "js-cookie": "^2.2.1",
     "jsbarcode": "^3.11.3",

+ 2 - 24
public/t.php

@@ -1,26 +1,4 @@
 <?php
 
-
-class Aa
-{
-    static public $enums=[
-        'status'=>[
-            '在库外'=>6,
-            '在U型线'=>1,
-            '在出库中'=>2,
-            '在入库中'=>3,
-            '在立库'=>4,
-            '异常'=>5,
-        ],
-    ];
-    function __construct(array $attributes = [])
-    {
-        foreach (self::$enums as &$enum) {
-            $enum=$enum+array_flip($enum);
-        }
-    }
-
-}
-
-$aa = new Aa();
-var_dump(Aa::$enums['status'][1]);
+$a=[];
+var_dump();

+ 3 - 1
resources/js/queryForm/queryForm.js

@@ -519,7 +519,9 @@ const query = function getQueryForm(data) {
         let min = $("<input id='" + condition.name + "_min' class='form-control form-control-sm ml-2' style='max-width: 100px;' placeholder='00:00' data-toggle='tooltip' data-placement='top' >");
         min.attr('title', controlJsType(condition.tip[1], 'undefined') ? '' : condition.tip[1]);
         dateTime.bind('input propertychange', function () {
-            let value = this.value !== '' ? this.value + ' ' + (!!min.val() ? min.val() : '23:59') : '';
+            let hm = '00:00';
+            if(!condition.name.includes('start'))hm = '23:59';
+            let value = this.value !== '' ? this.value + ' ' + (!!min.val() ? min.val() : hm) : '';
             modifyData({name: condition.name, type: 'time', value: value, mold: 'time'});
             // modifyData({name: condition.name, type: 'dateTime', value: this.value, mold: 'dateTime'});
         });

+ 11 - 0
resources/js/utilities/html2canvas.js

@@ -0,0 +1,11 @@
+import html2canvas from'html2canvas'
+
+window.canvasImg = function(dom,imageDiv,scale=1,func){
+    html2canvas($(dom)[0],{
+        _backgroundColor:null,
+        useCORS:true,
+        scale:scale
+    }).then(canvas=>{
+        func(canvas);
+    });
+}

+ 121 - 90
resources/views/inventory/stockInventory/inventoryMission.blade.php

@@ -27,6 +27,7 @@
 
             <span class="dropdown">
                 <button class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                        :class="[checkData.length>0?'btn-dark text-light':'']"
                         data-toggle="dropdown" title="导出所有页将会以搜索条件得到的过滤结果,将其全部记录(每一页)导出">
                     导出Excel
                 </button>
@@ -312,8 +313,34 @@
             </div>
         </form>
         <div class="card-body pt-1">
+
             <table class="table table-sm table-striped d-none d-xl-block p-0 text-nowrap table-bordered td-min-width-80"
                    id="table" ref="boxPc">
+                <tr>
+                    <th>
+                        <label for="all" class="d-none" id="cloneCheckAll">
+                            <input id="all" type="checkbox" @click="checkAll($event)">全选
+                        </label>
+                    </th>
+                    <th class="text-center">序号</th>
+                    <th class="text-center">库位</th>
+                    <th class="text-center">产品名</th>
+                    <th class="text-center">产品条码</th>
+                    <th class="text-center">产品编码</th>
+                    <th class="text-center">生产日期</th>
+                    <th class="text-center">失效日期</th>
+                    <th class="text-center">批号</th>
+                    <th class="text-center">盘点人</th>
+                    <th class="text-center">ERP属性仓</th>
+                    <th class="text-center">质量状态</th>
+                    <th class="text-center">库存数量</th>
+                    <th class="text-center">可用数量</th>
+                    <th class="text-center">盘点数量</th>
+                    <th class="text-center">复盘数量</th>
+                    <th class="text-center">复盘差异</th>
+                    <th class="text-center">分配数量</th>
+                    <th class="text-center">操作</th>
+                </tr>
                 <tr v-for="(inventoryMission, i) in 显示记录列" :key="i"
                     :style="{'opacity': inventoryMission.mark==='跳过'?'0.7':'','opacity': inventoryMission.mark==='确认差异'?'0.7':''}" :class="[
                     inventoryMission.mark==='已复盘有差异'?'td-cool':'',
@@ -325,13 +352,16 @@
                     inventoryMission.mark==='跳过'?'text-muted':'',
                     ]">
                     <td>
-                        <input type="checkbox" :value="inventoryMission">
+                        <input type="checkbox" :value="inventoryMission" v-model="checkData">
                         <span :id="'lockLine'+(i+1)"></span>
                     </td>
                     <td><span>@{{ i+1 }}</span></td>
                     <td><span>@{{ inventoryMission.location }}</span></td>
-                    <td v-if="inventoryMission.commodity"><span
+                    <td >
+                        <span v-if="inventoryMission.commodity">
+                        <span
                             v-if="inventoryMission.checked==='是'||inventoryMission.checked==='确认差异'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.commodity.name }}</span>
+                        </span>
                     </td>
                     <td>
                         <span
@@ -349,8 +379,11 @@
                         </span>
                     </td>
 
-                    <td v-if="inventoryMission.commodity"><span
+                    <td >
+                        <span v-if="inventoryMission.commodity">
+                        <span
                             v-if="inventoryMission.checked==='是'||inventoryMission.checked==='确认差异'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.commodity.sku }}</span>
+                        </span>
                     </td>
                     <td><span
                             v-if="inventoryMission.checked==='是'||inventoryMission.checked==='确认差异'||inventoryMission.checked==='跳过'||inventory.status==='复盘中'||listMode">@{{ inventoryMission.produced_at }}</span>
@@ -512,8 +545,8 @@
                                      <span class="btn  btn-sm btn-outline-secondary" v-if="inventoryMission.mark==='已复盘有差异'||inventoryMission.mark==='未复盘有差异'"
                                            @click="确认盘点差异(inventoryMission.id,inventory.id,inventoryMission.commodity.name)">跳过</span>
                                         <span class="btn  btn-sm btn-outline-secondary"
-                                          v-if="inventory.type=='动盘'&& inventoryMission.mark=='未盘' &&!listMode"
-                                          @click="选中盘点起始位置(inventoryMission.id,inventoryMission.location)">以此为起点</span>
+                                              v-if="inventory.type=='动盘'&& inventoryMission.mark=='未盘' &&!listMode"
+                                              @click="选中盘点起始位置(inventoryMission.id,inventoryMission.location)">以此为起点</span>
                             </span>
                                 </div>
                             @endcan
@@ -581,7 +614,6 @@
 
 @section('lastScript')
     <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
-    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
     <script>
         let hideHeaderTitle = function () {
             let $listOnPad = $('#listOnPad');
@@ -630,7 +662,7 @@
                         commodity_name: '{{$inventoryMission->commodity ? $inventoryMission->commodity->name : ''}}',
                         commodity_sku: '{{$inventoryMission->commodity ? $inventoryMission->commodity->sku : ''}}',
                         commodity_barcode: '{{$inventoryMission->commodity ? $inventoryMission->commodity->barcode : ''}}',
-                        commodity:{!! $inventoryMission->commodity  !!},
+                        commodity:{!! $inventoryMission->commodity ?? null  !!},
                         stockInventoryPersons:{!! $inventoryMission->stockInventoryPersons  !!},
                         commodity_barcodes: [
                                 @foreach($inventoryMission->commodity ? $inventoryMission->commodity->barcodes ?? [] : [] as $barcode)
@@ -664,6 +696,7 @@
                 库位索引_记录: {},
                 selectedStyle:'',
                 指定盘点记录列:[],
+                checkData: [],
                 lastStockInventoryRecord:{},
                 stockInventoryPersons:[],
                 inventoryAccountMissions:[],
@@ -693,6 +726,19 @@
                 this.重排序并标记全列表类型();
                 this.加载下方数据并置空上方数据()//初始化先调用一次
             },
+            watch: {
+                checkData: {
+                    handler() {
+                        if (this.checkData.length === this.inventoryMissions.length) {
+                            document.querySelector('#all').checked = true;
+
+                        } else {
+                            document.querySelector('#all').checked = false;
+                        }
+                    },
+                    deep: true
+                }
+            },
             destroyed() {
                 window.removeEventListener('scroll', this.lazy)
             },
@@ -704,6 +750,7 @@
             mounted: function () {
                 let _this = this;
                 _this.lazy();
+                $('#cloneCheckAll').removeClass('d-none')
                 window.addEventListener('scroll', this.lazy);
                 (function 显示渲染后页面(){
                     $('#loadingPage').remove();
@@ -727,36 +774,20 @@
                     }
                     _this.listMode = false;
                 })();
-                let column = [
-                    {name:'index',value: '序号', neglect: true},
-                    {name:'location',value: '库位'},
-                    {name: 'commodity_name', value: '产品名'},
-                    {name: 'commodity_barcode', value: '产品条码'},
-                    {name:'commodity_sku',value: '产品编码'},
-                    {name: 'produced_at', value: '生产日期', neglect: true},
-                    {name: 'valid_at', value: '失效日期', neglect: true},
-                    {name: 'batch_number', value: '批号', neglect: true},
-                    {name: 'stockInventoryPersons',value: '盘点人', neglect: true},
-                    {name: 'erp_type_position', value: 'ERP属性仓', neglect: true},
-                    {name: 'quality', value: '质量状态', neglect: true},
-                    {name: 'stored_amount', value: '库存数量', neglect: true},
-                    {name: 'valid_amount', value: '可用数量', neglect: true},
-                    {name: 'verified_amount', value: '盘点数量', neglect: true},
-                    {name: 're_checked_amount', value: '复盘数量', neglect: true},
-                    {name: 'difference_amount', value: '复盘差异', neglect: true},
-                    {name: 'occupied_amount', value: '分配数量', neglect: true},
-                    {name: '跳过', value: '操作', neglect: true},
-                ];
-                new Header({
-                    el: "table",
-                    name: "inventoryMission",
-                    column: column,
-                    data: this.inventoryMissions,
-                    fixedTop:($('#form').height())+2,
-                }).init();
-                this.建立记录索引();
+                _this.建立记录索引();
             },
             methods:{
+                checkAll(e) {
+                    if (e.target.checked) {
+                        this.inventoryMissions.forEach((el,i)=>{
+                            if (this.checkData.indexOf(el) == '-1'){
+                                this.checkData.push(el);
+                            }
+                        });
+                    } else {
+                        this.checkData = [];
+                    }
+                },
                 selectedColor(id,e){
                     $('#headerParent tr[class=focusing]').removeClass('focusing')
                     if (id==this.selectTr){
@@ -773,9 +804,9 @@
                     let clientHeight=window.innerHeight;//当前可视的页面高度
                     let count = parseFloat(clientHeight) + parseFloat(scrollTop);//浏览器底部位置
                     if (scrollHeight - count < 40) {
-                            if (_this.显示记录列.length < _this.inventoryMissions.length) {
-                                _this.加载下方数据并置空上方数据()
-                            }
+                        if (_this.显示记录列.length < _this.inventoryMissions.length) {
+                            _this.加载下方数据并置空上方数据()
+                        }
                     }
                 },
                 加载下方数据并置空上方数据(){
@@ -1087,18 +1118,18 @@
                     let 盘点数=_this.inputs().amount.trim();
                     let 选定盘点记录id=_this.selectingId;
                     $appointInventoryList.forEach(function (inventoryMission) {
-                            if (inventoryMission.location === 库位) {
-                                if (inventoryMission.stockInventoryPersons.length > 0 && inventoryMission.id === _this.selectingId) {
-                                    _this.lastStockInventoryRecord = inventoryMission;
-                                    _this.stockInventoryPersons = inventoryMission.stockInventoryPersons;
-                                    if (_this.inventory.status !== '复盘中'){
-                                        $("#lastStockInventoryRecord").modal('show');
-                                        return;
-                                    }
+                        if (inventoryMission.location === 库位) {
+                            if (inventoryMission.stockInventoryPersons.length > 0 && inventoryMission.id === _this.selectingId) {
+                                _this.lastStockInventoryRecord = inventoryMission;
+                                _this.stockInventoryPersons = inventoryMission.stockInventoryPersons;
+                                if (_this.inventory.status !== '复盘中'){
+                                    $("#lastStockInventoryRecord").modal('show');
+                                    return;
                                 }
-                                _this.盘点(选定盘点记录id,库位,条码,_this.inventory.id,盘点数);
-                                _this.清空指定盘点记录列();
                             }
+                            _this.盘点(选定盘点记录id,库位,条码,_this.inventory.id,盘点数);
+                            _this.清空指定盘点记录列();
+                        }
                     });
                 },100,{ 'trailing': false }),
                 //结束初盘任务
@@ -1384,7 +1415,7 @@
                     let _this = this;
                     if (!confirm('确定对勾选内容进行批量操作吗?')) {return ;}
                     let url = '{{url('inventory/批量跳过或确认差异')}}';
-                    axios.post(url, {checkData: checkData}).then(
+                    axios.post(url, {checkData: _this.checkData}).then(
                         function (response) {
                             if (!response.data.success) {
                                 tempTip.setDuration(3000);
@@ -1566,7 +1597,7 @@
                     }
                 },
                 清空checkbox(){
-                    checkData=[];
+                    this.checkData=[];
                 },
                 不覆盖() {
                     let _this = this;
@@ -1603,22 +1634,22 @@
                                 _this.inventory.surplus = response.data.inventory.surplus;
                                 _this.inventory.check_surplus = response.data.inventory.check_surplus;
                             }
-                                    if (response.data.inventoryMission.length >1) {
-                                        response.data.inventoryMission.forEach(function (mission) {
-                                            let isToEdit=false;
-                                            let commodity_barcodes=mission.commodity_barcodes;
-                                            _this.库位索引_记录[_this.inputs().location.trim()].every(function (inventoryMission){
-                                                if (parseInt(inventoryMission.id) === parseInt(mission.id)){
-                                                    isToEdit=true;
-                                                    inventoryMission.checked = mission.checked;
-                                                    inventoryMission.verified_amount = mission.verified_amount;
-                                                    inventoryMission.difference_amount =mission.difference_amount;
-                                                    inventoryMission.re_checked_amount = mission.re_checked_amount;
-                                                    inventoryMission.stockInventoryPersons = response.data.stockInventoryPersons;
-                                                    return false;
-                                                }
-                                                return true;
-                                            })
+                            if (response.data.inventoryMission.length >1) {
+                                response.data.inventoryMission.forEach(function (mission) {
+                                    let isToEdit=false;
+                                    let commodity_barcodes=mission.commodity_barcodes;
+                                    _this.库位索引_记录[_this.inputs().location.trim()].every(function (inventoryMission){
+                                        if (parseInt(inventoryMission.id) === parseInt(mission.id)){
+                                            isToEdit=true;
+                                            inventoryMission.checked = mission.checked;
+                                            inventoryMission.verified_amount = mission.verified_amount;
+                                            inventoryMission.difference_amount =mission.difference_amount;
+                                            inventoryMission.re_checked_amount = mission.re_checked_amount;
+                                            inventoryMission.stockInventoryPersons = response.data.stockInventoryPersons;
+                                            return false;
+                                        }
+                                        return true;
+                                    })
                                     if (!isToEdit){
                                         mission.commodity_barcodes= commodity_barcodes;
                                         mission.stockInventoryPersons=response.data.stockInventoryPersons;
@@ -1670,7 +1701,7 @@
                         let data = JSON.stringify(allData1);
                         excelExport(false,data,url,this.sum,token);
                     } else {
-                        checkData.forEach(function (inventoryMission) {
+                        this.checkData.forEach(function (inventoryMission) {
                             if (inventoryMission.stock_persons.length > 0) inventoryMission.stock_person = inventoryMission.stock_persons[inventoryMission.stock_persons.length - 1].name;
                             if (inventoryMission.stock_persons.length <1) inventoryMission.stock_person='';
                             delete inventoryMission.commodity_barcodes;
@@ -1678,7 +1709,7 @@
                             delete inventoryMission.stockInventoryPersons;
                             delete inventoryMission.commodity;
                         });
-                        let data = JSON.stringify(checkData);
+                        let data = JSON.stringify(this.checkData);
                         excelExport(checkAllSign,data,url,this.sum,token);
                     }
                 },
@@ -1689,12 +1720,12 @@
                     let trPc = $("#blueTablePc tr:gt(1)").get();
                     let tr = $("#blueTable tr:gt(0)").get();
                     $(trPc).each(function(item,key){
-                         input = $(key).find('.blueAmountPc');
-                         let obj=new Object();
-                         obj.id=input.attr('data_id');
-                         obj.stored_amount=input.attr('stored_amount');
-                         obj.amount=input.val();
-                         if (input.val()) _this.库位盘点记录.push(obj);
+                        input = $(key).find('.blueAmountPc');
+                        let obj=new Object();
+                        obj.id=input.attr('data_id');
+                        obj.stored_amount=input.attr('stored_amount');
+                        obj.amount=input.val();
+                        if (input.val()) _this.库位盘点记录.push(obj);
                     });
                     $(tr).each(function(item,key){
                         input = $(key).find('.blueAmount');
@@ -1716,22 +1747,22 @@
                                 _this.inventory.surplus = response.data.inventory.surplus;
                                 _this.inventory.check_surplus = response.data.inventory.check_surplus;
                             }
-                                response.data.inventoryMission.forEach(function (mission) {
-                                    if(mission.difference_amount>0) difference.push(mission.commodity.barcodes[0].code);
-                                    _this.inventoryMissions.every(function (inventoryMission,i){
-                                        if (parseInt(inventoryMission.id) === parseInt(mission.id)){
-                                            inventoryMission.checked = mission.checked;
-                                            inventoryMission.verified_amount = mission.verified_amount;
-                                            inventoryMission.difference_amount =mission.difference_amount;
-                                            inventoryMission.re_checked_amount = mission.re_checked_amount;
-                                            inventoryMission.stockInventoryPersons = response.data.stockInventoryPersons;
-                                            _this.inventoryMissions.splice(i, 1);
-                                            _this.inventoryMissions.unshift(inventoryMission);
-                                            return false;
-                                        }
-                                        return true;
-                                    })
-                                });
+                            response.data.inventoryMission.forEach(function (mission) {
+                                if(mission.difference_amount>0) difference.push(mission.commodity.barcodes[0].code);
+                                _this.inventoryMissions.every(function (inventoryMission,i){
+                                    if (parseInt(inventoryMission.id) === parseInt(mission.id)){
+                                        inventoryMission.checked = mission.checked;
+                                        inventoryMission.verified_amount = mission.verified_amount;
+                                        inventoryMission.difference_amount =mission.difference_amount;
+                                        inventoryMission.re_checked_amount = mission.re_checked_amount;
+                                        inventoryMission.stockInventoryPersons = response.data.stockInventoryPersons;
+                                        _this.inventoryMissions.splice(i, 1);
+                                        _this.inventoryMissions.unshift(inventoryMission);
+                                        return false;
+                                    }
+                                    return true;
+                                })
+                            });
                             _this.重排序并显示();
                             _this.清空inputs();
                             _this.清空指定盘点记录列();

+ 1 - 1
resources/views/layouts/menu.blade.php

@@ -53,7 +53,7 @@
                     <span class="fa fa-header" style="color: #72441b"></span>
                     人事管理</a></li> @endcan
         @can('站管理')
-            <li class="nav-item"><a href="{{url("station/index")}}" class="nav-link" target="station/index"
+            <li class="nav-item"><a href="{{url("station/monitor/index")}}" class="nav-link" target="station/monitor/index"
                                     :class="{active:isActive('station',1)}">
                     <span class="fa fa-share-alt-square" style="color: #72441b"></span>
                     站管理</a></li> @endcan

+ 12 - 0
resources/views/maintenance/expressPrinting/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/part" class="nav-link" href="{{url('/maintenance/expressPrinting/part')}}" :class="{active:isActive('part',3)}">组件</a>
+            </li>
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/template" class="nav-link" href="{{url('/maintenance/expressPrinting/template/index')}}" :class="{active:isActive('template',3)}">模板</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 19 - 0
resources/views/maintenance/expressPrinting/part/_table.blade.php

@@ -0,0 +1,19 @@
+<div class="container-fluid">
+    <table class="table table-striped table-sm table-hover" id="print-part-table">
+        <tr class="text-center">
+            <td>序号</td>
+            <td>名称</td>
+            <td>内容</td>
+            <td>操作</td>
+        </tr>
+        <tr  class="text-center" v-for="(printPart,i) in printParts" :key="i">
+            <td>@{{ i+1 }}</td>
+            <td>@{{ printPart.name }}</td>
+            <td>@{{ printPart.value }}</td>
+            <td>
+                <button type="button" class="btn btn-sm btn-danger" @click="destroy(printPart.id,i)">删除</button>
+            </td>
+        </tr>
+    </table>
+    {{$printParts->links()}}
+</div>

+ 213 - 0
resources/views/maintenance/expressPrinting/part/create.blade.php

@@ -0,0 +1,213 @@
+@extends('layouts.app')
+@section('title')组件创建@endsection
+
+@section('content')
+    <span class="nav">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.part.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none" id="create-print-part">
+        <div class="row">
+            <div class="col-3">
+                <div class="card">
+                    <div class="card-header">
+                        基础设置
+                    </div>
+                    <div class="card-body">
+                        <div class="form-group">
+                            <label for="template-width">宽</label>
+                            <input type="number" id="template-width" v-model="template.width" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for=template-height>高</label>
+                            <input type="number" id="template-height" v-model="template.height" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for="template-border-type">边框类型</label>
+                            <select class="form-control" id="template-border-type" v-model="template.borderStyle">
+                                <option v-for="style in borderStyles" :value="style.value">@{{ style.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-border-weight">边框大小</label>
+                            <input type="number" id="template-border-weight" v-model="template.borderWidth" class="form form-control">
+                        </div>
+                    </div>
+                    <div class="card-footer">
+                        <button type="button" class="btn btn-success" @click="show">保存当前模板</button>
+                    </div>
+                </div>
+            </div>
+            <div class="col-6 justify-content-center align-items-center flex-fill" >
+                {{-- 模板展示--}}
+                <div v-if="template.type==='text'" :style="getStyle()">
+                    <span >@{{ template.text }}</span>
+                </div>
+                {{-- 二维码展示 --}}
+                <svg v-show="template.type!=='text'" :style="{width:template.width,height:template.height}" id="barcodeDiv1">
+                </svg>
+            </div>
+            <div class="col-3">
+                {{-- 属性 --}}
+                <div class="card">
+                    <div class="card-header">
+                        设置
+                    </div>
+                    <div class="card-body">
+                        <div class="form-group">
+                            <label for="template-type">组件类型</label>
+                            <select class="form-control" v-model="template.type" @change="setContent">
+                                <option v-for="type in types" :value="type.value">@{{ type.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text">内容</label>
+                            <textarea id="template-text" class="form-text form-control" cols="5" rows="5" v-model="template.text"></textarea>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text-align">文本对齐方式</label>
+                            <select name="" id="template-text-align" v-model="template.justifyContent" class="form form-control">
+                                <option v-for="justifyContent in justifyContents" :value="justifyContent.value">@{{ justifyContent.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-text-align">文本垂直对齐</label>
+                            <select name="" id="template-text-align" v-model="template.alignItems" class="form form-control">
+                                <option v-for="alignItem in alignItems" :value="alignItem.value">@{{  alignItem.name }}</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label for="template-font-size">字体大小</label>
+                            <input type="text" id="template-font-size" v-model="template.fontSize" class="form form-control">
+                        </div>
+                        <div class="form-group">
+                            <label for="template-font-weight">字体宽</label>
+                            <select id="template-font-weight" v-model="template.fontWeight" class="form-control">
+                                <option v-for="fontWeight in fontWeights" :value="fontWeight.value" >@{{ fontWeight.name }}</option>
+                            </select>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="modal fade" id="saveModal" tabindex="-1"  aria-hidden="true">
+            <div class="modal-dialog">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h5 class="modal-title" id="saveModalLabel">保存组件</h5>
+                        <button type="button" class="close" data-dismiss="modal" aria-label="Close" >
+                            <span aria-hidden="true">&times;</span>
+                        </button>
+                    </div>
+                    <div class="modal-body">
+                        <form>
+                            <div class="form-group">
+                                <label for="recipient-name" class="col-form-label">组件名称</label>
+                                <input type="text" id="recipient-name" class="form-control" v-model="printPart.name">
+                            </div>
+                        </form>
+                    </div>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-secondary" data-dismiss="modal" >关闭</button>
+                        <button type="button" class="btn btn-success" @click="create">保存</button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+
+    <script>
+        let vue = new Vue({
+            el:"#create-print-part",
+            data:{
+                printPart:{name:'',value:''},
+                template:{
+                    type:'text',
+                    width:200,
+                    height:100,
+                    borderStyle:'solid',
+                    borderWidth:1,
+                    fontSize:12,
+                    text:'',
+                    fontWeight:'normal',   //normal lighter bold
+                    justifyContent:'',     //文字水平对齐方式
+                    alignItems:'center',         //文字垂直对齐
+                },
+                types:[
+                    {name:"文本框",value:"text"},
+                    {name:"条纹码",value:"StripeCode"},
+                ],
+                fontWeights:[
+                    {name:"正常",value:"normal"},
+                    {name:"细体",value:"lighter"},
+                    {name:"粗体",value:"bold"},
+                ],
+                justifyContents:[
+                    {name:"左对齐",value:""},
+                    {name:"居中",value:"center"},
+                    {name:"右对齐",value:"flex-end"},
+                ],
+                alignItems:[
+                    {name:"顶部",value:""},
+                    {name:"居中",value:"center"},
+                    {name:"底部",value:"flex-end"},
+                ],
+                borderStyles:[
+                    {name:"默认边框",value:"solid"},
+                    {name:"无边框",value:"none"},
+                    {name:"虚线边框",value:"dashed"},
+                ]
+            },
+            mounted() {
+                $("#create-print-part").removeClass('d-none');
+            },
+            methods:{
+                show(){
+                    $('#saveModal').modal('show');
+                },
+                getStyle(){
+                    return {
+                        'display':'flex',
+                        'width':this.template.width+'px',
+                        'height':this.template.height+'px',
+                        'border-style':this.template.borderStyle,
+                        'border-width':this.template.borderWidth+'px',
+                        'font-size':this.template.fontSize+'px',
+                        'font-weight':this.template.fontWeight,
+                        'justify-content':this.template.justifyContent,
+                        'align-items':this.template.alignItems,
+                    };
+                },
+                create(){
+                    tempTip.setDuration(3000);
+                    tempTip.setIndex(2000);
+                    let value = JSON.stringify(this.template);
+                    let data = {name:this.printPart.name,value:value};
+                    window.axios.post('{{url('apiLocal/maintenance/expressPrinting/part/create')}}',data).then(res=>{
+                        if(res.data.success){
+                            tempTip.showSuccess(res.data.data);
+                            $('#saveModal').modal('hide');
+                            return;
+                        }
+                        tempTip.show(res.data.message);
+                    }).catch(err=>{
+                        tempTip.show('网络异常:'+err);
+                    });
+                },
+                setContent(){
+                    if(this.template.type === "text")return;
+                    this.template.borderStyle = 'none';
+                    let div = $("#barcodeDiv1");
+                    window.setBarcode("0123456789","#barcodeDiv1",2,50,true)
+                    this.template.width = div.width();
+                    this.template.height = div.height();
+                }
+            }
+        });
+    </script>
+@endsection

+ 37 - 0
resources/views/maintenance/expressPrinting/part/index.blade.php

@@ -0,0 +1,37 @@
+@extends('layouts.app')
+@section('title')组件@endsection
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.part.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none" id="print_part">
+        @include('maintenance.expressPrinting.part._table')
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        let vue = new Vue({
+            el:"#print_part",
+            data:{
+                printParts:{!! $printParts->toJson() !!}['data'],
+            },
+            mounted(){
+                $('#print_part').removeClass('d-none');
+            },
+            methods:{
+                destroy(id,index){
+                    if (!confirm('是否删除当前组件')) return;
+                    tempTip.setDuration(3000);
+                    window.tempTip.postBasicRequest('{{url('apiLocal/maintenance/expressPrinting/part/destroy')}}',{id:id},res=>{
+                        tempTip.showSuccess(res);
+                        this.$delete(this.printParts,index);
+                    });
+                }
+            }
+        });
+    </script>
+@endsection

+ 12 - 0
resources/views/maintenance/expressPrinting/part/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/part" class="nav-link" href="{{url('/maintenance/expressPrinting/part')}}" :class="{active:isActive('part',3)}">查询</a>
+            </li>
+            <li class="nav-item">
+                <a target="/maintenance/expressPrinting/part/create" class="nav-link" href="{{url('/maintenance/expressPrinting/part/create')}}" :class="{active:isActive('create',4)}">创建</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 149 - 0
resources/views/maintenance/expressPrinting/print/index.blade.php

@@ -0,0 +1,149 @@
+@extends("layouts.app")
+@section("title","打印")
+
+@section("content")
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.print.menu')@endcomponent
+    </span>
+    <div class="container" id="print">
+        <div class="row">
+            <div class="container">
+                <div class="input-group">
+                    <label for="scaleNumber" class="col-form-label-sm">缩放比例</label>
+                    <input id="scaleNumber" type="number" v-model="scaleNumber" class="form-control-sm">
+                    <button class="btn btn-success" @click="printImage">打印</button>
+                </div>
+            </div>
+        </div>
+        <div class="row p-0 m-0" id="img-div">
+        </div>
+        <div class="container m-0 p-0" id="print-div" :style="getByWidth(template)"  >
+            <div class="position-relative border-1 row p-0 m-0 bg-white border print-template" v-for="(item,i) in items" :style="getBgStyle(template)">
+                <div class="position-absolute" v-for="(part,index) in parts" :style="getStyle(part)">
+                    <svg v-if="isSvg(part)" :style="getSvgStyle(part)" :id="'svg'+i"  class="StripeCode">
+                        @{{ getContent(part,item) }}
+                    </svg>
+                    <span v-else>@{{ getContent(part,item) }}</span>
+                </div>
+            </div>
+        </div>
+
+    </div>
+@endsection
+
+@section("lastScript")
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script type="text/javascript" src="{{mix('js/utilities/html2canvas.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            el:"#print",
+            data:{
+                template:{!! $template !!},
+                items:{!! $items !!},
+                parts:[],
+                index:0,
+                scaleNumber:1,
+            },
+            created() {
+                this.parts = JSON.parse(this.template.value);
+            },
+            mounted() {
+                $.each(this.items,(index,item)=>{
+                    window.setBarcode('123456',"#svg"+index,2,50,true);
+                    $("#svg"+index).find("svg");
+                });
+            },
+            methods:{
+                isSvg(part){
+                    return part.type==="StripeCode";
+                },
+                printingTemplate(template,items){
+                    let _this = this;
+                    $.each(items,function(i,item){
+                        _this.paddingPrintDiv(template,item);
+                    });
+                },
+                getBgStyle(template){
+                    if (this.parts === []) this.parts = JSON.parse(template.value);
+                    let style  = {};
+                    this.parts.forEach((item)=>{
+                        if(item.type==="bg"){
+                            style =  {
+                                width:item.width+'px',
+                                height:item.height+'px'
+                            }
+                        }
+                    });
+                    return style;
+                },
+                getByWidth(){
+                    if (this.parts === []) this.parts = JSON.parse(template.value);
+                    let style  = {};
+                    this.parts.forEach((item)=>{
+                        if(item.type==="bg"){
+                            style =  {
+                                width:item.width+'px',
+                                transform: "scale(" +this.scaleNumber +")",
+                                transformOrigin: "left top",
+                            }
+                        }
+                    });
+                    return style;
+                },
+                getSvgStyle(item){
+                    return {
+                        width:item.width+'px',
+                        height:item.height+'px',
+                    };
+                },
+                getStyle(item){
+                    let style = JSON.parse(JSON.stringify(item));
+                    style.display = 'flex';
+                    style['border-style'] = style.borderStyle;
+                    style['border-width'] = style.borderWidth+'px';
+                    style['font-size'] = style.fontSize+'px';
+                    style['font-weight'] = style.fontWeight;
+                    style['justify-content'] = style.justifyContent;
+                    style['align-items'] = style.alignItems;
+                    style.width+='px';
+                    style.height+='px';
+                    style.left+='px';
+                    style.top+='px';
+                    style['white-space'] = 'pre';              // 字体换行
+                    return style;
+                },
+                getContent(part,item){  // 组件内容
+                    return part.text;
+                    if(part.text.indexOf("$")===-1)return part.text;
+                    if(part.text.indexOf("+$")!==-1){
+                        let arr = part.text.split("+$");
+                        return arr[0]+item[ arr[1]];
+                    }
+                    if(part.text.indexOf("$")!==-1){
+                        let arr = part.text.split("$");
+                        return arr[0]+item[arr[1]];
+                    }
+                },
+                printImage(){
+                    let _this = this;
+                     window.canvasImg("#print-div","#img-div",this.scaleNumber,function(canvas){
+                        let data = canvas.toBlob(function (blob){
+                            let formData =new FormData();
+                            formData.append("blob",blob);
+                            _this.printData(formData);
+                        },"image/png");
+                    });
+                },
+                printData(data){
+                    window.axios.post("{{url("apiLocal/maintenance/expressPrinting/part/printTemplate")}}",data).then(res=>{
+                        tempTip.showSuccess(res);
+                    }).catch(err=>{
+                        tempTip.showSuccess(err);
+                    });
+                }
+            }
+        })
+    </script>
+@endsection

+ 9 - 0
resources/views/maintenance/expressPrinting/print/menu.blade.php

@@ -0,0 +1,9 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/print/index" class="nav-link" href="{{url('/maintenance/expressPrinting/print/index')}}" :class="{active:isActive('index',4)}">打印</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 85 - 0
resources/views/maintenance/expressPrinting/template/_compile.blade.php

@@ -0,0 +1,85 @@
+<div class="container-fluid">
+    <div class="card">
+        <form class="form">
+            <div class="card-header">
+                <button type="button" class="btn btn-success"  @click="showSaveModal">保存当前打印模板</button>
+            </div>
+            <div class="card-header" v-show="selectProducePanel">
+                <span>背景版编辑</span>
+            </div>
+            <div class="card-body" v-show="selectProducePanel">
+                <div class="form-group m-0">
+                    <label for="producePanel-width" class="col-form-label">宽</label>
+                    <input type="text" id="producePanel-width" class="form-control form-control-sm" v-model="producePanel.width">
+                </div>
+                <div class="form-group m-0">
+                    <label for="producePanel-height" class="col-form-label">高</label>
+                    <input type="text" id="producePanel-height" class="form-control form-control-sm" v-model="producePanel.height">
+                </div>
+            </div>
+            <div class="card-header">
+                <span>编辑面板</span>
+            </div>
+            <div class="card-body" v-if="productionParts.editPart">
+                <div class="form-group m-0">
+                    <label for="compile-text" class="col-form-label">文本内容</label>
+                    <textarea class="form-control" id="compile-text" cols="30" rows="5" v-model="productionParts.editPart.text"></textarea>
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-left" class="col-form-label">left</label>
+                    <input type="text" id="compile-left" class="form-control form-control-sm" v-model="productionParts.editPart.left">
+                </div>
+
+                <div class="form-group m-0">
+                    <label for="compile-top" class="col-form-label">top</label>
+                    <input type="text" id="compile-top" class="form-control form-control-sm" v-model="productionParts.editPart.top">
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-width" class="col-form-label">宽</label>
+                    <input type="text" id="compile-width" class="form-control form-control-sm" v-model="productionParts.editPart.width">
+                </div>
+                <div class="form-group m-0">
+                    <label for="compile-height" class="col-form-label text-sm-right">高</label>
+                    <input type="text" id="compile-height" class="form-control form-control-sm" v-model="productionParts.editPart.height">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-font-size" class="col-form-label text-sm-right">字体大小</label>
+                    <input type="text" id="compile-font-size" class="form-control form-control-sm" v-model="productionParts.editPart.fontSize">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-font-weight" class="col-form-label text-sm-right">字体粗细</label>
+                    <select class="form-control" id="compile-font-weight" v-model="productionParts.editPart.fontWeight">
+                        <option  value="normal">正常</option>
+                        <option  value="lighter">细体</option>
+                        <option  value="bold">粗体</option>
+                    </select>
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-z-index" class="col-form-label text-sm-right">图层</label>
+                    <input type="text" id="compile-z-index" class="form-control form-control-sm" v-model="productionParts.editPart.z_index">
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-justify-content" class="col-form-label text-sm-right">文本水平对齐方式</label>
+                    <select class="form-control-sm form-control" id="compile-justify-content" v-model="productionParts.editPart.justifyContent">
+                        <option value="">左对齐</option>
+                        <option value="center">居中对齐</option>
+                        <option value="flex-end">右对齐</option>
+                    </select>
+                </div>
+                <div class="form-group m-0" >
+                    <label for="compile-text-align" class="col-form-label text-sm-right">文本垂直对齐方式</label>
+                    <select class="form-control-sm form-control " id="compile-text-align" v-model="productionParts.editPart.alignItems">
+                        <option value="">顶部</option>
+                        <option value="center">垂直居中</option>
+                        <option value="flex-end">顶部</option>
+                    </select>
+                </div>
+            </div>
+            <div class="card-footer" v-show="!selectProducePanel">
+                <button type="button" class="btn btn-outline-secondary" v-show="productionParts.editPart" @click="_removePartToProductionPanel(productionParts.editPart)">删除</button>
+            </div>
+
+        </form>
+    </div>
+
+</div>

+ 35 - 0
resources/views/maintenance/expressPrinting/template/_produce.blade.php

@@ -0,0 +1,35 @@
+<div class="position-relative border-1 row p-0 m-0 bg-white border" id="produce-panel" @click="editProducePanel" :style="getProducePanelStyle()" >  <!--position-relative--> <!--position-absolute-->
+    <div class="position-absolute print-part"
+         draggable="true"
+         v-for="(item,i) in productionParts.printParts"
+         @click.stop="productionParts.editPart = item"
+         @dragstart="_dragstart(item,$event)"             {{--开始拖动元素时触发--}}
+         @dragend="_dragend(item,$event)"                 {{--拖动结束--}}
+         :style="getPrintPartStyle(item)"
+         :key="i" >
+        <svg v-if="item.type ==='StripeCode'" :style="{width:item.width,height:item.height}" :id="item.id" @click.stop="productionParts.editPart = item"></svg>
+        <span v-else>@{{ item.text }}</span>
+    </div>
+</div>
+<div class="modal fade" id="saveModal" tabindex="-1"  aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title" id="saveModalLabel">保存打印模板</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="productionParts.addPart.name = null">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="form-group">
+                    <label for="recipient-name" class="col-form-label">模板名称</label>
+                    <input type="text" id="recipient-name" class="form-control" v-model="productionParts.addPart.name">
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal" @click="productionParts.addPart.name = null">关闭</button>
+                <button type="button" class="btn btn-success" @click="_savePrintTemplate">保存</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 11 - 0
resources/views/maintenance/expressPrinting/template/_select.blade.php

@@ -0,0 +1,11 @@
+<div class="container-fluid p-0"  id="select-panel" style="cursor: pointer; overflow-y: scroll;border-radius:5px;" >
+    <input type="text" class="form-control" placeholder="输入组件名称进行搜索" @change="_searchPrintPart($event)">
+    <ul class="list-group" >
+        <li class="list-group-item align-text-top hover"
+            v-for="(printPart,i) in filterPrintParts"
+            @dblclick="_addPartToProductionPanel(printPart)">
+            @{{ printPart.name }}
+            <span class="text-right float-right">添加</span>
+        </li>
+    </ul>
+</div>

+ 177 - 0
resources/views/maintenance/expressPrinting/template/create.blade.php

@@ -0,0 +1,177 @@
+@extends('layouts.app')
+@section('title')模板@endsection
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.template.menu')@endcomponent
+    </span>
+    <div class="container-fluid d-none row m-1" id="print-template">
+        <div class="col-lg-2 col-sm-3 p-0"  id="part_panel">
+            {{--  组件选择面板 --}}
+            @include('maintenance.expressPrinting.template._select')
+        </div>
+        <div class="col-lg-8 col-sm-6 p-0" id="production_panel">
+            {{--  模板制作面板 --}}
+            @include('maintenance.expressPrinting.template._produce')
+        </div>
+        <div class="col-lg-2 col-sm-3 p-0" id="compile_panel">
+            {{-- 模板编辑页面 --}}
+            @include('maintenance.expressPrinting.template._compile')
+        </div>
+    </div>
+@endsection
+
+
+@section('lastScript')
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script>
+        let vue = new Vue({
+            el:"#print-template",
+            data:{
+                printParts:{!! $printParts !!},
+                filterPrintParts:[],
+                producePanel:{},              // 背景版
+                selectProducePanel:false,              // 是否选中背景版
+                productionParts:{
+                    printParts:[],                  // 组件s
+                    editPart: null,                    // 编辑中的组件
+                    editIndex:{},                   // 编辑中组件的下标
+                    addPart:{},                     // 添加模板
+                },
+                partIsSelected:false,               // 表示模块被选中
+                selectPrintPart:{},                 // 选中模块
+                selectPrintPartPoint:{x:'',y:''},   // 选中模块时模块 point
+                mousePointStart:{x:'',y:''},        // 开始拖动时的 point
+                mousePointEnd:{x:'',y:''},          // 结束拖动时的 point
+                selectPrintPartOffset:{left:'',top:''},     // 选中时的left 和 top
+                z_index:10,
+            },
+            mounted(){
+                this.initProductionParts();
+                $('.navbar,.nav1,.nav2').hide();
+                $('.nav3').on('mouseenter', function () {
+                    $('.navbar,.nav1,.nav2').show();
+                });
+                $('.body').on('mouseenter', function () {
+                    $('.navbar,.nav1,.nav2').hide();
+                });
+                $("#print-template").removeClass('d-none');
+            },
+            methods:{
+                _addPartToProductionPanel(printPart){
+                    let _clone = JSON.parse(JSON.stringify(printPart));
+                    let print_part = JSON.parse(_clone.value);
+                    print_part.left = 0;
+                    print_part.top = 0;
+                    print_part.index = this.productionParts.printParts.length;
+                    print_part.z_index = this.z_index++;
+                    print_part.id = "id"+this.z_index;
+                    print_part.text = null;
+                    this.productionParts.printParts.push(print_part);
+                    if(print_part.type ==="StripeCode"){
+                        setTimeout(function(){
+                            window.setBarcode("0123456789","#"+print_part.id,2,50,true)
+                        },100);
+                    }
+                },
+                _removePartToProductionPanel(editPart){
+                    this.productionParts.editPart = null;
+                    let index = this.productionParts.printParts.indexOf(editPart);
+                    this.productionParts.printParts.splice(index,1);
+                },
+                _alignContentToProductionPanel(){
+                    this.productionParts.printParts.splice(this.productionParts.editIndex,1);
+                    this.$forceUpdate();
+                },
+                _searchPrintPart(event){
+                    let value = $(event.target).val();
+                    this.filterPrintParts = this.printParts.filter(function(printPart){
+                        return printPart.name.includes(value);
+                    });
+                    if(value===null || value=== '') this.filterPrintParts = JSON.parse(JSON.stringify(this.printParts));
+                },
+                showSaveModal(){
+                    $('#saveModal').modal('show');
+                },
+                _savePrintTemplate(){
+                    tempTip.setDuration(3000);
+                    tempTip.setIndex(1999);
+                    let printTemplate =JSON.parse(JSON.stringify(this.productionParts.printParts));
+                    let bg = {
+                        type:'bg',
+                        'width':this.producePanel.width,
+                        'height':this.producePanel.height,
+                    }
+                    printTemplate.push(bg);
+                    let data = {
+                        name:this.productionParts.addPart.name,
+                        value:printTemplate
+                    };
+                    window.axios.post("{{url('apiLocal/maintenance/expressPrinting/template/create')}}",data).then(res=>{
+                        if(res.data.success){
+                            tempTip.showSuccess('保存成功!');
+                            $('#saveModal').modal('hide');
+                            return ;
+                        }
+                        tempTip.show(res.data.message);
+                    }).catch(err=>{
+                        tempTip.show(err);
+                    });
+                },
+                initProductionParts(){
+                    this.productionParts = {printParts:[], editPart:null, addPart:{}};
+                    this.filterPrintParts=JSON.parse(JSON.stringify(this.printParts));
+                    let height = (window.innerHeight-120)+'px';
+                    $("#production_panel,#part_panel,#compile_panel,#select-panel,#produce-panel").css({height:height});
+                    let produce_panel = $("#produce-panel");
+                    produce_panel.css({height:height});
+                },
+                getPrintPartStyle(item){
+                    let style = JSON.parse(JSON.stringify(item));
+                    style['border-style'] = style.borderStyle;
+                    style['border-width'] = style.borderWidth+'px';
+                    if(style.borderStyle === 'none'){
+                        style['border-style'] = 'dotted';
+                        style['border-width'] = '1px';
+                    }
+                    style.display = 'flex';
+                    style['font-size'] = style.fontSize+'px';
+                    style['font-weight'] = style.fontWeight;
+                    style['justify-content'] = style.justifyContent;
+                    style['align-items'] = style.alignItems;
+                    style.width+='px';
+                    style.height+='px';
+                    style.left+='px';
+                    style.top+='px';
+                    style['white-space'] = 'pre';              // 字体换行
+                    return style;
+                },
+                _dragstart(item,$event){
+                    {{--开始拖动元素时触发--}}
+                    this.selectPrintPartPoint  = {x:parseInt(item.left),y:parseInt(item.top)};
+                    this.mousePointStart = {x:$event.offsetX, y:$event.offsetY};
+                },
+                _dragend(item,$event){
+                    {{--结束拖动元素时触发--}}
+                        this.mousePointEnd =  {x:$event.offsetX, y:$event.offsetY};
+                    let left  = item.left - (this.mousePointStart.x - this.mousePointEnd.x);
+                    let top = item.top - (this.mousePointStart.y - this.mousePointEnd.y);
+                    item.left = left >0 ? left:0;
+                    item.top =  top > 0 ? top:0;
+                },
+                editProducePanel(){
+                    this.selectProducePanel =!this.selectProducePanel;
+                },
+                getProducePanelStyle(){
+                    return {
+                        width:this.producePanel.width+'px',
+                        height:this.producePanel.height+'px',
+                    }
+                }
+            }
+        });
+    </script>
+@endsection
+

+ 52 - 0
resources/views/maintenance/expressPrinting/template/index.blade.php

@@ -0,0 +1,52 @@
+@extends('layouts.app')
+
+@section('title','查询')
+
+@section('content')
+    <span id="nav2">
+        @component('maintenance.menu')@endcomponent
+        @component('maintenance.expressPrinting.menu')@endcomponent
+        @component('maintenance.expressPrinting.template.menu')@endcomponent
+    </span>
+    <div class="container-fluid" id="part-template">
+        <table class="table table-striped table-sm table-hover">
+            <tr>
+                <th>序号</th>
+                <th>名称</th>
+                <th>内容</th>
+                <th>操作</th>
+            </tr>
+            <tr v-for="(template,i) in templates">
+                <td>@{{ i+1 }}</td>
+                <td>@{{ template.name }}</td>
+                <td>@{{ template.value }}</td>
+                <td>
+                    <button type="button" class="btn btn-danger" @click="destroy(template.id,i)">删除</button>
+                </td>
+            </tr>
+        </table>
+    </div>
+@endsection
+
+@section('lastScript')
+    <script>
+        let vue = new Vue({
+            el:'#part-template',
+            data:{
+                templates:{!! $templates !!},
+            },
+            methods:{
+                destroy(id,i){
+                    if (!confirm('是否删除当前模板')) return;
+                    tempTip.setDuration(3000);
+                    window.tempTip.postBasicRequest("{{url('apiLocal/maintenance/expressPrinting/template/destroy')}}",{id:id},res=>{
+                        tempTip.showSuccess('删除成功');
+                        this.$delete(this.templates,i);
+                    });
+                }
+            }
+        });
+    </script>
+@endsection
+
+

+ 12 - 0
resources/views/maintenance/expressPrinting/template/menu.blade.php

@@ -0,0 +1,12 @@
+<div class="container-fluid nav3">
+    <div class="card" >
+        <ul class="nav nav-pills">
+            <li class="nav-item">
+                <a target="maintenance/expressPrinting/template/index" class="nav-link" href="{{url('/maintenance/expressPrinting/template/index')}}" :class="{active:isActive('index',4)}">查询</a>
+            </li>
+            <li class="nav-item">
+                <a target="/maintenance/expressPrinting/template/create" class="nav-link" href="{{url('/maintenance/expressPrinting/template/create')}}" :class="{active:isActive('create',4)}">创建</a>
+            </li>
+        </ul>
+    </div>
+</div>

+ 6 - 1
resources/views/maintenance/menu.blade.php

@@ -122,7 +122,12 @@
             @canany(['系统配置','基础设置-系统配置'])
                 <li class="nav-item">
                     <a class="nav-link text-muted" href="{{url('maintenance/configuration')}}" :class="{active:isActive('configuration',2)}">系统配置</a>
-                </li>@endcanany
+                </li>
+
+                    <li class="nav-item">
+                        <a class="nav-link text-muted" href="{{url('maintenance/expressPrinting/part')}}" :class="{active:isActive('expressPrinting',2)}">快递打印</a>
+                    </li>
+                @endcanany
             @canany(['装卸队','基础设置-装卸队'])
                 <li class="nav-item">
                     <a class="nav-link text-muted" href="{{url('maintenance/facilitator')}}" :class="{active:isActive('facilitator',2)}">装卸队</a>

+ 39 - 31
resources/views/order/issue/index.blade.php

@@ -99,23 +99,23 @@
                         <th class="one-layer align-middle" rowspan="2" style=" min-width: 50px;">序号</th>
                         <th class="one-layer align-middle" rowspan="2" style=" min-width: 70px;">ID</th>
                         @cannot('订单管理-问题件-客户不可见')
-                            <th class="one-layer align-middle" rowspan="2" style=" min-width: 75px;">新退件状态</th>
+                            <th class="one-layer align-middle" rowspan="2" style=" max-width: 55px;min-width: 55px">新退件状态</th>
                             @can("订单管理-问题件-置顶")
                                 <th class="one-layer align-middle" rowspan="2" style=" min-width: 75px;">置顶</th>
                             @endcan
                             <th class="one-layer align-middle" rowspan="2" style=" min-width: 100px;">退单状态</th>
                         @endcannot
-                        <th class="one-layer align-middle" rowspan="2" style="min-width: 120px">最终状态</th>
+                        <th class="one-layer align-middle" rowspan="2" style="min-width: 90px">最终状态</th>
                         @cannot('订单管理-问题件-客户不可见')
-                            <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 165px;">登记日期</th>
+                            <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 95px;min-width: 95px;">登记日期</th>
                         @endcannot
 
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 165px;">订单日期</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 100px;">客户</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 200px;">店铺</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 200px;">客户订单号</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 100px;">原始承运商</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width: 150px;">原始运单号</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 95px;min-width: 95px;">订单日期</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 100px;min-width: 100px;">客户</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 120px;min-width: 120px;">店铺</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 150px;min-width: 150px;">客户订单号</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 100px;min-width: 100px;">原始承运商</th>
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width: 150px;min-width: 150px;">原始运单号</th>
                         {{--原始商品明细 开始--}}
                         <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" rowspan="2"
                             style="min-width: 200px">收货人名称</th>
@@ -131,12 +131,12 @@
                             style="min-width:300px">收货人地址</th>
                         <th class="tow-layer align-middle td-yellow" v-show="isShowOrderInfo" colspan="3"
                             style="min-width:300px">原始商品明细</th>
-                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="min-width:50px">@{{
+                        <th class="tow-layer align-middle td-yellow" rowspan="2" style="max-width:50px">@{{
                             isShowOrderInfo? '隐藏':'展开' }}</th>
                         {{--原始商品明细 结束--}}
 
                         {{--原始商品明细 开始--}}
-                        <th class="three-layer   align-middle" rowspan="2" style="min-width:50px">@{{ isShowRejectedBill
+                        <th class="three-layer   align-middle" rowspan="2" style="max-width:50px">@{{ isShowRejectedBill
                             ? '隐藏':'展开' }}</th>
                         <th class="three-layer align-middle" rowspan="2" v-show="isShowRejectedBill"
                             style="min-width:265px">退回单号</th>
@@ -184,9 +184,9 @@
                             <th v-show="isShowRejectedBill" style="min-width: 50px">是否正品</th>
                             <th v-show="isShowRejectedBill" style="min-width: 100px">备注</th>
                         @endcannot
-                        <th style="min-width: 120px">说明</th>
-                        <th style="min-width: 100px">操作者</th>
-                        <th style="min-width: 170px">时间</th>
+                        <th style="max-width: 135px">说明</th>
+                        <th style="max-width: 55px">操作者</th>
+                        <th style="max-width: 135px">时间</th>
                         <th></th>
                         @cannot('订单管理-问题件-客户不可见')
                             <th v-show="isShowSecondOrderInfo" style="min-width: 100px">条码</th>
@@ -269,15 +269,15 @@
                         </td>
 
                         @cannot('订单管理-问题件-客户不可见')
-                            <td class="toptd td-yellow child-layer-2">
+                            <td class="toptd td-yellow child-layer-2 m-0 p-0 pt-1">
                                 <div v-if="orderIssue.remark"
                                      class="bg-light-yellow  text-danger top text-left position-absolute"
                                      data-toggle="tooltip" style="opacity: 0.1;z-index: 1">置顶备注:@{{ orderIssue.remark }}</div>
-                                @{{ orderIssue.created_at }}
+                                @{{ orderIssue.created_at  }}
                             </td>
                         @endcannot
 
-                        <td class="td-yellow child-layer-2">
+                        <td class="td-yellow child-layer-2  m-0 p-0 pt-1">
                             @cannot('订单管理-问题件-客户不可见')
                             @else
                                 <div v-if="orderIssue.top" class="bg-light-yellow  text-danger top text-left"
@@ -338,8 +338,7 @@
                                             <td>
                                                 <p class="text-truncate text-primary m-0 p-0 tooltipTarget"
                                                    style="width: 100px;cursor:pointer;text-decoration: underline"
-                                                   title="双击展开" @dblclick="nowrapText($event)">@{{ item.commodity.name
-                                                    }}</p>
+                                                   title="双击展开" @dblclick="nowrapText($event)">@{{ item.commodity.name }}</p>
                                                 <p class="text-nowrap m-0 p-0 tooltipTarget"
                                                    style="display: none;cursor:pointer" @dblclick="truncateText($event)"
                                                    title="双击收起">@{{ item.commodity.name }}</p>
@@ -471,24 +470,25 @@
                         <td class=" m-0 p-0 log-td child-layer-3  align-center" v-on:mouseover="showAddBtn($event)"
                             v-on:mouseleave="hideAddBtn($event)" colspan="4">
                             @can('订单管理-问题件-处理结果添加')
+                                <div style="position: absolute;display: none;margin-top: -35px" class="add-btn" :id="'AddBtn'+orderIssue.id">
+                                    <button type="button" class="btn  btn-primary "
+                                            @click="showAddDiv('AddLog_'+orderIssue.id)">新
+                                    </button>
+                                </div>
+
                                 <div class="addLogDiv row m-0 p-0 form-group" :id="'AddLog_'+orderIssue.id"
                                      style="display: none;">
                                     <input type="hidden" name="id" :value="orderIssue.id">
                                     <div style="width: 45px"></div>
                                     <div class="form-inline m-2">
-                                        <input type="text" name="content" class="form-control" style="width: 300px"
+                                        <input type="text" name="content" class="form-control m-0 p-0" style="width: 275px"
                                                required>
-                                        <button type="button" class="btn btn-primary ml-2"
-                                                @click="addOrderIssueLog('AddLog_'+orderIssue.id,orderIssue)">添加
+                                        <button type="button" class="btn btn-primary ml-2 m-0 p-0"
+                                                @click="addOrderIssueLog('AddLog_'+orderIssue.id,orderIssue)" style="width: 50px">添加
                                         </button>
                                     </div>
                                 </div>
-                                <div style="position: absolute;display: none;margin-top: -35px" class="add-btn"
-                                     :id="'AddBtn'+orderIssue.id">
-                                    <button type="button" class="btn  btn-primary "
-                                            @click="showAddDiv('AddLog_'+orderIssue.id)">新
-                                    </button>
-                                </div>
+
                             @endcan
                             <template v-if="orderIssue.logs && orderIssue.logs.length > 0" class="p-0 m-0">
                                 <table class="table table-sm p-0 m-0 " :id="'logs'+orderIssue.id">
@@ -496,11 +496,11 @@
                                         @click="removeFocusing($event)" v-on:mouseover="showDelBtn($event)"
                                         v-on:mouseleave="hideDelBtn($event)">
                                         <template v-if="logIndex<2||orderIssue.log_is_show===true">
-                                            <td style="min-width: 200px">@{{ log.content }}</td>
-                                            <td class="text-muted" style="min-width: 120px">
+                                            <td style="max-width: 175px;min-width: 175px;">@{{ log.content }}</td>
+                                            <td class="text-muted" style="max-width: 55px;min-width: 55px;">
                                                 <span v-if="log.user">@{{ log.user.name}}</span>
                                             </td>
-                                            <td class="text-muted" style="min-width: 170px">@{{ log.created_at }}</td>
+                                            <td class="text-muted" style="max-width: 95px;min-width: 95px;">@{{ log.created_at }}</td>
                                             @can('订单管理-问题件-处理结果删除')
                                                 <td style="" class="m-0 p-0 border-0">
                                                     <button type="button"
@@ -2136,6 +2136,14 @@
                 listenTBodyResize(){
                     this.$set(this,'toggleBtnHeight',document.getElementById('tbody').clientHeight);
                 },
+            },
+            filters:{
+                date:function(value) {
+                    if (value !== null) {
+                        return moment(value).format('yyyy-MM-DD');
+                    }
+                    return value
+                },
             }
         })
         // modal 隐藏时修改 input 为空

+ 3 - 3
resources/views/order/tracking/index.blade.php

@@ -3,7 +3,7 @@
 @section('content')
     @component('order.tracking.menu')@endcomponent
     <div class="container-fluid" id="tracking_div">
-        <div style="min-width: 3000px">
+        <div style="min-width: 3550px">
             <div class="d-none container-fluid" id="list">
                 <div id="form_div"></div>
                 @can('订单管理-跟踪-监听')
@@ -75,7 +75,7 @@
                         <th class="td-yellow">运输单号</th>
                         <th class="td-yellow" style="min-width: 120px">到达城市</th>
                         <th class="td-yellow" style="min-width: 120px">照片</th>
-                        <th class="td-yellow" style="min-width: 120px">序列号</th>
+                        <th class="td-yellow" style="min-width: 180px;max-width: 300px">序列号</th>
                         <th class="td-calm" style="min-width: 200px">应送达时间</th>
                         <th class="td-calm" style="min-width: 120px">是否赶上卡班</th>
                         <th class="td-calm" style="min-width: 120px">到货情况</th>
@@ -205,7 +205,7 @@
                             @endcan
                             </div>
                         </td>
-                        <td class="td-yellow">
+                        <td class="td-yellow w-auto">
                             <template v-if="trackOrder.commodities['serial_numbers'].length > 0">
                                     <template v-for="serialNumber in trackOrder.commodities['serial_numbers']">
                                         <transition name="fade">

+ 113 - 66
resources/views/package/logistic/index.blade.php

@@ -10,22 +10,40 @@
             <div id="form_div"></div>
             <div class="form-inline" id="btn">
                 @can('包裹管理-快递-异常类型-编辑')
-                    <select class="form-control-sm" v-model="batchExceptionType">
-                        <option v-for="(value,index) in exception_types" :value="value"
-                                :name="value" :key="index">@{{ value }}
-                        </option>
-                    </select>
-                    <button @click="batchExceptionTypeUpdate()" type="button"
-                            class="btn btn-sm ml-2 btn-outline-primary">批量异常状态修改
-                    </button>
-                    <select class="form-control-sm ml-2" v-model="batchStatus">
-                        <option v-for="(value,index) in statuses" :value="value"
-                                :name="value" :key="index">@{{ value }}
-                        </option>
-                    </select>
-                    <button @click="batchStatusUpdate()" type="button"
-                            class="btn btn-sm ml-2 btn-outline-danger">批量状态修改
-                    </button>
+                    <span class="dropdown ml-1">
+                        <button type="button"
+                                class="btn btn-outline-dark btn-sm form-control-sm dropdown-toggle tooltipTarget"
+                                data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">导出Excel
+                        </button>
+                        <div class="dropdown-menu">
+                            <a class="dropdown-item" @click="orderPackageExport(false)" href="javascript:">导出勾选内容</a>
+                            <a class="dropdown-item" @click="orderPackageExport(true)" href="javascript:">导出所有页</a>
+                        </div>
+                    </span>
+                    <span class="ml-1">
+                        <select class="form-control-sm" v-model="batchExceptionType">
+                            <option v-for="(value,index) in exception_types" :value="value"
+                                    :name="value" :key="index">@{{ value }}
+                            </option>
+                        </select>
+                        <button @click="batchExceptionTypeUpdate()" type="button"
+                                class="btn btn-sm ml-2 btn-outline-primary">批量异常状态修改
+                        </button>
+                    </span>
+                    <span class="ml-1">
+                        <select class="form-control-sm ml-2" v-model="batchStatus">
+                            <option v-for="(value,index) in statuses" :value="value"
+                                    :name="value" :key="index">@{{ value }}
+                            </option>
+                        </select>
+                        <button @click="batchStatusUpdate()" type="button"
+                                class="btn btn-sm ml-2 btn-outline-danger">批量状态修改
+                        </button>
+                    </span>
+                    <span class="ml-1">
+                        <button type="button" class="btn btn-outline-dark btn-sm form-control-sm  tooltipTarget"
+                                @click="copyLogisticNumber" style="background: #dad7e8;">复制快递单号</button>
+                    </span>
                 @endcan
             </div>
             <table class="table table-striped table-sm text-nowrap table-hover" id="table">
@@ -34,7 +52,8 @@
                     <td>
                         <input class="checkItem" type="checkbox" :value="package.logistic_number">
                     </td>
-                    <td><span>@{{ i+1 }} <span class="badge badge-danger" v-if="package.order.issue">问题件</span></span></td>
+                    <td><span>@{{ i+1 }} <span class="badge badge-danger" v-if="package.order.issue">问题件</span></span>
+                    </td>
                     <td>
                         <select class="form-control-sm" v-model="package.exception_type"
                                 @change="package.showEditButton = true">
@@ -74,28 +93,30 @@
                             </label>
                         </div>
                     </td>
-                    <td @mouseover="remarkHover = package.id" @mouseleave="remarkHover=null;remark=null;isShowRemarkInput = false">
+                    <td @mouseover="remarkHover = package.id"
+                        @mouseleave="remarkHover=null;remark=null;isShowRemarkInput = false">
                         @can('包裹管理-快递-客服备注')
-                        <button @click="isShowRemarkInput = true" v-if="remarkHover===package.id">新增</button>
-                        <input @keydown.enter="submitRemark(package)" v-if="isShowRemarkInput && remarkHover===package.id" type="text" v-model="remark">
-                        <div v-if="package.remark && package.remark.length>0" :id="'remark-'+i">
-                            <div v-if="showRemarkList[i]" class="text-overflow-warp-200 up" >
-                                <p v-for="remark_item in package.remark">
-                                    @{{ remark_item }}
-                                </p>
+                            <button @click="isShowRemarkInput = true" v-if="remarkHover===package.id">新增</button>
+                            <input @keydown.enter="submitRemark(package)"
+                                   v-if="isShowRemarkInput && remarkHover===package.id" type="text" v-model="remark">
+                            <div v-if="package.remark && package.remark.length>0" :id="'remark-'+i">
+                                <div v-if="showRemarkList[i]" class="text-overflow-warp-200 up">
+                                    <p v-for="remark_item in package.remark">
+                                        @{{ remark_item }}
+                                    </p>
+                                </div>
+                                <div class="text-overflow-warp-200" v-else>
+                                    @{{ package.remark[0] }}
+                                </div>
                             </div>
-                            <div class="text-overflow-warp-200" v-else>
-                                @{{ package.remark[0] }}
-                            </div>
-                        </div>
-                        <div @click="showRemarkItem(i)" v-if="package.remark && package.remark.length > 1">
-                            <label class="text-center mt-0 p-0 cursor-pointer pull-left">
+                            <div @click="showRemarkItem(i)" v-if="package.remark && package.remark.length > 1">
+                                <label class="text-center mt-0 p-0 cursor-pointer pull-left">
                                 <span class="fa"
                                       :class="package.isShowRemark ? 'fa-angle-double-down' : 'fa-angle-double-right'"></span>
-                                &nbsp;<span v-if="package.remark && showRemarkList[i]">收起</span><span
-                                    v-else>展开</span>&nbsp;@{{ package.remark.length }} 条
-                            </label>
-                        </div>
+                                    &nbsp;<span v-if="package.remark && showRemarkList[i]">收起</span><span
+                                        v-else>展开</span>&nbsp;@{{ package.remark.length }} 条
+                                </label>
+                            </div>
                         @endcan
                     </td>
                     <td class="text-overflow-warp-200"><span v-if="package.order && package.order.issue">@{{ package.order.issue.result_explain }}</span>
@@ -117,10 +138,12 @@
             <div class="text-info h5 btn btn">{{$orderPackages->count()}}/{{$orderPackages->total()}}</div>
             {{$orderPackages->appends($paginateParams)->links()}}
         </div>
+        <textarea id="clipboardDiv" style="opacity:0"></textarea>
     </div>
 @endsection
 
 @section('lastScript')
+    <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
     <script type="text/javascript" src="{{mix('js/queryForm/queryForm.js')}}"></script>
     <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
     <script>
@@ -159,8 +182,8 @@
                     '无',
                 ],
                 statuses: [
-                  '已揽收',
-                  '无',
+                    '已揽收',
+                    '无',
                 ],
                 exception_editable: @can('包裹管理-快递-异常类型-编辑') true @else false  @endcan,
                 selectedExceptionType: '修改异常类型',
@@ -280,31 +303,31 @@
                 });
                 _this.form.init();
                 let column = [
-                    {name:'index',value: '序号', neglect: true},
-                    {name:'exception_type',value: '异常类型'},
-                    {name:'logistic_number',value: '单号'},
-                    {name:'status',value: '状态'},
-                    {name:'logistic_name',value: '快递公司'},
-                    {name:'owner_name',value: '货主'},
-                    {name:'province',value: '省份'},
-                    {name:'sent_at',value: '发出日期'},
-                    {name:'received_at',value: '收货日期'},
-                    {name:'weighed_at',value: '称重日期'},
-                    {name:'transfer_status',value: '快递路由'},
-                    {name:'remark',value: '客服备注'},
-                    {name:'result_explain',value: '情况说明'},
-                    {name:'issue_type',value: '问题类别'},
-                    {name:'content',value: '说明'},
-                    {name:'operation_name',value: '操作者'},
-                    {name:'operation_date',value: '时间'},
+                    {name: 'index', value: '序号', neglect: true},
+                    {name: 'exception_type', value: '异常类型'},
+                    {name: 'logistic_number', value: '单号'},
+                    {name: 'status', value: '状态'},
+                    {name: 'logistic_name', value: '快递公司'},
+                    {name: 'owner_name', value: '货主'},
+                    {name: 'province', value: '省份'},
+                    {name: 'sent_at', value: '发出日期'},
+                    {name: 'received_at', value: '收货日期'},
+                    {name: 'weighed_at', value: '称重日期'},
+                    {name: 'transfer_status', value: '快递路由'},
+                    {name: 'remark', value: '客服备注'},
+                    {name: 'result_explain', value: '情况说明'},
+                    {name: 'issue_type', value: '问题类别'},
+                    {name: 'content', value: '说明'},
+                    {name: 'operation_name', value: '操作者'},
+                    {name: 'operation_date', value: '时间'},
                 ];
                 new Header({
                     el: "table",
-                    name:"package",
+                    name: "package",
                     column: column,
                     data: this.packages,
                     restorationColumn: 'addtime',
-                    fixedTop:($('#form_div').height())+($('#btn').height())+1,
+                    fixedTop: ($('#form_div').height()) + ($('#btn').height()) + 1,
                 }).init();
             },
             methods: {
@@ -364,30 +387,54 @@
                     })
                 },
                 submitRemark(orderPackage) {
-                    if (this.remark===null){
+                    if (this.remark === null) {
                         return
                     }
                     let url = '{{url('apiLocal/package/logistic/')}}';
                     let _this = this;
-                    axios.put(url,{remark:_this.remark,orderPackageId:orderPackage.id}).then(function (response) {
-                        if (response.data.success){
+                    axios.put(url, {remark: _this.remark, orderPackageId: orderPackage.id}).then(function (response) {
+                        if (response.data.success) {
                             orderPackage.remark = response.data.data
                             tempTip.setDuration(2000);
                             tempTip.showSuccess('成功!');
-                        } else{
+                        } else {
                             tempTip.setDuration(5000);
                             tempTip.show(response.data.fail_info);
                         }
                     }).catch(function (err) {
                         tempTip.setDuration(3000);
-                        tempTip.show("网络错误:"+err)
+                        tempTip.show("网络错误:" + err)
                     });
                 },
-                {{--orderPackageExport(checkAllSign){--}}
-                {{--    let url = '{{url('package/logistic/export')}}';--}}
-                {{--    let token='{{ csrf_token() }}';--}}
-                {{--    excelExport(checkAllSign,checkData,url,this.packages.length,token,{is_merge : this.is_merge});--}}
-                {{--},--}}
+                copyLogisticNumber() {
+                    if (checkData.length === 0) {
+                        tempTip.show('没有勾选');
+                        return;
+                    }
+                    this.copyText(checkData.join('\n'));
+                },
+                copyText(text) {
+                    try {
+                        $('#clipboardDiv').text(text).select().focus();
+                        document.execCommand("Copy");
+                        tempTip.setIndex(1052)
+                        tempTip.setDuration(2000)
+                        tempTip.showSuccess('复制成功')
+                    } catch (e) {
+                        tempTip.setIndex(1052)
+                        tempTip.setDuration(2000)
+                        tempTip.showSuccess('复制失败:' + e)
+                    }
+                },
+                orderPackageExport(sign) {
+                    let url = '{{url('package/logistic/export')}}';
+                    let token = '{{ csrf_token() }}';
+                    if (sign) {
+                        excelExport(true, checkData, url, this.total, token);
+                    } else {
+                        excelExport(false, checkData, url, null, token);
+                    }
+                },
             },
             filters: {
                 toObjected: function (value) {

+ 1 - 1
resources/views/package/measureMonitor/index.blade.php

@@ -138,7 +138,7 @@
                             },10);
                         }else {
                             window.tempTip.setDuration(3000);
-                            window.axios.post('package/weigh/measureMonitor/speech',{logistic:logistic_name})
+                            window.axios.post("{{url('package/weigh/measureMonitor/speech')}}",{logistic:logistic_name})
                                 .then(function (response) {
                                     if (response.data){
                                         _this.logisticAudioURL[logistic_name]=response.data;

+ 2 - 2
resources/views/procurement/procurement/index.blade.php

@@ -132,7 +132,7 @@
                 <td class="text-center"><span>@{{ procurement.unit_price }}</span></td>
                 <td class="text-center"><span v-if="procurement.deliver_amount">@{{ procurement.deliver_amount }}</span></td>
                 <td class="text-center"><span>@{{ procurement.quantity*procurement.unit_price }}</span></td>
-                <td class="text-muted"><span v-if="procurement.owner_material.owner">@{{ procurement.owner_material.owner.customer? procurement.owner_material.owner.customer.phone:'' }}</span></td>
+                <td class="text-muted"><span v-if="procurement.supplier">@{{ procurement.supplier.phone }}</span></td>
             </tr>
         </table>
         <div class="text-info h5 btn btn">{{$procurements->count()}}/@{{ sum }}</div>
@@ -249,7 +249,7 @@
                     {name: 'unit_price', value: '销售单价(元)', neglect: true,class: 'text-center'},
                     {name: '送货数量', value: '送货数量', neglect: true,class: 'text-center'},
                     {name: '销售总价', value: '销售总价(元)', neglect: true,class: 'text-center'},
-                    {name: '联系方式', value: '联系方式', neglect: true,class: 'text-center'},
+                    {name: '联系方式', value: '供应商联系方式', neglect: true,class: 'text-center'},
                 ];
 
                 new Header({

+ 2 - 1
resources/views/rejected/importRejectedNumber.blade.php

@@ -14,7 +14,8 @@
                             退回单号修改<br/>
                             【退回单号,订单号】 必填项;【到付金额】 非必填项<br/>
                             <span class="text-muted" style="opacity:0.7">
-                                如果在导入后出现部分数据导入失败,修改对应错误的数据继续导入即可,
+                                不支持空格分隔,只支持中英文逗号分隔<br/>
+                                如果在导入后出现部分数据导入失败,修改对应错误的数据继续导入即可.
                             </span>
                         </div>
                     </div>

+ 179 - 34
resources/views/station/monitor/show.blade.php

@@ -26,19 +26,67 @@
                     <div class="col-4">
                         <div class="row">
                             <div class="col py-3 h4">
-                                <div>波次号:</div>
-                                <div class=" text-center">
-                                    <b v-if="task&&task.station_task_batches">
-                                        <div v-for="taskBatch in task.station_task_batches">
-                                            @{{ taskBatch.batch.code }}
+                                <div class="row">
+                                    <div class="col">选择执行波次:</div>
+                                </div>
+                                <div class="row" v-if="current_stationTaskBatch">
+                                    <div class="col font-weight-bold text-center position-relative"
+                                         :style="[
+                                                    {opacity:
+                                                        current_stationTaskBatch.status==='完成'?'0.5':'1'
+                                                    },
+                                                ]"
+                                         :class="[
+                                            (current_stationTaskBatch.runningStatus==='')?'text-info':'',
+                                            (current_stationTaskBatch.runningStatus==='请求中')?'text-dark':'',
+                                            (current_stationTaskBatch.runningStatus==='请求失败')?'text-danger':'',
+                                            (current_stationTaskBatch.runningStatus==='请求成功')?'text-success':'',
+                                            (current_stationTaskBatch.runningStatus==='请求异常')?'text-danger':'',
+                                         ]"
+                                    >
+                                        <div class="text-center mt-2">@{{ current_stationTaskBatch.batch.code }}</div>
+                                        <div class="text-center" style="font-size: 12px;">
+                                            @{{ current_stationTaskBatch.batch.owner.name }}
                                         </div>
-                                    </b>
+                                        <div class="col text-muted text-left">
+                                            <img id="barcode" :alt="batchCode">
+                                        </div>
+                                    </div>
+                                    <div class="col text-center">
+                                        <button class="btn btn-lg mt-4" @click="runTheTaskBatch()"
+                                                :class="[
+                                            (current_stationTaskBatch.runningStatus==='')?'btn-info':'',
+                                            (current_stationTaskBatch.runningStatus==='请求中')?'btn-dark':'',
+                                            (current_stationTaskBatch.runningStatus==='请求失败')?'btn-danger':'',
+                                            (current_stationTaskBatch.runningStatus==='请求成功')?'btn-success':'',
+                                            (current_stationTaskBatch.runningStatus==='请求异常')?'btn-danger':'',
+                                         ]"
+                                        >
+                                            <span v-if="!current_stationTaskBatch.runningStatus">执行</span>
+                                            <span v-if="current_stationTaskBatch.runningStatus==='请求中'">请求中</span>
+                                            <span v-if="current_stationTaskBatch.runningStatus==='请求失败'">(失败)重新执行</span>
+                                            <span v-if="current_stationTaskBatch.runningStatus==='请求成功'">(请求成功)重新执行</span>
+                                            <span v-if="current_stationTaskBatch.runningStatus==='请求异常'">(请求异常)重新执行</span>
+                                        </button>
+                                    </div>
+                                </div>
+                                <div class="text-center my-2" style="overflow-y: scroll;max-height:200px;">
+                                    <div class="flex flex-column flex-wrap" v-if="stationTaskBatches">
+                                        <button v-for="stationTaskBatch in stationTaskBatches"
+                                                @click="selectBatch(stationTaskBatch)"
+                                                class="btn"
+                                                :class="[
+                                                    (current_stationTaskBatch&&current_stationTaskBatch.id===stationTaskBatch.id)?'btn-outline-info':'btn-outline-dark',
+                                                ]"
+                                                :style="[
+                                                    {opacity:
+                                                        stationTaskBatch.status==='完成'?'0.5':'1'
+                                                    },
+                                                ]"
+                                        >
+                                            @{{stationTaskBatch.batch.code | simplifyBatchCode}}</button>
+                                    </div>
                                 </div>
-                            </div>
-                        </div>
-                        <div class="row">
-                            <div class="col py-3 text-muted text-center">
-                                <img id="barcode" alt="" :data-refresh="batchCode">
                             </div>
                         </div>
                         <div class="row">
@@ -157,7 +205,7 @@
                                 <div class="text-left">
                                     <div >
                                         <div class="btn btn-outline-info" @click="
-                                        (inputs.manuallyTakeBox.visible=true)
+                                        (inputs.manuallyTakeBox.visible=!inputs.manuallyTakeBox.visible)
                                         &&(inputs.manuallyTakeBox.text='')">手动出库</div>
                                         <div class="position-relative bg-white" v-if="inputs.manuallyTakeBox.visible">
                                 <textarea  name="" id="" cols="30" rows="3" class="form-control" v-model="inputs.manuallyTakeBox.text"
@@ -286,16 +334,20 @@
         $vue=new Vue({
             el:"#container",
             data:{
-                broadcastName : "{{config('database.redis.options.prefix').'station-'.$station->id}}",
+                taskBroadcastName : "{{config('database.redis.options.prefix').'station-'.$station->id}}",
+                allTaskBroadcastName : "{{config('database.redis.options.prefix').'station-0'}}",
                 channelName : ".App\\Events\\BroadcastToStation",
                 error:"",
-                station:{!! $station??[] !!},
+                station:{!! $station !!},
                 inputs:{
                     manuallyTakeBox:{
                         visible:false,
                         text:'',
                     }
                 },
+                current_stationTaskBatch: null,
+                stationTask_indexByBatch: [],
+                stationTaskBatch_index: [],
                 grids:{
                     single:{status:'',},
                     half:{
@@ -315,7 +367,9 @@
             },
             mounted() {
                 this._makeMenuHiding();
-                this._listenBroadcast();
+                initEcho();
+                this._listenTaskBroadcast();
+                this._listenAllTaskBroadcast();
             },
             methods:{
                 _makeMenuHiding(){
@@ -327,60 +381,145 @@
                         $('.navbar,.nav1,.nav2').hide();
                     });
                 },
-                _listenBroadcast(){
-                    initEcho();
-                    window.Echo.channel(this.broadcastName).listen(this.channelName,(msg)=> {
+                _listenTaskBroadcast(){
+                    window.Echo.channel(this.taskBroadcastName).listen(this.channelName,(msg)=> {
                         console.log((new Date()).toTimeString(),msg);
                         let json = JSON.parse(msg.json);
                         if(!json||json.length===0)return;
-                        this.station['current_station_task']=json;
+                        taskIn['station_task_batches'].forEach(function(station_task_batch){
+                            let taskOld=_this.stationTask_indexByBatch[station_task_batch['batch_id']];
+                            if(typeof(taskOld)==='undefined')return;
+                            for(let key in taskIn){
+                                if(taskIn.hasOwnProperty(key)){
+                                    if(taskOld[key].hasOwnProperty(key)){
+                                        taskOld[key]=taskIn[key]
+                                    }
+                                }
+                            }
+                        });
+                    });
+                },
+                _listenAllTaskBroadcast(){
+                    let _this=this;
+                    window.Echo.channel(this.allTaskBroadcastName).listen(this.channelName,(msg)=> {
+                        console.log((new Date()).toTimeString(),msg);
+                        let stationTasksIn = JSON.parse(msg.json);
+                        if(!stationTasksIn||stationTasksIn.length===0)return;
+                        stationTasksIn.forEach(function(stationTaskIn){
+                            let stationTaskIn_toAdd=stationTaskIn;
+                            _this.stationTasks.forEach(function(stationTask){
+                                if(stationTask.id===stationTaskIn.id){
+                                    for(let key in stationTaskIn){
+                                        if(stationTaskIn.hasOwnProperty(key)){
+                                            if(stationTask[key].hasOwnProperty(key)){
+                                                stationTask[key]=stationTaskIn[key]
+                                            }
+                                        }
+                                    }
+                                    stationTaskIn_toAdd=null;
+                                }
+                            });
+                            if(stationTaskIn_toAdd){
+                                _this.station.station_tasks_today.push(stationTaskIn_toAdd);
+                            }
+                        })
+
                     });
                 },
+                selectBatch(stationTaskBatch){
+                    this.current_stationTaskBatch=stationTaskBatch;
+                    if(typeof(this.current_stationTaskBatch.runningStatus)==='undefined')
+                        this.current_stationTaskBatch.runningStatus=''
+                },
                 manuallyTakeBoxOut(){
+                    let _this=this;
+                    if(typeof(window.manuallyHairouRequesting)==='undefined'
+                        ||window.manuallyHairouRequesting===false){
+                        window.manuallyHairouRequesting=true;
+                    }else{return;}
                     let text = this.inputs.manuallyTakeBox.text.trim();
                     if(!text){
                         alert('请输入料箱号')
                         return
-                    };
+                    }
                     axios.post('{{url('/api/thirdPart/haiq/storage/takeOutToULine')}}',{codes:text})
                         .then(function(response){
                             tempTip.okWindow(response.data.result,'确定')
                         }).catch(function(err){
                         tempTip.okWindow(err,'确定')
                     }).finally(function(){
-                        this.inputs.manuallyTakeBox.text='';
+                        _this.inputs.manuallyTakeBox.text='';
+                        window.manuallyHairouRequesting=false;
                     })
                 },
+                runTheTaskBatch(){
+                    let _this=this;
+                    _this.current_stationTaskBatch.runningStatus='请求中';
+                    _this.$forceUpdate();
+                    axios.post('{{url('/api/thirdPart/haiq/runTaskBatch')}}',{station_task_batch_id:_this.current_stationTaskBatch.id})
+                        .then(function(response){
+                            if(!response.data.success){
+                                _this.current_stationTaskBatch.runningStatus='请求失败';
+                                return;
+                            }
+                            _this.current_stationTaskBatch.runningStatus='请求成功'
+                        }).catch(function(err){
+                        _this.current_stationTaskBatch.runningStatus='请求异常'
+                        tempTip.okWindow(err+': 服务器代码出错,请联系开发部门负责人','确定')
+                    }).finally(function(){
+                        _this.$forceUpdate();
+                    });
+                },
             },
             computed:{
                 task(){
-                    if(!this.station['current_station_task'])return null;
-                    return this.station['current_station_task'];
+                    if(!this.current_stationTaskBatch||typeof(this.stationTask_indexByBatch['_'+this.current_stationTaskBatch.batch_id])==='undefined')return null;
+                    return this.stationTask_indexByBatch['_'+this.current_stationTaskBatch.batch_id];
+                },
+                stationTasks(){
+                    if(!this.station)return;
+                    return this.station.station_tasks_today;
+                },
+                stationTaskBatches(){
+                    if(!this.stationTasks)return;
+                    let _this=this;
+                    let stationTaskBatches=[];
+                    this.stationTasks.forEach(function(stationTask){
+                        if(!stationTask.station_task_batches)return;
+                        stationTask.station_task_batches.forEach(function(stationTaskBatch){
+                            if(typeof(_this.stationTaskBatch_index['_'+stationTaskBatch.batch_id])==='undefined'){
+                                // if(stationTaskBatch_index['_'+stationTaskBatch.batch_id]['status']==='完成')return;
+                                stationTaskBatches.push(stationTaskBatch)
+                                _this.stationTaskBatch_index['_'+stationTaskBatch.batch_id]=stationTaskBatch;
+                                _this.stationTask_indexByBatch['_'+stationTaskBatch.batch_id]=stationTask;
+                            }
+                        })
+                    });
+                    return stationTaskBatches;
                 },
                 batchCode(){
-                    if(!this.task)return;
-                    let batches = this.task.station_task_batches;
-                    if(batches
-                        && Array.isArray(batches)
-                        && batches.length>0
+                    let _this=this;
+                    if(!this.current_stationTaskBatch)return;
+                    if(typeof(this.current_stationTaskBatch)!=='undefined'
+                        && typeof(this.current_stationTaskBatch.batch)!=='undefined'
                     ){
                         setTimeout(function (){
-                            setBarcode(batches[0].batch.code,"#barcode",1,50,false);
+                            setBarcode(_this.current_stationTaskBatch.batch.code,"#barcode",1,50,false);
                         })
                     }
-                    return batches[0].batch.code;
+                    return this.current_stationTaskBatch.batch.code;
                 },
                 taskCommodities(){
                     if(!this.task)return [];
-                    return this.station['current_station_task']['station_task_commodities'];
+                    return this.task['station_task_commodities'];
                 },
                 taskCommoditiesListByBin(){
                     if(!this.task)return [];
                     function reIndexByBin() {
                         this.taskCommoditiesListByBinVar = [];
-                        this.taskCommoditiesListByBinVar.md5 = md5(JSON.stringify(this.station['current_station_task']['station_task_commodities']));
+                        this.taskCommoditiesListByBinVar.md5 = md5(JSON.stringify(this.task['station_task_commodities']));
                         let _this=this;
-                        this.station['current_station_task']['station_task_commodities']
+                        this.task['station_task_commodities']
                             .forEach(function (taskCommodity) {
                                 if (typeof (_this.taskCommoditiesListByBinVar[taskCommodity['bin_number']]) === 'undefined') {
                                     _this.taskCommoditiesListByBinVar[taskCommodity['bin_number']] = null;
@@ -393,7 +532,7 @@
                     if((typeof this.taskCommoditiesListByBinVar)==='undefined'||!this.taskCommoditiesListByBinVar){
                         return reIndexByBin.call(this);
                     }
-                    let md5Now = md5(JSON.stringify(this.station['current_station_task']['station_task_commodities']));
+                    let md5Now = md5(JSON.stringify(this.task['station_task_commodities']));
 
                     if(this.taskCommoditiesListByBinVar.md5!==md5Now){
                         return reIndexByBin.call(this);
@@ -556,6 +695,12 @@
                     }
 
                 },
+            },
+            filters:{
+                simplifyBatchCode(val){
+                    if(!val){return ''}
+                    return val.replace(/W\d{6}0*/,'').trim()
+                }
             }
         });
     </script>

+ 44 - 905
resources/views/test.blade.php

@@ -1,916 +1,55 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>table</title>
-    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
-    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.0-beta2/css/bootstrap-grid.css" rel="stylesheet">
-    <style type="text/css">
-        #test th{
-            position: sticky;
-            position: -webkit-sticky;
-            top: 0;
-            z-index:999;
-            background-color: white;
-        }
-    </style>
-    <link href="{{ mix('css/app.css') }}" rel="stylesheet">
-</head>
-<body onload="a()">
-<button></button>
-<table id="table" cellspacing="0" cellpadding="2" width="100%" border="1">
-    <tr id="test" style="white-space: nowrap !important;">
-        <th >用户编号</th>
-        <th>试用时间</th>
-        <th>转正时间</th>
-        <th>生日时间</th>
-        <th>民族</th>
-        <th>身高</th>
-    </tr>
-    <tr>
-        <td style="overflow-x: hidden">200004512312312321321</td>
-        <td><div>2001-2-15</div></td>
-        <td><div>2001-2-15</div></td>
-        <td>1978-8-5</td>
-        <td>汉</td>
-        <td>162</td>
-    </tr>
-</table>
-<div class="modal fade" tabindex="-1" role="dialog" id="auditOrRecover">
-    <div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal">&times;</button>
-            </div>
-            <div class="modal-body">
-                <div class="row" v-if="showAuditPiece.C">
-                    <label class="col-1 text-right h4"><span class="badge badge-success">新增</span></label>
-                    <label class="col-1 h3 text-success" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10 border-bottom border-success">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.counting_type }}-@{{ s.using_type }})</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(@{{ s.operation_type }}-@{{ s.strategy }})</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.C">
-                            <div><b>@{{ s.name }}</b></div>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.C">
-                            <div><b>@{{ s.name }}</b></div>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.C">
-                            <div><b>@{{ s.name }}</b><span class="text-muted">(起步:@{{ s.base_km }}KM)</span></div>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div>使用费:¥<b>@{{ auditList.system.C.usage_fee }}</b></div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row" v-if="showAuditPiece.D">
-                    <label class="col-1 text-right h4"><span class="badge badge-danger">删除</span></label>
-                    <label class="col-1 h3 text-danger" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10 border-bottom border-danger">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.D">
-                            <table class="table table-sm">
-                                <tr class="text-center">
-                                    <th>名称</th>
-                                    <th>计费类型</th>
-                                    <th>用仓类型</th>
-                                    <th>最低起租面积</th>
-                                    <th>减免类型</th>
-                                    <th>减免值</th>
-                                    <th>单位</th>
-                                    <th>计时单位</th>
-                                    <th>数量-单价</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.counting_type }}</td>
-                                    <td>@{{ s.using_type }}</td>
-                                    <td>@{{ s.minimum_area }}</td>
-                                    <td>@{{ s.discount_type }}</td>
-                                    <td>@{{ s.discount_value }}</td>
-                                    <td>@{{ s.unit_id }}</td>
-                                    <td>@{{ s.time_unit_id }}</td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}(@{{ s.price[i] }}元)<br></span>
-                                            <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+(@{{ s.price[s.amount_interval.length-1] }}元)<br></span>
-                                        </div>
-                                    </td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>作业类型</th>
-                                    <th>策略</th>
-                                    <th>特征</th>
-                                    <th>按单价</th>
-                                    <th>按单减免单价</th>
-                                    <th>减免值</th>
-                                    <th>类型</th>
-                                    <th>附加费</th>
-                                    <th>附加费单位</th>
-                                    <th>封顶费</th>
-                                    <th>备注</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.operation_type }}</td>
-                                    <td>@{{ s.strategy }}</td>
-                                    <td>@{{ s.feature }}</td>
-                                    <td>@{{ s.total_price }}</td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.total_discount_price">@{{ a }}元<br></span>
-                                        </div>
-                                    </td>
-                                    <td>
-                                        <div class="float-left small">
-                                            <span v-for="(a,i) in s.discount_count" v-if="i!=s.discount_count.length-1">@{{ a }}-@{{ s.discount_count[i+1] }}<br></span>
-                                            <span>@{{ s.discount_count[s.discount_count.length-1] }}&nbsp;+<br></span>
-                                        </div>
-                                    </td>
-                                    <td>@{{ s.type_mark }}</td>
-                                    <td>@{{ s.surcharge }}</td>
-                                    <td>@{{ s.surcharge_unit_id }}</td>
-                                    <td>@{{ s.max_fee }}</td>
-                                    <td>@{{ s.remark }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>首重</th>
-                                    <th>续重</th>
-                                    <th>数量-重量</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.initial_weight }}</td>
-                                    <td>@{{ s.additional_weight }}</td>
-                                    <td>
-                                        <span v-for="(a,i) in s.amount_interval" v-if="i!=s.amount_interval.length-1">@{{ a }}-@{{ s.amount_interval[i+1] }}/单(
-                                            <span v-for="(w,j) in s.weight_interval[i]" v-if="j!=s.weight_interval[i].length">@{{ w }}-@{{ s.weight_interval[i][j+1] }}/KG,</span>
-                                            @{{ s.weight_interval[i][s.weight_interval[i].length-1] }}&nbsp;+/KG)<br></span>
-                                        <span>@{{ s.amount_interval[s.amount_interval.length-1] }}&nbsp;+/单(
-                                            <span v-for="(w,j) in s.weight_interval[s.amount_interval.length-1]" v-if="j!=s.weight_interval[s.amount_interval.length-1].length">@{{ w }}-@{{ s.weight_interval[s.amount_interval.length-1][j+1] }}/KG,</span>
-                                            @{{ s.weight_interval[s.amount_interval.length-1][s.weight_interval[s.amount_interval.length-1].length-1] }}&nbsp;+/KG)<br></span>
-                                    </td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>单位一</th>
-                                    <th>单位一区间</th>
-                                    <th>单位二</th>
-                                    <th>单位二区间</th>
-                                    <th>提货费</th>
-                                    <th>燃油附加费</th>
-                                    <th>服务费</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.unit_id }}</td>
-                                    <td>
-                                        <span class="small" v-for="u in s.unit_range">@{{ u }}<br></span>
-                                    </td>
-                                    <td>@{{ s.other_unit_id }}</td>
-                                    <td>
-                                        <span class="small" v-for="u in s.other_unit_range">@{{ u }}<br></span>
-                                    </td>
-                                    <td>@{{ s.pick_up_price }}</td>
-                                    <td>@{{ s.fuel_price }}</td>
-                                    <td>@{{ s.service_price }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.D">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th>名称</th>
-                                    <th>起步公里数</th>
-                                    <th>税率</th>
-                                </tr>
-                                <tr>
-                                    <td>@{{ s.name }}</td>
-                                    <td>@{{ s.base_km }}</td>
-                                    <td>@{{ s.tax_rate_id }}</td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div>使用费:<b>@{{ auditList.system.D.usage_fee }}</b></div>
-                        </div>
-                    </div>
-                </div>
-                <div class="row" v-if="showAuditPiece.U">
-                    <label class="col-1 text-right h4"><span class="badge badge-primary">修改</span></label>
-                    <label class="col-1 h3 text-primary" style="bottom: 0.25rem">
-                        <span class="fa fa-long-arrow-right"></span>
-                    </label>
-                    <div class="col-10">
-                        <div v-if="selectedAudit=='storage'" v-for="s in auditList.storage.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.storage">@{{ val }}</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.storage" v-html="s[key]"></td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='operation'" v-for="s in auditList.operation.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.items.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.operation" v-if="key!='child'" v-html="s[key]"></td>
-                                    <td v-if="s.items.length>0">
-                                        <table class="table table-sm">
-                                            <tr><th v-for="(val,key) in auditList.mapping.operation.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.items">
-                                                <td v-for="(val,key) in auditList.mapping.operation.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='express'" v-for="s in auditList.express.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.express" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.express" v-if="key!='child'" v-html="s[key]"></td>
-                                    <td v-if="s.details.length>0">
-                                        <table class="table table-sm">
-                                            <tr><th v-for="(val,key) in auditList.mapping.express.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
-                                                <td v-for="(val,key) in auditList.mapping.express.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='logistic'" v-for="s in auditList.logistic.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.logistic" v-if="key!='child'" v-html="s[key]"></td>
-                                    <td v-if="s.details.length>0">
-                                        <table class="table table-sm">
-                                            <tr><th v-for="(val,key) in auditList.mapping.logistic.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
-                                                <td v-for="(val,key) in auditList.mapping.logistic.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='directLogistic'" v-for="s in auditList.directLogistic.U">
-                            <table class="table table-sm">
-                                <tr>
-                                    <th v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'">@{{ val }}</th>
-                                    <th v-if="s.details.length>0" class="text-center">子项</th>
-                                </tr>
-                                <tr>
-                                    <td v-for="(val,key) in auditList.mapping.directLogistic" v-if="key!='child'" v-html="s[key]"></td>
-                                    <td v-if="s.details.length>0">
-                                        <table class="table table-sm">
-                                            <tr><th v-for="(val,key) in auditList.mapping.directLogistic.child">@{{ val }}</th></tr>
-                                            <tr v-for="item in s.details">
-                                                <td v-for="(val,key) in auditList.mapping.directLogistic.child" v-html="item[key]"></td>
-                                            </tr>
-                                        </table>
-                                    </td>
-                                </tr>
-                            </table>
-                        </div>
-                        <div v-if="selectedAudit=='system'">
-                            <div v-if="auditList.system.H.usage_fee!=auditList.system.U.usage_fee">
-                                <div class="float-left">使用费:</div>
-                                <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.usage_fee }}</div>
-                                <div class="float-left mt-1 mr-4">
-                                    <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
-                                    <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.usage_fee }}</div>
-                                </div>
-                            </div>
-                            <div v-if="auditList.system.H.tax_rate_id!=auditList.system.U.tax_rate_id">
-                                <div class="float-left">税率:</div>
-                                <div class="float-left small text-secondary mt-1">@{{ auditList.system.H.tax_rate_id }}</div>
-                                <div class="float-left mt-1">
-                                    <span class="float-left fa fa-arrow-right text-info ml-2 mr-2"></span>
-                                    <div class="float-left small text-primary font-weight-bold">@{{ auditList.system.U.tax_rate_id }}</div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-            <div class="modal-footer">
+@extends('layouts.app')
 
-            </div>
+@section('content')
+    <div class="container" id="container">
+        <div class="form-group">
+            <input id="file" type="file" class="form-control-file">
+            <button class="btn btn-primary" type="button" @click="uploadFile">上传</button>
         </div>
-    </div>
+        <svg id="barcodeDiv" style="width: 2px;height: 200px">
+        </svg>
+        <svg id="barcodeDiv1" style="width: 2px;height: 200px">
 
-</div>
-<div id="app">
+        </svg>
+        <div><img src="{{asset('icon/faviconc.ico')}}" alt=""></div>
 
-</div>
-<script type="text/javascript" src="{{mix("js/app.js")}}"></script>
-<script type="text/javascript">
-    function a(){
-        let url = "{{url('maintenance/priceModel/getPriceModelAudit')}}";
-        let type = 'directLogistic';
-        window.tempTip.postBasicRequest(url,{type:type,"owner_id":86},res=>{
-            console.log(res);
-        });
-        return;
-        //$("#auditOrRecover").modal("show");
-        let video = document.createElement("video");
-        let canvas = document.createElement("canvas");
-        let arr=["{{asset("1.mp4")}}"];
-        let result = [];
-        arr.forEach(url=>{
-            video.setAttribute('src',url);
-            document.getElementById("app").appendChild(video);
-            canvas.style.width = video.clientWidth+"px";
-            canvas.style.height = video.clientHeight+"px";
-            document.getElementById("app").appendChild(canvas);
-            canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
-            result.push(canvas.toDataURL("image/png"));
-        });
-        console.log(result)
-    }
+        <button class="btn btn-primary" @click="deduction">截图</button>
 
-    new Vue({
-        el:"#auditOrRecover",
-        data:{
-            auditList:{
-                storage:{
-                    "C":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"},{name:"笕尚退货",counting_type:"包仓",using_type:"恒温"}],
-                    "U":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                        minimum_area:"200",price:["0.2"],discount_type:"无减免",target_id:"10",
-                        discount_value:"20",unit_id:"1",time_unit_id:"2",tax_rate_id:"1",amount_interval:["2"]}],
-                    "D":[{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                        minimum_area:"200",price:["0.2","0.1"],discount_type:"无减免",
-                        discount_value:"20",unit_id:"m²",time_unit_id:"日",tax_rate_id:"3",amount_interval:["2","5"]}],
-                    "H":{10:{name:"笕尚退货",counting_type:"包仓",using_type:"恒温",
-                            minimum_area:"200",price:["0.1","0.2"],discount_type:"无减免",
-                            discount_value:"20",unit_id:"2",time_unit_id:"1",tax_rate_id:"2",amount_interval:["2","5"]}},
-                },
-                operation:{
-                    "C":[{name:"笕尚入库",operation_type:"入库",strategy:"特征"},{name:"笕尚入库",operation_type:"入库",strategy:"特征"}],
-                    "D":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%"}],
-                    "U":[{name:"笕尚入库",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2],total_price:"222",total_discount_price:[1,2,3,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"米",max_fee:"777",tax_rate_id:"5%",target_id:"10",
-                        items:[{id:"2",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"5",owner_price_operation_id:"5",strategy:"特征",amount:"22",unit_id:"8",unit_price:"9",feature:"13",priority:"0",discount_price:[5,6,7],odd_price:"5"},]}],
-                    "H":{10:{name:"笕尚入库1",operation_type:"入库",strategy:"特征",
-                        feature:"特征X",remark:"x",discount_count:[1,2,5],total_price:"222",total_discount_price:[1,2,4]
-                        ,type_mark:"退货单",surcharge:"58",surcharge_unit_id:"T",max_fee:"7771",tax_rate_id:"3%",
-                        items:[{id:"1",owner_price_operation_id:"5",strategy:"默认",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"3",owner_price_operation_id:"5",strategy:"起步",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                            {id:"4",owner_price_operation_id:"5",strategy:"特征",amount:"21",unit_id:"8",unit_price:"9",feature:"11",priority:"0",discount_price:[5,6,7],odd_price:"5"},
-                        ]}},
-                },
-                express:{
-                    "C":[{name:"笕尚快递"}],
-                    "D":[{name:"笕尚快递",initial_weight:"包仓",additional_weight:"恒温",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%"}],
-                    "U":[{name:"笕尚快递",initial_weight:"1",additional_weight:"3",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%",target_id:10,
-                    details:[{province_id:"河南",initial_weight_price:[[4]],additional_weight_price:[[5]]}]}],
-                    "H":{10:{name:"笕尚快递",initial_weight:"1",additional_weight:"2",
-                        amount_interval:[2,5],
-                        weight_interval:[[10,20],[]],tax_rate_id:"5%",
-                            details:[{province_id:"河南",initial_weight_price:[[5]],additional_weight_price:[[5]]}]}},
-                },
-                logistic:{
-                    "C":[{name:"笕尚物流"}],
-                    "D":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"20%"},
-                        ]}],
-                    "U":[{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",target_id:10,details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"20%"},
-                        ]}],
-                    "H":{10:{name:"笕尚物流",unit_range:["0-5","5-10"],unit_id:"5",other_unit_range:["0-5","5-10"],other_unit_id:"T"
-                        ,pick_up_price:"222",fuel_price:"22",service_price:"34",tax_rate_id:"6%",details:[
-                            {unit_id:"T",range:"0-10",province_id:"河北",city_id:"石家庄",unit_price:"22",delivery_fee:"170",
-                                rate:"21%"},
-                        ]}},
-                },
-                directLogistic:{
-                    "C":[{name:"笕尚直发",base_km:"10"}],
-                    "D":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%"}],
-                    "U":[{name:"笕尚直发",base_km:"10",tax_rate_id:"3%",target_id:"10",details:[
-                            {car_type_id:"碰碰车",base_fee:"30",additional_fee:"50"}
-                        ]}],
-                    "H":{10:{name:"笕尚直发",base_km:"101",tax_rate_id:"32%",details:[
-                            {car_type_id:"碰碰车",base_fee:"301",additional_fee:"50"}
-                        ]}},
-                },
-                system:{
-                    "C":[{usage_fee:"500"}],
-                    "D":[{usage_fee:"500"}],
-                    "U":{usage_fee:"510",tax_rate_id:20},
-                    "H":{usage_fee:"500",tax_rate_id:21},
-                },
-                mapping:{
-                    "storage":{
-                        "name":"名称",
-                        "counting_type":"计费类型",
-                        "using_type":"用仓类型",
-                        "minimum_area":"最低起租面积",
-                        "discount_type":"减免类型",
-                        "discount_value":"减免值",
-                        "unit_id":"单位",
-                        "time_unit_id":"计时单位",
-                        "amount_interval":"数量-单价",
-                        "tax_rate_id":"税率",
-                    },
-                    "operation":{
-                        name:"名称",
-                        operation_type:"作业类型",
-                        strategy:"策略",
-                        feature:"特征",
-                        total_price:"按单价",
-                        total_discount_price:"按单减免单价",
-                        discount_count:"减免值",
-                        type_mark:"类型",
-                        surcharge:"附加费",
-                        surcharge_unit_id:"附加费单位",
-                        max_fee:"封顶费",
-                        remark:"备注",
-                        tax_rate_id:"税率",
-                        child:{
-                            strategy:"子策略",
-                            amount:"起步数",
-                            unit_id:"单位",
-                            unit_price:"单价",
-                            feature:"特征",
-                            discount_price:"减免单价",
-                            odd_price:"零头价",
-                        }
-                    },
-                    "express":{
-                        name:"名称",
-                        initial_weight:"首重",
-                        additional_weight:"续重",
-                        weight_interval:"数量-重量",
-                        tax_rate_id:"税率",
-                        child:{
-                            province_id:"省",
-                            initial_weight_price:"初始单价",
-                            additional_weight_price:"续重单价",
-                        },
-                    },
-                    "logistic":{
-                        name:"名称",
-                        unit_id:"单位一",
-                        unit_range:"单位一区间",
-                        other_unit_id:"单位二",
-                        other_unit_range:"单位二区间",
-                        pick_up_price:"提货费",
-                        fuel_price:"燃油附加费",
-                        service_price:"服务费",
-                        tax_rate_id:"税率",
-                        child:{
-                            unit_id:"单位",
-                            range:"区间",
-                            province_id:"省份",
-                            city_id:"城市",
-                            unit_price:"单价",
-                            delivery_fee:"送货费",
-                            initial_fee:"起始计费",
-                            initial_amount:"起始计数",
-                            rate:"费率",
-                        },
-                    },
-                    "directLogistic":{
-                        name:"名称",
-                        base_km:"起步公里数",
-                        tax_rate_id:"税率",
-                        child:{
-                            car_type_id:"车型",
-                            base_fee:"起步费",
-                            additional_fee:"续费(元/KM)"
-                        }
-                    },
-                },
-            },
-            selectedAudit:"system",
-            poolMapping:{
-                units:{1:"T",2:"G"},
-                taxRates:{1:"2",2:"3"},
-            },
-            showAuditPiece:{
-                "C":true,"D":true,"U":true
-            }
-        },
-        mounted(){
-            let temp = {"name":"名称"};
-            let font = "<div class='float-left'><span class='float-left fa fa-arrow-right text-info ml-2 mr-2'></span>";
-            this.auditList.storage.U.forEach(data=>{
-                let tar = this.auditList.storage.H[data.target_id];
-                for (let key in this.auditList.mapping.storage){
-                    if (String(data[key])!==String(tar[key])){
-                        if (!temp[key]) temp[key] = this.auditList.mapping.storage[key];
-                        data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
-                    }else data[key] = this.transformData(data,key);
-                }
-                if (String(data["price"])!==String(tar["price"]) && String(data["amount_interval"])===String(tar["amount_interval"])){
-                    data["amount_interval"] = this.transformData(tar,"amount_interval")+font+this.transformData(data,"amount_interval",true)+"</div>";
-                }
-            });
-            this.auditList.mapping.storage = temp;
-            temp={"name":"名称",child:{strategy:"子策略"}};
-            this.auditList.operation.U.forEach(data=>{
-                let tar = this.auditList.operation.H[data.target_id];
-                for (let key in this.auditList.mapping.operation){
-                    if (String(data[key])!==String(tar[key])){
-                        if (!temp[key]) temp[key] = this.auditList.mapping.operation[key];
-                        data[key] = this.transformData(tar,key)+font+this.transformData(data,key,true)+"</div>";
-                    }else data[key] = this.transformData(data,key);
-                }
-                let itemTem = {};
-                tar.items.forEach(item=>{
-                    if (!itemTem[item.strategy])itemTem[item.strategy] = [];
-                    itemTem[item.strategy].push(item);
-                });
-                let items = [];
-                let amount = 0;
+    </div>
+@endsection
 
-                data.items.forEach(item=>{
-                    if (itemTem[item.strategy]){
-                        let mark = true;
-                        for (let i=0;i<itemTem[item.strategy].length;i++){
-                            for (let key in this.auditList.mapping.operation.child){
-                                let oldStr = itemTem[item.strategy][i][key];
-                                let newStr = item[key];
-                                if (String(newStr)!==String(oldStr)){
-                                    mark = false;break;
-                                }
-                            }
-                            if (mark){
-                                item.operation = "H";
-                                itemTem[item.strategy].splice(i,1);
-                                if (itemTem[item.strategy].length===0)itemTem[item.strategy] = null;
-                                break;
-                            }
-                        }
-                    }//去重
-                });
-                data.items.forEach(item=>{
-                    if (item.operation!=='H'){
-                        if (!itemTem[item.strategy]){
-                            for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
-                            item.operation = "C";
-                            items.unshift(item);
-                            amount++;
-                        }else{
-                            let tar = item.strategy;
-                            for (let key in this.auditList.mapping.operation.child){
-                                if (String(item[key])!==String(itemTem[tar][0][key])){
-                                    if (!temp.child[key]) temp.child[key] = this.auditList.mapping.operation.child[key];
-                                    item[key] = this.transformData(itemTem[tar][0],key)+font+this.transformData(item,key,true)+"</div>";
-                                }else item[key] = this.transformData(item,key);
-                            }
-                            item.operation = "U";
-                            items.push(item);
-                            itemTem[tar].splice(0,1);
-                            if (itemTem[tar].length===0) itemTem[tar] = null;
-                        }
-                    }
-                });
-                for (let key in itemTem){
-                    if (itemTem[key]){
-                        itemTem[key].forEach(item=>{
-                            for (let key in this.auditList.mapping.operation.child)item[key] = this.transformData(item,key);
-                            item.operation = "D";
-                            items.splice(amount,0,item);
-                            amount++;
-                        });
-                    }
-                }
-                data.items = items;
-            });
-            this.auditList.mapping.operation = temp;
-            temp={"name":"名称",child:{province_id:"省"}};
-            this.auditList.express.U.forEach(data=> {
-                let tar = this.auditList.express.H[data.target_id];
-                for (let key in this.auditList.mapping.express) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.express[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                    if (String(data["amount_interval"])!==String(tar["amount_interval"]) && String(data["weight_interval"])===String(tar["weight_interval"])){
-                        data["weight_interval"] = this.transformData(tar,"weight_interval")+font+this.transformData(data,"weight_interval",true)+"</div>";
-                    }
-                }
-                let itemTem = {};
-                tar.details.forEach(item => {itemTem[item.province_id] = item;});
-                let items = [];
-                let amount = 0;
-                data.details.forEach(item=>{
-                    if (!itemTem[item.province_id]){
-                        for (let key in this.auditList.mapping.express.child)item[key] = this.transformData(item,key);
-                        item.operation = "C";
-                        items.unshift(item);
-                        amount++;
-                    }else{
-                        let mark = true;
-                        for (let key in this.auditList.mapping.express.child){
-                            if (String(item[key])!==String(itemTem[item.province_id][key])){
-                                mark = false;break;
-                            }
-                        }
-                        if (!mark){
-                            let tar = item.province_id;
-                            for (let key in this.auditList.mapping.express.child) {
-                                if (String(item[key]) !== String(itemTem[tar][key])) {
-                                    if (!temp.child[key]) temp.child[key] = this.auditList.mapping.express.child[key];
-                                    item[key] = this.transformData(itemTem[tar], key) + font + this.transformData(item, key, true) + "</div>";
-                                } else item[key] = this.transformData(item, key);
-                            }
-                            item.operation = "U";
-                            items.push(item);
-                            delete itemTem[tar];
-                        }else delete itemTem[item.province_id];
+@section("lastScript")
+    <script type="text/javascript" src="{{mix('js/utilities/barcode.js')}}"></script>
+    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/html2canvas/0.5.0-beta4/html2canvas.js"></script>
+    <script>
+        let vue = new Vue({
+            el:"#container",
+            data:{
 
-                    }
-                });
-                for (let key in itemTem){
-                    for (let k in this.auditList.mapping.express.child)itemTem[key][k] = this.transformData(itemTem[key],k);
-                    itemTem[key].operation = "D";
-                    items.splice(amount,0,itemTem[key]);
-                    amount++;
-                }
-                data.details = items;
-            });
-            this.auditList.mapping.express = temp;
-            temp={name:"名称",child:{province_id:"省份",city_id:"城市"}};
-            this.auditList.logistic.U.forEach(data=> {
-                let tar = this.auditList.logistic.H[data.target_id];
-                for (let key in this.auditList.mapping.logistic) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.logistic[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                }
-                let itemTem = this.logisticDataFormat(tar);
-                let dataTem = this.logisticDataFormat(data);
-                let items = [];
-                for (let key in itemTem){
-                    if (dataTem[key]){
-                        for (let key2 in itemTem[key]){
-                            if (dataTem[key][key2]){
-                                for (let key3 in itemTem[key][key2]){
-                                    if (dataTem[key][key2][key3]){
-                                        for (let key4 in itemTem[key][key2][key3]){
-                                            if (dataTem[key][key2][key3][key4]){
-                                                let mark = true;
-                                                for (let key5 in this.auditList.mapping.logistic.child){
-                                                    if (String(dataTem[key][key2][key3][key4][key5]) !== String(itemTem[key][key2][key3][key4][key5])){
-                                                        if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
-                                                        mark=false;
-                                                        if (!temp.child[key5]) temp.child[key5] = this.auditList.mapping.logistic.child[key5];
-                                                        dataTem[key][key2][key3][key4][key5] = this.transformData(itemTem[key][key2][key3][key4], key5) + font + this.transformData(dataTem[key][key2][key3][key4], key5, true) + "</div>";
-                                                    } else dataTem[key][key2][key3][key4][key5] = this.transformData(dataTem[key][key2][key3][key4], key5);
-                                                }
-                                                if (!mark){
-                                                    dataTem[key][key2][key3][key4].operation = "U";
-                                                    items.push(dataTem[key][key2][key3][key4])
-                                                }
-                                                delete dataTem[key][key2][key3][key4];
-                                                delete itemTem[key][key2][key3][key4];
-                                            }
-                                        }
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                dataTem = this.logisticDataRestore(dataTem,"C");
-                dataTem.push.apply(dataTem,this.logisticDataRestore(itemTem,"D"));
-                dataTem.push.apply(dataTem,items);
-                data.details = dataTem;
-            });
-            this.auditList.mapping.logistic = temp;
-            temp={name:"名称",child:{car_type_id:"车型"}};
-            this.auditList.directLogistic.U.forEach(data=> {
-                let tar = this.auditList.directLogistic.H[data.target_id];
-                for (let key in this.auditList.mapping.directLogistic) {
-                    if (String(data[key]) !== String(tar[key])) {
-                        if (!temp[key]) temp[key] = this.auditList.mapping.directLogistic[key];
-                        data[key] = this.transformData(tar, key) + font + this.transformData(data, key, true) + "</div>";
-                    } else data[key] = this.transformData(data, key);
-                }
-                let itemTem = {};
-                tar.details.forEach(item => {itemTem[item.car_type_id] = item;});
-                let items = [];
-                let amount = 0;
-                data.details.forEach(item => {
-                    if (itemTem[item.car_type_id]){
-                        let car = item.car_type_id;
-                        let mark = true;
-                        for (let key in this.auditList.mapping.directLogistic.child) {
-                            if (String(item[key]) !== String(itemTem[car][key])) {
-                                mark = false;
-                                if (!temp.child[key]) temp.child[key] = this.auditList.mapping.directLogistic.child[key];
-                                item[key] = this.transformData(itemTem[car], key) + font + this.transformData(item, key, true) + "</div>";
-                            } else item[key] = this.transformData(item, key);
-                        }
-                        if (!mark){
-                            item.operation = "U";
-                            items.push(item);
-                        }
-                        delete itemTem[car];
-                    }else{
-                        item.operation = "C";
-                        items.unshift(item);
-                        amount++;
-                    }
-                    for (let key in itemTem){
-                        for (let k in this.auditList.mapping.directLogistic.child)itemTem[key][k] = this.transformData(itemTem[key],k);
-                        itemTem[key].operation = "D";
-                        items.splice(amount,0,itemTem[key]);
-                        amount++;
-                    }
-                    data.details = items;
-                });
-            });
-            this.auditList.mapping.directLogistic = temp;
-        },
-        methods:{
-            {{--@include("customer.customer.project.part._auditComparisonVue")--}}
-            transformData(data,key,font=false){
-                if (!data[key])return;
-                let html = '<div class="float-left small ';
-                if (font)html += "text-primary font-weight-bold";
-                else html += "text-secondary";
-                html+='">';
-                switch (key) {
-                    case "amount_interval":
-                        data[key].forEach((am,i)=>{
-                            if (i!==data[key].length-1) html += "<span>"+am+"-"+data[key][i+1]+"("+data["price"][i]+"元)<br></span>";
-                        });
-                        html += "<span>"+data[key][data[key].length-1]+" +("+data["price"][data[key].length-1]+"元)<br></span></div>";
-                        return html;
-                    case "total_discount_price":
-                        data[key].forEach(am=>{
-                            html += '<span>'+am+'元<br></span>'
-                        });
-                        return html+"</div>";
-                    case "discount_price":
-                        data[key].forEach(am=>{
-                            html += '<span>'+am+'元<br></span>'
-                        });
-                        return html+"</div>";
-                    case "discount_count":
-                        data[key].forEach((am,i)=>{
-                            if (i!==data[key].length-1)html += '<span>'+am+'-'+data[key][i+1]+'<br></span>'
-                        });
-                        html += '<span>'+data[key][data[key].length-1]+'&nbsp;+<br></span>';
-                        return html+"</div>";
-                    case "weight_interval":
-                        data[key].forEach((arr,i)=>{
-                            if (i!==data[key].length-1) html += '<span>'+data.amount_interval[i]+'-'+data.amount_interval[i+1]+'/单(';
-                            arr.forEach((w,j)=>{
-                                if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
-                            });
-                            html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
-                        });
-                        html += '<span>'+data.amount_interval[data.amount_interval.length-1]+'&nbsp;+/单(';
-                        let arr = data.weight_interval[data.weight_interval.length-1];
-                        arr.forEach((w,j)=>{
-                            if (j!==arr.length-1)html += w+'-'+arr[j+1]+'/KG,';
-                        });
-                        html += (arr[arr.length-1] ? arr[arr.length-1] : 0)+'&nbsp;+/KG)<br></span>';
-                        return html;
-                    case "initial_weight_price":
-                        data[key].forEach(arr=>{
-                            html += "<div class='float-left'>"+arr+"<br></div>";
-                        });
-                        return html;
-                    case "additional_weight_price":
-                        data[key].forEach(arr=>{
-                            html += "<div class='float-left'>"+arr+"<br></div>";
-                        });
-                        return html;
-                    case "unit_range":
-                        data[key].forEach(r=>{
-                            html += '<span class="small">'+r+'<br></span>';
-                        });
-                        return html;
-                    case "other_unit_range":
-                        data[key].forEach(r=>{
-                            html += '<span class="small">'+r+'<br></span>';
-                        });
-                        return html;
-                }
-                return html+= data[key]+"</div>";
             },
-            logisticDataFormat(tar){
-                let obj={};
-                tar.details.forEach(item => {
-                    if (obj[item.province_id]){
-                        if (obj[item.province_id][item.city_id]){
-                            if (obj[item.province_id][item.city_id][item.unit_id]){
-                                obj[item.province_id][item.city_id][item.unit_id][item.range] = item;
-                            }else{
-                                let arr1={};
-                                arr1[item.range] = item;
-                                obj[item.province_id][item.city_id][item.unit_id] = arr1;
-                            }
-                        }else{
-                            let arr1={};
-                            arr1[item.range] = item;
-                            let arr2={};
-                            arr2[item.unit_id] = arr1;
-                            obj[item.province_id][item.city_id] = arr2;
-                        }
-                    }else{
-                        let arr1={};
-                        arr1[item.range] = item;
-                        let arr2={};
-                        arr2[item.unit_id] = arr1;
-                        let arr3={};
-                        arr3[item.city_id] = arr2;
-                        obj[item.province_id] = arr3;
-                    }
-                });
-                return obj;
+            mounted() {
+                window.setBarcode("0123456789","#barcodeDiv1",2,50,false)
             },
-            logisticDataRestore(tar,type,items=[],count=0){
-                if (count===4){
-                    tar["operation"] = type;
-                    items.push(tar);
-                } else{
-                    count++;
-                    for (let key in tar){
-                        this.logisticDataRestore(tar[key],type,items,count);
-                    }
+            methods:{
+                uploadFile(){
+                    let formData = new FormData();
+                    //第一个参数key和表单中的name的值是一个意思canvascanvas
+                    //第二个参数是文件的数据对象
+                    formData.append('file',document.getElementById('file').files[0]);
+                    window.axios.post("http://127.0.0.1:3000",formData).then(res=>{
+                        console.log(res);
+                    }).catch(err=>{
+                        console.log(err);
+                    })
+                },
+                deduction(){
+                    html2canvas(document.body).then(function(canvas) {
+                        document.body.appendChild(canvas);
+                    });
                 }
-                return items;
-            },
-            这样(){
-                let video = document.createElement("video");
-                let canvas = document.createElement("canvas");
-                let arr=["url1","url2","url3"];
-                let result = [];
-                arr.forEach(url=>{
-                    video.setAttribute('src',url);
-                    canvas.width = video.clientWidth+"px";
-                    canvas.height = video.clientHeight+"px";
-                    canvas.getContext("2d").drawImage(video,0,0,canvas.width,canvas.height);
-                    result.push(canvas.toDataURL("image/png"));
-                });
-                console.log(result);
+
             },
-        },
-    });
-</script>
-</body>
-</html>
+
+        })
+    </script>
+@stop

+ 1 - 1
resources/views/transport/waybill/_dailyBilling.blade.php

@@ -9,7 +9,7 @@
             </div>
             <div class="modal-body">
                 <div class="form-group row">
-                    <label for="screenDate" class="col-2 col-form-label text-right">选定日期</label>
+                    <label for="screenDate" class="col-2 col-form-label text-right">选定发货日期</label>
                     <div class="col-8">
                         <input type="date" class="form-control" :class="error.screenDate ? 'is-invalid' : ''" name="screenDate" autocomplete="off"  v-model="dailyBilling.screenDate" >
                         <span class="invalid-feedback" role="alert" v-if="error.screenDate">

+ 3 - 0
routes/api/thirdPart/haiq.php

@@ -27,3 +27,6 @@ Route::group(['prefix'=>'pickStation'],function(){
 Route::group(['prefix'=>'light'],function(){
     Route::post('update', "LightController@update");//移库
 });
+
+
+Route::post('runTaskBatch', "HaiRoboticsController@runTaskBatch");//启动taskBatch任务

+ 15 - 0
routes/apiLocal.php

@@ -116,6 +116,17 @@ Route::group(['prefix'=>'maintenance'],function (){
     Route::group(['prefix'=>'owner'],function (){
         Route::post('getOwners','OwnerController@getOwners');
     });
+    Route::group(['prefix'=>'expressPrinting'],function (){
+        Route::group(['prefix'=>'part'],function(){
+            Route::post('create','PrintPartController@storeApi');
+            Route::post('destroy','PrintPartController@destroyApi');
+            Route::post('printTemplate','PrintPartController@printTemplateApi');
+        });
+        Route::group(['prefix'=>'template'],function(){
+            Route::post('create','PrintTemplateController@storeApi');
+            Route::post('destroy','PrintTemplateController@destroyApi');
+        });
+    });
 });
 
 /** 控制台 */
@@ -206,3 +217,7 @@ Route::group(['prefix' => 'station'],function(){
 Route::group(['prefix' => 'package'], function () {
     Route::put('logistic', 'OrderPackageController@update')->name('orderPackage.update');
 });
+/** 快递打印 */
+Route::group(['prefix' => 'print'],function (){
+    Route::post('template/store','PrintTemplateController@storeAi');
+});

+ 11 - 1
routes/web.php

@@ -21,7 +21,7 @@ Route::get('/', function () {
 Route::any('test/{method}', 'TestController@method'); //测试
 
 /** 称重广播 */
-Route::post('package/weigh/measureMonitor/speech','MeasureMonitorController@speech')->middleware("check.token");
+Route::post('package/weigh/measureMonitor/speech','MeasureMonitorController@speech');
 
 Auth::routes();
 
@@ -230,6 +230,15 @@ Route::group(['prefix'=>'maintenance'],function(){
     Route::get('configuration','ConfigurationController@index');
     /** 服务商 */
     Route::resource('facilitator','FacilitatorController');
+    /** 快递打印 */
+    Route::group(['prefix'=>'expressPrinting'],function(){
+        Route::get('/part','PrintPartController@index');
+        Route::get('/part/create','PrintPartController@create');
+        Route::group(['prefix'=>'template'],function(){
+            Route::get('/index','PrintTemplateController@index');
+            Route::get('/create','PrintTemplateController@create');
+        });
+    });
 
     Route::get('syncRedisLogs','LogController@syncRedisLogs');
     Route::get('region', 'RegionController@index');
@@ -396,6 +405,7 @@ Route::group(['prefix'=>'package'],function(){
     Route::get('weigh/index','WeighController@index');
     Route::resource('weigh','WeighController');
     Route::put('logistic/batchUpdate','PackageLogisticController@batchUpdate');
+    Route::any('logistic/export','PackageLogisticController@export');
     Route::resource('logistic','PackageLogisticController');
 });
 Route::resource('package','WeighController');

+ 9 - 6
tests/Services/BatchService/AssignTasksTest.php

@@ -24,8 +24,8 @@ class AssignTasksTest extends TestCase
     /** @var BatchService $service */
     public $service;
     private $data;
-    private $batchAmount=2;
-    private $orderAmount=4;
+    private $batchAmount=3;
+    private $orderAmount=5;
     private $orderCommodityAmount=8;
     function setUp(): void
     {
@@ -79,11 +79,14 @@ class AssignTasksTest extends TestCase
 
     public function testReturned()
     {
-        $this->service->assignTasks($this->data['batches']);
+        try {
+            $this->service->assignTasks($this->data['batches']);
+        } catch (\Exception $e) {
+        }
         ($波次任务指向了波次=function(){
             $this->data['batches']->load('stationTaskBatch');
-            dump(data_get($this->data['batches'],'*.id'),data_get($this->data['batches'],'*.stationTaskBatch.batch_id'));
-            dd(array_diff(data_get($this->data['batches'],'*.id'),data_get($this->data['batches'],'*.stationTaskBatch.batch_id')));
+//            dump(data_get($this->data['batches'],'*.id'),data_get($this->data['batches'],'*.stationTaskBatch.batch_id'));
+//            dd(array_diff(data_get($this->data['batches'],'*.id'),data_get($this->data['batches'],'*.stationTaskBatch.batch_id')));
             $this->assertEquals(
                 data_get($this->data['batches'],'*.id'),
                 data_get($this->data['batches'],'*.stationTaskBatch.batch_id')
@@ -121,7 +124,7 @@ class AssignTasksTest extends TestCase
             ->whereIn('id',data_get($this->data['batches'],'*.id')??[])
             ->delete();
         Owner::query()
-            ->whereIn('id',data_get($this->data['owner'],'*.id')??[])
+            ->where('id',$this->data['owner']['id']??'')
             ->delete();
         parent::tearDown();
     }

+ 16 - 16
tests/Services/CacheShelfService/ProcessTest.php

@@ -102,22 +102,22 @@ class ProcessTest extends TestCase
 
     protected function tearDown(): void
     {
-//        $station = Station::query()->with('parent')->where('code',$this->data['localCode'])->first();
-//        $materialBox = MaterialBox::query()->where('code',$this->data['boxCode'])->first();
-//        if($materialBox){
-//            $StationTaskMaterialBoxes = StationTaskMaterialBox::query()->where('material_box_id',$materialBox['id'])->get();
-//            foreach ($StationTaskMaterialBoxes as $stationTaskMaterialBox) {
-//                if($stationTaskMaterialBox->stationTask) {
-//                    StationTaskChildren::query()->where('station_task_id',$stationTaskMaterialBox->stationTask['id'])->delete();
-//                    $stationTaskMaterialBox->stationTask ? $stationTaskMaterialBox->stationTask->delete() : null;
-//                }
-//                $stationTaskMaterialBox->delete();
-//            }
-//        }
-//        if($station){
-//            $station->parent->delete();
-//            $station->delete();
-//        }
+        $station = Station::query()->with('parent')->where('code',$this->data['localCode'])->first();
+        $materialBox = MaterialBox::query()->where('code',$this->data['boxCode'])->first();
+        if($materialBox){
+            $StationTaskMaterialBoxes = StationTaskMaterialBox::query()->where('material_box_id',$materialBox['id'])->get();
+            foreach ($StationTaskMaterialBoxes as $stationTaskMaterialBox) {
+                if($stationTaskMaterialBox->stationTask) {
+                    StationTaskChildren::query()->where('station_task_id',$stationTaskMaterialBox->stationTask['id'])->delete();
+                    $stationTaskMaterialBox->stationTask ? $stationTaskMaterialBox->stationTask->delete() : null;
+                }
+                $stationTaskMaterialBox->delete();
+            }
+        }
+        if($station){
+            $station->parent->delete();
+            $station->delete();
+        }
         parent::tearDown(); // TODO: Change the autogenerated stub
     }
 

+ 4 - 4
tests/Services/ForeignHaiRoboticsService/PutBinToStoreFromCacheShelfTest.php

@@ -36,17 +36,17 @@ class PutBinToStoreFromCacheShelfTest extends TestCase
         ]);
         $this->data['station'] = factory(Station::class)->create();
         $this->data['materialBox'] = factory(MaterialBox::class)->create();
-        $this->data['grids'] = factory(StationCacheShelfGrid::class)->create();
+//        $this->data['grids'] = factory(StationCacheShelfGrid::class)->create();
         $this->data['stationTaskMaterialBox'] = factory(StationTaskMaterialBox::class)
             ->create(['station_id'=>$this->data['station']['id']]);
-        $this->data['station']->setRelation('grids',collect([$this->data['grids']]));
+//        $this->data['station']->setRelation('grids',collect([$this->data['grids']]));
         $this->data['stationTaskMaterialBox']->setRelation('station', $this->data['station']);
         $this->data['stationTaskMaterialBox']->setRelation('materialBox', $this->data['materialBox']);
     }
 
     public function testSuccess1()
     {
-        $success = $this->service->putBinToStore_fromCacheShelf($this->data['stationTaskMaterialBox']);
+        $success = $this->service->putBinToStore_fromCacheShelf($this->data['stationTaskMaterialBox'],$this->data['station']['code']);
         $this->assertEquals($success,true);
     }
 
@@ -54,7 +54,7 @@ class PutBinToStoreFromCacheShelfTest extends TestCase
     protected function tearDown(): void
     {
         Station::query()->where('id',$this->data['station']['id'])->delete();
-        StationCacheShelfGrid::query()->where('id',$this->data['grids']['id'])->delete();
+//        StationCacheShelfGrid::query()->where('id',$this->data['grids']['id'])->delete();
         MaterialBox::query()->where('id',$this->data['materialBox']['id'])->delete();
         StationTaskMaterialBox::query()->where('id',$this->data['stationTaskMaterialBox']['id'])->delete();
         parent::tearDown();

+ 3 - 3
tests/Services/ForeignHaiRoboticsService/TaskUpdateTest.php

@@ -64,13 +64,13 @@ class TaskUpdateTest extends TestCase
     function tearDown(): void
     {
         Station::query()
-            ->whereIn('id',[$this->data['task']['station']['id']??''])
+            ->whereIn('id',[$this->data['station']['id']??''])
             ->delete();
         MaterialBox::query()
-            ->whereIn('id',[$this->data['task']['materialBox']['id']??''])
+            ->whereIn('id',[$this->data['materialBox']['id']??''])
             ->delete();
         StationTaskMaterialBox::query()
-            ->whereIn('id',[$this->data['task']['stationTaskMaterialBox']['id']??''])
+            ->whereIn('id',[$this->data['stationTaskMaterialBox']['id']??''])
             ->delete();
         parent::tearDown();
     }

+ 0 - 32
tests/Services/LogisticQiaoSFService/LogisticQiaoSFServiceTest.php

@@ -1,32 +0,0 @@
-<?php
-
-namespace Tests\Services\LogisticQiaoSFService;
-
-use App\Services\LogisticSFService;
-use Tests\TestCase;
-
-class LogisticQiaoSFServiceTest extends TestCase
-{
-    protected $logisticQiaoSFService;
-
-    protected function setUp(): void
-    {
-        parent::setUp(); // TODO: Change the autogenerated stub
-        $this->logisticQiaoSFService = new LogisticSFService();
-        \App\OrderPackage::query()->whereIn('logistic_number', ['SF1335376515904', 'SF2050377278135', 'SF2060390000049'])->delete();
-    }
-
-
-    /**
-     * @test
-     */
-    public function testGet()
-    {
-//        factory(\App\OrderPackage::class)->create(['logistic_number' => 'SF1335376515904',]);
-//        factory(\App\OrderPackage::class)->create(['logistic_number' => 'SF2050377278135',]);
-//        factory(\App\OrderPackage::class)->create(['logistic_number' => 'SF2060390000049',]);
-        $response = $this->logisticQiaoSFService->get(['SF1333381646256']);
-//        $this->assertCount(3, $response);
-        $this->assertTrue(true);
-    }
-}

+ 1 - 1
tests/Services/LogisticService/GetLogisticByCodeTest.php

@@ -41,7 +41,7 @@ class GetLogisticByCodeTest extends TestCase
     public function tearDown(): void
     {
         cache()->forget('getLogisticByCode_'.$this->data['logistic']['code']);
-        $this->data['logistic']->delete();
+        $this->data['logistic']->forceDelete();
         parent::tearDown(); // TODO: Change the autogenerated stub
     }
 }

+ 1 - 1
tests/Services/LogisticService/GetLogisticByCodesTest.php

@@ -59,7 +59,7 @@ class GetLogisticByCodesTest extends TestCase
             cache()->forget('getLogisticByCode_'.$baseCustomer['customerid']);
         }
         foreach ( $this->data['logistics'] as $item) {
-            $item->delete();
+            $item->forceDelete();
         }
         parent::tearDown(); // TODO: Change the autogenerated stub
     }

+ 0 - 1
tests/Services/LogisticYTOService/QueryTest.php

@@ -29,7 +29,6 @@ class QueryTest extends TestCase
     public function prod_test()
     {
        $response = $this->service->query('YT5487281295636');
-       dump($response);
        if (is_object($response))$this->assertEquals('1001', $response->code);
        if (!is_object($response))$this->assertNotEmpty($response);
     }

+ 6 - 2
tests/Services/NewOrderCountingRecordService/GetFromCacheTest.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace NewOrderCountingRecordService;
+namespace Tests\Services\NewOrderCountingRecordService;
 
 
 use App\Order;
@@ -31,7 +31,11 @@ class GetFromCacheTest extends TestCase
         parent::setUp(); // TODO: Change the autogenerated stub
 
         $this->newOrderCountingRecordService = new NewOrderCountingRecordService();
-        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+//        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+        $user = new User([
+            'name'=>'yang'
+        ]);
+        $this->be($user);
         $owners = factory(Owner::class)->times(2)->create();
         $this->ownerIds = array_column($owners->toArray(), 'id');
         $this->queryConditionDay = $this->newOrderCountingRecordService->transfersToCondition(Carbon::now()->subDays($this->step_length)->toDateString(), Carbon::now()->toDateString(), '日', $this->ownerIds);

+ 5 - 1
tests/Services/NewOrderCountingRecordService/GetFromLowerUnitTest.php

@@ -31,7 +31,11 @@ class GetFromLowerUnitTest extends TestCase
         parent::setUp(); // TODO: Change the autogenerated stub
 
         $this->newOrderCountingRecordService = new NewOrderCountingRecordService();
-        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+//        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+        $user = new User([
+            'name'=>'yang'
+        ]);
+        $this->be($user);
         $owners = factory(Owner::class)->times(2)->create();
         $this->ownerIds = array_column($owners->toArray(), 'id');
         $this->queryConditionDay = $this->newOrderCountingRecordService->transfersToCondition(Carbon::now()->subDays($this->step_length)->toDateString(), Carbon::now()->toDateString(), '日', $this->ownerIds);

+ 7 - 2
tests/Services/NewOrderCountingRecordService/GetOrderCountingRecordsTest.php

@@ -34,7 +34,11 @@ class GetOrderCountingRecordsTest extends TestCase
         parent::setUp(); // TODO: Change the autogenerated stub
 
         $this->newOrderCountingRecordService = new NewOrderCountingRecordService();
-        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+//        $this->actingAs(factory(User::class)->create(['name' => 'yang']));
+        $user = new User([
+            'name'=>'yang'
+        ]);
+        $this->be($user);
         $owners = factory(Owner::class)->times(2)->create();
         $this->ownerIds = array_column($owners->toArray(), 'id');
         $this->queryConditionDay = $this->newOrderCountingRecordService->transfersToCondition(Carbon::now()->subDays($this->step_length)->toDateString(), Carbon::now()->toDateString(), '日', $this->ownerIds);
@@ -49,6 +53,7 @@ class GetOrderCountingRecordsTest extends TestCase
         OrderCountingRecord::destroy($this->orderCountingRecordIds);
         Order::destroy($this->orderIds);
         OrderCountingRecord::query()->whereIn('owner_id', $this->ownerIds)->delete();
+        Order::query()->whereIn('owner_id',$this->ownerIds)->delete();
         parent::tearDown();
     }
 
@@ -163,6 +168,6 @@ class GetOrderCountingRecordsTest extends TestCase
             'counting_unit' => '月',
             'amount' => '2',
         ]);
-        dump($result->toArray());
+//        Order::query()->whereIn('id',data_get($orders,'*.id'))->delete();
     }
 }

+ 3 - 1
tests/Services/NewOrderCountingRecordService/OrderCountingRecordsTest.php

@@ -46,7 +46,9 @@ class OrderCountingRecordsTest extends TestCase
     {
 
         Owner::destroy($this->ownerIds);
-        orderCountingRecord::destroy($this->orderCountingRecordIds);
+        OrderCountingRecord::destroy($this->orderCountingRecordIds);
+        Order::query()->whereIn('owner_id',$this->ownerIds)->delete();
+        OrderCountingRecord::query()->whereIn('owner_id',$this->ownerIds)->delete();
         parent::tearDown();
     }
 

+ 30 - 30
tests/Services/NewOrderCountingRecordService/TransfersToConditionsTest.php

@@ -1,6 +1,6 @@
 <?php
 
-namespace NewOrderCountingRecordService;
+namespace Tests\Services\NewOrderCountingRecordService;
 
 use App\Order;
 use App\OrderCountingRecord;
@@ -73,35 +73,35 @@ class TransfersToConditionsTest extends TestCase
         }
     }
 
-    public function test_transfersToConditions_ifDatesMatches()
-    {
-        foreach($this->data['units'] as $unit){
-            foreach($this->data['dates']['right'] as $date){
-                $result=$this->newOrderCountingRecordService->transfersToCondition($date['startAt'],$date['endAt'],$unit,data_get($this->data['owners'],'*.id'));
-                $datesExpected=[];
-                switch ($unit){
-                    case '年': $datesExpected=collect($date['startAt']->yearsUntil($date['endAt'], 1)->toArray())
-                        ->map(function(Carbon $date){
-                            return $date->firstOfYear();
-                        })->toArray();
-                        break;
-                    case '月': $datesExpected=collect($date['startAt']->monthsUntil($date['endAt'], 1)->toArray())
-                        ->map(function(Carbon $date){
-                            return $date->firstOfMonth();
-                        })->toArray();break;
-                    case '日': $datesExpected=collect($date['startAt']->daysUntil($date['endAt'], 1)->toArray())
-                        ->map(function(Carbon $date){
-                            return $date->startOfDay();
-                        })->toArray();break;
-                }
-                $datesExpected=array_map(function($date){
-                    return $date->toDateString();
-                },$datesExpected);
-                $actualDays = array_keys($result['data']);
-                $this->assertEquals(array_filter($datesExpected), $actualDays);
-            }
-        }
-    }
+//    public function test_transfersToConditions_ifDatesMatches()
+//    {
+//        foreach($this->data['units'] as $unit){
+//            foreach($this->data['dates']['right'] as $date){
+//                $result=$this->newOrderCountingRecordService->transfersToCondition($date['startAt'],$date['endAt'],$unit,data_get($this->data['owners'],'*.id'));
+//                $datesExpected=[];
+//                switch ($unit){
+//                    case '年': $datesExpected=collect($date['startAt']->yearsUntil($date['endAt'], 1)->toArray())
+//                        ->map(function(Carbon $date){
+//                            return $date->firstOfYear();
+//                        })->toArray();
+//                        break;
+//                    case '月': $datesExpected=collect($date['startAt']->monthsUntil($date['endAt'], 1)->toArray())
+//                        ->map(function(Carbon $date){
+//                            return $date->firstOfMonth();
+//                        })->toArray();break;
+//                    case '日': $datesExpected=collect($date['startAt']->daysUntil($date['endAt'], 1)->toArray())
+//                        ->map(function(Carbon $date){
+//                            return $date->startOfDay();
+//                        })->toArray();break;
+//                }
+//                $datesExpected=array_map(function($date){
+//                    return $date->toDateString();
+//                },$datesExpected);
+//                $actualDays = array_keys($result['data']);
+//                $this->assertEquals(array_filter($datesExpected), $actualDays);
+//            }
+//        }
+//    }
 
     public function test_transfersToConditions_ifOwnerIdMatches()
     {

+ 1 - 0
tests/Services/OracleDOCOrderHeaderService/GetWMSOrderOnStartDateTest.php

@@ -46,6 +46,7 @@ class GetWMSOrderOnStartDateTest extends TestCase
     }
     public function tearDown(): void
     {
+        OrderTrackingOwner::query()->where('owner_id',$this->owner['id'])->delete();
         $this->owner->delete();
         parent::tearDown(); // TODO: Change the autogenerated stub
     }

+ 1 - 0
tests/Services/OracleDOCOrderHeaderService/GetWmsOrderOnStartDateEditTest.php

@@ -53,6 +53,7 @@ class GetWmsOrderOnStartDateEditTest extends TestCase
     }
     public function tearDown(): void
     {
+        OrderTrackingOwner::query()->where('owner_id',$this->owner['id'])->delete();
         $this->owner->delete();
         parent::tearDown(); // TODO: Change the autogenerated stub
     }

+ 1 - 0
tests/Services/OracleDOCOrderHeaderService/GetWmsOrderOnstartDateCreateTest.php

@@ -48,6 +48,7 @@ class GetWmsOrderOnstartDateCreateTest extends TestCase
     }
     public function tearDown(): void
     {
+        OrderTrackingOwner::query()->where('owner_id',$this->owner['id'])->delete();
         $this->owner->delete();
         parent::tearDown(); // TODO: Change the autogenerated stub
     }

+ 2 - 2
tests/Services/OrderCommodityService/SyncOrderCommodityTest.php

@@ -34,7 +34,7 @@ class SyncOrderCommodityTest extends TestCase
         $this->data['commodities'] = $commodities;
 
         $orderHeaders = collect();$orders = collect();
-        for ($i=0;$i<2000;$i++) {
+        for ($i=0;$i<20;$i++) {
             $owner = $owners->random();
             $commodity_list = $commodities->where('owner_id',$owner->id);
             $order = factory(Order::class)->create(['owner_id'=>$owner->id]);
@@ -57,7 +57,7 @@ class SyncOrderCommodityTest extends TestCase
         $this->data['orderHeaders'] = $orderHeaders;
 
         $this->mock(CommodityService::class,function($mock)use($commodities){
-            $mock->shouldReceive('get_')->andReturn($commodities);
+            $mock->shouldReceive('getCommoditiesByMaps')->andReturn($commodities);
         });
     }
 

+ 8 - 2
tests/Services/OrderIssueService/GetRecycleBinPaginateTest.php

@@ -14,16 +14,17 @@ class GetRecycleBinPaginateTest extends TestCase
      */
     public $service;
     public $data = [];
+    public $orderIssue;
     public function setUp(): void
     {
         parent::setUp(); // TODO: Change the autogenerated stub
         $this->service = app('OrderIssueService');
-        $orderIssue = factory(OrderIssue::class)->create([
+        $this->orderIssue = factory(OrderIssue::class)->create([
             'is_new_rejecting' => '无',
             'rejecting_status' => '无',
             'imported_status' => '正常',
         ]);
-        $orderIssue->delete();
+
     }
 
     public function testGetRecycleBinPaginate()
@@ -31,4 +32,9 @@ class GetRecycleBinPaginateTest extends TestCase
         $orderIssue = $this->service->getRecycleBinPaginate([]);
         $this->assertNotEmpty($orderIssue);
     }
+    public function tearDown(): void
+    {
+        $this->orderIssue->forceDelete();
+        parent::tearDown(); // TODO: Change the autogenerated stub
+    }
 }

+ 0 - 47
tests/Services/OrderIssueService/OrderIssueTagTest.php

@@ -1,47 +0,0 @@
-<?php
-
-namespace Tests\Services\OrderIssueService\OrderIssueTagTest;
-
-use App\OracleDOCOrderHeader;
-use App\Order;
-use App\OrderIssue;
-use App\OrderPackage;
-use App\Services\OrderIssueService;
-use Carbon\Carbon;
-use Illuminate\Foundation\Testing\RefreshDatabase;
-use Tests\TestCase;
-
-class OrderIssueTagTest extends TestCase
-{
-    /** @var OrderIssueService $service */
-    public $service;
-    public function setUp(): void
-    {
-        $this->service = app(OrderIssueService::class);
-        parent::setUp();
-    }
-
-    public function testOrderIssueTag()
-    {
-        $orderHeader = OracleDOCOrderHeader::query()->where('sostatus',99)->orderByDesc('AddTime')->first();
-        $orderNos = OracleDOCOrderHeader::query()
-            ->where('AddTime','>=',$orderHeader->addtime)
-            ->where('sostatus',99)
-            ->get()
-            ->map(function($orderHeader){
-                return $orderHeader->orderno;
-            });
-        $orderNo_arr = collect($orderNos)->chunk(5)->toArray();
-        $orderNos  = $orderNo_arr[0];
-        $this->assertNotNull($orderNos);
-        $arr = [];
-        $arr['orderNos'] = $orderNos;
-        $arr['typeId'] = 0;
-        $arr['result_explain'] = '';
-        $this->service->orderIssueTag($arr);
-        $orderIssue = OrderIssue::query()->whereHas('order',function($query)use($orderNos){
-            $query->whereIn('code',$orderNos);
-        })->get();
-        $this->assertEquals($orderIssue->count(),count($orderNos));
-    }
-}

+ 5 - 0
tests/Services/OrderIssueService/RecoverOrderIssueTest.php

@@ -31,4 +31,9 @@ class RecoverOrderIssueTest extends TestCase
         $orderIssue = OrderIssue::query()->where('id',$ids[0])->first();
         $this->assertNotEmpty($orderIssue);
     }
+    protected function tearDown(): void
+    {
+        $this->data['orderIssue']->forceDelete();
+        parent::tearDown(); // TODO: Change the autogenerated stub
+    }
 }

Vissa filer visades inte eftersom för många filer har ändrats