Zhouzhendong преди 5 години
родител
ревизия
28f58d44a9

+ 59 - 0
app/Http/Controllers/InventoryController.php

@@ -0,0 +1,59 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+
+class InventoryController extends Controller
+{
+    public function changeInventory(Request $request){
+        $date_start=$request->input('date_start');
+        $date_end=$request->input('date_end');
+        $start=microtime(true);
+        //$sql=' select * from (select ROWNUM r,result.*  from ( ';
+        $sql=' select customer.Descr_C 货主, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码, ';
+        $sql.=' sku.Descr_C 商品名称, lot.LotAtt05 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
+        $sql.=' lot.LotAtt04 批号 ';
+        $sql.=' , sum(移出数量)移出数量, sum(移入数量)移入数量 ';
+        $sql.=' , storeStatus.QTY 在库数量, storeStatus.QtyAllocated 占用数量,count(1) over () as sum from ';
+        $sql.=' (select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量, sum(TOQty_Each) as 移入数量, TOLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
+        if ($date_start) $sql.=" and addtime > '".$date_start." 00:00:00' ";
+        if ($date_end) $sql.=" and addtime < '".$date_end." 23:59:59' ";
+        $sql.=' group by TOCustomerID, TOLocation, TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
+        if ($date_start) $sql.=" and addtime > '".$date_start." 00:00:00' ";
+        if ($date_end) $sql.=" and addtime < '".$date_end." 23:59:59' ";
+        $sql.=' group by FMCustomerID, FMLocation, TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log  where TransactionType='MV' ";
+        if ($date_start) $sql.=" and addtime > '".$date_start." 00:00:00' ";
+        if ($date_end) $sql.=" and addtime < '".$date_end." 23:59:59' ";
+        $sql.=' group by FMLocation,TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
+        if ($date_start) $sql.=" and addtime > '".$date_start." 00:00:00' ";
+        if ($date_end) $sql.=" and addtime < '".$date_end." 23:59:59' ";
+        $sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
+        $sql.=' left join BAS_Customer customer on customer.CustomerID=stockLog.TOCUSTOMERID ';
+        $sql.=' left join BAS_SKU sku on sku.SKU=stockLog.FMSKU ';
+        $sql.=' left join INV_LOT_ATT lot on lot.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' and storeStatus.LocationID=stockLog.库位 where rownum<=300 ';
+        $sql.=' group by 库位,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1 ';
+        $sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt05,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
+        $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated ';
+        //$sql.=' ) result)data ';
+        $page=$request->input('page')??1;
+        /*$sql.=" where data.r>".($page-1)*50;
+        $sql.=" and data.r<=".$page*50;*/
+        $oracleActTransactingLogs=DB::connection('oracle')->select($sql);
+        $oracleActTransactingLogs=json_encode($oracleActTransactingLogs);
+        $end=microtime(true);
+        $date=$end-$start;
+        return view('inventory.statement.changeInventory',compact('oracleActTransactingLogs','page','date'));
+    }
+}

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

@@ -94,6 +94,7 @@ class StoreController extends Controller
                         if($customDepository)return $customDepository;
                         $depository=Depository::where('code',$sku->LOTATT05)->first();
                         if (!$depository){
+                            if (!$sku->LOTATT05)return $depository;
                             $depository=new Depository([
                                 'name'=>$sku->LOTATT05,
                                 'code'=>$sku->LOTATT05
@@ -108,10 +109,10 @@ class StoreController extends Controller
                         'name'=>$sku->SKUDESCRC,
                         'sku'=>$sku->SKU,
                         'barcode'=>$sku->ALTERNATE_SKU1,
-                        'depository_id'=>$depository->id,
                         'quality'=>$request->input('quality'),
                         'status'=>'未入库',
                     ]);
+                    if ($depository)$storeItem->depository_id=$depository->id;
                     $storeItem->save();
                 }
             }

+ 39 - 113
app/Http/Controllers/TestController.php

