| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- @extends('layouts.app')
- @section('title')计费模型-仓储计费@endsection
- @section('content')
- <div id="nav2">
- @component('maintenance.menu')@endcomponent
- @component('maintenance.priceModel.storage.menu')
- @if(isset($model))
- <li class="nav-item">
- <a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('edit',5)}">编辑</a>
- </li>
- @endif
- @endcomponent
- </div>
- <div class="container-fluid mt-2 card" id="container">
- <form method="POST" :action="model.id ? '{{url('maintenance/priceModel/storage/update')}}' : '{{url('maintenance/priceModel/storage/store')}}'" class="card-body offset-3">
- @csrf
- <label hidden><input :value="model.id" name="id"></label>
- <div class="row">
- <label for="name" class="col-2">名称</label>
- <input id="name" type="text" name="name" class="col-6 form-control"
- :class="errors.name ? 'is-invalid' : ''" v-model="model.name">
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.name">
- <strong>@{{ errors.name[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="counting_type" class="col-2 text-info">计费类型</label>
- <select id="counting_type" name="counting_type" class="col-3 form-control"
- :class="errors.counting_type ? 'is-invalid' : ''" v-model="model.counting_type">
- <option v-for="type in counting_type" :value="type">@{{ type }}</option>
- </select>
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.counting_type">
- <strong>@{{ errors.counting_type[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="using_type" class="col-2 text-info">用仓类型</label>
- <select id="using_type" name="using_type" class="col-3 form-control"
- :class="errors.using_type ? 'is-invalid' : ''" v-model="model.using_type">
- <option v-for="type in using_type" :value="type">@{{ type }}</option>
- </select>
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.using_type">
- <strong>@{{ errors.using_type[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="minimum_area" class="col-2">最低起租面积</label>
- <input id="minimum_area" type="number" min="0" step="0.001" name="minimum_area" class="col-6 form-control"
- :class="errors.minimum_area ? 'is-invalid' : ''" v-model="model.minimum_area">
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.minimum_area">
- <strong>@{{ errors.minimum_area[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="price" class="col-2 text-info">单价</label>
- <input id="price" type="number" min="0" step="0.001" name="price" class="col-6 form-control"
- :class="errors.price ? 'is-invalid' : ''" v-model="model.price">
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.price">
- <strong>@{{ errors.price[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="discount_type" class="col-2 text-info">减免类型</label>
- <select id="discount_type" name="discount_type" class="col-3 form-control"
- :class="errors.discount_type ? 'is-invalid' : ''" v-model="model.discount_type">
- <option v-for="type in discount_type" :value="type">@{{ type }}</option>
- </select>
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.discount_type">
- <strong>@{{ errors.discount_type[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="discount_value" class="col-2">减免值</label>
- <input id="discount_value" type="number" min="0" step="0.001" name="discount_value" class="col-6 form-control"
- :class="errors.discount_value ? 'is-invalid' : ''" v-model="model.discount_value">
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.discount_value">
- <strong>@{{ errors.discount_value[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3">
- <label for="unit_id" class="col-2 text-info">单位</label>
- <select id="unit_id" name="unit_id" class="col-3 form-control"
- :class="errors.unit_id ? 'is-invalid' : ''" v-model="model.unit_id">
- <option v-for="unit in units" :value="unit.id">@{{ unit.name }}</option>
- </select>
- <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.unit_id">
- <strong>@{{ errors.unit_id[0] }}</strong>
- </span>
- </div>
- <div class="row mt-3 offset-1">
- <button type="submit" class="btn btn-success col-7">提交</button>
- </div>
- </form>
- </div>
- @stop
- @section("lastScript")
- <script>
- new Vue({
- el:"#container",
- data:{
- model : {
- 'id' : "{{isset($model) ? $model->id : ''}}",
- 'counting_type' : "{{old('counting_type') ?? (isset($model) ? $model->counting_type : '')}}",
- 'using_type' : "{{old('using_type') ?? (isset($model) ? $model->using_type : '')}}",
- 'minimum_area' : "{{old('minimum_area') ?? (isset($model) ? $model->minimum_area : '')}}",
- 'discount_value' : "{{old('discount_value') ?? (isset($model) ? $model->discount_value : '')}}",
- 'price' : "{{old('price') ?? (isset($model) ? $model->price : '')}}",
- 'discount_type' : "{{old('discount_type') ?? (isset($model) ? $model->discount_type : '')}}",
- 'unit_id' : "{{old('unit_id') ?? (isset($model) ? $model->unit_id : '')}}",
- },
- counting_type : ['包仓','灵活用仓','统单价'],
- using_type : ['常温','恒温'],
- discount_type : ['无减免','按单减免','固定减免'],
- units : [
- @foreach($units as $unit)
- {id:"{{$unit->id}}", name:"{{$unit->name}}"},
- @endforeach
- ],
- errors:{!! $errors !!}
- },
- });
- </script>
- @stop
|