Browse Source

Merge branch 'master' into zengjun

# Conflicts:
#	app/Http/Controllers/TestController.php
ajun 4 years ago
parent
commit
8ae87cfafb
37 changed files with 1204 additions and 226 deletions
  1. 1 1
      app/Console/Commands/CreateWeightStatistic.php
  2. 6 6
      app/Filters/RequirementFilters.php
  3. 2 2
      app/Http/Controllers/ControlPanelController.php
  4. 16 12
      app/Http/Controllers/HandInStorageController.php
  5. 92 119
      app/Http/Controllers/StorageController.php
  6. 34 48
      app/Http/Controllers/TestController.php
  7. 23 1
      app/Http/Controllers/WaybillController.php
  8. 4 4
      app/Jobs/CacheShelfTaskJob.php
  9. 15 0
      app/OracleBasForwardingLoc.php
  10. 1 0
      app/Services/CacheShelfService.php
  11. 97 1
      app/Services/HandInStorageService.php
  12. 1 1
      app/Services/MaterialBoxService.php
  13. 6 3
      app/Services/StationService.php
  14. 2 2
      app/Services/StationTaskMaterialBoxService.php
  15. 5 15
      app/Services/StorageService.php
  16. 1 1
      app/Services/WaybillService.php
  17. 6 0
      app/Waybill.php
  18. 32 0
      database/migrations/2021_08_10_110830_change_express_face_list_column_in_waybills_table.php
  19. BIN
      resources/images/dbwl/qrCode.jpg
  20. BIN
      resources/images/dbwl/revice.png
  21. 1 0
      resources/js/app.js
  22. BIN
      resources/js/lodop/CLodop_Setup_for_Win32NT.exe
  23. 133 0
      resources/js/lodop/LodopFuncs.js
  24. BIN
      resources/js/lodop/install_lodop32.exe
  25. BIN
      resources/js/lodop/install_lodop64.exe
  26. 37 0
      resources/js/lodop/jquery.PrintArea.js
  27. 2 0
      resources/js/lodop/jquery.js
  28. 50 0
      resources/js/lodop/myAlert.js
  29. 316 0
      resources/js/lodop/myPrintKit.js
  30. 2 2
      resources/views/requirement/index.blade.php
  31. 2 0
      resources/views/store/handInStorage/receive.blade.php
  32. 7 2
      resources/views/store/handInStorage/receiveDetailPage.blade.php
  33. 7 0
      resources/views/store/inStorage/androidIndex.blade.php
  34. 23 5
      resources/views/store/inStorage/halfChestStorage.blade.php
  35. 268 1
      resources/views/transport/waybill/index.blade.php
  36. 2 0
      routes/web.php
  37. 10 0
      webpack.mix.js

+ 1 - 1
app/Console/Commands/CreateWeightStatistic.php

@@ -25,7 +25,7 @@ class CreateWeightStatistic extends Command
     {
         $yesterday = date("Y-m-d",strtotime("-1 day"));
         $sql = <<<sql
-SELECT DATE_FORMAT(order_packages.created_at,'%Y-%m-%d') date,IFNULL(order_packages.measuring_machine_id, 0) measuring_machine_id,order_packages.owner_id
+SELECT DATE_FORMAT(order_packages.created_at,'%Y-%m-%d') date,IFNULL(order_packages.measuring_machine_id, 0) measuring_machine_id,order_packages.owner_id,
 SUM(CASE WHEN order_packages.weighed_at IS NOT NULL THEN 1 ELSE 0 END) AS count,
 COUNT(1) total FROM order_packages LEFT JOIN orders ON order_packages.order_id=orders.id
 WHERE orders.wms_status != '订单取消'

+ 6 - 6
app/Filters/RequirementFilters.php

@@ -18,7 +18,7 @@ class RequirementFilters
     protected $queryBuilder;
     protected $filters = [
         'title',
-        'creator_id',
+        'creator',
         'worker_ids',
         'began_at_start',
         'began_at_end',
@@ -26,7 +26,7 @@ class RequirementFilters
         'finished_at_end',
         'created_at_start',
         'created_at_end',
-        'requirement_id',
+        'requirement',
         'status'
     ];
 
@@ -47,9 +47,9 @@ class RequirementFilters
         return $this->queryBuilder;
     }
 
-    public function creator_id($creator_id)
+    public function creator($creator)
     {
-        $this->queryBuilder->where('u];ser_id', $creator_id);
+        $this->queryBuilder->where('user_id', $creator);
     }
 
     private function worker_ids($worker_ids)
@@ -104,8 +104,8 @@ class RequirementFilters
         $this->queryBuilder->where('status', Requirement::$enums['status'][$status]);
     }
 
-    public function requirement_id($requirement_id)
+    public function requirement($requirement)
     {
-        $this->queryBuilder->where('id', $requirement_id);
+        $this->queryBuilder->where('id', $requirement);
     }
 }

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

@@ -221,7 +221,7 @@ class ControlPanelController extends Controller
     private function getTargetData(string $date, array $owner = [])
     {
         $res = [];$where='';$no_weight  = 0;
-        if ($owner) $where = " and order_packages.owner_id in ".implode(',',$owner).")";
+        if ($owner) $where = " and order_packages.owner_id in (".implode(',',$owner).")";
         if ($date == date("Y-m-d")){
             $sql = <<<sql
 SELECT DATE_FORMAT(order_packages.created_at,'%Y-%m-%d') date,IFNULL(order_packages.measuring_machine_id, 0) measuring_machine_id,
@@ -235,7 +235,7 @@ sql;
             if (empty($info)) return  $res;
             foreach ($info as $v){
                 $res[] = [$v->measuring_machine_id,(int)$v->count];
-                $no_weight += (int)($v->total_count - $v->un_weigh_count);
+                $no_weight += (int)($v->total - $v->count);
             }
             array_push($res, ['未称重',$no_weight]);
         }else{

+ 16 - 12
app/Http/Controllers/HandInStorageController.php

@@ -3,10 +3,9 @@
 namespace App\Http\Controllers;
 
 use App\Components\AsyncResponse;
-use App\OracleBasLocation;
 use App\OracleDOCASNHeader;
 use App\Services\HandInStorageService;
-use Doctrine\DBAL\Exception\DatabaseObjectExistsException;
+use Carbon\Carbon;
 use Illuminate\Http\Request;
 
 class HandInStorageController extends Controller
@@ -47,7 +46,6 @@ class HandInStorageController extends Controller
      * @param $asnno
      * 跳转到收货明细页面
      */
-
     public function receiveDetailPage($asnno,$customerid)
     {
         $this->gate("入库管理-手持入库-收货");
@@ -97,17 +95,22 @@ class HandInStorageController extends Controller
     {
         $this->gate("入库管理-手持入库-收货");
         $info=$request->input('info');
+        if ($info['lotatt02']&&Carbon::now()->gt($info['lotatt02']))$this->error('失效日期超过入库效期');
         if (!$info['customerid']||!$info['sku']||!$info['asnno']) $this->error('参数错误');
         if ($info['amount']+$info['receivedqty']>$info['expectedqty'])$this->error('收货数大于预期数');
-//        if ($info['location']){
-//            $location=OracleBasLocation::query()
-//                ->where('locationid',$info['location'])
-//                ->where('status','OK')
-//                ->first();
-//            if (!$location)$this->error('目标库位不存在');
-//        }
         /** @var HandInStorageService $handInStorageService  */
         $handInStorageService=app('HandInStorageService');
+        if ($info['customerid']=='ONKYO'||$info['customerid']=='ANMEILAI'||$info['customerid']=='FEIHE'){
+            $res=$handInStorageService->checkWidthHeight($info);
+            if ($res===1)$this->error('需要维护产品档案');
+            if ($res===2)$this->error('需要维护该产品档案中的长宽高');
+        }
+        if ($info['customerid']=='TANGENBEI'||$info['customerid']=='ANMEILAI'){
+            $result=$handInStorageService->checkCubicWeight($info);
+            if ($result===1)$this->error('需要维护产品档案');
+            if ($result===2)$this->error('需要维护该产品档案中的重量体积');
+        }
+        if ($handInStorageService->checkForwardingLoc($info)===1)$this->error('请维护拣货位');
         try {
             $result = $handInStorageService->fluxHandIn($info);
             if ($result)$this->success("收货成功");
@@ -156,8 +159,9 @@ class HandInStorageController extends Controller
         if ($res===4)$this->error('库位:产品不能混放');
         try {
             $result = $handInStorageService->fluxHandPa($info, $checkData);
-            if ($result)$this->success("上架成功");
-            else $this->error("上架失败");
+            if ($result===true)$this->success("上架成功");
+            if ($result===false) $this->error("上架失败");
+            if ($result===1)$this->error("拣货区找到效期更新的同样货品,不能上架至存储区");
         } catch (\Exception $e) {
             app('LogService')->log(__METHOD__,'error_'.__FUNCTION__,json_encode($info).'|catch:'.$e->getMessage());
         }

+ 92 - 119
app/Http/Controllers/StorageController.php

@@ -192,8 +192,12 @@ sql;
     public function acquireBox()
     {
         $this->gate("入库管理-入库-半箱补货入库");
-
-        list($track, $barCode, $lotNum, $amount) = request()->only(["track","barCode","lotNum","amount"]);
+        $param = request()->only(["track","barCode","lotNum","amount","call"]);
+        $track = $param["track"] ?? null;
+        $barCode = $param["barCode"] ?? null;
+        $lotNum = $param["lotNum"] ?? null;
+        $amount = $param["amount"] ?? null;
+        $manualCall = $param["call"] ?? false;
         if (!$track || !$barCode || !$lotNum || !$amount)$this->error("提交信息不完整");
 
         $sql = <<<SQL
@@ -206,7 +210,7 @@ WHERE FMID = ? AND FMLOTNUM = ? AND
   AND TASKPROCESS = '00' AND TASKTYPE = 'PA'
 GROUP BY FMID,FMLOTNUM,TSK_TASKLISTS.SKU,TSK_TASKLISTS.CUSTOMERID
 SQL;
-        $task = DB::connection("oracle")->selectOne(DB::raw($sql));
+        $task = DB::connection("oracle")->selectOne(DB::raw($sql),[$track,$lotNum,$barCode,$barCode,$barCode]);
         if (!$task || $task->qty<$amount)$this->error("待上架数量不足");
         $commodity = Commodity::query()->whereHas("owner",function ($query)use($task){
             $query->where("code",$task->customerid);
@@ -219,7 +223,7 @@ SQL;
             $query->where("commodity_id",$commodity->id);
         }]);
         $models = $models->whereNotNull("commodity");
-        if ($models->count()==0)$this->success(["status"=>false]);
+        if ($models->count()==0)$this->success(["status"=>false,"commodityId"=>$commodity->id]);
 
         //设定一个默认缓存架 仅用于任务占位 没有实际作用
         $defaultStation = Station::query()->where("station_type_id",5)
@@ -259,19 +263,44 @@ SQL;
                 return $task;
             };
 
-            $stations = app("StationService")->getCacheShelf(true);
+            $stations = app("StationService")->getCacheShelf(true,true);
             $collection = collect();
             $location = collect();
             $ids = [];
             //寻找半箱
-            foreach ($models as $model){
-                list($invs,$map) = app("StorageService")->getMaxAvailableHalfBoxLocation($model->commodity, request("lotNum"));
-                if (!$invs)continue;
+            $sql = <<<SQL
+SELECT LOCATIONID,QTY FROM INV_LOT_LOC_ID WHERE LOTNUM = '{$lotNum}'
+AND LOCATIONID LIKE 'IDE%' AND SKU = '{$commodity->sku}' AND TRACEID = '*' AND QTY > 0 AND QTY > 0 ORDER BY QTY
+SQL;
+            $invs = DB::connection("oracle")->select(DB::raw($sql));
+            if ($invs){
+                $map = [];
+                $codes = [];
                 foreach ($invs as $inv){
+                    $map[$inv->locationid] = $inv->qty;
+                    $codes[] = $inv->locationid;
+                }
+                $modelMap = [];
+                $orderBy = "CASE material_box_model_id ";
+                foreach ($models as $key=>$model){
+                    $orderBy .= 'WHEN '.$model->id." THEN ".$key;
+                    $modelMap[$model->id] = $model->commodity->maximum;
+                }
+                $orderBy.= " END";
+                $boxes = MaterialBox::query()->whereIn("code",$codes)->orderByRaw($orderBy)->lockForUpdate()->get();
+                //筛选下海柔可用箱
+                list($codes,$notCodes) = app("MaterialBoxService")->checkHaiQ(array_column($boxes->toArray(),"code"));
+                if (!$codes)$boxes = new \Illuminate\Database\Eloquent\Collection();
+                $boxes = $boxes->filter(function ($box)use($codes,$notCodes){
+                    if (!isset($codes[$box->code]) || isset($notCodes[$box->code]))return false;
+                    return true;
+                });
+                foreach ($boxes as $box){
+                    if ($modelMap[$box->material_box_model_id]<=$map[$box->code])continue;
+                    $num = $modelMap[$box->material_box_model_id]-$map[$box->code];
                     $station = $stations->last();
-                    $boxId = $map[$inv->locationid];
-                    $number = $amount >= $inv->qty ? $amount-$inv->qty : $amount;
-                    $task = $exe($station, $boxId, $number);
+                    $number = $amount >= $num ? $amount-$num : $amount;
+                    $task = $exe($station, $box->id, $number);
                     if ($station){
                         $stations->offsetUnset($stations->count()-1);
                         $collection->push($task);
@@ -281,8 +310,8 @@ SQL;
                     $amount -= $number;
                     if ($amount==0)break;
                 }
-                if ($amount==0)break;
             }
+
             if ($amount){
                 //寻找空箱
                 $blacklist = [];//空箱逐一寻找需要列队黑名单
@@ -308,7 +337,8 @@ SQL;
             if ($location->count()){
                 /** @var ForeignHaiRoboticsService $service */
                 $service = app("ForeignHaiRoboticsService");
-                $result = $service->fetchGroup_multiLocation($location,$collection,'','立架出至缓存架');
+                if ($manualCall)$result = $this->mergeIntoCache($location,$collection);
+                else $result = $service->fetchGroup_multiLocation($location,$collection,'','立架出至缓存架');
                 if (!$result){
                     DB::rollBack();
                     $this->error("机器人呼叫失败,海柔任务错误");
@@ -335,105 +365,35 @@ SQL;
     }
 
     /**
-     * 取得料箱 废弃
+     * 并入缓存 等待呼叫
+     *
+     * @param Collection $location
+     * @param Collection $collection
+     *
+     * @return bool
      */
-    public function acquireBoxTemp()
+    public function mergeIntoCache(Collection $location,Collection $collection):bool
     {
-        $this->gate("入库管理-入库-半箱补货入库");
-        $boxId = request("material_box_id");
-        $modelId = request("material_box_model_id");
-        if (!$modelId)$this->error("商品未设定库存上限");
-        //获取目标库位
-        $station = app("StationService")->getMirrorMappingLocation(request("station"));
-        if (!$station)$this->error("未知库位");
-        $isAvailable = app("StationService")->isAvailable($station);
-        if (!$isAvailable)$this->error("库存被占用或存在任务未处理");
-        $amount = app("StorageService")->checkPutAmount(request("track"),request("barCode"),request("lotNum"));
-        if ($amount<request("amount"))$this->error("待上架数量不足,最大可上数量为{$amount}");
-
-        //发起取箱任务
-        $exe = function ($boxId)use($station,$amount){
-            DB::beginTransaction();
-            try{
-                $collection = new Collection();
-                $task = StationTask::query()->create([
-                    'status' => "待处理",
-                    'station_id' => $station->id,
-                ]);
-                $collection->add(StationTaskMaterialBox::query()->create([
-                    'station_id' => $station->id,
-                    'material_box_id'=>$boxId,
-                    'status'=>"待处理",
-                    'type' => '取',
-                    'station_task_id' => $task->id,
-                ]));
-                if (!app("ForeignHaiRoboticsService")->fetchGroup($station->code,$collection,'','立架出至缓存架'))$this->error("呼叫机器人失败");
-                //生成临时任务事务
-                TaskTransaction::query()->create([
-                    //"doc_code" => request("asn"),
-                    "bar_code" => request("barCode"),
-                    "fm_station_id" => $station->id,
-                    "material_box_id" => $boxId,
-                    "commodity_id" => request("commodity_id"),
-                    "amount" => request("amount"),
-                    "type" => "入库",
-                    "user_id" => Auth::id(),
-                    "mark" => 1,
-                    "lot_num" => request("lotNum"),
-                    "track_num" => request("track"),
-                ]);
-                //亮灯
-                app("CacheShelfService")->lightUp($station->code,'3','0');
-                app("StationService")->locationOccupy($station->code);//占用库位
-                Cache::forever("CACHE_SHELF_OCCUPANCY_{$station->id}",true);
-                DB::commit();
-                return true;
-            }catch (\Exception $e){
-                DB::rollBack();
-                return false;
-            }
-        };
-        //检查获取的料箱仍然可用
-        if ($boxId && app("MaterialBoxService")->checkUsableBox($boxId))$this->success(["status"=>$exe($boxId),"amount"=>$amount-request("amount")]);
-
-        $commodity = Commodity::query()->find(request("commodity_id"));
-        if (!$commodity)$this->error("商品在WAS丢失");
-        $models = app("MaterialBoxModelService")->getModelSortedByOwner($commodity->owner_id);
-        $models->load(["commodity"=>function($query)use($commodity){
-            $query->where("commodity_id",$commodity->id);
-        }]);
-        //获取料箱
-        if ($boxId){
-            $blacklist = [$boxId];
-            $boxId = null;
-            //料箱存在且不可用
-            /** @var \Illuminate\Database\Eloquent\Collection $models */
-            foreach ($models as $model){
-                if (!$model->commodity)continue;
-                //料箱不可用寻找新料箱
-                $result = app("StorageService")->getMaxAvailableHalfBoxLocation($model->commodity, request("lotNum"), $blacklist);
-                while ($result){
-                    $materialBox = MaterialBox::query()->where("code",$result->locationid)->first();
-                    //料箱可用并且数量符合本次半箱数量 跳出
-                    if ($materialBox && app("MaterialBoxService")->checkUsableBox($materialBox->id)
-                        && $result->qty>=request("amount"))$this->success(["status"=>$exe($materialBox->id),"amount"=>$amount-request("amount")]);
-                    else if ($materialBox)$blacklist[] = $materialBox->id;
-                    //否则黑名单此料箱继续查找 直至料箱为空
-                    $result = app("StorageService")->getMaxAvailableHalfBoxLocation($model->commodity, request("lotNum"), $blacklist);
-                }
-            }
+        $key = "CACHE_SHELF_CALL_".Auth::id();
+        if (Cache::has($key)){
+            list($locationAdd,$collectionAdd) = Cache::get($key);
+            $location = $locationAdd->merge($location);
+            $collection = $collectionAdd->merge($collection);
         }
-        //料箱不存在且该商品有过入库记录 拿取空箱
-        if (!$modelId){
-            $box = null;
-            foreach ($models as $model){
-                if (!$model->commodity)continue;
-                $box = app("MaterialBoxService")->getAnEmptyBox($model);
-                if($box)break;
-            }
-        }else $box = app("MaterialBoxService")->getAnEmptyBox(MaterialBoxModel::query()->find($modelId));
-        if (!$box)$this->error("无可用料箱");
-        $this->success(["status"=>$exe($box->id),"amount"=>$amount-request("amount")]);
+        return Cache::forever($key,[$location,$collection]);
+    }
+
+    public function callRobot()
+    {
+        /** @var ForeignHaiRoboticsService $service */
+        $service = app("ForeignHaiRoboticsService");
+        $key = "CACHE_SHELF_CALL_".Auth::id();
+        list($location,$collection) = Cache::get($key);
+        if ($location->count()==0||$collection->count()==0)$this->error("没有可执行任务");
+        $res = $service->fetchGroup_multiLocation($location,$collection,'','立架出至缓存架');
+        if (!$res)$this->error("呼叫失败,海柔拒绝任务");
+        Cache::forget($key);
+        $this->success();
     }
 
     /**
@@ -448,16 +408,28 @@ SQL;
         $box = MaterialBox::query()->where("code",$ide)->first();
         if (!$box)$this->error("未知料箱");
 
-        $task = TaskTransaction::query()->where("material_box_id",$box->id)->where("amount",">",$amount)
-            ->where("type","入库")->where("mark",1)->where("status",0)->first();
-        if (!$task)$this->error("无任务存在");
-        $task->update(["amount" => DB::raw("amount - {$amount}")]);
-        $storage = MaterialBoxCommodity::query()->where("material_box_id",$task->material_box_id)
-            ->where("commodity_id",$task->commodity_id)->first();
-        $maximum = (($storage->amount ?? 0)+$task->amount)-$amount;
-        CommodityMaterialBoxModel::query()->where("material_box_model_id",$task->materialBox->material_box_model_id)
-            ->where("commodity_id",$task->commodity_id)->update(["maximum"=>$maximum]);
-        $this->success("校正成功");
+        DB::beginTransaction();
+        try {
+            $task = TaskTransaction::query()->where("material_box_id",$box->id)->where("amount",">=",$amount)
+                ->where("type","入库")->where("mark",1)->where("status",0)->lockForUpdate()->first();
+            if (!$task)$this->error("无任务存在");
+            if ($task->amount == $amount){
+                $station = Station::query()->find($task->fm_station_id);
+                app("CacheShelfService")->lightUp($station->code);
+                $task->delete();
+            }
+            else $task->update(["amount" => DB::raw("amount - {$amount}")]);
+            $storage = MaterialBoxCommodity::query()->where("material_box_id",$task->material_box_id)
+                ->where("commodity_id",$task->commodity_id)->first();
+            $maximum = (($storage->amount ?? 0)+$task->amount)-$amount;
+            CommodityMaterialBoxModel::query()->where("material_box_model_id",$task->materialBox->material_box_model_id)
+                ->where("commodity_id",$task->commodity_id)->update(["maximum"=>$maximum]);
+            DB::commit();
+            $this->success("校正成功");
+        }catch (\Exception $e){
+            DB::rollBack();
+            $this->error("校正失败");
+        }
     }
 
     public function syncStorage()
@@ -588,6 +560,7 @@ sql;
      */
     public function settingModelMaximum()
     {
+        if (!request("commodityId"))$this->error("未获取商品");
         $insert = function ($commodityId){
             $in = [];
             $ids = [];

+ 34 - 48
app/Http/Controllers/TestController.php

@@ -2,12 +2,38 @@
 
 namespace App\Http\Controllers;
 
+use App\Commodity;
+use App\CommodityMaterialBoxModel;
 use App\Components\AsyncResponse;
 use App\Components\ErrorPush;
+use App\ErrorTemp;
+use App\Feature;
+use App\Jobs\CacheShelfTaskJob;
+use App\Jobs\OrderCreateWaybill;
+use App\MaterialBox;
+use App\MaterialBoxModel;
+use App\Order;
+use App\Owner;
+use App\OwnerFeeDetail;
+use App\OwnerPriceOperation;
 use App\OrderPackageCountingRecord;
+use App\RejectedBill;
+use App\Services\ForeignHaiRoboticsService;
+use App\Services\StationService;
+use App\Services\StorageService;
+use App\Station;
+use App\StationTask;
+use App\StationTaskMaterialBox;
+use App\TaskTransaction;
+use App\Unit;
 use App\Waybill;
+use Carbon\Carbon;
+use Carbon\CarbonPeriod;
+use Illuminate\Database\Eloquent\Collection;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Cookie;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Http;
 
@@ -40,55 +66,15 @@ class TestController extends Controller
         $response = Http::post(config('api.haiq.storage.light'), $params);
         return json_decode($response->body());
     }
-    private $key = "CACHE_SHELF_AVAILABLE";
-    public function test()
-    {
-        $w = Waybill::query()->first();
-        $w->loadCount(["waybillAuditLogs"]);
-        dd($w);
-    }
-
-    public function addRecord()
-    {
-        $yesterday = '2021-06-08';
-        $sql = <<<sql
-SELECT DATE_FORMAT(order_packages.created_at,'%Y-%m-%d') date,IFNULL(order_packages.measuring_machine_id,0) measuring_machine_id,order_packages.owner_id,
-SUM(CASE WHEN order_packages.weighed_at IS NOT NULL THEN 1 ELSE 0 END) AS count,
-COUNT(1) total FROM order_packages LEFT JOIN orders ON order_packages.order_id=orders.id
-WHERE orders.wms_status != '订单取消'
-AND order_packages.created_at BETWEEN '{$yesterday} 00:00:00' AND '{$yesterday} 23:59:59' GROUP BY date,order_packages.measuring_machine_id,order_packages.owner_id
-sql;
-        $result = DB::select(DB::raw($sql));
-        if (!$result) {
-            $obj = [
-                "targeted_at" => $yesterday,
-                "un_weigh_count" => 0,
-                "total_count" => 0,
-                "measuring_machine_id" => 0,
-                "owner_id" => 0
-            ];
-            $model = OrderPackageCountingRecord::query()->create($obj);
-            Cache::put("weight.".$yesterday, $obj);
-        }else{
-            $objs = [];
-            foreach ($result as $v){
-                $obj = [
-                    "targeted_at"    => $v->date,
-                    "un_weigh_count" => $v->count,
-                    "total_count"    => $v->total,
-                    "measuring_machine_id"    => $v->measuring_machine_id,
-                    "owner_id"    => $v->owner_id
-                ];
-                $model = OrderPackageCountingRecord::query()->create($obj);
-                array_push($objs, $obj);
-            }
-            Cache::put("weight.".$yesterday, $objs);
-        }
+    public function a($a){
+        $test = ["asdas"];
+        $a($test);
+        dd($test);
     }
-
-    public function redis()
+    public function test()
     {
-        Cache::pull('weight.2021-06-06');
+        $this->a(function (&$test){
+            $test[] = 123;
+        });
     }
-
 }

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

@@ -170,7 +170,7 @@ class WaybillController extends Controller
             if ($waybill->type=='德邦物流' && !$oldBill){
                 $bill = app('DbOpenService')->getDbOrderNo($waybill);
                 if (!$bill){DB::rollBack();return "获取德邦单号失败,德邦服务异常";}
-                $waybill->update(["carrier_bill"=>$bill]);
+                $waybill->update(["carrier_bill"=>$bill,'waybill_number'=>$bill]);
                 $msg =  "【申请德邦物流单号:".$bill."】";
                 if (!app("WaybillService")->notifyFlux($waybill))$msg .= ",通知FLUX失败";
                 $stage = '发起德邦调度';
@@ -1120,4 +1120,26 @@ class WaybillController extends Controller
         }
         $this->success(count($ids)==$waybills->count() ? '运单拆单完毕' : '部分运单不符合拆单条件');
     }
+
+    /**
+     * 快递面单打印 :暂时支持 德邦
+     */
+    public function expressFaceList(Request $request)
+    {
+        $this->gate("运输管理-编辑");
+        $ids = $request->input("ids");
+        try {
+            /** @var Collection $waybills */
+            $waybills = Waybill::query()->whereIn("id",$ids)->get();
+            if ($waybills->count()==0)$this->error("运单不存在");
+            foreach ($waybills as $waybill){
+                $waybill->loadMissing([
+                    "order.shop","destinationCity","owner","order.warehouse.province","order.warehouse.city","order.warehouse.county","deliveryType"
+                ]);
+            }
+        }catch (\Exception $e){
+            $this->error($e->getMessage());
+        }
+        $this->success(count($ids)==$waybills->count() ? $waybills : []);
+    }
 }

+ 4 - 4
app/Jobs/CacheShelfTaskJob.php

@@ -108,7 +108,7 @@ class CacheShelfTaskJob implements ShouldQueue
                 }else $updateTransaction[] = ["id"=>$obj->id,"to_station_id"=>$stationId,"status"=>0,"updated_at"=>$time];
             },function ($service,$toLocation,$task,$prefix){
                 return $service->fetchGroup_multiLocation($toLocation,$task,$prefix,'立架出至缓存架',20);
-            })){DB::commit();return true;}
+            },"to_station_id")){DB::commit();return true;}
             DB::rollBack();
         }catch (\Exception $e){
             DB::rollBack();
@@ -137,7 +137,7 @@ class CacheShelfTaskJob implements ShouldQueue
                 $updateTransaction[] = ["id"=>$obj->id,"fm_station_id"=>$stationId,"status"=>0,"updated_at"=>$time];
             },function ($service,$toLocation,$task,$prefix){
                 return $service->fetchGroup_multiLocation($toLocation,$task,'','立架出至缓存架');
-            })){DB::commit();return true;}
+            },"fm_station_id")){DB::commit();return true;}
             DB::rollBack();
         }catch (\Exception $e){
             DB::rollBack();
@@ -147,7 +147,7 @@ class CacheShelfTaskJob implements ShouldQueue
     }
 
     private function dispatchTask(\Illuminate\Database\Eloquent\Collection $tasks, array $available, $service,
-                                  \Closure $update, \Closure $execute):bool
+                                  \Closure $update, \Closure $execute, string $stationName):bool
     {
         if (!$tasks->count())return false;
         if ($tasks->count()>count($available))$tasks = $tasks->slice(0,count($available));//事务过多切割部分处理
@@ -156,7 +156,7 @@ class CacheShelfTaskJob implements ShouldQueue
         $availableTemp = array_keys($available);
         $map = app("StationService")->getStationMapping($availableTemp);//获取库位映射信息
         $updateTask = [["id","station_id","updated_at"]];
-        $updateTransaction = [["id","to_station_id","status","updated_at"]];
+        $updateTransaction = [["id",$stationName,"status","updated_at"]];
         $time = date("Y-m-d H:i:s");
         foreach ($tasks as $index=>$obj){
             $loc = $availableTemp[$index];

+ 15 - 0
app/OracleBasForwardingLoc.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+use App\Traits\ModelLogChanging;
+
+class OracleBasForwardingLoc extends Model
+{
+    use ModelLogChanging;
+
+    protected $connection="oracle";
+    protected $table="BAS_Forwarding_LOC";
+}

+ 1 - 0
app/Services/CacheShelfService.php

@@ -66,6 +66,7 @@ class   CacheShelfService
                 $this->lightUp($station->code);
                 return ['success' => true];
             }
+            app("StationService")->locationFreed($station->code);
         }
         try {
             $bool = $this->putBinToStore($station);                         // 推送任务

+ 97 - 1
app/Services/HandInStorageService.php

@@ -4,6 +4,8 @@ namespace App\Services;
 
 use App\CommodityBarcode;
 use App\OracleBasCode;
+use App\OracleBasCustomer;
+use App\OracleBasForwardingLoc;
 use App\OracleBasLocation;
 use App\OracleBasLotId;
 use App\OracleBasSKU;
@@ -21,11 +23,63 @@ use Illuminate\Database\Eloquent\Model;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\DB;
+use Monolog\Handler\IFTTTHandler;
 
 class HandInStorageService
 {
     use ServiceAppAop;
 
+    /**
+     * @param array $info
+     * @return bool|int
+     * 校验货主拣货位
+     */
+    public function checkForwardingLoc(array $info)
+    {
+        $res=OracleBasCustomer::query()
+            ->where('customerid',$info['customerid'])
+            ->where('customer_type','OW')
+            ->where('udf1','Y')->count(); //查询此货主是否必须有拣货位
+        if ($res>0) {
+            $amount=OracleBasForwardingLoc::query()
+                ->where('customerid',$info['customerid'])
+                ->where('sku',$info['sku'])
+                ->count();
+            if ($amount==0)return 1;//请维护拣货位!
+        }
+        return true;
+    }
+    /**
+     * @param array $info
+     * @return bool|int
+     * 校验产品档案长宽高
+     */
+    public function checkWidthHeight(array $info)
+    {
+        $basSku=OracleBasSKU::query()->where('customerid',$info['customerid'])->where('sku',$info['sku'])->first();
+        if (!$basSku)return 1;//需要维护产品档案
+        if ($basSku->skulength<=0||$basSku->skuwidth<=0||$basSku->skuhigh<=0)return 2;//需要维护该产品档案中的长宽高
+        return true;
+    }
+
+    /**
+     * @param array $info
+     * @return bool|int
+     * 校验产品档案重量体积
+     */
+    public function checkCubicWeight(array $info)
+    {
+        $basSku=OracleBasSKU::query()->where('customerid',$info['customerid'])->where('sku',$info['sku'])->first();
+        if (!$basSku)return 1;//需要维护产品档案
+        if ($basSku->grossweight<=0||$basSku->cube<=0)return 2;//需要维护该产品档案中的重量体积
+        return true;
+    }
+    /**
+     * @param array $info
+     * @param array $param
+     * @return bool|int
+     * 校验库位
+     */
     public function checkLocation(array $info, array $param)
     {
         $location = OracleBasLocation::query()
@@ -174,6 +228,8 @@ sql;
     {
         $sql = <<<sql
 SELECT DOC_ASN_DETAILS.sku,DOC_ASN_DETAILS.expectedqty,DOC_ASN_DETAILS.skudescrc,
+       DOC_ASN_DETAILS.lotatt01, DOC_ASN_DETAILS.lotatt02, DOC_ASN_DETAILS.lotatt03, DOC_ASN_DETAILS.lotatt04,
+       DOC_ASN_DETAILS.lotatt05, DOC_ASN_DETAILS.lotatt06, DOC_ASN_DETAILS.lotatt07, DOC_ASN_DETAILS.lotatt08,
        DOC_ASN_DETAILS.asnlineno,DOC_ASN_DETAILS.asnno,DOC_ASN_DETAILS.receivedqty FROM DOC_ASN_DETAILS
          LEFT JOIN BAS_SKU ON DOC_ASN_DETAILS.CUSTOMERID = BAS_SKU.CUSTOMERID AND DOC_ASN_DETAILS.SKU = BAS_SKU.SKU
 WHERE ASNNO = ? AND LINESTATUS IN ('00','30') AND (ALTERNATE_SKU1 = ? OR ALTERNATE_SKU2 = ?  OR ALTERNATE_SKU3 = ?)
@@ -181,7 +237,8 @@ sql;
         $asn_detail = DB::connection("oracle")->selectOne(DB::raw($sql), [$asnno, $skuOrBarcode, $skuOrBarcode, $skuOrBarcode]);
         if ($asn_detail) return $asn_detail;
         else return OracleDOCASNDetail::query()
-            ->select(['sku', 'expectedqty', 'skudescrc', 'asnlineno', 'asnno', 'receivedqty'])
+            ->select(['sku', 'expectedqty', 'skudescrc', 'asnlineno', 'asnno', 'receivedqty',
+                'lotatt01','lotatt02','lotatt03','lotatt04','lotatt05','lotatt06','lotatt07','lotatt08'])
             ->where('asnno', $asnno)
             ->where('sku', $skuOrBarcode)
             ->whereIn('linestatus', ['00', '30'])
@@ -267,6 +324,8 @@ sql;
         if (!$tasks) return false; //获取任务失败
         return DB::connection("oracle")->transaction(function () use ($tasks, $info) { //单体嵌套事务 回滚FLUX失败任务
             foreach ($tasks as $task) {
+                $res=$this->checkExpiryPa($task,$info['location']);
+                if ($res!==true)return $res;
                 if (!app("StorageService")->fluxPA($task, $info['location'])) {
                     DB::connection("oracle")->rollBack();
                     return false; //上架失败
@@ -276,6 +335,43 @@ sql;
         });
     }
 
+    /**
+     * @param $task
+     * @param $location
+     * @return bool|int
+     * 上架校验效期
+     */
+    public function checkExpiryPa($task,$location)
+    {
+        if (!$task->taskid)return 0;//任务id不存在
+        if (strpos($task->taskid,'MIX') !== false)return true;//合并拣货,不校验
+
+        $sql = <<<sql
+select instr(DESCR,'拣货') as var_IsPickingArea from BAS_Zone where ZONE=(select PutawayZone from BAS_Location where LocationID = ?)
+sql;
+        $basZone = DB::connection("oracle")->selectOne(DB::raw($sql), [$location]);
+        if ($basZone&&$basZone->var_ispickingarea>0) return true; //不是存储区,不校验
+
+        $sql1 = <<<sql
+select SKU,LotAtt02,CustomerID from INV_LOT_ATT WHERE LOTNUM=?
+sql;
+        $invLotAtt = DB::connection("oracle")->selectOne(DB::raw($sql1), [$task->fmlotnum]);
+        $sql2 = <<<sql
+    select count(*) as var_amountOfDecaying from INV_LOT_LOC_ID store
+                                                       left join BAS_Location location on store.LocationID=location.locationId
+                                                       left join BAS_Zone zone on zone.zone=location.PickZone
+                                                       left join INV_LOT_ATT attres on store.LOTNUM=attres.LOTNUM
+    where store.SKU=?
+      and store.CustomerID=?
+      and store.LOTNUM!=?
+      and attres.LotAtt02 > ?
+      and zone.DESCR like '%拣货%'
+sql;
+        $invLotLocId=DB::connection("oracle")->selectOne(DB::raw($sql2), [$invLotAtt->sku,$invLotAtt->customerid,$task->fmlotnum,$invLotAtt->lotatt02]);
+        if ($invLotLocId&&$invLotLocId->var_amountofdecaying>0)return 1;//拣货区找到效期更新的同样货品,不能上架至存储区
+        return true;
+    }
+
     /**
      * @param $taskParam
      * @param $amount

+ 1 - 1
app/Services/MaterialBoxService.php

@@ -65,7 +65,7 @@ sql;
         return null;
     }
 
-    private function checkHaiQ(array $boxCodes)
+    public function checkHaiQ(array $boxCodes)
     {
         $haiBoxes = DB::connection("mysql_haiRobotics")->table("ks_bin")
             ->where("status",1)->whereIn("ks_bin_code",$boxCodes)->get();

+ 6 - 3
app/Services/StationService.php

@@ -135,10 +135,11 @@ class StationService
      * 获取缓存架
      *
      * @param bool $onlyAvailable
+     * @param bool $desc
      *
      * @return Collection
      */
-    public function getCacheShelf(bool $onlyAvailable = false):Collection
+    public function getCacheShelf(bool $onlyAvailable = false, bool $desc = false):Collection
     {
         $stations = Station::query()->where("station_type_id",5)
             ->whereNotNull("parent_id");
@@ -146,6 +147,7 @@ class StationService
             ->whereNotIn("id",Station::query()->select("id")->whereHas("task",function ($query){
                 $query->whereNotIn("status",["完成","取消"]);
             }))->lockForUpdate();
+        if ($desc)$stations->orderByDesc("code");
         return $stations->get();
     }
 
@@ -191,13 +193,14 @@ class StationService
     /**
      * 库位释放
      *
-     * @param string $location
+     * @param ?string $location
      * @param int|null $boxId
      *
      * @return int
      */
-    public function locationFreed(string $location, ?int $boxId=null):int
+    public function locationFreed(?string $location, ?int $boxId=null):int
     {
+        if (!$location)return 0;
         $update = ["status"=>0];
         if ($boxId)$update["material_box_id"]=$boxId;
         return Station::query()->where("code",$location)->update($update);

+ 2 - 2
app/Services/StationTaskMaterialBoxService.php

@@ -179,7 +179,6 @@ class StationTaskMaterialBoxService
                     $stationTaskMaterialBox->materialBox->update();
                     $stationTaskMaterialBox->loadMissing("station");    //提前加载站,后续都需要站信息来处理
                     $this->storageService->putCacheShelf($stationTaskMaterialBox);
-                    $this->storageService->releaseOccupation($stationTaskMaterialBox); //释放库位占用
                     break;
                 default:;
             }
@@ -206,11 +205,12 @@ class StationTaskMaterialBoxService
     /**
      * 取出料箱通知
      *
-     * @param $stationTaskMaterialBox
+     * @param StationTaskMaterialBox|\stdClass $stationTaskMaterialBox
      * @throws \Exception
      */
     function markHasTaken($stationTaskMaterialBox)
     {
+        $stationTaskMaterialBox->loadMissing("station");
         $this->instant($this->cacheShelfService,'CacheShelfService');
         //维护缓存架可用度
         $map = Cache::get("CACHE_SHELF_MAPPING",function (){return [];});

+ 5 - 15
app/Services/StorageService.php

@@ -37,8 +37,9 @@ class StorageService
         try{
             $stationTaskMaterialBox->loadMissing("station");
             //如果为半箱位置 清理原有任务
-            if ($stationTaskMaterialBox->station && app("StationService")->isHalfBoxLocation($stationTaskMaterialBox->station)){
-                app("StationService")->locationFreed($stationTaskMaterialBox->station->code,$stationTaskMaterialBox->material_box_id);
+            if (!$stationTaskMaterialBox->station)return;
+            if (app("StationService")->isHalfBoxLocation($stationTaskMaterialBox->station)){
+                app("StationService")->locationOccupy($stationTaskMaterialBox->station->code,$stationTaskMaterialBox->material_box_id);
                 //清除海柔库位信息
                 $this->clearTask([$stationTaskMaterialBox->station->code]);
                 $stationId = $stationTaskMaterialBox->station_id;
@@ -97,7 +98,7 @@ class StorageService
                     app("CacheShelfService")->lightUp($stationTaskMaterialBox->station->code,'2','0',$options);
                     Cache::forget("CACHE_SHELF_OCCUPANCY_{$stationTaskMaterialBox->station->id}");//关闭无限亮灯
                 }
-            }
+            }else app("StationService")->locationFreed($stationTaskMaterialBox->station->code); //释放库位占用
             DB::commit();
         }catch (\Exception $e){
             DB::rollBack();
@@ -105,17 +106,6 @@ class StorageService
         }
     }
 
-    /**
-     * 释放库位占用
-     *
-     * @param StationTaskMaterialBox|\stdClass $stationTaskMaterialBox
-     */
-    public function releaseOccupation($stationTaskMaterialBox)
-    {
-        if (!app("StationService")->isHalfBoxLocation($stationTaskMaterialBox->station))return;
-        app("StationService")->locationFreed($stationTaskMaterialBox->station->code);
-    }
-
     /**
      * 检查临时事务标记处理一些特殊情况
      *
@@ -307,8 +297,8 @@ AND TSK_TASKLISTS.SKU = BAS_SKU.SKU
 WHERE FMID = ? AND FMLOTNUM = ? AND (ALTERNATE_SKU1 = ? OR ALTERNATE_SKU2 = ? OR ALTERNATE_SKU3 = ?)
 AND TASKPROCESS = '00' AND TASKTYPE = 'PA'
 SQL;
+        $tasks = DB::connection("oracle")->select(DB::raw($sql),[$trace,$lotNum,$barCode,$barCode,$barCode]);
 
-        $tasks = DB::connection("oracle")->select(DB::raw($sql),[$trace,$lotNum,$barCode,$barCode,$barCode,$amount]);
         if (!$tasks)return [];
         $nums = [];
         $sum = 0;

+ 1 - 1
app/Services/WaybillService.php

@@ -219,7 +219,7 @@ class WaybillService
     {
         //替换换行符
         if ($param["dispatch_remark"] ?? false)$param["dispatch_remark"] = str_replace(["\n","\r"], ' ', $param["dispatch_remark"]);
-        if (!$param["destination"]) $param["destination"] = $waybill->destination;
+        if (!($param["destination"] ?? false)) $param["destination"] = $waybill->destination;
         $waybill->fill($param);
         $waybill->update();
         return $waybill;

+ 6 - 0
app/Waybill.php

@@ -65,6 +65,12 @@ class Waybill extends Model
         'total_weight',
         'deliveryType_id',
         "merge_owner",//合并货主ID集
+        'order_type',
+        'transport_type',
+        'pay_type',
+        'back_sign_bill',
+        'package_service',
+        'express_face_list'
     ];
 
     public function district()

+ 32 - 0
database/migrations/2021_08_10_110830_change_express_face_list_column_in_waybills_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeExpressFaceListColumnInWaybillsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            $table->tinyInteger('express_face_list')->default(0)->comment('快递面单 是否打印: 1:是 0:否');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            $table->dropColumn('express_face_list');
+        });
+    }
+}

BIN
resources/images/dbwl/qrCode.jpg


BIN
resources/images/dbwl/revice.png


+ 1 - 0
resources/js/app.js

@@ -9,6 +9,7 @@ window.ElementUI=require('./utilities/tempTip');
 window.getGetVal=require('./utilities/getGetVal');
 window.scanner=require('./utilities/scanner');
 window.datetimeRelating=require('./utilities/datetimeRelating');
+window.lodop=require('./lodop');
 window.Vue.use(window.ElementUI);
 require('bootstrap-select');
 window.Vue.use(require('http-vue-loader'));

BIN
resources/js/lodop/CLodop_Setup_for_Win32NT.exe


+ 133 - 0
resources/js/lodop/LodopFuncs.js

@@ -0,0 +1,133 @@
+var CreatedOKLodop7766=null;
+
+//====判断是否需要安装CLodop云打印服务器:====
+function needCLodop(){
+    try{
+	var ua=navigator.userAgent;
+	if (ua.match(/Windows\sPhone/i) !=null) return true;
+	if (ua.match(/iPhone|iPod/i) != null) return true;
+	if (ua.match(/Android/i) != null) return true;
+	if (ua.match(/Edge\D?\d+/i) != null) return true;
+	if (ua.match(/QQBrowser/i) != null) return false;
+	var verTrident=ua.match(/Trident\D?\d+/i);
+	var verIE=ua.match(/MSIE\D?\d+/i);
+	var verOPR=ua.match(/OPR\D?\d+/i);
+	var verFF=ua.match(/Firefox\D?\d+/i);
+	var x64=ua.match(/x64/i);
+	if ((verTrident==null)&&(verIE==null)&&(x64!==null)) 
+		return true; else
+	if ( verFF !== null) {
+		verFF = verFF[0].match(/\d+/);
+		if ( verFF[0] >= 42 ) return true;
+	} else 
+	if ( verOPR !== null) {
+		verOPR = verOPR[0].match(/\d+/);
+		if ( verOPR[0] >= 32 ) return true;
+	} else 
+	if ((verTrident==null)&&(verIE==null)) {
+		var verChrome=ua.match(/Chrome\D?\d+/i);		
+		if ( verChrome !== null ) {
+			verChrome = verChrome[0].match(/\d+/);
+			if (verChrome[0]>=42) return true;
+		};
+	};
+        return false;
+    } catch(err) {return true;};
+};
+
+//====页面引用CLodop云打印必须的JS文件:====
+if (needCLodop()) {
+	var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
+	var oscript = document.createElement("script");
+	var ishttps = 'https:' == document.location.protocol ? true: false;
+
+	if(ishttps){
+		oscript.src ="https://localhost:8443/CLodopfuncs.js?priority=1";
+		head.insertBefore( oscript,head.firstChild );
+		//本机云打印的后补端口8444:
+		oscript = document.createElement("script");
+		oscript.src ="https://localhost:8444/CLodopfuncs.js?priority=2";
+		head.insertBefore( oscript,head.firstChild );
+	}else{
+		oscript.src ="http://localhost:8000/CLodopfuncs.js?priority=1";
+		head.insertBefore( oscript,head.firstChild );
+		//本机云打印的后补端口8001:
+		oscript = document.createElement("script");
+		oscript.src ="http://localhost:8001/CLodopfuncs.js?priority=2";
+		head.insertBefore( oscript,head.firstChild );
+	}
+	
+	
+};
+
+//====获取LODOP对象的主过程:====
+function getLodop(oOBJECT,oEMBED){
+    var strHtmInstall="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='../lodop/install_lodop32.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtmUpdate="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='../lodop/install_lodop32.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtm64_Install="<br><font color='#FF00FF'>打印控件未安装!点击这里<a href='../lodop/install_lodop64.exe' target='_self'>执行安装</a>,安装后请刷新页面或重新进入。</font>";
+    var strHtm64_Update="<br><font color='#FF00FF'>打印控件需要升级!点击这里<a href='../lodop/install_lodop64.exe' target='_self'>执行升级</a>,升级后请重新进入。</font>";
+    var strHtmFireFox="<br><br><font color='#FF00FF'>(注意:如曾安装过Lodop旧版附件npActiveXPLugin,请在【工具】->【附加组件】->【扩展】中先卸它)</font>";
+    var strHtmChrome="<br><br><font color='#FF00FF'>(如果此前正常,仅因浏览器升级或重安装而出问题,需重新执行以上安装)</font>";
+    var strCLodopInstall="<br><font color='#FF00FF'>CLodop云打印服务(localhostw本地)未安装启动!点击这里<a href='../lodop/CLodop_Setup_for_Win32NT.exe' target='_self'>执行安装</a>,安装后请刷新页面。</font>";
+    var strCLodopUpdate="<br><font color='#FF00FF'>CLodop云打印服务需升级!点击这里<a href='../lodop/CLodop_Setup_for_Win32NT.exe' target='_self'>执行升级</a>,升级后请刷新页面。</font>";
+    var LODOP;
+    try{
+        var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
+        if (needCLodop()) {
+            try{ LODOP=getCLodop();} catch(err) {};
+	    if (!LODOP && document.readyState!=="complete") {/*alert("C-Lodop没准备好,请稍后再试!");*/ return;};
+            if (!LODOP) {
+		 if (isIE) document.write(strCLodopInstall); else
+		  $("#lodopTips").append(strCLodopInstall);
+                 return;
+            } else {
+
+	         if (CLODOP.CVERSION<"2.0.6.8") { 
+			if (isIE) document.write(strCLodopUpdate); else
+			 $("#lodopTips").append(strCLodopUpdate);
+		 };
+		 if (oEMBED && oEMBED.parentNode) oEMBED.parentNode.removeChild(oEMBED);
+		 if (oOBJECT && oOBJECT.parentNode) oOBJECT.parentNode.removeChild(oOBJECT);	
+	    };
+        } else {
+            var is64IE  = isIE && (navigator.userAgent.indexOf('x64')>=0);
+            //=====如果页面有Lodop就直接使用,没有则新建:==========
+            if (oOBJECT!=undefined || oEMBED!=undefined) {
+                if (isIE) LODOP=oOBJECT; else  LODOP=oEMBED;
+            } else if (CreatedOKLodop7766==null){
+                LODOP=document.createElement("object");
+                LODOP.setAttribute("width",0);
+                LODOP.setAttribute("height",0);
+                LODOP.setAttribute("style","position:absolute;left:0px;top:-100px;width:0px;height:0px;");
+                if (isIE) LODOP.setAttribute("classid","clsid:2105C259-1E0C-4534-8141-A753534CB4CA");
+                else LODOP.setAttribute("type","application/x-print-lodop");
+                document.documentElement.appendChild(LODOP);
+                CreatedOKLodop7766=LODOP;
+             } else LODOP=CreatedOKLodop7766;
+            //=====Lodop插件未安装时提示下载地址:==========
+            if ((LODOP==null)||(typeof(LODOP.VERSION)=="undefined")) {
+                 if (navigator.userAgent.indexOf('Chrome')>=0)
+                      $("#lodopTips").append(strHtmChrome);
+                 if (navigator.userAgent.indexOf('Firefox')>=0)
+                      $("#lodopTips").append(strHtmFireFox);
+                 if (is64IE) document.write(strHtm64_Install); else
+                 if (isIE)   document.write(strHtmInstall);    else
+                      $("#lodopTips").append(strHtmInstall);
+                 return LODOP;
+            };
+        };
+        if (LODOP.VERSION<"6.2.0.8") {
+            if (needCLodop())
+             $("#lodopTips").append(strCLodopUpdate); else
+            if (is64IE)  $("#lodopTips").append(strHtm64_Update); else
+            if (isIE)  $("#lodopTips").append(strHtmUpdate); else
+             $("#lodopTips").append(strHtmUpdate);
+            return LODOP;
+        };
+        //===如下空白位置适合调用统一功能(如注册语句、语言选择等):===
+        LODOP.SET_LICENSES("","8547576574263FCEE0D67DA8BFE4BECC","C94CEE276DB2187AE6B65D56B3FC2848","");
+        //===========================================================
+        return LODOP;
+    } catch(err) {alert("getLodop出错:"+err);};
+};
+