@@ -9,6 +9,7 @@ use App\Events\CancelOrder;
 use App\Events\WmsReceiveNewEvent;
 use App\Http\Controllers\Api\thirdPart\flux\WaybillController;
 use App\Logistic;
+use App\OracleActTransactionLog;
 use App\Order;
 use App\Package;
 use App\Rejected;
@@ -22,7 +23,9 @@ use App\Waybill;
 use App\OraccleBasCustomer;
 use App\WMSReflectReceive;
 use Carbon\Carbon;
+use Endroid\QrCode\QrCode;
 use Endroid\QrCode\Response\QrCodeResponse;
+use Illuminate\Database\Query\JoinClause;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use function PHPSTORM_META\map;
@@ -135,87 +138,6 @@ class TestController extends Controller
             $authority->delete();
         });
     }
-
-    public function test1(){
-        $s="IXCM";
-        $arr=str_split($s);
-        $temp=["I"=>1,"V"=>5,"X"=>10,"L"=>50,"C"=>100,"D"=>500,"M"=>1000];
-        $result=0;
-        for($i=0;$i<count($arr);$i++){
-            if($i!=count($arr)-1){
-                if($arr[$i]=="I"){
-                    if($arr[$i+1]=="V" || $arr[$i+1]=="X"){
-                        $result-=$temp["I"];
-                        continue;
-                    }
-                }
-                if($arr[$i]=="X"){
-                    if($arr[$i+1]=="L" || $arr[$i+1]=="C"){
-                        if($i>0&&$arr[$i-1]=="I"){$result+=$temp[$arr[$i]];continue;}
-                        $result-=$temp["X"];
-                        continue;
-                    }
-                }
-                if($arr[$i]=="C"){
-                    if($arr[$i+1]=="D" || $arr[$i+1]=="M"){
-                        if($i>0&&$arr[$i-1]=="X"){
-                            if ($i>1&&$arr[$i-2]=="I"){
-                                $result-=$temp["C"];
-                                continue;
-                            }
-                            $result+=$temp[$arr[$i]];continue;
-                        }
-                        $result-=$temp["C"];
-                        continue;
-                    }
-                }
-            }
-            $result+=$temp[$arr[$i]];
-        }
-        if($result<1 || $result>3999)$result=0;
-        return $result;
-    }
-    public function test2(){
-        $s="VI";
-        $arr=str_split($s);
-        $temp=["I"=>1,"V"=>5,"X"=>10,"L"=>50,"C"=>100,"D"=>500,"M"=>1000];
-        $result=0;
-        $sign=false;
-        for($i=0;$i<count($arr);$i++){
-            if($i!=count($arr)-1){
-                if($arr[$i]=="I"){
-                    if($arr[$i+1]=="V" || $arr[$i+1]=="X"){
-                        $result-=$temp["I"];
-                        $sign=true;
-                        continue;
-                    }
-                }
-                if($arr[$i]=="X"){
-                    if($arr[$i+1]=="L" || $arr[$i+1]=="C"){
-                        if($sign){$result+=$temp[$arr[$i]];$sign=false;continue;}
-                        $result-=$temp["X"];
-                        $sign=true;
-                        continue;
-                    }
-                }
-                if($arr[$i]=="C"){
-                    if($arr[$i+1]=="D" || $arr[$i+1]=="M"){
-                        if($sign){
-                            $sign=false;
-                            $result+=$temp[$arr[$i]];continue;
-                        }
-                        $result-=$temp["C"];
-                        $sign=true;
-                        continue;
-                    }
-                }
-            }
-            $result+=$temp[$arr[$i]];
-            if ($sign)$sign=false;
-        }
-        if($result<1 || $result>3999)$result=0;
-        return $result;
-    }
     public function test3()
     {
         $strs=["auibh","aopk","bikon"];
@@ -271,39 +193,43 @@ class TestController extends Controller
         //利用栈的先进后出 一个正确的括号组对应都为1对1或N对N
         // 先进后出“([{”入栈,")]}"出栈,轮询到出栈元素去映射栈顶,符合出栈,不符合直接返回
         //依次轮询 如果映射正确那么最后栈为空栈 否则返回false
-
-        /*
-        $r=[];
-        $sTemp=["("=>1,"["=>2,"{"=>3,")"=>-1,"]"=>-2,"}"=>-3];
-        for ($i=0;$i<strlen($s);$i++){
-            if ($i!=strlen($s)-1){
-                if (($sTemp[$s[$i]]+$sTemp[$s[$i+1]])==0){
-                    $i++;
-                    var_dump($s[$i],$i);
-                    continue;
-                }
-            }
-
-            array_push($r,$sTemp[$s[$i]]);
-        }
-        $sum=count($r);
-        if ($sum==0)return "a";
-        if ($sum%2!=0)return "b";
-        $svg=$sum/2;
-        for ($i=0;$i<$svg;$i++){
-            if ($r[$i]>0&&$r[$i]+$r[$sum-1-$i]!=0)return "b";
-        }
-        return "a";*/
     }
     function test5(){
-
-        $x=10;
-        $s=0;
-        if ($x<0 || ($x%10 == 0 && $x!=0))dd(false);
-        while($x>$s){
-            $s=$s*10+($x%10);
-            $x=intval($x/10);
-        }
-        dd($x==$s || $x==intval($s/10));
+        /*$sql='select customer.CUSTOMERID from BAS_Customer customer';
+        dd(DB::connection('oracle')->select($sql));*/
+        $sql=' select ';
+        $sql.=' customer.Descr_C 货主, 库位, sku.SKU 产品编码, sku.ALTERNATE_SKU1 产品条码, ';
+        $sql.=' sku.Descr_C 商品名称, lot.LotAtt05 属性仓, lot.LotAtt08 质量状态, lot.LotAtt02 失效日期, ';
+        $sql.=' lot.LotAtt04 批号 ';
+        $sql.=' , sum(移出数量)移出数量, sum(移入数量)移入数量 ';
+        $sql.=' , storeStatus.QTY 在库数量, storeStatus.QtyAllocated 占用数量 from ';
+        $sql.=' (select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量, sum(TOQty_Each) as 移入数量, TOLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='PA' ";
+        $sql.=' group by TOCustomerID, TOLocation, TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量, 0 as 移入数量, FMLOCATION as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='SO' ";
+        $sql.=' group by FMCustomerID, FMLocation, TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,sum(FMQty_Each) as 移出数量,0 as 移入数量, FMLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log  where TransactionType='MV' ";
+        $sql.=' group by FMLocation,TOCustomerID,FMSKU,FMLotNum union all ';
+        $sql.=' select FMLotNum,FMSKU,TOCustomerID,0 as 移出数量,sum(TOQty_Each)as 移入数量, TOLocation as 库位 ';
+        $sql.=" from ACT_Transaction_Log where TransactionType='MV' ";
+        $sql.=' group by TOLocation,TOCustomerID,FMSKU,FMLotNum)stockLog ';
+        $sql.=' left join BAS_Customer customer on customer.CustomerID=stockLog.TOCUSTOMERID ';
+        $sql.=' left join BAS_SKU sku on sku.SKU=stockLog.FMSKU ';
+        $sql.=' left join INV_LOT_ATT lot on lot.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' left join INV_LOT_LOC_ID storeStatus on storeStatus.LOTNUM=stockLog.FMLOTNUM ';
+        $sql.=' and storeStatus.LocationID=stockLog.库位 where rownum<=50 ';
+        $sql.=' group by 库位,customer.Descr_C,sku.SKU,sku.ALTERNATE_SKU1 ';
+        $sql.=' ,sku.Descr_C,FMLotNum,lot.LotAtt05,lot.LotAtt08,lot.LotAtt02,lot.LotAtt04 ';
+        $sql.=' , storeStatus.QTY, storeStatus.QtyAllocated';
+        $oracleActTransactingLogs=DB::connection('oracle')->select($sql);
+        dd($oracleActTransactingLogs);
+        /*dd(OracleActTransactionLog::with(['oracleBasCustomer','oracleInvLotAtt','oracleBasSku'])
+            ->leftJoin('INV_LOT_LOC_ID',function (JoinClause $join){
+                $join->on('INV_LOT_LOC_ID.LOCATIONID','=','ACT_TRANSACTION_LOG.TOLOCATIONID')
+                    ->on('INV_LOT_LOC_ID.LOTNUM','=','ACT_TRANSACTION_LOG.FMLOTNUM');
+            })->paginate(5));*/
     }
 }

