ソースを参照

入库预约,用仓报表

Zhouzhendong 5 年 前
コミット
24bce99ddd

+ 1 - 1
app/DeliveryAppointment.php

@@ -41,7 +41,7 @@ class DeliveryAppointment extends Model
         0 => "待收",
         1 => "取消",
         2 => "完成",
-        3 => "未送达",
+        3 => "已逾期",
     ];
     protected $appends=[
         "period"

+ 9 - 1
app/Events/DeliveryAppointmentEvent.php

@@ -5,6 +5,7 @@ namespace App\Events;
 use App\DeliveryAppointmentCar;
 use Illuminate\Broadcasting\Channel;
 use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
+use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
 
@@ -22,8 +23,15 @@ class DeliveryAppointmentEvent implements ShouldBroadcast
      */
     public function __construct(DeliveryAppointmentCar $delivery)
     {
+        $delivery->load(["deliveryAppointment"=>function($query){
+            /** @var Builder $query */
+            $query->withCount("cars");
+        }]);
+        $count = $delivery->deliveryAppointment->cars_count ?? 0;
         $delivery->warehouse = $delivery->deliveryAppointment->warehouse_id ?? "";
-        $this->delivery = $delivery;
+        $delivery->cubic_meter = isset($delivery->deliveryAppointment->cubic_meter) ? ($count>1 ? $delivery->deliveryAppointment->cubic_meter."/".$count : $delivery->deliveryAppointment->cubic_meter) : "";
+        $delivery->tonne = isset($delivery->deliveryAppointment->tonne) ? ($count>1 ? $delivery->deliveryAppointment->tonne."/".$count : $delivery->deliveryAppointment->tonne) : "";
+        $this->delivery = $delivery->withoutRelations();
     }
 
     /**

+ 46 - 5
app/Http/Controllers/DeliveryAppointmentController.php

@@ -8,6 +8,7 @@ use App\DeliveryAppointment;
 use App\DeliveryAppointmentCar;
 use App\Events\DeliveryAppointmentEvent;
 use App\Imports\AppointmentDetail;
+use App\Jobs\DeliveryAppointmentCheck;
 use App\Services\common\ExportService;
 use App\Warehouse;
 use Carbon\Carbon;
@@ -163,6 +164,7 @@ class DeliveryAppointmentController extends Controller
             }
             DeliveryAppointmentCar::query()->insert($insert);
         });
+        dispatch(new DeliveryAppointmentCheck($appointment->id))->delay(Carbon::parse($appointment->appointment_date." ".(explode("-",DeliveryAppointment::PERIOD[$appointment->date_period])[1]).":00:01"));
         //md5加密在密文第五位后插入
         $md5 = substr_replace(md5(date("m-d")),$appointment->id,5,0);
         $this->success(["key"=>$md5]);
@@ -293,9 +295,10 @@ class DeliveryAppointmentController extends Controller
      */
     public function getExhibitionList()
     {
-        $this->gate("入库管理-入库预约-预约管理");
+        $this->gate("入库管理-入库预约-入库区终端");
         $list = [];
         $hour = date("H");
+        $warehouse = request("warehouse");
         $index = null;
         foreach (DeliveryAppointment::PERIOD as $key=>$period){
             $arr = explode("-",$period);
@@ -306,8 +309,10 @@ class DeliveryAppointmentController extends Controller
             }
         }
         if ($index===null)$this->success();
-        DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function (Builder $query)use($index){
-            $query->where("appointment_date",date("Y-m-d"))->whereIn("status",[0,2]);
+        DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function ($query)use($index,$warehouse){
+            /** @var Builder $query */
+            $query->withCount("cars")->where("appointment_date",date("Y-m-d"))
+                ->where("warehouse_id",$warehouse)->whereIn("status",[0,2]);
         })->where(function ($query)use($index){
             /** @var Builder $query */
             $query->where("status",1)->orWhereHas("deliveryAppointment",function (Builder $query)use($index){
@@ -316,17 +321,21 @@ class DeliveryAppointmentController extends Controller
         })->orderByRaw("(CASE WHEN status=0 THEN 2 WHEN status=2 THEN 3 END),IF(ISNULL(delivery_time),1,0),delivery_time")
             ->limit(10)->get()->each(function ($car)use(&$list){
             //$diff = $car->delivery_time ? (strtotime($car->delivery_time)+1799)-time() : 0;
+            $count = $car->deliveryAppointment->cars_count ?? 0;
             $list[] = [
                 "id" => $car->id,
                 "license_plate_number" => $car->license_plate_number,
                 "driver_name" => $car->driver_name,
                 "driver_phone" => $car->driver_phone,
                 "status" => $car->status,
+                "cubic_meter" => isset($car->deliveryAppointment->cubic_meter) ? ($count>1 ? $car->deliveryAppointment->cubic_meter."/".$count : $car->deliveryAppointment->cubic_meter) : "",
+                "tonne" => isset($car->deliveryAppointment->tonne) ? ($count>1 ? $car->deliveryAppointment->tonne."/".$count : $car->deliveryAppointment->tonne) : "",
                 //"diff" => $diff>0 ? $diff*1000 : 0,
             ];
         });
-        $counts = DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function (Builder $query)use($index){
-            $query->where("appointment_date",date("Y-m-d"))->whereIn("status",[0,2]);
+        $counts = DeliveryAppointmentCar::query()->whereHas("deliveryAppointment",function (Builder $query)use($index,$warehouse){
+            $query->where("appointment_date",date("Y-m-d"))
+                ->where("warehouse_id",$warehouse)->whereIn("status",[0,2]);
         })->selectRaw("status, COUNT(1) AS c")->groupByRaw("status")->get();
         $success = 0;
         $work = 0;
@@ -453,4 +462,36 @@ html;
         event(new DeliveryAppointmentEvent($car));
         $this->success();
     }
+
+    /**
+     * 产能维护
+     * */
+    public function capacityMaintenance()
+    {
+        if(!Gate::allows('入库管理-入库预约-产能维护')){ return view("exception.authority");  }
+        $warehouses = Warehouse::query()->select("name","id","production_capacity","reduced_production_capacity_coefficient")->get();
+        return view("store.deliveryAppointment.capacityMaintenance",compact("warehouses"));
+    }
+
+    /**
+     * 修改产能
+     */
+    public function updateCapacity()
+    {
+        $this->gate("入库管理-入库预约-产能维护");
+        $id = request("id");
+        $capacity = request("production_capacity");
+        Warehouse::query()->where("id",$id)->update(["production_capacity"=>$capacity]);
+        $this->success();
+    }
+
+    /**
+     * 入库区终端界面
+     */
+    public function exhibition()
+    {
+        if(!Gate::allows('入库管理-入库预约-入库区终端')){ return view("exception.authority");  }
+        if (!request("warehouse"))$warehouses = Warehouse::query()->select("name","id")->get();
+        return view("store.deliveryAppointment.exhibition",["warehouses"=>$warehouses??[],"id"=>request("warehouse")]);
+    }
 }

+ 4 - 6
app/Http/Controllers/TestController.php

@@ -161,12 +161,10 @@ class TestController extends Controller
 
     public function test()
     {
-        $authorities = \App\Authority::query()->where("alias_name","like","%客户预约%")->get();
-        foreach ($authorities as $authority){
-            $name = str_replace("客户预约","入库预约",$authority->alias_name);
-            dump($name,$authority->alias_name);
-        }
-        dd();
+        $w = Waybill::query()->first();
+        $w->owner = $w->owner->name;
+        $w = $w->withoutRelations();
+        dd($w);
         return view("test");
     }
 

+ 41 - 0
app/Jobs/DeliveryAppointmentCheck.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Jobs;
+
+use App\DeliveryAppointment;
+use Illuminate\Bus\Queueable;
+use Illuminate\Contracts\Queue\ShouldQueue;
+use Illuminate\Foundation\Bus\Dispatchable;
+use Illuminate\Queue\InteractsWithQueue;
+use Illuminate\Queue\SerializesModels;
+
+class DeliveryAppointmentCheck implements ShouldQueue
+{
+    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
+
+
+    protected $int;
+    /**
+     * Create a new job instance.
+     *
+     * @param int $int
+     *
+     * @return void
+     */
+    public function __construct(int $int)
+    {
+        $this->int = $int;
+    }
+
+    /**
+     * Execute the job.
+     *
+     * @return void
+     */
+    public function handle()
+    {
+        /** @var DeliveryAppointment|\stdClass $appointment */
+        $appointment = DeliveryAppointment::query()->find($this->int);
+        if ($appointment && $appointment->status!=2)$appointment->update(["status"=>3]);
+    }
+}

+ 30 - 0
database/migrations/2021_04_13_140044_add_authority_data_delivery_terminal.php

@@ -0,0 +1,30 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddAuthorityDataDeliveryTerminal extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        \App\Authority::query()->firstOrCreate(["name"=>"入库管理-入库预约-入库区终端"],["name"=>"入库管理-入库预约-入库区终端","alias_name"=>"入库管理-入库预约-入库区终端"]);
+        \App\Authority::query()->firstOrCreate(["name"=>"入库管理-入库预约-二维码"],["name"=>"入库管理-入库预约-入库区终端","alias_name"=>"入库管理-入库预约-二维码"]);
+        \App\Authority::query()->firstOrCreate(["name"=>"入库管理-入库预约-产能维护"],["name"=>"入库管理-入库预约-产能维护","alias_name"=>"入库管理-入库预约-产能维护"]);
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        \App\Authority::query()->whereIn("alias_name",["入库管理-入库预约-入库区终端","入库管理-入库预约-二维码","入库管理-入库预约-产能维护"])->delete();
+    }
+}

+ 1 - 1
resources/views/customer/project/area.blade.php

@@ -196,7 +196,7 @@
                 $('#container').removeClass('d-none');
                 let data=[
                     [
-                        {name:'owner_group_id',type:'select',tip:'项目小组',placeholder: '项目小组',data:this.ownerGroups},
+                        {name:'user_owner_group_id',type:'select',tip:'项目小组',placeholder: '项目小组',data:this.ownerGroups},
                         {name:'counting_month_start',type:'dateMonth',tip:'起始结算月'},
                         {name:'owner_id',type:'select_multiple_select',tip:['输入关键词快速定位下拉列表,回车确定','选择要显示的项目'],
                             placeholder:['项目','定位或多选项目'],data:this.owners},

+ 47 - 0
resources/views/store/deliveryAppointment/capacityMaintenance.blade.php

@@ -0,0 +1,47 @@
+@extends('layouts.app')
+@section('title')预约管理-入库预约@endsection
+
+@section('content')
+    <span id="nav2">
+    @component('store.menu')@endcomponent
+    @component('store.deliveryAppointment.menu')@endcomponent
+    </span>
+    <div class="card container" id="container">
+        <div class="card-body">
+            <div class="row">
+                <div class="col-12 font-weight-bold h1 text-center mb-4">产能信息</div>
+            </div>
+            <div class="row mt-2 offset-2" v-for="(warehouse,i) in warehouses">
+                <label class="col-2">@{{ warehouse.name }}</label>
+                <label class="col-5"><input :readonly="!warehouse.read" @blur="updateCapacity($event,warehouse)" @focus="readonlyInput(i)" class="form-control" type="number" step="0.01"
+                                            :value="warehouse.production_capacity"></label>
+            </div>
+        </div>
+    </div>
+@stop
+
+@section("lastScript")
+    <script>
+        new Vue({
+            el:"#container",
+            data:{
+                warehouses:[@foreach($warehouses as $warehouse)@json($warehouse),@endforeach],
+            },
+            methods:{
+                readonlyInput(index){
+                    this.$set(this.warehouses[index],"read",this.warehouses[index].read==='undefined' ? true : !this.warehouses[index].read);
+                },
+                updateCapacity(e,warehouse){
+                    let val = e.target.value;
+                    if (Number(val)!==Number(warehouse.production_capacity)){
+                        window.tempTip.postBasicRequest("{{url('store/deliveryAppointment/updateCapacity')}}",{id:warehouse.id,production_capacity:val},res=>{
+                            warehouse.read = false;
+                            warehouse.production_capacity = val;
+                            return "产能修改成功";
+                        });
+                    }
+                }
+            },
+        });
+    </script>
+@stop

+ 83 - 2
resources/views/store/deliveryAppointment/exhibition.blade.php

@@ -81,6 +81,25 @@
             border: 2px solid #1b1e21;
             border-radius: 2px;
         }
+        .modal-body-div{
+            width: 30%;
+            display: inline-block;
+        }
+        .modal-body-item{
+            margin: 10px;
+            border: 2px solid #aaaaaa;
+            border-radius: 5px;
+            height:100px;
+            text-align: center;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex-direction: column
+        }
+        .modal-body-item-text{
+            margin-left:10%;
+            width: 80%;
+        }
     </style>
 </head>
 <body onload="initLoad()" class="h-100">
@@ -102,7 +121,12 @@
             </div>
             <div class="w-100 h-90">
                 <div class="row h-9 mt-1" v-for="(data,i) in list" :class="data.status==1 ? 'text-primary' : (data.status==2 ? 'text-success' : 'text-dark')" {{--v-if="i<5"--}}>
-                    <div class="col-3 text-line">@{{ data.license_plate_number }}</div>
+                    <div class="col-3 text-line">@{{ data.license_plate_number }}
+                        <span class="badge" :class="data.status==1 ? 'badge-primary' : (data.status==2 ? 'badge-success' : 'badge-secondary')" style="font-size: 20px">
+                            <span v-if="data.tonne && data.tonne>0">吨&nbsp;&nbsp;&nbsp;:@{{ data.tonne }}<br></span>
+                            <span v-if="data.cubic_meter && data.cubic_meter>0">立方:@{{ data.cubic_meter }}</span>
+                        </span>
+                    </div>
                     <div class="col-2 text-line">@{{ data.driver_name }}</div>
                     <div class="col-3 text-line">@{{ data.driver_phone }}</div>
                     <div class="col-2 text-line">
@@ -124,13 +148,67 @@
                 </div>
             </div>--}}
         </div>
