소스 검색

Merge branch 'zzd' of ssh://was.baoshi56.com:10022/var/git/bswas

LD 4 년 전
부모
커밋
cfbac3a79d

+ 1 - 21
app/Console/Commands/CheckCacheRackStorage.php

@@ -46,26 +46,6 @@ class CheckCacheRackStorage extends Command
                 ->where("status","!=","完成")->whereIn("station_id",Station::query()->select("id")->where("station_type_id",5)
                     ->whereNotNull("parent_id"))->groupBy("station_id"))
             ->get();
-        $collection = new Collection();
-        $stationCollection = new Collection();
-        $blacklist = [];
-        foreach ($stations as $station){
-            $box = app("MaterialBoxService")->getAnEmptyBox($blacklist);
-            if (!$box)continue;
-            $task = StationTask::query()->create([
-                'status' => "待处理",
-                'station_id' => $station->id,
-            ]);
-            $collection->add(StationTaskMaterialBox::query()->create([
-                'station_id' => $station->id,
-                'material_box_id'=>$box->id,
-                'status'=>"待处理",
-                'type' => '取',
-                'station_task_id' => $task->id,
-            ]));
-            $stationCollection->add($station->code);
-            $blacklist[] = $box->id;
-        }
-        app("ForeignHaiRoboticsService")->fetchGroup_multiLocation($stationCollection,$collection,'','立架出至缓存架');
+        app("StorageService")->paddingCacheShelf($stations);
     }
 }

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

@@ -86,15 +86,7 @@ class OrderController extends Controller
             "SKU"=>"产品代码","ALTERNATE_SKU1"=>"产品条码","ORDERDETAILCODENAME"=>"明细状态","DESCR_C"=> "产品名称",
             "QTYORDERED"=>"订单数量","CHECKTIME"=>"复核时间","ERPCANCELFLAG"=>"接口取消标记",
             "PICKING_PRINT_FLAG"=>"拣货单打印标记","EDISENDFLAG"=>"接口回传标记","EDIREMARKS2"=>"接口回传异常备注",
-            "RELEASESTATUS"=>"订单冻结"])->direct();
-        /*$post = Http::post(config('go.export.url'),$req);
-        if ($post->status() == 500){
-            throw new Exception($post->header("Msg"));
-        }
-        return response($post,200, [
-            "Content-type"=>"application/octet-stream",
-            "Content-Disposition"=>"attachment; filename=订单记录-".date('ymdHis').'.xlsx',
-        ]);*/
+            "RELEASESTATUS"=>"订单冻结"],["ADDTIME"=>"date","EDISENDTIME2"=>"date"])->direct();
     }
 
     public function createRejectedBill(Request $request){

+ 39 - 0
app/Http/Controllers/StorageController.php

@@ -5,6 +5,10 @@ namespace App\Http\Controllers;
 use App\Components\AsyncResponse;
 use App\MaterialBox;
 use App\Services\LogService;
+use App\Station;
+use App\StationTask;
+use App\StationTaskMaterialBox;
+use App\Storage;
 use App\ValueStore;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\DB;
@@ -180,4 +184,39 @@ sql;
     {
         ValueStore::query()->select("value")->where("name","flux_tr_number")->update(["value"=>DB::raw("flux_tr_number+1")]);
     }
+
+    /**
+     * 重置缓存架指定格口
+     */
+    public function resetCacheShelf()
+    {
+        $boxes = request("boxes");
+        //清理任务
+        $data = '';
+        $station = Station::query()->select("id")->whereIn("code",$boxes);
+        $occupy = Storage::query()->with("station:id,code")->whereIn("station_id",$station)->where("status",1)->get();
+        foreach ($occupy as $item){
+            unset($boxes[array_search($item->station->code,$boxes)]);
+            $data .= '“'.$item->station->code.'”,';
+        }
+        if ($occupy->count()>0){
+            $data .= "存在任务待处理,无法释放";
+            $boxes = array_values($boxes);
+            $station = Station::query()->select("id")->whereIn("code",$boxes);
+        }
+        $task = StationTask::query()->select("id")->where("status","!=",'完成')->whereIn("station_id",$station);
+        StationTaskMaterialBox::query()->where("status","!=",'完成')->whereIn("station_task_id",$task)->update([
+            "status" => "完成"
+        ]);
+        StationTask::query()->where("status","!=",'完成')->whereIn("station_id",$station)->update([
+            "status" => "完成"
+        ]);
+        //清理库存
+        Storage::query()->whereIn("station_id",$station)->update([
+            "status" => 0,"material_box_id" => null, "commodity_id" => null, "amount" => 0,
+        ]);
+        //重新调取料箱
+        //app("StorageService")->paddingCacheShelf($station->get());
+        $this->success(["data"=>$data,"boxes"=>$boxes]);
+    }
 }

+ 7 - 1
app/Http/Controllers/StoreController.php

@@ -6,6 +6,8 @@ use App\Depository;
 use App\Owner;
 use App\Services\common\BatchUpdateService;
 use App\Services\StoreService;