+ 34 - 0
app/OracleActTransactionLog.php

@@ -0,0 +1,34 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * DB:      FLUX/WMS_USER
+ * TABLE:   ACT_TRANSACTION_LOG
+ * EXPLAIN: 库存事务
+ */
+class OracleActTransactionLog extends Model
+{
+    protected $connection="oracle";
+    protected $table="ACT_TRANSACTION_LOG";
+    /*
+     * column:  FMLotNum  FMSKU  ADDTIME TOCustomerID TOQty_Each FMQty_Each TransactionType TOLocation
+     * */
+
+    function oracleBasCustomer(){
+        return $this->hasOne('App\OracleBasCustomer','customerid','tocustomerid');
+    }
+    function oracleBasSku(){
+        return $this->hasOne('App\OracleBasSKU','sku','fmsku');
+    }
+    function oracleInvLotAtt(){
+        return $this->hasOne('App\OracleInvLotAtt','lotnum','fmlotnum');
+    }
+    function oracleInvLotLocId(){
+        //return $this->hasMany('App\OracleInvLotLocId',['LOTNUM','LocationID'],['FMLOTNUM','TOLocation']);
+        return $this->hasOne('App\OracleInvLotLocId','locationid','tolocation');
+    }
+}

+ 19 - 0
app/OracleBasCustomer.php