BIN
resources/js/lodop/install_lodop32.exe


BIN
resources/js/lodop/install_lodop64.exe


+ 37 - 0
resources/js/lodop/jquery.PrintArea.js

@@ -0,0 +1,37 @@
+// JavaScript Document
+(function($) {
+var printAreaCount = 0;
+$.fn.printArea = function()
+{
+var ele = $(this);
+var idPrefix = "printArea_";
+removePrintArea( idPrefix + printAreaCount );
+printAreaCount++;
+var iframeId = idPrefix + printAreaCount;
+var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
+iframe = document.createElement('IFRAME');
+$(iframe).attr({ style : iframeStyle,
+id    : iframeId
+});
+document.body.appendChild(iframe);
+var doc = iframe.contentWindow.document;
+$(document).find("link")
+.filter(function(){
+return $(this).attr("rel").toLowerCase() == "stylesheet";
+})
+.each(function(){
+doc.write('<link type="text/css" rel="stylesheet" href="' +
+$(this).attr("href") + '" >');
+});
+doc.write('<div class="' + $(ele).attr("class") + '">' + $(ele).html() + '</div>');
+doc.close();
+var frameWindow = iframe.contentWindow;
+frameWindow.close();
+frameWindow.focus();
+frameWindow.print();
+}
+var removePrintArea = function(id)
+{
+$( "iframe#" + id ).remove();
+};
+})(jQuery);

File diff suppressed because it is too large
+ 2 - 0
resources/js/lodop/jquery.js


+ 50 - 0
resources/js/lodop/myAlert.js

@@ -0,0 +1,50 @@
+(function() {
+	$.extend({
+		myAlert: function(options) {//参数格式{title:'Title',message:'message',callback:function(){alert('callback')}}or"需要提示的话"
+			var option={title:"提示",message:"程序员太傻,忘记输入提示内容啦……",callback:function(){}}
+			if(typeof(options)=="string"){
+				option.message=options
+			}else{
+				option=$.extend(option,options);
+			}
+			var top=$(window).height()*0.3;
+			$('body').append('<div class="myModa"><div class="myAlertBox"  style="margin-top:'+top+'px"><h6>'+option.title+'</h6><p>'+option.message+'</p><div class="btn sure">确定</div></div></div>');
+			$('.btn.sure').click(function(){
+				$('.myModa').remove();
+				option.callback();
+			})
+		},
+		myConfirm: function(options) {//参数格式{title:'Title',message:'message',callback:function(){alert('callback')}}or"需要提示的话"$.myConfrim()
+			var option={title:"提示",message:"程序员太傻,忘记输入提示内容啦……",callback:function(){}}
+			if(typeof(options)=="string"){
+				option.message=options
+			}else{
+				option=$.extend(option,options);
+			}
+			var top=$(window).height()*0.3;
+			$('body').append('<div class="myModa"><div class="myAlertBox" style="margin-top:'+top+'px"><h6>'+option.title+'</h6><p>'+option.message+'</p><div class="col2"><div class="col" style="margin-right: 20px;"><div class="btn exit">取消</div></div><div class="col"><div class="btn sure">确定</div></div></div></div></div>');
+			$('.btn.exit').click(function(){
+				$('.myModa').remove();
+			})
+			$('.btn.sure').click(function(){
+				$('.myModa').remove();
+				option.callback();
+			})
+		},
+		myToast:function(message){
+			var top=$(window).height()*0.3;
+			$('body').append('<div class="myToast">'+message+'</div>');
+			console.log($('.myToast').outerWidth())
+			var top=($(window).height()-$('.myToast').height())/2;
+			var left=($('body').width()-$('.myToast').width())/2;
+			$('.myToast').css({'top':top+'px','left':left+'px'});
+			setTimeout(function(){
+				$('.myToast').fadeOut(300);
+				setTimeout(function(){
+					$('.myToast').remove();
+				},300)
+			},1000)
+		}
+	});
+})(jQuery)
+

+ 316 - 0
resources/js/lodop/myPrintKit.js

@@ -0,0 +1,316 @@
+function PrintTable(billList){
+    for (var i = 0; i < billList.length; i++) {
+        var printOrders = billList[i];
+        //如果原发货人,电话不为空,显示原发货人信息,否则现在发货人信息
+        if (printOrders.shipperCompanyName != null
+            && printOrders.shipperCompanyName != ''
+            && printOrders.shipperCompanyPhone != null
+            && printOrders.shipperCompanyPhone != '') {
+            printOrders.shipperTel = printOrders.shipperCompanyPhone;
+            printOrders.shipperName = printOrders.shipperCompanyName;
+            printOrders.saddress = printOrders.shipperCompanyAddress;
+            printOrders.shipperPhone = '';
+        }
+    }
+    var len = $(".waybillNum").length;
+    var wayNum = "";
+    for (var i = 0; i < len; i++) {
+        wayNum += $(".waybillNum")[i].innerText + ",";
+    }
+    wayNum = wayNum.substring(0, wayNum.length - 1);
+    //newPrintWayBill(billList, wayNum); //打印
+    lodopPrintTable(billList, wayNum); //打印
+}
+//当前打印模板
+var htmlTemplateObj = null;
+
+function lodopPrintTable(billList, wayNum){
+    //获取打印模板
+    htmlTemplateObj = $("#printContext");
+    //console.log("shipperName"+htmlTemplateObj.find("span.shipperName").text())
+    var LODOP = null;
+    try{
+        LODOP=getLodop();
+        if ((LODOP!=null)&&(typeof(LODOP.VERSION)!="undefined")){
+            $("#lodopTips").hide();
+        }
+        else{
+            $("#lodopTips").show();
+            return;
+        }
+    }catch(err){
+        $("#lodopTips").show();
+        return;
+    }
+    //打印
+    print(billList, wayNum);
+
+}
+//打印模板
+function templateDataProcess(data, index){
+    Date.prototype.Format = function (fmt) { //author: meizz
+        var o = {
+            "M+": this.getMonth() + 1, //月份
+            "d+": this.getDate(), //日
+            "H+": this.getHours(), //小时
+            "m+": this.getMinutes(), //分
+            "s+": this.getSeconds(), //秒
+            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+            "S": this.getMilliseconds() //毫秒
+        };
+        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+        for (var k in o)
+            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+        return fmt;
+    }
+
+    var printHtml = null;
+    if(data==undefined || data == null || data== ""){
+        return printHtml;
+    }
+
+    htmlTemplateObj.find("span.conPhone").text(data.conPhone);
+    htmlTemplateObj.find("span.conTel").text(data.conTel);
+    htmlTemplateObj.find("span.shipperTel").text(data.shipperTel);
+    htmlTemplateObj.find("span.shipperName").text(data.shipperName);
+    htmlTemplateObj.find("span.shipperPhone").text(data.shipperPhone);
+    htmlTemplateObj.find("span.conName").text(data.conName);
+
+    if(data.caddress.length>42){
+        $('#conMsg').attr('style','border-right:0mm;font-size:8pt;width:90mm;font-family:黑体;font-weight:bold;text-align:left; ');
+        $('#conMsg2').attr('style','font-family:黑体;text-align:left; font-size:8px;font-weight:bold; ');
+
+    }else{
+        $('#conMsg').attr('style','border-right:0mm;font-size:10pt;width:90mm;font-family:黑体;font-weight:bold;text-align:left; ');
+        $('#conMsg2').attr('style','font-family:黑体;text-align:left; font-size:10px;font-weight:bold; ');
+    }
+    htmlTemplateObj.find("span.caddress").text(data.caddress);
+    htmlTemplateObj.find("span.saddress").text(data.saddress);
+    htmlTemplateObj.find("span.cargoName").text(data.cargoName);
+    htmlTemplateObj.find("span.cargoWeight").text(data.cargoWeight);
+    htmlTemplateObj.find("span.refundPayment").text(data.refundPayment);
+
+    if (data.refundPayment > 0) {
+        $("#refundPaymentId").text("代收货款");
+        $('#refundPaymentId').attr('style','border-top:0mm;background:#000000;line-height:72px;font-weight:bold; text-align:center; color:#FFFFFF; font-size:20px;');
+    } else {
+        $("#refundPaymentId").text("");
+        $('#refundPaymentId').attr('style','border-top:0mm;background:#000000;line-height:72px; text-align:center; color:#FFFFFF;');
+    }
+
+    if (data.payType.length > 2) {
+
+        $('#payTypeId').attr('style','border-top:0mm;background:#000000;line-height:72px;font-weight:bold; text-align:center; color:#FFFFFF; font-size:10px;');
+
+    } else {
+
+        $('#payTypeId').attr('style','border-top:0mm;background:#000000;line-height:72px;font-weight:bold; text-align:center; color:#FFFFFF; font-size:20px;');
+
+    }
+    $("#payTypeId").text(data.payType);
+
+    if ("" == data.transType) {
+
+        $('#transTypeId').attr('style','border-top:0mm;background:#FFFFFF;line-height:72px;font-weight:bold; text-align:center; color:#000000; font-size:13px;');
+        htmlTemplateObj.find("span.transType").text("无法匹配");
+
+    } else {
+
+        if (data.transType.length > 4) {
+
+            $('#transTypeId').attr('style','border-top:0mm;background:#FFFFFF;line-height:72px;font-weight:bold; text-align:center; color:#000000; font-size:8px;');
+
+        } else {
+
+            $('#transTypeId').attr('style','border-top:0mm;background:#FFFFFF;line-height:72px;font-weight:bold; text-align:center; color:#000000; font-size:13px;');
+
+        }
+
+        htmlTemplateObj.find("span.transType").text(data.transType);
+    }
+
+    htmlTemplateObj.find("span.destination").text(data.destination);
+    htmlTemplateObj.find("span.billWeight").text(data.billWeight);
+    htmlTemplateObj.find("span.transportCharge").text(data.transportCharge);
+    htmlTemplateObj.find("span.totalCharge").text(data.totalCharge);
+    htmlTemplateObj.find("span.insuranceMoney").text(data.insuranceMoney);
+    htmlTemplateObj.find("span.signSheet").text(data.signSheet);
+    htmlTemplateObj.find("span.outerField1").text(data.outerField1);
+    htmlTemplateObj.find("span.lastOutLoadOrgName").text(data.lastOutLoadOrgName);
+    htmlTemplateObj.find("span.departCityName").text(data.departCityName);
+    htmlTemplateObj.find("span.departCityName").text(data.departCityName);
+    htmlTemplateObj.find("span.secondLoadOrgName").text(data.secondLoadOrgName);
+    htmlTemplateObj.find("span.stationNumber").text(data.stationNumber);
+    htmlTemplateObj.find("span.custOrderLine").text(data.custOrderLine);
+    htmlTemplateObj.find("span.transNote").text(data.transNote);
+
+    if ("" == data.markerPen) {
+
+        $('#markerPen').attr('style','text-align: center; line-height: 13mm; vertical-align: middle;font-size: 35px; font-weight: bold; margin: 0px; padding: 0px;');
+        $("#refundPaymentId").text("无大头笔信息");
+    } else {
+
+        if (data.markerPen.length > 10) {
+
+            $('#markerPen').attr('style','text-align: center; line-height: 13mm; vertical-align: middle;font-size: 18px; font-weight: bold; margin: 0px; padding: 0px;');
+            $("#markerPen").text(data.markerPen);
+        } else {
+
+            $('#markerPen').attr('style','text-align: center; line-height: 13mm; vertical-align: middle;font-size: 35px; font-weight: bold; margin: 0px; padding: 0px;');
+            $("#markerPen").text(data.markerPen);
+        }
+    }
+//	htmlTemplateObj.find("span.markerPen").text(data.markerPen);
+
+
+
+    htmlTemplateObj.find("span.orderNumber").text(data.orderNumber);
+    htmlTemplateObj.find("span.printTime").text(new Date().Format("yyyyMMdd HH:mm:ss"));
+    htmlTemplateObj.find("span.billTime").text(data.billTime.substring(0,10));
+    var cargoCount = data.cargoCount;
+    if(data.cargoCount>1){
+        cargoCount += "-" + (index+1);
+    }
+    htmlTemplateObj.find("span.cargoCount").text(cargoCount);
+
+    //代收账号
+    var account = data.reciveLoanAccount;
+    if (account != null && account != '') {
+        account = account.substring(0, 3) + "*"
+            + account.substring(account.length - 4, account.length);
+    } else {
+        account = "";
+    }
+    htmlTemplateObj.find("span.reciveLoanAccount").text(account);
+
+    if (data.conTel != '' && data.conTel != null) {
+        if (data.conPhone != '' && data.conPhone != null) {
+            htmlTemplateObj.find("span.conTel").text(data.conTel + "/");
+        }
+    }
+    if (data.shipperTel != '' && data.shipperTel != null) {
+        if (data.shipperPhone != ''
+            && data.shipperPhone != null) {
+            htmlTemplateObj.find("span.shipperTel").text(data.shipperTel + "/");
+        }
+    }
+//	return htmlTemplateObj.html();
+}
+/**
+ * 打印
+ * @param list
+ */
+function print(billList, wayNum){
+    for(var i=0; i<billList.length; i++){
+
+        var data = billList[i];
+        data.cargoCount = 1;
+        for(var j=0; j<data.cargoCount; j++){
+
+            var serialNo = data.printSerialNos;
+            if(data.cargoCount>1){
+                serialNo = data.printSerialNos.split(",")[j];
+            }
+            //条码
+            var barcode = data.waybillNumber + serialNo + data.stationNumber;
+
+            var isHideWareHouse  = data.isHideWareHouse;
+
+            //模板数据处理
+            templateDataProcess(data, j);
+            console.log("XXXX: "+ htmlTemplateObj.find("span.shipperName").text())
+            //打印电子运单1
+            printEWaybill(data, serialNo, barcode, wayNum);
+
+            //打印仓库分拣单
+//			if("N"==isHideWareHouse){
+//				printWareHouseWaybill(data, serialNo, barcode);
+//			}
+
+        }
+    }
+    if(billList.length>0){
+        //$.myAlert("本次共打印"+billList.length+"张,已成功添加到打印列表!");
+
+    }else {
+        //$.myAlert('请先勾选需要打印的面单');
+    }
+}
+/**
+ * 打印电子运单
+ * @param data
+ * @param serialNo
+ */
+function printEWaybill(data, serialNo, barcode, wayNum){
+    //打印内容
+    var printHtml = htmlTemplateObj.find("div#expressPrintArea").html();
+
+    LODOP.PRINT_INIT("二级模板");
+    LODOP.SET_PRINT_PAGESIZE(0,"110mm","180mm","CreateCustomPage");
+
+    // LODOP.ADD_PRINT_TEXT(130,30,150,130,$(".markerPenCode").text());
+    // LODOP.ADD_PRINT_TEXT(130,30,150,130,"河南郑州");
+    LODOP.SET_SHOW_MODE("BKIMG_WIDTH","100mm");
+    LODOP.SET_SHOW_MODE("BKIMG_HEIGHT","180mm");
+
+
+    LODOP.ADD_PRINT_TABLE("2mm","0.6mm","95mm","177mm",printHtml);
+    LODOP.ADD_PRINT_BARCODE("79mm","10mm","84mm","15mm","128C", data.waybillNumber);
+    LODOP.ADD_PRINT_BARCODE("117mm","45mm","50mm","8mm","128C", data.waybillNumber);
+
+    //打印
+    LODOP.PREVIEW();
+    //LODOP.PRINT();
+//	LODOP.PRINT_DESIGN();
+
+    //记录打印日志
+    try {
+        printLogses(data);
+    } catch (e) {
+    }
+}
+function printTest(item = '') {
+    var printOrder = {};
+
+    printOrder.waybillNumber = item.waybill_number??'';
+    printOrder.shipperCompanyPhone = item.owner.phone_number;
+    printOrder.shipperCompanyAddress = item.order.warehouse.province.name +'-'+item.order.warehouse.city.name+'-'+item.order.warehouse.county.name+'-'+item.order.warehouse.address
+    printOrder.shipperTel = item.owner.phone_number;
+    printOrder.saddress = item.order.warehouse.province.name +'-'+item.order.warehouse.city.name+'-'+item.order.warehouse.county.name+'-'+item.order.warehouse.address;
+    printOrder.shipperPhone = item.owner.phone_number;
+    printOrder.conPhone = item.order.consignee_phone;
+    printOrder.conTel = item.order.consignee_phone;
+    printOrder.shipperName = item.owner.name;
+    printOrder.conName = item.order.consignee_name;
+    printOrder.caddress = item.order.province+'-'+item.order.city+'-'+item.order.district+'-'+item.order.address;
+    printOrder.cargoName = item.cargo_name;
+    printOrder.cargoWeight = item.total_weight;
+    printOrder.refundPayment = item.is_to_pay ? item.collect_fee : 0;  //代收款
+    printOrder.payType = '月结';
+    printOrder.transType = item.transport_type == "JZQY_LONG" ? '精确汽运' : '精准卡航';
+    printOrder.destination = item.destination_city.name;
+    printOrder.billWeight = item.total_weight;
+    printOrder.transportCharge = item.fee;
+    printOrder.totalCharge = item.charge;
+    printOrder.insuranceMoney = 0; //保价
+    printOrder.signSheet = item.back_sign_bill ? (item.back_sign_bill == 1 ? '签收单原件返回' : '电子签收单' ) : '无需返单';
+    printOrder.outerField1 = '德邦货运'; //受理部门
+    printOrder.lastOutLoadOrgName = '上海市';  //最终外场
+    printOrder.departCityName = '上海市'; //原寄地
+    printOrder.secondLoadOrgName = '上海市';  //第二外场
+    printOrder.stationNumber = 1; //提货网点id
+    printOrder.custOrderLine = item.wms_bill_number;
+    printOrder.transNote = item.ordering_remark;
+    printOrder.markerPen = item.origination;
+    printOrder.orderNumber = item.source_bill;
+    printOrder.billTime = item.order.created_at;
+    printOrder.cargoCount = item.total_number;
+    printOrder.reciveLoanAccount = ''; //代收账号
+    printOrder.printSerialNos = ''; //流水号
+    printOrder.isHideWareHouse = '';
+    printOrder.originalNumber = '';
+
+    var printList = [];
+    printList.push(printOrder);
+    PrintTable(printList);
+}

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

@@ -97,7 +97,7 @@
                 let data = [
                     [
                         {
-                            name: 'requirement_id',
+                            name: 'requirement',
                             type: 'input',
                             tip: '输入任务号',
                             placeholder: '任务号',
@@ -116,7 +116,7 @@
                             ]
                         },
                         {
-                            name: 'creator_id',
+                            name: 'creator',
                             type: 'select',
                             tip: ['输入关键词快速定位下拉列表,回车确定', '选择要显示的状态'],
                             placeholder: '发布人',

+ 2 - 0
resources/views/store/handInStorage/receive.blade.php

@@ -82,6 +82,8 @@
                 asns:[],
                 selectTr:'',
                 isAndroid:false,
+                asnno:'',
+                customerid:'',
             },
             mounted(){
                 if (navigator.userAgent.indexOf("Android")!==-1)this.isAndroid = true;

+ 7 - 2
resources/views/store/handInStorage/receiveDetailPage.blade.php

@@ -27,7 +27,7 @@
                     <div class="form-group row m-1">
                         <label for="quantity" class="text-right">已收/预收数量:</label>
                         <span>&nbsp;&nbsp;&nbsp;</span>
-                        <span id="quantity">@{{ info.receivedqty??0 }}/@{{ info.expectedqty??0 }}</span>
+                        <span id="quantity">@{{ info.receivedqty?info.receivedqty:0 }}/@{{ info.expectedqty?info.expectedqty:0 }}</span>
                     </div>
                     <div class="form-group row m-1">
                         <label for="amount" class="text-right text-danger font-weight-bold">实收数量:</label>
@@ -158,7 +158,7 @@
                 isAndroid:false,
                 isInit:true,
                 element:[
-                    "sku","amount",/*"location",*/"trackNumber"
+                    "sku","amount","trackNumber"
                 ],
                 selectTr:'',
             },
@@ -195,6 +195,8 @@
                         .then(res=>{
                             if (res.data.success){
                                 this.fillInfo(res.data.asnDetail);
+                                if (res.data.asnDetail.lotatt08) this.info.lotatt08=res.data.asnDetail.lotatt08;
+                                if (res.data.asnDetail.lotatt05) this.info.lotatt05=res.data.asnDetail.lotatt05;
                                 this.basSku=res.data.basSku;
                                 this.$forceUpdate()
                                 return;
@@ -214,6 +216,8 @@
                     window.axios.post(url,{asnno:this.asnno,customerid:this.customerid,sku:this.info.sku})
                         .then(res=>{
                             if (res.data.success){
+                                if (res.data.asnDetail.lotatt08) this.info.lotatt08=res.data.asnDetail.lotatt08;
+                                if (res.data.asnDetail.lotatt05) this.info.lotatt05=res.data.asnDetail.lotatt05;
                                 this.basSku=res.data.basSku;
                                 this.$forceUpdate()
                                 return;
@@ -287,6 +291,7 @@
                     this.info.asnno=this.asnno;
                     // if (this.info.trackNumber==''||this.info.trackNumber==null||this.info.trackNumber==undefined)this.info.trackNumber='';
                     if (this.info.location==''||this.info.location==null||this.info.location==undefined)this.info.location='';
+                    if (this.info.lotatt02==''||this.info.lotatt02==null||this.info.lotatt02==undefined)this.info.lotatt02='';
                     if (Number(this.info.receivedqty)===Number(this.info.expectedqty)){
                         window.tempTip.setDuration(2000); window.tempTip.show("收货已完成");
                     }

+ 7 - 0
resources/views/store/inStorage/androidIndex.blade.php

@@ -26,6 +26,13 @@
                 <a href="{{url('store/inStorage/boxBindShelf')}}"><button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>新箱上架</h4></button></a>
                 <a href="{{url('store/inStorage/boxBindModel')}}"><button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>料箱型号</h4></button></a>
                 <a href="{{url('store/inStorage/commodityBindModel')}}"><button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>商品型号</h4></button></a>
+
+    <a href="{{ route('logout') }}" onclick="event.preventDefault();
+                                                     document.getElementById('logout-form').submit();">
+        <button class="btn btn-info w-75 mt-3 text-white" style="height: 60px"><h4>退出登录</h4></button></a>
+    <form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
+        @csrf
+    </form>
             </div>
         </div>
     </div>

+ 23 - 5
resources/views/store/inStorage/halfChestStorage.blade.php

@@ -33,8 +33,13 @@
                             <strong>@{{ errors.amount[0] }}</strong>
                         </span>
                     </div>
+                    <div class="form-group row">
+                        <label for="call" class="col-sm-2 col-3 text-right">手动呼叫:</label>
+                        <input type="checkbox" style="top: 5px" class="switch" id="call" v-model="info.call">
+                    </div>
                     <div class="input-group row mt-5">
-                        <button type="submit" id="submit" class="btn btn-success offset-2 col-8" @click="checkInfo()">提交</button>
+                        <button type="submit" id="submit" class="btn btn-success offset-3 col-6" @click="checkInfo()">提交</button>
+                        <button type="button" class="btn btn-sm btn-info col-2 text-white offset-1" @click="callRobot()">手动呼叫</button>
                     </div>
                 </div>
             </div>
@@ -142,7 +147,7 @@
                 },
                 //提交溢出减量
                 overflowRevision(){
-                    if (!this.ov.station || !this.ov.amount){
+                    if (!this.ov.ide || !this.ov.amount){
                         window.tempTip.show("信息不完整");
                         return;
                     }
@@ -171,11 +176,14 @@
                 _exeTask(){
                     window.tempTip.postBasicRequest("{{url('store/inStorage/acquireBox')}}",this.info,res=>{
                         if (!res.status){
+                            this.info.commodityId = res.commodityId;
                             this.showMaximumModal();
                             return;
                         }
-                        this.info = {track:this.info.track};
+                        this.info = {track:this.info.track,call:this.info.call};
                         this.errors = {};
+                        let element = document.getElementById("barCode");
+                        if (element)element.focus();
                         return res.amount==0 ? "调取料箱成功!" : "空箱不足,剩余”"+res.amount+"“未上架";
                     });
                 },
@@ -192,7 +200,7 @@
                                 case 1:
                                     this.info.lotNum = res.lots;
                                     this.info.maximum = res.lotMap[res.lots];
-                                    break;
+                                    return "最大可上数量为"+this.info.maximum;
                                 default:
                                     this.lots = res.lots;
                                     $("#lotModal").modal("show");
@@ -271,7 +279,9 @@
                         return;
                     }
                     window.tempTip.postBasicRequest("{{url('store/inStorage/setMaximum')}}",
-                        {models:models,commodityId:this.info.commodity_id},()=>{
+                        {models:models,commodityId:this.info.commodityId},()=>{
+                            $("#maximumModal").modal("hide");
+                            this._exeTask();
                     },true);
                 },
                 selectedLot(index){
@@ -279,6 +289,14 @@
                     this.info.maximum = this.lotMap[this.lots[index].lotnum];
                     $("#lotModal").modal("hide");
                 },
+                callRobot(){
+                    window.tempTip.postBasicRequest("{{url('store/inStorage/callRobot')}}",{},()=>{
+                        this.info = {call:this.info.call};
+                        let element = document.getElementById("track");
+                        if (element)element.focus();
+                        return '呼叫成功';
+                    });
+                }
             },
         });
     </script>

+ 268 - 1
resources/views/transport/waybill/index.blade.php

@@ -46,6 +46,10 @@
                         title="合并多条运单至一条,已填写信息将被累加处理" @click="waybillMerge()">运单合并</button>
             <button class="btn btn-sm btn-outline-info tooltipTarget"
                     title="将已合并运单拆分返回原状态" @click="waybillSplit()">拆单返回</button>
+                @if($uriType=='' || $uriType=='德邦物流')
+                    <button class="btn btn-sm btn-outline-info tooltipTarget"
+                        title="打印快递面单" @click="expressFaceList()">打印快递面单</button>
+                @endif
             @endcan
             <div>
                 @if(Session::has('successTip'))
@@ -241,8 +245,241 @@
         </div>
     </div>
 
-@endsection
+{{--    德邦面单--}}
+    <div id="lodopTips"></div>
+    <div id="printContext" class="ordercontent"
+         style="margin-top: 15px; width: 630px; height: 665px; float: left; overflow-y: auto; text-align: center; display:none">
+        <div id="expressPrintArea">
+            <style>
+                .wayBill li {
+                    float: left;
+                    width: 85px;
+                }
+
+                .wayBill li a:hover {
+                    color: blue;
+                }
+
+                .wayBill li a {
+                    color: blue;
+                }
+                #expressPrintArea {
+                    width: 100mm;
+                    height: 180mm;
+                    margin-left: 100px;
+                    /*  float: left; */
+                    /* background: url('../images/order/lttBackground.jpg') no-repeat; */
+                    background-size: 104mm 175mm;
+                    padding: 4mm 0.5mm 0.5mm 2.3mm;
+                }
+                td {
+                    border: 0.15mm solid #cecece;
+                    padding-left: 1mm;
+                    font-size: 12px;
+                    font-family: 宋体;
+                    vertical-align: middle;
+                    text-align: left;
+                }
+                tr {
+                    width: 100%;
+                    border-left:0mm;
+                    border-right:0mm;
+                    border: 0.2mm solid #000000;
+                }
+                .singlePlane{
+                    font-size: 7pt;
+                    width:60mm;
+                    font-family:黑体;
+                    text-align:left;
+                    valign:top;
+                }
+                .sign{
+                    font-size:8pt;
+                    width:60mm;
+                    font-family:黑体;
+                    text-align:right;
+                    line-height: 5mm;
+                    padding-top: 2mm;
+                }
+                .singlePlane2{
+                    font-size:7pt;
+                    width:99mm;
+                    font-family:黑体;
+                    text-align:left;
+                    valign:top;
+                    padding-left: 1mm;
+                    padding-right: 1mm;
+                }
+                .houseCode td{
+                    font-size:17px;width:20mm;font-family:黑体; font-weight:bold; text-align:center;
+                }
+                .originalNumber {
+                    font-size: 15px;
+                    font-weight: bold;
+                }
+
+                #cargoName {
+                    font-size:  16px;
+                    font-weight: bold;
+                }
+                #transNote {
+                    font-weight: bold;
+                }
+                #transNote {
+                    font-size:  10px;
+                }
+
+                .top-amount td span, .top-amount td strong, .outerField1, .signSheet {
+                    font-size: 10px !important;
+                    font-family: "黑体";
+                }
+
+            </style>
+            <%-- <div style="width: 20mm;height: 20mm;/* background-color: #fff; */text-align: center;line-height: 20mm;position: absolute; left:50mm; top:60mm;">
+                <span class="markerPenCode" style=" display: inline-block; color: #666;font-size: 40mm;font-weight: bold;transform:rotate(-30deg);opacity: 0.5;">A5</span>
+            </div> --%>
+            <span class="markerPenCode" style="
+        /*display: none;*/
+"></span>
+            <table border="2" style="width: 99mm;border-collapse:collapse;">
+                <%--==================================上联=============================================--%>
+                <tr class="tr1" style="height: 0mm; border: none;">
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="10mm"></td>
+                    <td width="5mm"></td>
+                </tr>
+                <%--德邦--%>
+                <tr style="height: 14mm;">
+                    <td colspan="3"></td>
+                    <td valign="middle" colspan="3" style="border-top:0mm;background:white;color:black;line-height:72px;font-weight:bold; text-align:center; font-size:20px;" id="refundPaymentId"></td>
+                    <td valign="middle" colspan="2" style="border-top:0mm;background:black;color:white;line-height:72px;font-weight:bold; text-align:center; font-size:20px;" id="payTypeId"></td>
+                    <td valign="middle" colspan="2" style="border-top:0mm;background:white;color:black;line-height:72px;font-weight:bold; text-align:left; font-size:13px;" id = "transTypeId">
+                        <span class=transType></span></td>
+                </tr>
+                <%--金额--%>
+                <tr style="height: 11mm;" class="top-amount">
+                    <td colspan="4" style="width: 30mm; vertical-align: middle; border-right: 0px;">
+                        <span style="padding-bottom: 1.5mm;"><strong>代收金额:</strong></span><span
+                            class="refundPayment">20000</span><br/>
+                    </td>
+                    <td colspan="6" style="width: 50mm; vertical-align: middle; border-left: 0px;">
+                        <span style="padding-bottom: 1.5mm;"><strong>保价金额:</strong></span><span
+                            class="insuranceMoney">22</span><br/>
+                        <span style="padding-bottom: 1.5mm;"><strong>签单返回:</strong></span><span
+                            class="signSheet"></span><br/>
+                        <span style="padding-bottom: 1.5mm;"><strong>始发网点:</strong></span><span
+                            class="outerField1" style="font-size: 8px;"></span><br/>
+                    </td>
+                </tr>
+                <%--大头笔--%>
+                <tr style="height: 14mm;" >
+                    <td colspan="10" style="text-align: center; line-height: 13mm; vertical-align: middle;font-size: 35px; font-weight: bold; margin: 0px; padding: 0px;" id="markerPen">
+                        无大头笔信息
+                    </td>
+                </tr>
 
+                <%--收件人--%>
+                <tr style="height: 14mm;">
+                    <td colspan="1" style="border-right:0mm;font-size:10px;width:10mm;font-family:黑体;text-align:center;"><img
+                            src="{{URL::asset('./images/dbwl/revice.png')}}"/></td>
+                    <td colspan="9"
+                        style="border-right:0mm;font-size:10pt;width:90mm;font-family:黑体;font-weight:bold;text-align:left; " id="conMsg">
+                        <span class="conName">张小二</span>&nbsp;&nbsp;
+                        <span class="conPhone">(优先取手机号取不到取固话)</span>&nbsp;&nbsp;&nbsp;<span class="conTel"></span><br/>
+                        <span class="caddress">上海市青浦区徐泾镇明珠路10181号</span>
+                    </td>
+                </tr>
+                <%--寄件人--%>
+                <tr style="height: 11mm;">
+                    <td colspan="1" style="border-right:0mm;font-size:25px;width:10mm;font-family:黑体;font-weight:bold;text-align:center;">
+                        寄
+                    </td>
+                    <td colspan="9"
+                        style="border-right:0mm;font-size:8pt;width:90mm;font-family:黑体;text-align:left;">
+                        <span class="shipperName">张小二</span>&nbsp;&nbsp;&nbsp;
+                        <span class="shipperPhone">400-617-9999</span><br/>
+                        <span class="saddress">寄件人地址</span>
+                    </td>
+                </tr>
+                <%--运单号条码--%>
+                <tr style="height: 23mm;">
+                    <td colspan="10"></td>
+                </tr>
+                <%--打印时间验视--%>
+                <tr style="height: 18mm; text-align: left;">
+                    <td colspan="2" valign="bottom" colspan="2" style="text-align:left;font-size:12px;font-family:黑体;width:20mm;border-right:0mm;">
+                    <span class="printTime">
+                    </span><br/>
+                        打印时间
+                    </td>
+                    <td colspan="6">
+                        <div class = "singlePlane">
+                            快件送达收件人地址,经收件人或收件人(寄件人)允许的代收人签字,视为送达。您的签字代表您已经签收次包裹,并已确定商品信息无损,包装完好、没有划痕、破损等表面质量问题。
+                            <br/>
+                        </div>
+                        <div class="sign">
+                            签收栏
+                        </div>
+                    </td>
+                    <td valign="bottom" colspan="2" style="text-align:center;font-size:12px;width:20mm;font-family:黑体;border-right:0mm;">
+                        已验视
+                    </td>
+                </tr>
+                <%--==================================下联=============================================--%>
+                <%--德邦图标--%>
+                <tr style="height: 12mm;" >
+                    <td colspan="4" align="center"></td>
+                    <td colspan="6" align="center">
+                    </td>
+                </tr>
+                <%--收件人--%>
+                <tr style="height: 10mm;">
+                    <td  colspan="1"style="border-right:0mm;font-family:黑体;font-size:11pt;text-align:center;"> <img src="{{URL::asset('./images/dbwl/revice.png')}}" /></td>
+                    <td  colspan="7"style="font-family:黑体;text-align:left; font-size:10px;font-weight:bold;" id="conMsg2">
+                        <span class="conName">张小二</span>&nbsp;&nbsp;
+                        <span class="conPhone">(优先取手机号取不到取固话)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                        <span class="conTel"></span><br/><span class="caddress">上海市青浦区徐泾镇明珠路1018号</span></td>
+                    <%--<td  rowspan="2" valign="bottom">  <!-- <img src="../images/order/deppon_qrcode.jpg" /> --> </td>--%>
+                    <td valign="bottom" rowspan="2" style="width:180mm;border-right:0mm;">
+                        <img src="{{URL::asset('./images/dbwl/qrCode.jpg')}}" style="width: 18mm; height: 18mm" />
+                    </td>
+                </tr>
+                <%--寄件人--%>
+                <tr style="height: 10mm;">
+                    <td  colspan="1"style="font-weight:bold;border-right:0mm;font-family:黑体;font-size:14pt;width:10mm;text-align:center;">寄</td>
+                    <td  colspan="7"style="font-family:黑体;text-align:left; font-size:7pt;width:70mm">
+                        <span class="shipperName">张小二</span>&nbsp;&nbsp;&nbsp;
+                        <span class="shipperPhone">400-617-9999</span><br/>
+                        <span class="saddress">酒仙网电子商务股份有限公司</span>
+                </tr>
+                <tr style="text-align: left;">
+                    <td colspan="10">
+                        <div class="singlePlane2" style="height: 5mm; max-height: 5mm;">
+                            客户订单号:<span class="originalNumber"></span>
+                        </div>
+                        <div class="singlePlane2" style="height: 10mm; max-height: 10mm;">
+                            货物品名:<span id="cargoName" class="cargoName"></span>
+                        </div>
+                        <div class="singlePlane2" style="height: 11mm; max-height: 11mm;">
+                            备注:<span class="transNote" id="transNote"></span>
+                        </div>
+                        <div class="singlePlane2" style="height: 2mm; max-height: 2mm;">
+                            <!--                        <%&#45;&#45;用户订单号:<span class="orderNumber"></span>&#45;&#45;%>-->
+                            用户订单号:<span class="orderNumber"></span>
+                        </div>
+                    </td>
+                </tr>
+            </table>
+        </div>
+    </div>
+@endsection
 
 @section('lastScript')
     <style type="text/css">