+        <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static">
+            <div class="modal-dialog modal-dialog-centered modal-xl" role="document">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <div class="text-center font-weight-bold">选择仓库</div>
+                    </div>
+                    <div class="modal-body" id="modal-body"></div>
+                    <div class="modal-footer">
+                        <button class="btn btn-success" onclick="selectedWarehouse()"> 确 定 </button>
+                    </div>
+                </div>
+            </div>
+        </div>
     </div>
+
 </body>
 <script src="{{ mix('js/app.js') }}"></script>
 <script src="{{ mix('js/utilities/qrcode.js') }}"></script>
 <script type="text/javascript">
+    var warehouses = [@foreach($warehouses as $warehouse)@json($warehouse),@endforeach];
+    var warehouse = "{{$id}}";
+    var selected = "";
     //初始化询问
     function initLoad() {
+        if (!warehouse){
+            let dom = document.getElementById("modal-body");
+            for (let i=0;i<warehouses.length;i++){
+                let div = document.createElement("div");
+                div.className="modal-body-div";
+                let div1 = document.createElement("div");
+                div1.className="modal-body-item";
+                div1.style.cursor = "pointer";
+                div1.dataset.id = warehouses[i].id;
+                div1.id = "warehouse-"+warehouses[i].id;
+                if (i===0){
+                    div1.className += " box-shadow-dark";
+                    selected = "warehouse-"+warehouses[i].id;
+                }
+                div1.onclick = function(){
+                    let dom = event.target;
+                    while (!dom.id)dom = dom.parentElement;
+                    if (dom.id===selected)return;
+                    document.getElementById(selected).className = "modal-body-item";
+                    document.getElementById(dom.id).className = "modal-body-item box-shadow-dark";
+                    selected = dom.id;
+                };
+                let div2 = document.createElement("div");
+                div2.className="modal-body-item-text";
+                div2.innerText = warehouses[i].name;
+                div1.appendChild(div2);
+                div.appendChild(div1);
+                dom.appendChild(div);
+            }
+            $("#modal").modal('show');
+        }else alert("是否需要开启全屏?");
+    }
+    function selectedWarehouse() {
+        if (!selected) return;
+        warehouse = document.getElementById(selected).dataset.id;
+        history.pushState(null,null,window.location.href+"?warehouse="+warehouse);
+        $("#modal").modal('hide');
         alert("是否需要开启全屏?");
     }
     //重绘弹窗样式