@@ -0,0 +1,19 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * DB:      FLUX/WMS_USER
+ * TABLE:   BAS_CUSTOMER
+ * EXPLAIN: 客户
+ */
+class OracleBasCustomer extends Model
+{
+    protected $connection="oracle";
+    protected $table="BAS_CUSTOMER";
+    /*
+     * column: Descr_C 货主
+     * */
+}

+ 11 - 4
app/OracleBasSKU.php

@@ -3,15 +3,22 @@
 namespace App;
 
 use Illuminate\Database\Eloquent\Model;
-
 /**
- * WMS_USER
- * 产品档案 OracleBas_SKU
- */use App\Traits\ModelTimeFormat;
+ * DB:      FLUX/WMS_USER
+ * TABLE:   BAS_SKU
+ * EXPLAIN: 商品
+ */
+use App\Traits\ModelTimeFormat;
 
 class OracleBasSKU extends Model
 {
     use ModelTimeFormat;
     protected $connection="oracle";
     protected $table="BAS_SKU";
+
+    /*
+     * column: SKU 产品编码
+     *         ALTERNATE_SKU1 产品条码
+     *         Descr_C 商品名称
+     * */
 }

+ 22 - 0
app/OracleInvLotAtt.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+/**
+ * DB:      FLUX/WMS_USER
+ * TABLE:   INV_LOT_ATT
+ * EXPLAIN: 批次属性
+ */
+class OracleInvLotAtt extends Model
+{
+    protected $connection="oracle";
+    protected $table="INV_LOT_ATT";
+    /*
+     * column: LotAtt05 属性仓
+     *         LotAtt08 质量状态
+     *         LotAtt02 失效日期
+     *         LotAtt04 批号
+     * */
+}

+ 23 - 0
app/OracleInvLotLocId.php

@@ -0,0 +1,23 @@
+<?php
+
+namespace App;
+
+use Illuminate\Database\Eloquent\Model;
+
+
+/**
+ * DB:      FLUX/WMS_USER
+ * TABLE:   INV_LOT_LOC_ID
+ * EXPLAIN: 库存状态
+ */
+class OracleInvLotLocId extends Model
+{
+    protected $connection="oracle";
+    protected $table="INV_LOT_LOC_ID";
+
+    /*
+    * column: ADDTIME 发生时间
+    *         QTY 在库数量
+    *         QtyAllocated 占用数量
+    * */
+}

+ 31 - 0
database/migrations/2020_05_29_144440_add_inventory_authority.php

@@ -0,0 +1,31 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddInventoryAuthority extends Migration
+{
+    protected $authNames=[
+        "库存管理"
+    ];
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+    }
+}

BIN
public/images/QRCodeIMG/1.png


+ 11 - 0
resources/views/inventory/menu.blade.php

@@ -0,0 +1,11 @@
+
+<div class="container-fluid nav2" id="nav2">
+    <div class="card">
+        <ul class="nav nav-pills">
+            @can('库存管理')
+            <li class="nav-item">
+                <a class="nav-link" href="{{url('inventory/statement/changeInventory')}}" :class="{active:isActive('statement',2)}">查询</a>
+            </li> @endcan
+        </ul>
+    </div>
+</div>

+ 123 - 0
resources/views/inventory/statement/changeInventory.blade.php

@@ -0,0 +1,123 @@
+@extends('layouts.app')
+@section('title')库存管理@endsection
+
+@section('content')
+    @component('inventory.statement.menu')@endcomponent
+<div id="list" class="d-none card container-fluid" style="min-width: 1500px">
+    <form method="GET" action="{{url('inventory/statement/changeInventory')}}" id="form">
+        <div class="text-nowrap mb-0" style="background: #fff;">
+            <div v-if="isBeingFilterConditions">
+                <div><div class="col" style="padding:0">
+                        <a  href="{{url('inventory/statement/changeInventory')}}"><span class="btn btn-warning text-dark">清除过滤条件</span></a>
+                    </div>
+                </div>
+            </div>
+            <div class="row mt-2 ml-2">
+                <div class="col-md-6" style="max-width: 400px">
+                    <input type="date" name="date_start" class=" form-control-sm tooltipTarget" title="选择显示指定日期的起始时间"
+                           v-model="filterData.date_start" :class="filterData.created_at_start?'bg-warning':''">
+                    <input type="date" class=" form-control-sm tooltipTarget" name="date_end" title="选择显示指定日期的结束时间"
+                           v-model="filterData.date_end" :class="filterData.created_at_end?'bg-warning':''" >
+                    <button type="submit" class="btn btn-sm btn-outline-dark">查询</button>
+                </div>
+
+            </div>
+        </div>
+    </form>
+    <table class="table table-sm table-striped table-bordered table-hover text-nowrap card-body mt-2">
+        <tr>
+            <th>货主</th>
+            <th>库位</th>
+            <th>产品编码</th>
+            <th>产品条码</th>
+            <th>商品名称</th>
+            <th>属性仓</th>
+            <th>质量状态</th>
+            <th>失效日期</th>
+            <th>批号</th>
+            <th>移出数量</th>
+            <th>移入数量</th>
+            <th>在库数量</th>
+            <th>占用数量</th>
+        </tr>
+        <tr v-for="oracleActTransactingLog in oracleActTransactingLogs">
+            <td>@{{ oracleActTransactingLog.货主 }}</td>
+            <td>@{{ oracleActTransactingLog.库位 }}</td>
+            <td>@{{ oracleActTransactingLog.产品编码 }}</td>
+            <td>@{{ oracleActTransactingLog.产品条码 }}</td>
+            <td>@{{ oracleActTransactingLog.商品名称 }}</td>
+            <td>@{{ oracleActTransactingLog.属性仓 }}</td>
+            <td>@{{ oracleActTransactingLog.质量状态 }}</td>
+            <td>@{{ oracleActTransactingLog.失效日期 }}</td>
+            <td>@{{ oracleActTransactingLog.批号 }}</td>
+            <td>@{{ oracleActTransactingLog.移出数量 }}</td>
+            <td>@{{ oracleActTransactingLog.移入数量 }}</td>
+            <td>@{{ oracleActTransactingLog.在库数量 }}</td>
+            <td>@{{ oracleActTransactingLog.占用数量 }}</td>
+        </tr>
+    </table>
+
+    {{--<div>
+        <button type="button" @click="pageUp()">上一页</button>
+        <button type="button" @click="pageDown()">下一页</button>
+        <input name="page" placeholder="去往指定页">
+        <span v-if="oracleActTransactingLogs && oracleActTransactingLogs.length>0">@{{ oracleActTransactingLogs[0].sum }}</span>
+        <span v-if="oracleActTransactingLogs && oracleActTransactingLogs.length>0">@{{ page }}/@{{ Math.ceil(oracleActTransactingLogs[0].sum/50) }}</span>
+    </div>--}}
+</div>
+@endsection
+
+@section('lastScript')
+    <script>
+        new Vue({
+            el:"#list",
+            data:{
+                oracleActTransactingLogs:{!! $oracleActTransactingLogs !!},
+                page:Number('{{$page}}'),
+                filterData:{date_start:'',date_end:''},
+            },
+            mounted:function () {
+                $(".tooltipTarget").tooltip({'trigger':'hover'});
+                this.initInputs();
+                $("#list").removeClass('d-none');
+            },
+            computed:{
+                isBeingFilterConditions:function(){
+
+                    for(let key in this.filterData){
+                        if(this.filterData[key]){
+                            return true
+                        }
+                    }
+                    return false;
+                },
+
+            },
+            methods:{
+                initInputs:function(){
+                    let data=this;
+                    let uriParts =decodeURI(location.href).split("?");
+                    if(uriParts.length>1){
+                        let params = uriParts[1].split('&');
+                        params.forEach(function(paramPair){
+                            let pair=paramPair.split('=');
+                            let key = pair[0], val = pair[1];
+                            $('input[name="'+key+'"]').val(val);
+                            $('select[name="'+key+'"]').val(val);
+                            decodeURI(data.filterData[key]=val);
+                        });
+                    }
+                },
+                pageUp(){
+                    if (this.page<=1)return;
+                     this.page=this.page-1;
+                     window.location.href="{{url('inventory/statement/changeInventory?page=')}}"+this.page;
+                },
+                pageDown(){
+                    this.page=this.page+1;
+                    window.location.href="{{url('inventory/statement/changeInventory?page=')}}"+this.page;
+                }
+            },
+        });
+    </script>
+@endsection

