@extends('layouts.app')
@section('title')编辑-测量设备@endsection

@section('content')
    <div id="nav2">
        @component('maintenance.menu')
        @endcomponent
        @component('maintenance.measuringMachine.menu')
                <li class="nav-item">
                    <a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('edit',4)}">修改</a>
                </li>
        @endcomponent
    </div>
    <div class="container-fluid">
        <div class="card">
            <div class="card-body">
                <form method="POST" action='{{url("maintenance/measuringMachine/{$measuringMachine->id}")}}'>
                    @csrf
                    @method('PUT')
                    <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')?old('name'):$measuringMachine->name}}" >
                            @error('name')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('name') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <label for="code" class="col-2 col-form-label text-right">设备代码(ID)</label>
                        <div class="col-8">
                            <input type="text" class="form-control @error('code') is-invalid @enderror"
                                   name="code" autocomplete="off" value="{{ old('code')?old('code'):$measuringMachine->code }}" >
                            @error('code')
                            <span class="invalid-feedback" role="alert">
                                <strong>{{ $errors->first('code') }}</strong>
                            </span>
                            @enderror
                        </div>
                    </div>
                    <div class="form-group row">
                        <div class="col-8 offset-2">
                            <input type="submit" class="btn btn-outline-dark form-control">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection
