Przeglądaj źródła

表头反选
入库预约迁移

Zhouzhendong 5 lat temu
rodzic
commit
2797812d4d

+ 4 - 4
app/Http/Controllers/DeliveryAppointmentController.php

@@ -203,7 +203,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function showAppointmentInfo()
     {
-        if(!Gate::allows('入库管理-客户预约-预约')){ return view("exception.authority");  }
+        if(!Gate::allows('入库管理-入库预约-预约')){ return view("exception.authority");  }
         $key = request("k");
         $len = strlen($key);
         $id = substr($key,5,$len-32);
@@ -221,7 +221,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function cancel()
     {
-        $this->gate("入库管理-客户预约-预约");
+        $this->gate("入库管理-入库预约-预约");
         $id = request("id");
         if (!$id)$this->error("非法参数");
         DeliveryAppointment::query()->where("status",0)->where("id",$id)->update(["status"=>1]);
@@ -233,7 +233,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function export()
     {
-        if(!Gate::allows('入库管理-客户预约-预约管理')){ return view("exception.authority");  }
+        if(!Gate::allows('入库管理-入库预约-预约管理')){ return view("exception.authority");  }
         if (request("checkAllSign")){
             $params = request()->input();
             unset($params["checkAllSign"]);
@@ -293,7 +293,7 @@ class DeliveryAppointmentController extends Controller
      */
     public function getExhibitionList()
     {
-        $this->gate("入库管理-客户预约-预约管理");
+        $this->gate("入库管理-入库预约-预约管理");
         $list = [];
         $hour = date("H");
         $index = null;

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

@@ -161,6 +161,12 @@ 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();
         return view("test");
     }
 

+ 36 - 0
database/migrations/2021_04_13_112852_add_authority_data_delivery.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddAuthorityDataDelivery extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        $authorities = \App\Authority::query()->where("alias_name","like","%客户预约%")->get();
+        foreach ($authorities as $authority){
+            $name = str_replace("客户预约","入库预约",$authority->alias_name);
+            $authority->update(["name"=>$name,"alias_name"=>$name]);
+        }
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        $authorities = \App\Authority::query()->where("alias_name","like","%客户预约%")->get();
+        foreach ($authorities as $authority){
+            $name = str_replace("入库预约","客户预约",$authority->alias_name);
+            $authority->update(["name"=>$name,"alias_name"=>$name]);
+        }
+    }
+}

+ 13 - 1
resources/js/queryForm/header.js

@@ -444,6 +444,12 @@ window.Header = function getHeader(object) {
             }
         }
     }
+    function bindReverseEvent() {
+        return function () {
+            let nodes = document.getElementById("setting-column-body").getElementsByTagName("input");
+            for (let i=0;i<nodes.length;i++)nodes[i].checked=!nodes[i].checked;
+        }
+    }
     function _createSetting2() {
         /*
         * <div id="setting-2"  style="background-color: white;position: fixed;bottom: 0;left: 0;width: 100%;display: none">
@@ -527,9 +533,15 @@ window.Header = function getHeader(object) {
         let btn1 = document.createElement("button");
         btn1.className = "btn btn-sm btn-outline-info ml-1";
         btn1.type = "button";
-        btn1.innerText = "全选/反选";
+        btn1.innerText = "全选/取消";
         btn1.onclick = bindCheckAllEvent();
         div211.appendChild(btn1);
+        let btn2 = document.createElement("button");
+        btn2.className = "btn btn-sm btn-outline-info ml-1";
+        btn2.type = "button";
+        btn2.innerText = "反选";
+        btn2.onclick = bindReverseEvent();
+        div211.appendChild(btn2);
         div21.appendChild(div211);
         div2.appendChild(div21);
         let div22 = document.createElement("div");

+ 1 - 1
resources/views/store/deliveryAppointment/appointment.blade.php

@@ -1,5 +1,5 @@
 @extends('layouts.app')
-@section('title')客户预约-客户预约@endsection
+@section('title')入库预约@endsection
 
 @section('content')
     <span id="nav2">

+ 1 - 1
resources/views/store/deliveryAppointment/delivery.blade.php

@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="icon" href="{{asset('icon/faviconc.ico')}}" type="image/x-icon"/>
 
-    <title>填写预约码-客户预约</title>
+    <title>填写预约码-入库预约</title>
     <style>
         html{
             height: 100%;

+ 1 - 1
resources/views/store/deliveryAppointment/deliverySuccess.blade.php

@@ -5,7 +5,7 @@
     <meta name="viewport" content="width=device-width, initial-scale=1">
     <link rel="icon" href="{{asset('icon/faviconc.ico')}}" type="image/x-icon"/>
 
-    <title>送货成功-客户预约</title>
+    <title>送货成功-入库预约</title>
     <link href="{{ mix('css/app.css') }}" rel="stylesheet">
     <style>
         .font{

+ 1 - 1
resources/views/store/deliveryAppointment/exhibition.blade.php

@@ -7,7 +7,7 @@
     <!-- CSRF Token -->
     <meta name="csrf-token" content="{{ csrf_token() }}">
 
-    <title>入库区终端-客户预约</title>
+    <title>入库区终端-入库预约</title>
     <link href="{{ mix('css/app.css') }}" rel="stylesheet">
     <style>
         html{

+ 3 - 3
resources/views/store/deliveryAppointment/list.blade.php

@@ -1,5 +1,5 @@
 @extends('layouts.app')
-@section('title')预约管理-客户预约@endsection
+@section('title')预约管理-入库预约@endsection
 
 @section('content')
     <span id="nav2">
@@ -95,7 +95,7 @@
                             <div class="col-2 text-secondary">@{{ info.cars[0].car ? info.cars[0].car.name : '' }}</div>
                             <div class="col-1 text-secondary">@{{ info.cars[0].driver_name }}</div>
                             <div class="col-3 text-secondary">@{{ info.cars[0].driver_phone }}</div>
-                            <div class="col-2">@can("入库管理-客户预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,0)" v-if="info.cars[0].status==1">卸货完成</button>@endcan</div>
+                            <div class="col-2">@can("入库管理-入库预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,0)" v-if="info.cars[0].status==1">卸货完成</button>@endcan</div>
                         </div>
                         <div class="up" :id="'item-'+info.id" v-show="info.cars.length>1">
                             <div class="row" v-for="(car,j) in info.cars" v-if="j!==0" style="min-width: 600px">
@@ -104,7 +104,7 @@
                                 <div class="col-2 text-secondary">@{{ car.car ? car.car.name : '' }}</div>
                                 <div class="col-1 text-secondary">@{{ car.driver_name }}</div>
                                 <div class="col-3 text-secondary">@{{ car.driver_phone }}</div>
-                                <div class="col-2">@can("入库管理-客户预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,j)" v-if="car.status==1">卸货完成</button>@endcan</div>
+                                <div class="col-2">@can("入库管理-入库预约-预约管理-卸货完成")<button class="btn btn-sm btn-outline-success" @click="unloading(i,j)" v-if="car.status==1">卸货完成</button>@endcan</div>
                             </div>
                         </div>
                         <div class="text-center m-auto small cursor-pointer" v-if="info.cars.length>1" @click="upAll(info.id)">

+ 1 - 1
resources/views/store/deliveryAppointment/qrcode.blade.php

@@ -7,7 +7,7 @@
     <link href="{{ mix('css/app.css') }}" rel="stylesheet">
     <!-- CSRF Token -->
     <meta name="csrf-token" content="{{ csrf_token() }}">
-    <title>二维码-客户预约</title>
+    <title>二维码-入库预约</title>
     <style>
         html{
             background: white;