+ 15 - 0
resources/views/inventory/statement/menu.blade.php

@@ -0,0 +1,15 @@
+<div id="nav2">
+    @component('inventory.menu')
+    @endcomponent
+    <div class="container-fluid nav3">
+        <div class="card menu-third" >
+            <ul class="nav nav-pills">
+                @can('库存管理')
+                    <li class="nav-item">
+                        <a class="nav-link text-dark" href="{{url('inventory/statement/changeInventory')}}" :class="{active:isActive('changeInventory',3)}">动库报表</a>
+                    </li> @endcan
+            </ul>
+        </div>
+    </div>
+</div>
+

+ 3 - 0
resources/views/layouts/menu.blade.php

@@ -13,6 +13,9 @@
         @can('称重管理')
             <li class="nav-item"><a href="{{url("package/")}}" class="nav-link"
                                     :class="{active:isActive('package',1)}">称重管理</a></li> @endcan
+        @can('库存管理')
+            <li class="nav-item"><a href="{{url("inventory/statement/changeInventory")}}" class="nav-link"
+                                    :class="{active:isActive('inventory',1)}">库存管理</a></li> @endcan
         @can('二次加工管理')
             <li class="nav-item"><a href="{{url("process/")}}" class="nav-link"
                                     :class="{active:isActive('process',1)}">二次加工管理</a></li> @endcan

+ 8 - 0
routes/web.php

@@ -208,3 +208,11 @@ Route::group(['prefix'=>'personnel'],function(){
     //相关设置
     Route::get('relating',function (){return view('personnel/menuPersonnel');});
 });
+
+/**
+ * 库存
+ */
+Route::group(['prefix'=>'inventory'],function (){
+    //动库报表
+    Route::get('statement/changeInventory','InventoryController@changeInventory');
+});