+use App\Station;
+use App\Storage;
 use App\Store;
 use App\StoreItem;
 use App\Warehouse;
@@ -438,6 +440,10 @@ class StoreController extends Controller
      */
     public function cacheRackStorage()
     {
-        return \view("store.inStorage.cacheRackStorage");
+        $stations = Station::query()->select("id")->where("parent_id",6);
+        $storages = Storage::query()->with("station:id,code")->whereIn("station_id",$stations)->where(function (Builder $query){
+            $query->whereNotNull("material_box_id")->orWhere("status",1);
+        })->get();
+        return \view("store.inStorage.cacheRackStorage",compact("storages"));
     }
 }

+ 33 - 0
app/Services/StorageService.php

@@ -2,14 +2,47 @@
 
 namespace App\Services;
 
+use App\StationTask;
+use App\StationTaskMaterialBox;
 use App\Traits\ServiceAppAop;
 use App\Storage;
+use Illuminate\Support\Collection;
 
 class StorageService
 {
     use ServiceAppAop;
     protected $modelClass=Storage::class;
 
+
+    /**
+     * 填充缓存架
+     *
+     * @param \Illuminate\Database\Eloquent\Collection $stations
+     */
+    public function paddingCacheShelf($stations)
+    {
+        $collection = new Collection();
+        $stationCollection = new Collection();
+        $blacklist = [];
+        foreach ($stations as $station){
+            $box = app("MaterialBoxService")->getAnEmptyBox($blacklist);
+            if (!$box)continue;
+            $task = StationTask::query()->create([
+                'status' => "待处理",
+                'station_id' => $station->id,
+            ]);
+            $collection->add(StationTaskMaterialBox::query()->create([
+                'station_id' => $station->id,
+                'material_box_id'=>$box->id,
+                'status'=>"待处理",
+                'type' => '取',
+                'station_task_id' => $task->id,
+            ]));
+            $stationCollection->add($station->code);
+            $blacklist[] = $box->id;
+        }
+        app("ForeignHaiRoboticsService")->fetchGroup_multiLocation($stationCollection,$collection,'','立架出至缓存架');
+    }
     /**
      * 标记指定库位为占用
      *

+ 6 - 2
app/Storage.php

@@ -23,12 +23,16 @@ class Storage extends Model
         1 => "占用",
     ];
 
+    public function station()
+    {   //货架
+        return $this->belongsTo(Station::class);
+    }
     public function materialBox()
     {   //料箱
-        $this->belongsTo(MaterialBox::class);
+        return $this->belongsTo(MaterialBox::class);
     }
     public function commodity()
     {   //商品
-        $this->belongsTo(Commodity::class);
+        return $this->belongsTo(Commodity::class);
     }
 }

+ 1 - 0
resources/views/store/deliveryAppointment/list.blade.php

@@ -116,6 +116,7 @@
                             <div class="col-2 text-secondary">@{{ info.cars[0].driver_phone }}</div>
                             <div class="col-3">
                                 @can("入库管理-入库预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,0)" v-if="info.cars[0].status==1">卸货完成</button>@endcan
+                                @can("入库管理-入库预约-预约管理-签到")<button class="btn btn-sm btn-outline-success" @click="signIn(i,0)" v-if="info.cars[0].status==0">签到</button>@endcan
                                 <div v-if="info.cars[0].status==2">@{{ info.cars[0].delivery_time }}</div>
                             </div>
                         </div>

+ 63 - 1
resources/views/store/inStorage/cacheRackStorage.blade.php

@@ -8,7 +8,7 @@
     </span>
     <div class="container-fluid" id="container">
         <div class="row">
-            <div class="card offset-md-3 col-md-6 col-sm-12">
+            <div class="card offset-md-1 col-md-5 col-sm-12">
                 <div class="card-body">
                     <div class="form-group text-center font-weight-bold h4">
                         入库信息
@@ -46,6 +46,41 @@
                     </div>
                 </div>
             </div>
+            <div class="card col-md-5 col-sm-12">
+                <div class="card-body">
+                    <div class="mt-1 text-center">
+                        <button class="btn btn-primary" @click="submitBox()">为选中格口手动补充料箱</button>
+                    </div>
+                    <div class="mt-2 h-75">
+                        <table class="table table-sm table-bordered border-dark w-100 h-100 text-center" style="cursor: pointer">
+                            <tr>
+                                <th :class="[shelfOccupy['HAIB1-03-03'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-03-03'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-03-03')">HAIB1-03-03</th>
+                                <th :class="[shelfOccupy['HAIB1-02-03'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-02-03'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-02-03')">HAIB1-02-03</th>
+                                <th :class="[shelfOccupy['HAIB1-01-03'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-01-03'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-01-03')">HAIB1-01-03</th>
+                            </tr>
+                            <tr>
+                                <th :class="[shelfOccupy['HAIB1-03-02'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-03-02'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-03-02')">HAIB1-03-02</th>
+                                <th :class="[shelfOccupy['HAIB1-02-02'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-02-02'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-02-02')">HAIB1-02-02</th>
+                                <th :class="[shelfOccupy['HAIB1-01-02'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-01-02'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-01-02')">HAIB1-01-02</th>
+                            </tr>
+                            <tr>
+                                <th :class="[shelfOccupy['HAIB1-03-01'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-03-01'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-03-01')">HAIB1-03-01</th>
+                                <th :class="[shelfOccupy['HAIB1-02-01'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-02-01'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-02-01')">HAIB1-02-01</th>
+                                <th :class="[shelfOccupy['HAIB1-01-01'] ? 'bg-danger' : 'bg-success',selectedBox['HAIB1-01-01'] ? 'box-shadow-dark' : '']"
+                                    @click="fillingBox('HAIB1-01-01')">HAIB1-01-01</th>
+                            </tr>
+                        </table>
+                    </div>
+                </div>
+            </div>
         </div>
     </div>
 @stop
@@ -65,13 +100,40 @@
                     ide:"",
                 },
                 errors:{},
+                shelfOccupy:{},
+                selectedBox:{},
             },
             mounted(){
+                @foreach($storages as $storage)this.$set(this.shelfOccupy,"{{$storage->station->code}}",true);@endforeach
                 this.codeFocus();
                 this.globalClick();
                 this.createBefore();
             },
             methods:{
+                //选中填充料箱
+                fillingBox(ideCode){
+                    this.$set(this.selectedBox,ideCode,this.selectedBox[ideCode] ? !this.selectedBox[ideCode] : true);
+                },
+                //提交填充料箱
+                submitBox(){
+                    window.tempTip.setDuration(3000);
+                    if (JSON.stringify(this.selectedBox)==='{}'){window.tempTip.show("未选中格口");return;}
+                    window.tempTip.confirm("确定选中格口已无料箱存在?",()=>{
+                        let boxes = [];
+                        for (let key in this.selectedBox)boxes.push(key);
+                        window.tempTip.postBasicRequest("{{url('store/inStorage/resetCacheShelf')}}",{boxes:boxes},res=>{
+                            for (let i=0;i<res.boxes.length;i++){
+                                this.$set(this.shelfOccupy,res.boxes[i],false);
+                                this.$set(this.selectedBox,res.boxes[i],false);
+                            }
+                            if (res.data){
+                                window.tempTip.show(res.data);
+                                return;
+                            }
+                            return "手动补充成功";
+                        },true);
+                    })
+                },
                 //聚焦 白名单
                 codeFocus(){
                     if (!this.permissionList.includes(document.activeElement.id)) document.getElementById("barCode").focus();

+ 3 - 3
resources/views/transport/waybill/index.blade.php

@@ -417,7 +417,7 @@
                             placeholder:['承运商','定位或多选承运商'],data:this.logistics},
                     ],
                     [
-                        {name:'source_bill',type:'input',tip: '可支持多上游单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '上游单号'},
+                        {name:'source_bill',type:'input',tip: '可支持多客户订单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '客户订单号'},
                         {name:'recipient',type:'input',tip: '可支持多收货人姓名:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人姓名'},
                         {name:'recipient_mobile',type:'input',tip: '可支持多收货人电话:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人电话'},
                         {name:'car_owner_info',type:'input',tip: '车辆信息:可在左侧增加百分号(%)进行模糊搜索',placeholder: '车辆信息'},
@@ -530,7 +530,7 @@
                         {name:'operating',value: '操作记录', class:"td-warm"},
                         {name:'type',value: '运单类型', class:"td-warm"},
                         {name:'owner',value: '货主', class:"td-warm"},
-                        {name:'source_bill',value: '上游单号', class:"td-warm"},
+                        {name:'source_bill',value: '客户订单号', class:"td-warm"},
                         {name:'wms_bill_number',value: 'WMS订单号', class:"td-warm"},
                         {name:'order_status',value: '订单状态', class:"td-warm"},
                         {name:'end_date',value: '完结时间', class:"td-warm"},
@@ -715,7 +715,7 @@
                 },
                 commonImg(id,uploadFiles){
                     let div = "";
-                    let isBtn = 0+@can('运输管理-运单-图片删除1')1 @endcan > 0;
+                    let isBtn = '@can('运输管理-运单-图片删除') true @endcan ';
                     for(let i=0;i<uploadFiles.length;i++){
                         let btn = isBtn ? "<button type='button' class='btn btn-sm btn-danger' onclick='vue.btnDeleteImg(this)' data-url='"+uploadFiles[i].url+"' value='"+id+"' style='position: relative;float: right;margin-top: -30px;' >删除</button>" : "";
                         let href = this.imgPrefix+uploadFiles[i].url+'-bulky.'+uploadFiles[i].type;

+ 1 - 0
routes/web.php

@@ -416,6 +416,7 @@ Route::group(['prefix'=>'store'],function(){
         Route::get('index','StoreController@storage');
         Route::get('cacheRackStorage','StoreController@cacheRackStorage');
         Route::post('putShelf','StorageController@putShelf');
+        Route::post('resetCacheShelf','StorageController@resetCacheShelf');
     });
     Route::group(['prefix'=>'fast'],function() {
         Route::resource('storeItem','StoreItemController');