Sfoglia il codice sorgente

运输管理-created_at字段增加索引,增加收件人筛选条件Z

Zhouzhendong 5 anni fa
parent
commit
caea85fada

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

@@ -542,7 +542,7 @@ class WaybillController extends Controller
                 unset($images[$index]);
                 continue;
             }
-            $num = rtrim($name,".".$suffix);
+            $num = trim(rtrim($name,".".$suffix));
             $number[] = $num;
             $mapping[$num] = $index;
         }

+ 2 - 0
app/Services/WaybillService.php

@@ -39,6 +39,8 @@ Class WaybillService
             'created_at_end' => ['alias' => 'created_at' , 'endDate' => ':59'],
             'uriType' => ['alias' => 'type'],
             'id' => ['multi' => ','],
+            'recipient' => ['timeLimit' => 15],
+            'recipient_mobile' => ['timeLimit' => 15],
         ];
         $waybills = app(QueryService::class)->query($param,$waybills,$columnQueryRules,"waybills");
         return $waybills;

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

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddIndexCreatedAtTableWaybills extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            $table->index("created_at");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('waybills', function (Blueprint $table) {
+            $table->dropIndex("waybills_created_at_index");
+        });
+    }
+}

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

@@ -40,7 +40,7 @@
                     <a class="dropdown-item" @click="waybillExport(true)" href="javascript:">导出所有页</a>
                 </div>
             </span>
-            <button class="btn btn-sm btn-outline-info" data-target="#batchUploadImg" data-toggle="modal">批量上传图片</button>
+            @can('运输管理-图片上传')<button class="btn btn-sm btn-outline-info" data-target="#batchUploadImg" data-toggle="modal">批量上传图片</button>@endcan
             <div>
                 @if(Session::has('successTip'))
                     <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
@@ -379,6 +379,7 @@
                         {name:'carrier_bill',type:'input',tip:'承运商单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '承运商单号'},
                         {name:'status',type:'select',placeholder: '运单状态',data:this.status},
                         {name:'source_bill',type:'input',tip: '上游单号:可在左侧增加百分号(%)进行模糊搜索',placeholder: '上游单号'},
+                        {name:'recipient',type:'input',tip: '收货人姓名:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人姓名'},
                     ],
                     [
                         {name:'wms_bill_number',type:'input',tip:'WMS单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: 'WMS单号'},
@@ -386,6 +387,7 @@
                         {name:'destination',type:'input',tip:'目的地:可在两侧增加百分号(%)进行模糊搜索',placeholder: '目的地'},
                         {name:'waybill_number',type:'input',tip:'运单号:可在两侧增加百分号(%)进行模糊搜索',placeholder: '运单号'},
                         {name:'logistic_id',type:'select',placeholder: '承运商',data:this.logistics},
+                        {name:'recipient_mobile',type:'input',tip: '收货人电话:可在左侧增加百分号(%)进行模糊搜索',placeholder: '收货人电话'},
                     ],
                 ];
                 let param=[];