@extends('layouts.app')
@section('title')入库管理@endsection

@section('content')
    <span id="nav2">
        @component('store.menu')@endcomponent
        @component('store.fast.menu')@endcomponent
    </span>
    <div class="d-none" id="item">
        <div class="container-fluid">
            <table class="table table-striped table-sm text-nowrap table-hover td-min-width-80" id="table">
                <tr v-for="(storeItem,i) in storeItems">
                    <td>
                        <input class="checkItem" type="checkbox" :value="storeItem.id">
                    </td>
                    <td><span>@{{ i+1  }}</span></td>
                    <td><span>@{{storeItem.store_asn_code}}</span></td>
                    <td><span>@{{storeItem.asn_line_code}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.name}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.sku}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.barcode}}</span></td>
                    <td><span>@{{storeItem.depository_name}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.amount}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.quality}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.status}}</span></td>
                    <td class="text-muted"><span>@{{storeItem.created_at}}</span></td>
                </tr>
            </table>
            <div class="text-info h5 btn btn">{{$storeItems->count()}}/{{$storeItems->total()}}</div>
            {{$storeItems->links()}}
        </div>
    </div>
@endsection

@section('lastScript')
    <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
    <script>
        let vue = new Vue({
            el:'#item',
            data:{
                storeItems:[
                @foreach($storeItems as $storeItem)
                {!! $storeItem !!},
                @endforeach
                ],
            },
            mounted:function(){
                $('#item').removeClass('d-none');
                let column = [
                    {name:'index',value: '序号', neglect: true},
                    {name:'store_asn_code',value: 'ASN编号'},
                    {name:'asn_line_code',value: 'ASN行号'},
                    {name:'name',value: '产品名', class:'text-muted'},
                    {name:'sku',value: 'SKU', class:'text-muted'},
                    {name:'barcode',value: '条码', class:'text-muted'},
                    {name:'depository_name',value: '属性仓'},
                    {name:'amount',value: '总计', class:'text-muted'},
                    {name:'quality',value: '质量', class:'text-muted'},
                    {name:'status',value: '状态', class:'text-muted'},
                    {name:'created_at',value: '创建时间', class:'text-muted'},
                ];
                new Header({
                    el: "table",
                    name: "inStorage",
                    column: column,
                    data: this.storeItems,
                }).init();
            },
        });
    </script>
@endsection
