@extends('layouts.app')
@section('title')录入-承运商@endsection

@section('content')
    <div id="nav2">
        @component('maintenance.menu')@endcomponent
        @component('maintenance.logistic.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/logistic') }}">
                    @csrf
                    <div class="form-group row">
                        <label for="type" class="col-2 col-form-label text-right">承运商类型 <b class="text-danger">*</b></label>
                        <div class="col-5">
                            <select id="type" name="type" class="form-control @error('type') is-invalid @enderror" value="{{ old('type') }}" required>
                                <option value="快递">快递</option>
                                <option value="物流">物流</option>
                                <option value="全部">全部</option>
                            </select>
                            @error('type')
                            <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">承运商名称 <b class="text-danger">*</b></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="english_name" class="col-2 col-form-label text-right">承运商英文名称</label>
                        <div class="col-8">
                            <input type="text" class="form-control" id="english_name"
                                   name="english_name" autocomplete="off" value="{{ old('name') }}">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="code" class="col-2 col-form-label text-right">承运商代码 <b class="text-danger">*</b></label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('code') is-invalid @enderror"
                                   name="code" autocomplete="off" value="{{ old('code') }}" required>
                            @error('code')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $message }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="is_bunched" class="col-2 col-form-label text-right">是否子母单</label>
                        <div class="col-8">
                            <input id="is_bunched" name="is_bunched" type="checkbox" class="switch" @if(old('is_bunched')) checked @endif>
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="mobile" class="col-2 col-form-label text-right">承运商电话</label>
                        <div class="col-8">
                            <input id="mobile" type="text" class="form-control @error('mobile') is-invalid @enderror"
                                   name="mobile" autocomplete="off" value="{{ old('mobile') }}" >
                            @error('mobile')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('mobile') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="delivery_fee" class="col-2 col-form-label text-right">送货费</label>
                        <div class="col-8">
                            <input id="delivery_fee" type="text" class="form-control @error('delivery_fee') is-invalid @enderror"
                                   name="delivery_fee" autocomplete="off" value="{{ old('delivery_fee') }}" >
                            @error('delivery_fee')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('delivery_fee') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="remark" class="col-2 col-form-label text-right">备注</label>
                        <div class="col-8">
                            <textarea id="remark" type="text" class="form-control "
                                      name="remark" autocomplete="off" >{{ old('remark') }}</textarea>
                        </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
