@extends('layouts.app')
@section('title')导入-退货管理@endsection

@section('content')
    <div id="nav2">
        @component('rejected.menu')@endcomponent
        @component('rejected.search.menu')@endcomponent
    </div>
    <div class="container-fluid">
        <div class="card col-md-8 offset-md-2">
            <div class="card-body">
                @if(Session::has('successTip'))
                    <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
                @endif
                <form method="POST" action="{{ url('rejected/import/excel') }}" enctype="multipart/form-data" target="_blank">
                    @csrf
                    <div class="form-group row text-center">
                        <div class="col-12 text-danger">
                            导入表格需要包含以下字段：
                            货主，
                            退回单号，
                            手机号，
                            快递公司，
                            条码，
                            数量，
                            品质(正品/ 残次/ 未知)，
                            <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 @error('isOverride') is-invalid @enderror" >
                                <option value="0">仅新增</option>
                                <option value="1">新增且覆盖</option>
                            </select>
                            @error('isOverride')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                            @enderror
                        </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