@@ -293,6 +530,12 @@
     <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 type="text/javascript" src="{{mix('js/lodop/jquery.js')}}"></script>--}}
+    <script type="text/javascript" src="{{URL::asset('js/lodop/jquery.PrintArea.js')}}"></script>
+    <script type="text/javascript" src="{{URL::asset('js/lodop/LodopFuncs.js')}}"></script>
+    <script type="text/javascript" src="{{URL::asset('js/lodop/myAlert.js')}}"></script>
+    <script type="text/javascript" src="{{URL::asset('js/lodop/myPrintKit.js')}}"></script>
     <script>
         let vue = new Vue({
             el:'#list',
@@ -393,6 +636,7 @@
                 selectTr:'',
                 dailyBilling:{screenDate:'', billing:''},
                 error:{screenDate:'', billing:''},
+                expresss:[{name:1,value:'是'},{name:0,value:'否'}]
             },
             mounted:function(){
                 $(".tooltipTarget").tooltip({'trigger':'hover'});
@@ -427,6 +671,7 @@
                         {name:'logistic',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的承运商'],
                             placeholder:['承运商','定位或多选承运商'],data:this.logistics},
                         {name:'carType_id',type:'select',placeholder: '车型',data:this.carTypes},
+                        {name:'express_face_list',type:'select',placeholder: '快递面单是否打印',data:this.expresss},
                     ]
                 ];
                 let param=[];
@@ -483,6 +728,28 @@
                         });
                     })
                 },
+                //快递面单打印
+                expressFaceList(){
+                    if (checkData.length<1){
+                        window.tempTip.setDuration(2000);
+                        window.tempTip.show("未选择任何记录");
+                        return;
+                    }
+                    window.tempTip.confirm("确定要打印快递面单吗?",()=>{
+                        window.tempTip.setDuration(99999);
+                        window.tempTip.waitingTip("打印中,请稍等...");
+                        window.tempTip.postBasicRequest("{{url('transport/waybill/expressFaceList')}}",{ids:checkData},res=>{
+                            window.tempTip.cancelWaitingTip();
+                            window.tempTip.setDuration(2000);
+                            console.log(res);
+                            res.forEach((item, index)=>{
+                                console.log(item);
+                                //window.myPrintKit.printTest(item);
+                                printTest(item)
+                            })
+                        });
+                    })
+                },
                 rendingFloatBtn(){
                     let parent = $('.pick-btn :visible');
                     if (parent.length<1)return;

+ 2 - 0
routes/web.php

@@ -380,6 +380,7 @@ Route::group(['middleware'=>'auth'],function ($route){
             Route::post('waybillSplit','WaybillController@waybillSplit');
             Route::resource('waybillFinancialSnapshot','WaybillFinancialSnapshotsController');
             Route::resource('waybillFinancialExcepted','WaybillFinancialExceptedController');
+            Route::post('expressFaceList','WaybillController@expressFaceList');
         });
         Route::resource('waybill','WaybillController');
     });
@@ -489,6 +490,7 @@ Route::group(['middleware'=>'auth'],function ($route){
             Route::post('settingCommodityMaximum','StorageController@settingCommodityMaximum');
             Route::post('checkTask','StorageController@checkTask');
             Route::post('changeAsnRule','StorageController@changeAsnRule');
+            Route::post('callRobot','StorageController@callRobot');
         });
         Route::group(['prefix'=>'handInStorage'],function() {
             Route::get('receive',function (){return view('store.handInStorage.receive');});//收货页面

+ 10 - 0
webpack.mix.js

@@ -35,4 +35,14 @@ mix.js('resources/js/elementUi.js','public/js/element-ui.js')
 mix.copy("resources/sass/animation.css",'public/css/animation.css');
 mix.js("resources/js/marked.js", "public/js/marked.js");
 
+//德邦快递
+mix.js('resources/js/lodop/jquery.js','public/js/lodop/jquery.js')
+mix.js('resources/js/lodop/jquery.PrintArea.js','public/js/lodop/jquery.PrintArea.js')
+mix.js('resources/js/lodop/LodopFuncs.js','public/js/lodop/LodopFuncs.js')
+mix.js('resources/js/lodop/myAlert.js','public/js/lodop/myAlert.js')
+mix.js('resources/js/lodop/myPrintKit.js','public/js/lodop/myPrintKit.js')
+mix.copy('resources/js/lodop/install_lodop32.exe','public/js/lodop/install_lodop32.exe')
+mix.copy('resources/js/lodop/install_lodop64.exe','public/js/lodop/install_lodop64.exe')
+mix.copy('resources/js/lodop/CLodop_Setup_for_Win32NT.exe','public/js/lodop/CLodop_Setup_for_Win32NT.exe')
+
 mix.version();

Some files were not shown because too many files changed in this diff