create.blade.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. @extends('layouts.app')
  2. @section('title')计费模型-仓储计费@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('maintenance.menu')@endcomponent
  6. @component('maintenance.priceModel.storage.menu')
  7. @if(isset($model))
  8. <li class="nav-item">
  9. <a class="nav-link" href="{{URL::current()}}" :class="{active:isActive('edit',5)}">编辑</a>
  10. </li>
  11. @endif
  12. @endcomponent
  13. </div>
  14. <div class="container-fluid mt-2 card" id="container">
  15. <form method="POST" :action="model.id ? '{{url('maintenance/priceModel/storage/update')}}' : '{{url('maintenance/priceModel/storage/store')}}'" class="card-body offset-3">
  16. @csrf
  17. <label hidden><input :value="model.id" name="id"></label>
  18. <div class="row">
  19. <label for="name" class="col-2">名称</label>
  20. <input id="name" type="text" name="name" class="col-6 form-control"
  21. :class="errors.name ? 'is-invalid' : ''" v-model="model.name">
  22. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.name">
  23. <strong>@{{ errors.name[0] }}</strong>
  24. </span>
  25. </div>
  26. <div class="row mt-3">
  27. <label for="counting_type" class="col-2 text-info">计费类型</label>
  28. <select id="counting_type" name="counting_type" class="col-3 form-control"
  29. :class="errors.counting_type ? 'is-invalid' : ''" v-model="model.counting_type">
  30. <option v-for="type in counting_type" :value="type">@{{ type }}</option>
  31. </select>
  32. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.counting_type">
  33. <strong>@{{ errors.counting_type[0] }}</strong>
  34. </span>
  35. </div>
  36. <div class="row mt-3">
  37. <label for="using_type" class="col-2 text-info">用仓类型</label>
  38. <select id="using_type" name="using_type" class="col-3 form-control"
  39. :class="errors.using_type ? 'is-invalid' : ''" v-model="model.using_type">
  40. <option v-for="type in using_type" :value="type">@{{ type }}</option>
  41. </select>
  42. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.using_type">
  43. <strong>@{{ errors.using_type[0] }}</strong>
  44. </span>
  45. </div>
  46. <div class="row mt-3">
  47. <label for="minimum_area" class="col-2">最低起租面积</label>
  48. <input id="minimum_area" type="number" min="0" step="0.001" name="minimum_area" class="col-6 form-control"
  49. :class="errors.minimum_area ? 'is-invalid' : ''" v-model="model.minimum_area">
  50. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.minimum_area">
  51. <strong>@{{ errors.minimum_area[0] }}</strong>
  52. </span>
  53. </div>
  54. <div class="row mt-3">
  55. <label for="price" class="col-2 text-info">单价</label>
  56. <input id="price" type="number" min="0" step="0.001" name="price" class="col-6 form-control"
  57. :class="errors.price ? 'is-invalid' : ''" v-model="model.price">
  58. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.price">
  59. <strong>@{{ errors.price[0] }}</strong>
  60. </span>
  61. </div>
  62. <div class="row mt-3">
  63. <label for="discount_type" class="col-2 text-info">减免类型</label>
  64. <select id="discount_type" name="discount_type" class="col-3 form-control"
  65. :class="errors.discount_type ? 'is-invalid' : ''" v-model="model.discount_type">
  66. <option v-for="type in discount_type" :value="type">@{{ type }}</option>
  67. </select>
  68. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.discount_type">
  69. <strong>@{{ errors.discount_type[0] }}</strong>
  70. </span>
  71. </div>
  72. <div class="row mt-3">
  73. <label for="discount_value" class="col-2">减免值</label>
  74. <input id="discount_value" type="number" min="0" step="0.001" name="discount_value" class="col-6 form-control"
  75. :class="errors.discount_value ? 'is-invalid' : ''" v-model="model.discount_value">
  76. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.discount_value">
  77. <strong>@{{ errors.discount_value[0] }}</strong>
  78. </span>
  79. </div>
  80. <div class="row mt-3">
  81. <label for="unit_id" class="col-2 text-info">单位</label>
  82. <select id="unit_id" name="unit_id" class="col-3 form-control"
  83. :class="errors.unit_id ? 'is-invalid' : ''" v-model="model.unit_id">
  84. <option v-for="unit in units" :value="unit.id">@{{ unit.name }}</option>
  85. </select>
  86. <span class="invalid-feedback mt-0 offset-2" role="alert" v-if="errors.unit_id">
  87. <strong>@{{ errors.unit_id[0] }}</strong>
  88. </span>
  89. </div>
  90. <div class="row mt-3 offset-1">
  91. <button type="submit" class="btn btn-success col-7">提交</button>
  92. </div>
  93. </form>
  94. </div>
  95. @stop
  96. @section("lastScript")
  97. <script>
  98. new Vue({
  99. el:"#container",
  100. data:{
  101. model : {
  102. 'id' : "{{isset($model) ? $model->id : ''}}",
  103. 'counting_type' : "{{old('counting_type') ?? (isset($model) ? $model->counting_type : '')}}",
  104. 'using_type' : "{{old('using_type') ?? (isset($model) ? $model->using_type : '')}}",
  105. 'minimum_area' : "{{old('minimum_area') ?? (isset($model) ? $model->minimum_area : '')}}",
  106. 'discount_value' : "{{old('discount_value') ?? (isset($model) ? $model->discount_value : '')}}",
  107. 'price' : "{{old('price') ?? (isset($model) ? $model->price : '')}}",
  108. 'discount_type' : "{{old('discount_type') ?? (isset($model) ? $model->discount_type : '')}}",
  109. 'unit_id' : "{{old('unit_id') ?? (isset($model) ? $model->unit_id : '')}}",
  110. },
  111. counting_type : ['包仓','灵活用仓','统单价'],
  112. using_type : ['常温','恒温'],
  113. discount_type : ['无减免','按单减免','固定减免'],
  114. units : [
  115. @foreach($units as $unit)
  116. {id:"{{$unit->id}}", name:"{{$unit->name}}"},
  117. @endforeach
  118. ],
  119. errors:{!! $errors !!}
  120. },
  121. });
  122. </script>
  123. @stop