@extends('layouts.app')
@section('title')创建商品@endsection

@section('content')
    <div id="nav2">
        @component('maintenance.menu')@endcomponent
        @component('maintenance.commodity.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('maintenance/commodity') }}">
                    @csrf
                    <div class="form-group row">
                        <label for="sku" class="col-2 col-form-label text-right">SKU</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('sku') is-invalid @enderror"
                                   name="sku" autocomplete="off" value="{{ old('sku') }}" >
                            @error('sku')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="name" class="col-2 col-form-label text-right">商品名</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('name') is-invalid @enderror"
                                   name="name" autocomplete="off" value="{{ old('name') }}" required>
                            @error('name')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="barcode" class="col-2 col-form-label text-right">条码</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('barcode') is-invalid @enderror"
                                   name="barcode" autocomplete="off" value="{{ old('barcode') }}" required>
                            @error('barcode')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="owner_name" class="col-2 col-form-label text-right">货主名</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('owner_name') is-invalid @enderror"
                                   name="owner_name" autocomplete="off" value="{{ old('owner_name') }}" >
                            @error('owner_name')
                            <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">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