@@ -187,6 +265,7 @@
                 window.Echo.channel('{{config('database.redis.options.prefix')}}delivery').listen('.car',(res)=>{this._sortData(res.delivery)})
             },
             _sortData(res){
+                if (res.warehouse!=warehouse)return;
                 if (this.list.every((data,i)=>{
                     if (data.id === res.id){
                         //this.$set(this.list[i],"is_delivery",true);
@@ -211,6 +290,8 @@
                         "license_plate_number"  : res.license_plate_number,
                         "driver_name"           : res.driver_name,
                         "driver_phone"          : res.driver_phone,
+                        "cubic_meter"           : res.driver_phone,
+                        "tonne"                 : res.driver_phone,
                         "status"                : res.status,
                         /*"is_delivery"           : true,*/
                     };
@@ -237,7 +318,7 @@
             //初始化数据
             _initData(){
                 let url = "{{url('store/deliveryAppointment/getExhibitionList')}}";
-                window.tempTip.postBasicRequest(url,{},res=>{
+                window.tempTip.postBasicRequest(url,{warehouse:warehouse},res=>{
                     if (!res)return;
                     if (res.list){
                         /*let data = res.list;

+ 8 - 2
resources/views/store/deliveryAppointment/menu.blade.php

@@ -10,12 +10,18 @@
                 <li class="nav-item">
                     <a target="store/deliveryAppointment/list" class="nav-link" href="{{url('store/deliveryAppointment/list')}}" :class="{active:isActive('list',3)}">预约管理</a>
                 </li> @endcan
+                @can('入库管理-入库预约-入库区终端')
                 <li class="nav-item">
                     <a target="_blank" class="nav-link" href="{{url('store/deliveryAppointment/exhibition')}}" :class="{active:isActive('exhibition',3)}">入库区终端</a>
-                </li>
+                </li>@endcan
+                @can('入库管理-入库预约-二维码')
                 <li class="nav-item">
                     <a target="_blank" class="nav-link" href="{{url('store/deliveryAppointment/qrcode')}}" :class="{active:isActive('qrcode',3)}">二维码</a>
-                </li>
+                </li>@endcan
+                @can('入库管理-入库预约-产能维护')
+                <li class="nav-item">
+                    <a target="_blank" class="nav-link" href="{{url('store/deliveryAppointment/capacityMaintenance')}}" :class="{active:isActive('capacityMaintenance',3)}">产能维护</a>
+                </li>@endcan
             </ul>
         </div>
     </div>

+ 117 - 193
resources/views/test.blade.php

@@ -1,212 +1,136 @@
-<!DOCTYPE html>
+<!DOCTYPE HTML>
 <html>
 <head>
     <meta charset="utf-8">
-    <title>table</title>
-    <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
-    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.0-beta2/css/bootstrap-grid.css" rel="stylesheet">
-    <style type="text/css">
-        #test th{
-            position: sticky;
-            position: -webkit-sticky;
+    <title>简单的模态框(Modal)</title>
+    <style>
+        .modal:before {
+            content: "";
+            display: none;
+            background: rgba(0, 0, 0, 0.6);
+            position: fixed;
             top: 0;
-            z-index:999;
-            background-color: white;
+            left: 0;
+            right: 0;
+            bottom: 0;
+            z-index: 10;
+        }
+        .modal:target:before {
+            display: block;
+        }
+        .modal:target .modal-dialog {
+            -webkit-transform: translate(0, 0);
+            -ms-transform: translate(0, 0);
+            transform: translate(0, 0);
+            top: 20%;
+        }
+        .modal-dialog {
+            background: #fefefe;
+            border: #333 solid 1px;
+            border-radius: 5px;
+            margin-left: -120px;
+            position: fixed;
+            left: 35%;
+            z-index: 11;
+            width: 800px;
+            -webkit-transform: translate(0, -500%);
+            -ms-transform: translate(0, -500%);
+            transform: translate(0, -500%);
+            -webkit-transition: -webkit-transform 0.3s ease-out;
+            -moz-transition: -moz-transform 0.3s ease-out;
+            -o-transition: -o-transform 0.3s ease-out;
+            transition: transform 0.3s ease-out;
+        }
+        .modal-body {
+            padding: 10px 20px;
+        }
+        .modal-header {
+            border-bottom: #eee solid 1px;
+        }
+        .modal-header h2 {
+            font-size: 20px;
+            margin-left: 30px;
+        }
+        .box-shadow-dark{
+            box-shadow: 0 0 10px 5px rgba(0,0,0,0.9);
+            z-index:100;
+            position:relative;
+        }
+        .modal-body-div{
+            width: 30%;
+            display: inline-block;
+        }
+        .modal-body-item{
+            margin: 10px;
+            border: 3px solid red;
+            border-radius: 5px;
+            height:100px;
+            text-align: center;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            flex-direction: column
+        }
+        .modal-body-item-text{
+            margin-left:10%;
+            width: 80%;
+        }
+        .modal-footer {
+            padding: 10px 20px;
+        }
+        .modal-footer {
+            border-top: #eee solid 1px;
+            text-align: right;
+        }
+        .btn {
+            background: #428bca;
+            border: #357ebd solid 1px;
+            border-radius: 3px;
+            color: #fff;
+            display: inline-block;
+            font-size: 14px;
+            padding: 8px 15px;
+            text-decoration: none;
+            text-align: center;
+            min-width: 60px;
+            position: relative;
+            transition: color .1s ease;
+        }
+        .btn:hover {
+            background: #357ebd;
         }
     </style>
-    <link href="{{ mix('css/app.css') }}" rel="stylesheet">
 </head>
 <body>
-<button onclick="a()">11111111</button>
-<table id="table" cellspacing="0" cellpadding="2" width="100%" border="1">
-    <tr id="test" style="white-space: nowrap !important;">
-        <th >用户编号</th>
-        <th>试用时间</th>
-        <th>转正时间</th>
-        <th>生日时间</th>
-        <th>民族</th>
-        <th>身高</th>
-    </tr>
-    <tr>
-        <td style="overflow-x: hidden"><div>1</div>200004512312312321321</td>
-        <td>2001-2-15</td>
-        <td>2001-3-15</td>
-        <td>1978-8-5</td>
-        <td>汉</td>
-        <td rowspan="2">162</td>
-    </tr>
-    <tr>
-       <td colspan="3">1</td>
-        <td>2</td>
-        <td>3</td>
-    </tr>
-</table>
-<div id="setting-1" onclick="tt()" style="position: fixed;bottom: 0;left: 0;background-color: #1b1e21;width: 50px;height: 50px;cursor: pointer;text-align: center;border-radius: 3px">
-    <h1><span class="fa fa-spin fa-gear" style="color: white;"></span></h1>
-</div>
-<div id="setting-2"  style="background-color: white;position: fixed;bottom: 0;left: 0;width: 100%;display: none">
-    <div style="width: 100%;background-color: RGB(245,245,200);border-top: 1px solid #1b1e21">
-        <div style="width: 30px;display:inline-block;text-align: center"><span class="fa fa-gear"></span></div>
-        <div style="width: 5%;display:inline-block;border-left: 1px solid #aaaaaa;text-align: center;cursor: pointer;background-color: #3490dc;color: white">显示列</div>
-        <div style="width: 5%;display:inline-block;border-left: 1px solid #aaaaaa;text-align: center;cursor: pointer">表头设置</div>
-        <b style="float: right;margin-right:10px;cursor: pointer;font-size: 18px">&times;</b>
-    </div>
-    <div style="width: 100%;min-height: 50px;margin: 10px 50px 20px 50px">
-        <div id="setting-column">
-            <label style="width: 7%;">
-                <label style="float: left;white-space: nowrap">
-                    <label style="display: inline-block">
-                        <input type="checkbox" id="column-x" class="fixed-checkbox" checked value="1" onclick="test()">
-                        <label for="column-x" class="h-100"></label>
-                    </label>
-                     <label style="display: inline-block"><div>测试啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</div></label>
-                </label>
-            </label>
-            <label style="width: 7%;">
-                <label style="float: left">
-                    <input type="checkbox" id="column-x" class="fixed-checkbox" checked value="1" onclick="test()">
-                    <label for="column-x"></label> 测试
-                </label>
-            </label>
-            <div><button class="btn btn-sm btn-success">保存</button></div>
+<a href="#modal-one">111</a>
+<div class="modal" id="modal-one" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-header">
+            <h2>选择仓库</h2>
         </div>
-        <div id="setting-header">
-            清除本地列宽设置:
-            <button type="button" class="btn btn-sm btn-outline-danger">清除全部</button>
-            <button type="button" class="btn btn-sm btn-outline-danger">清除本页</button>
+        <div class="modal-body">
+            <div class="modal-body-div" data-id="1">
+                <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
+            </div>
+            <div class="modal-body-div">
+                <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
+            </div>
+            <div class="modal-body-div">
+                <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
+            </div>
+            <div class="modal-body-div">
+                <div class="box-shadow-dark modal-body-item"><div class="modal-body-item-text">测试喜喜喜喜喜喜喜喜喜喜顶顶顶顶顶顶顶顶顶顶顶</div></div>
+            </div>
+        </div>
+        <div class="modal-footer">
+            <a href="#" class="btn" onclick="test()">确 定</a>
         </div>
     </div>
 </div>
 <script type="text/javascript">
-    function a() {
-        let trs = document.getElementById("table").getElementsByTagName("tr");
-        let count = trs[0].children.length;
-        let show = [1,5];
-        for (let i=0;i<trs.length;i++){
-            if (count!==trs[i].children.length){
-                let pointer = [];
-                for (let j=0;j<trs[i].children.length;j++){
-                    if (trs[i].children[j] && trs[i].children[j].colSpan>1){
-                        for (let k=0;k<trs[i].children[j].colSpan;k++)pointer.push(j);
-                    }else pointer.push(j);
-                }
-                console.log(pointer)
-                for (let j=0;j<show.length;j++){
-                    let dom = trs[i].children[pointer[show[j]]];
-                    console.log(j,pointer[show[j]])
-                    if (dom){
-                        if (dom.colSpan>1)dom.colSpan--;
-                        else dom.hidden = true;
-                    }
-                }
-            }
-        }
-    }
-    function tt() {
-        let width = document.documentElement.clientWidth;
-        let div = document.getElementById("setting-2");
-        div.style.width = width+"px";
-        div.style.height = "100"+"px";
-        div.style.display = "block";
-        document.getElementById("setting-1").style.display = "none";
-    }
     function test() {
-        localStorage.setItem("name:xx1",[11,22,33]);
-        localStorage.setItem("name:xx2","22");
-        localStorage.setItem("name:xx3","33");
-        for (let i=0;i<localStorage.length;i++){
-            console.log(localStorage.key(i))
-            console.log(localStorage.getItem(localStorage.key(i)));
-        }
-        let _name = "column:xxx.";
-
-        let val = event.target.value;
-        let checked = event.target.checked;
-
-        console.log(checked);
-    }
-</script>
-<script type="text/javascript">
-    var tTD; //用来存储当前更改宽度的Table Cell,避免快速移动鼠标的问题
 
-    var table = document.getElementById("table");
-    function a1() {
-        let div = document.createElement("div");
-        div.className = "test ";
-        div.className += "test1";
-        div.className += "test2";
-        console.log(div);
-    }
-    function a2() {
-        for (let i=0;i<table.children[0].children.length;i++){
-            let arr = table.children[0].children[i].children;
-            for (let j=0;j<arr.length;j++){
-                let td = arr[j];
-                let div = document.createElement("div");
-                div.style.overflowX = "hidden";
-                let count = td.childNodes.length;
-                for (let k=0;k<count;k++){div.appendChild(td.childNodes[0]);}
-                td.appendChild(div);
-            }
-        }
     }
-    var down = false;
-    for (i = 0; i < table.rows[0].cells.length; i++) {
-        table.rows[0].cells[i].onmousedown = function () {
-            //记录单元格
-            tTD = this;
-            if (event.offsetX > tTD.offsetWidth - 10) {
-                down = true;
-                tTD.oldX = event.x;
-                tTD.oldWidth = tTD.offsetWidth;
-            }
-            //记录Table宽度
-            table = tTD; while (table.tagName != 'TABLE') table = table.parentElement;
-            tTD.tableWidth = table.offsetWidth;
-        };
-        table.rows[0].cells[i].onmousemove = function () {
-            //更改鼠标样式
-            if (event.offsetX > this.offsetWidth - 10)
-                this.style.cursor = 'col-resize';
-            else
-                this.style.cursor = 'default';
-            //取出暂存的Table Cell
-            if (tTD == undefined) tTD = this;
-        }
-    }
-    document.onmouseup = function () {
-        if (down) {
-            //结束宽度调整
-            if (tTD == undefined) tTD = this;
-            down = false;
-            tTD.style.cursor = 'default';
-        }
-    };
-    document.onmousemove = function () {
-        if (down) {
-            //调整宽度
-            if (down) {
-                tTD.style.cursor = 'default';
-                if (tTD.oldWidth + (event.x - tTD.oldX) > 0)
-                    tTD.width = tTD.oldWidth + (event.x - tTD.oldX);
-                //调整列宽
-                tTD.style.width = tTD.width;
-                tTD.style.cursor = 'col-resize';
-                //调整该列中的每个Cell
-                table = tTD;
-                while (table.tagName != 'TABLE') table = table.parentElement;
-                setTimeout(()=>{
-                    for (i = 0; i < table.rows.length; i++) {
-                        let td = table.rows[i].cells[tTD.cellIndex];
-                        td.firstChild.style.width = tTD.width+"px";
-                    }
-                });
-                //调整整个表
-                table.width = tTD.tableWidth + (tTD.offsetWidth - tTD.oldWidth);
-                table.style.width = table.width;
-            }
-        }
-    };
 </script>
 </body>
 </html>

+ 5 - 3
routes/web.php

@@ -1,5 +1,6 @@
 <?php
 
+use Illuminate\Support\Facades\Gate;
 use Illuminate\Support\Facades\Route;
 use Illuminate\Support\Facades\Auth;
 /*
@@ -438,15 +439,16 @@ Route::group(['prefix'=>'store'],function(){
         Route::any('export','DeliveryAppointmentController@export');
         Route::post('getExhibitionList','DeliveryAppointmentController@getExhibitionList');
         Route::post('getKey','DeliveryAppointmentController@getKey');
-        Route::get('exhibition',function (){
-            return view("store.deliveryAppointment.exhibition");
-        });
+        Route::get('exhibition','DeliveryAppointmentController@exhibition');
         Route::get('qrcode',function (){
+            if(!Gate::allows('入库管理-入库预约-二维码')){ return view("exception.authority");  }
             return view("store.deliveryAppointment.qrcode");
         });
         Route::group(['prefix'=>'appointment'],function(){
             Route::post('import','DeliveryAppointmentController@import');
         });
+        Route::get('capacityMaintenance','DeliveryAppointmentController@capacityMaintenance');
+        Route::post('updateCapacity','DeliveryAppointmentController@updateCapacity');
     });
 });