create.blade.php 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. @extends('layouts.app')
  2. @section('content')
  3. <div id="nav2">
  4. @component('maintenance.priceModel.waybillPriceModel.menu')@endcomponent
  5. </div>
  6. <div class="container-fluid" id="list">
  7. <div class="card col-md-8 offset-md-2">
  8. <div class="card-body">
  9. <form method="POST" action="{{ url('waybill/waybillPriceModel') }}">
  10. @if(Session::has('successTip'))
  11. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  12. @endif
  13. @csrf
  14. <div class="form-group row">
  15. <label for="logistic_id" class="col-2 col-form-label text-right">承运商</label>
  16. <div class="col-8">
  17. <select class="form-control" name="WaybillPriceModel[logistic_id]" style="width: 30%;" v-model="inputting.WaybillPriceModel.logistic_id">
  18. <option v-for="logistic in logistics" :value="logistic.id">@{{logistic.name}}</option>
  19. </select>
  20. <div class="col-sm-5">
  21. <p class="form-control-static text-danger small font-weight-bold">{{ $errors->first('WaybillPriceModel.logistic_id') }}</p>
  22. </div>
  23. </div>
  24. </div>
  25. <div class="form-group row">
  26. <label for="province_id" class="col-2 col-form-label text-right">选择省份</label>
  27. <div class="col-8" >
  28. <select id="province_id" class="form-control" name="WaybillPriceModel[province_id]" style="width: 30%;" v-model="inputting.WaybillPriceModel.province_id">
  29. <option v-for="province in regions" v-if="province.type == 1" :value="province.id">@{{province.name}}</option>
  30. </select>
  31. <div class="col-sm-5">
  32. <p class="form-control-static text-danger small font-weight-bold">{{ $errors->first('WaybillPriceModel.province_id') }}</p>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group row">
  37. <label for="city_id" class="col-2 col-form-label text-right">选择城市</label>
  38. <div class="col-8" >
  39. <select class="form-control" name="WaybillPriceModel[city_id]" style="width: 30%;" v-model="inputting.WaybillPriceModel.city_id">
  40. <option v-for="city in regions" v-if="city.type == 2 && city.parent_id == inputting.WaybillPriceModel.province_id" :value="city.id">@{{city.name}}</option>
  41. </select>
  42. <div class="col-sm-5">
  43. <p class="form-control-static text-danger small font-weight-bold">{{ $errors->first('WaybillPriceModel.city_id') }}</p>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="form-group row">
  48. <label for="unit_id" class="col-2 col-form-label text-right">货物单位</label>
  49. <div class="col-8" >
  50. <select class="form-control" name="WaybillPriceModel[unit_id]" style="width: 30%;" v-model="inputting.WaybillPriceModel.unit_id">
  51. <option v-for="unit in units" :value="unit.id">@{{unit.name}}</option>
  52. </select>
  53. <div class="col-sm-5">
  54. <p class="form-control-static text-danger small font-weight-bold">{{ $errors->first('WaybillPriceModel.unit_id') }}</p>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="form-group row">
  59. <label for="range_min" class="col-2 col-form-label text-right">计价区间</label>
  60. <div class="col-8 form-inline">
  61. <input type="text" style="width: 20%" class="form-control @error('WaybillPriceModel.range_min') is-invalid @enderror"
  62. name="WaybillPriceModel[range_min]" autocomplete="off" value="{{ old('WaybillPriceModel')['range_min'] }}" >&nbsp;&nbsp;--&nbsp;&nbsp;
  63. <input type="text" style="width: 20%" class="form-control @error('WaybillPriceModel.range_max') is-invalid @enderror"
  64. name="WaybillPriceModel[range_max]" autocomplete="off" value="{{ old('WaybillPriceModel')['range_max'] }}" >
  65. @error('WaybillPriceModel.range_min')
  66. <span class="invalid-feedback" role="alert">
  67. <strong>{{ $message }}</strong>
  68. </span>
  69. @enderror
  70. @error('WaybillPriceModel.range_max')
  71. <span class="invalid-feedback" role="alert">
  72. <strong>{{ $message }}</strong>
  73. </span>
  74. @enderror
  75. </div>
  76. </div>
  77. <div class="form-group row">
  78. <label for="unit_price" class="col-2 col-form-label text-right">单价</label>
  79. <div class="col-8">
  80. <input type="text" class="form-control @error('WaybillPriceModel.unit_price') is-invalid @enderror"
  81. name="WaybillPriceModel[unit_price]" autocomplete="off" value="{{ old('WaybillPriceModel')['unit_price'] }}" >
  82. @error('WaybillPriceModel.unit_price')
  83. <span class="invalid-feedback" role="alert">
  84. <strong>{{ $message }}</strong>
  85. </span>
  86. @enderror
  87. </div>
  88. </div>
  89. <div class="form-group row">
  90. <label for="base_fee" class="col-2 col-form-label text-right">起步费(元)</label>
  91. <div class="col-8">
  92. <input type="text" class="form-control @error('WaybillPriceModel.base_fee') is-invalid @enderror"
  93. name="WaybillPriceModel[base_fee]" autocomplete="off" value="{{ old('WaybillPriceModel')['base_fee'] }}" >
  94. @error('WaybillPriceModel.base_fee')
  95. <span class="invalid-feedback" role="alert">
  96. <strong>{{ $message }}</strong>
  97. </span>
  98. @enderror
  99. </div>
  100. </div>
  101. <div class="form-group row">
  102. <label for="initial_weight" class="col-2 col-form-label text-right">最低计数</label>
  103. <div class="col-8">
  104. <input type="text" class="form-control @error('WaybillPriceModel.initial_weight') is-invalid @enderror"
  105. name="WaybillPriceModel[initial_weight]" autocomplete="off" value="{{ old('WaybillPriceModel')['initial_weight'] }}" >
  106. @error('WaybillPriceModel.initial_weight')
  107. <span class="invalid-feedback" role="alert">
  108. <strong>{{ $message }}</strong>
  109. </span>
  110. @enderror
  111. </div>
  112. </div>
  113. <div class="form-group row">
  114. <div class="col-8 offset-2">
  115. <input type="submit" class="btn btn-success form-control">
  116. </div>
  117. </div>
  118. </form>
  119. </div>
  120. </div>
  121. </div>
  122. @endsection
  123. @section('lastScript')
  124. <script>
  125. let insertVue=new Vue({
  126. el:'#list',
  127. data:{
  128. inputting:{
  129. WaybillPriceModel:{
  130. @if(isset(old('WaybillPriceModel')['province_id']))
  131. province_id:'{{old('WaybillPriceModel')['province_id']}}',
  132. @endif
  133. @if(isset(old('WaybillPriceModel')['city_id']))
  134. city_id:'{{old('WaybillPriceModel')['city_id']}}',
  135. @endif
  136. @if(isset(old('WaybillPriceModel')['logistic_id']))
  137. logistic_id:'{{old('WaybillPriceModel')['logistic_id']}}',
  138. @endif
  139. @if(isset(old('WaybillPriceModel')['unit_id']))
  140. unit_id:'{{old('WaybillPriceModel')['unit_id']}}',
  141. @endif
  142. }
  143. },
  144. regions:[
  145. @foreach($regions as $region)
  146. {id:"{{$region->id}}",parent_id:"{{$region->parent_id}}",type:"{{$region->type}}",name:"{{$region->name}}"},
  147. @endforeach
  148. ],
  149. logistics:[
  150. @foreach($logistics as $logistic)
  151. {id:'{{$logistic->id}}',name:'{{$logistic->name}}'},
  152. @endforeach
  153. ],
  154. units:[
  155. @foreach($units as $unit)
  156. {id:'{{$unit->id}}',name:'{{$unit->name}}'},
  157. @endforeach
  158. ],
  159. },
  160. });
  161. </script>
  162. @endsection