Kaynağa Gözat

库存对比添加属性仓筛选项,并为inventory_compares对比表添加属性仓+创建时间联合索引

haozi 5 yıl önce
ebeveyn
işleme
6c95faa73b

+ 2 - 1
app/Services/InventoryCompareService.php

@@ -145,7 +145,8 @@ class InventoryCompareService
             'owner_id' => ['multi' => ','],
             'date_start' => ['alias' => 'created_at' , 'startDate' => ' 00:00:00'],
             'date_end' => ['alias' => 'created_at' , 'endDate' => ' 23:59:59'],
-            'mission_code' => ['timeLimit' => 20],
+            'mission_code' => ['timeLimit' => 15],
+            'custom_location' => ['timeLimit' => 15],
             'id' => ['multi' => ','],
         ];
         $inventoryCompares = app(QueryService::class)->query($param,$inventoryCompares,$columnQueryRules,'inventory_compares');

+ 32 - 0
database/migrations/2020_12_24_142511_add_custom_location_index_to_inventory_compares.php

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

+ 2 - 1
resources/views/inventory/statement/inventoryCompare.blade.php

@@ -199,6 +199,7 @@
                     ],
                     [
                         {name:'date_end',type:'dateTime',tip:'选择创建日期的结束时间'},
+                        {name:'custom_location',type:'input',tip:'属性仓:糊模查找需要在左边打上%符号',placeholder: '属性仓'},
                         {name: 'differ', type: 'select', placeholder: '差值', data: this.differ},
                     ],
                 ];
@@ -217,7 +218,7 @@
                     {name: 'commodity_name', value: '商品名称'},
                     {name:'commodity_sku',value: '商品编码'},
                     {name: 'commodity_barcodes', value: '商品条码', neglect: true},
-                    {name: 'amount', value: '属性仓', neglect: true},
+                    {name: 'custom_location', value: '属性仓', neglect: true},
                     {name: 'quality', value: '质量状态', neglect: true},
                     {name: 'amount_in_sys',value: '宝时库存', neglect: true},
                     {name: 'amount_in_compare', value: '参考库存', neglect: true},