@extends('layouts.app')
@section('title')导入-纸箱@endsection

@section('content')
    <div id="nav2">
        @component('maintenance.menu')@endcomponent
        @component('maintenance.paperBox.menu')@endcomponent
    </div>
    <div class="container">
        <div class="card col-md-8 offset-md-2">
            <div class="card-body">
                <form method="POST" action="{{ url('maintenance/paperBox/excel/import') }}" enctype="multipart/form-data" target="_blank">
                    @csrf
                    <div class="form-group row text-center">
                        <div class="col-12 text-danger">

                            注意：请保证表第一行有以下对应的字段名<br>(可不按顺序)：<br>
                            货主，纸箱名称，长，宽，高<br>
                        </div>
                        <div class="col-12 text-info ">
                            导入时间随文件大小可能达数十分钟以上，请耐心等候
                            <hr>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="sku" class="col-2 col-form-label text-right">选择EXCEL</label>
                        <div class="col-8">
                            <div class="form-control">
                                <input type="file" class="form-control-file @error('file') is-invalid @enderror"
                                       name="file" value="{{ old('file') }}" required>
                                @error('file')
                                <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                                @enderror
                            </div>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="sku" class="col-2 col-form-label text-right">是否覆盖</label>
                        <div class="col-8">
                            <select name="isOverride" id="isOverride" class="form-control" >
                                <option value="0">仅新增</option>
                                <option value="1">新增且覆盖</option>
                            </select>
                            <p class="text-muted">覆盖会以货主，纸箱名称为依据，覆盖其余字段</p>
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-8 offset-2">
                            <input type="submit" class="btn btn-success form-control" value="执行导入">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
