create.blade.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. @extends('layouts.app')
  2. @section('title')运输管理-录入@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('waybill.menu')@endcomponent
  6. <div class="container-fluid nav3">
  7. <div class="card menu-third" >
  8. <ul class="nav nav-pills">
  9. @can('运输管理-录入')
  10. <li class="nav-item">
  11. <a class="nav-link @if($type=='专线') active @endif" href="{{url('waybill/create?type=ZX')}}" >专线</a>
  12. </li>
  13. <li class="nav-item">
  14. <a class="nav-link @if($type=='直发车') active @endif" href="{{url('waybill/create?type=ZF')}}">直发车</a>
  15. </li> @endcan
  16. </ul>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="container-fluid" id="list">
  21. <div class="card col-md-8 offset-md-2">
  22. <div class="card-body">
  23. <form method="POST" action="{{ url('waybill') }}">
  24. @csrf
  25. <input name="type" hidden value="{{$type}}">
  26. <div class="h5 text-center mb-3">
  27. <ul class="nav nav-tabs">
  28. <li class="nav-item offset-5"><a class="nav-link @if($type=='专线') active @endif" href="{{url('waybill/create?type=ZX')}}">专线</a></li>
  29. <li class="nav-item"><a class="nav-link @if($type!='专线') active @endif" href="{{url('waybill/create?type=ZF')}}">直发车</a></li>
  30. </ul>
  31. </div>
  32. <div class="form-group row">
  33. <label for="owner_id" class="col-2 col-form-label text-right text-primary">货主{{old('owner_id')}} *</label>
  34. <div class="col-8 form-inline">
  35. <select name="owner_id" class="form-control @error('owner_id') is-invalid @enderror" v-model="owner_id" style="width: 30%">
  36. <option v-for="owner in owners" :value="owner.id">@{{owner.name}}</option>
  37. </select>
  38. <input class="form-control-sm ml-2" placeholder="输入关键字定位" @input="owner_seek">
  39. </div>
  40. <div class="col-sm-5">
  41. <p class="form-control-static text-danger small font-weight-bold" style="margin-left: 50%">{{ $errors->first('owner_id') }}</p>
  42. </div>
  43. </div>
  44. <div class="form-group row">
  45. <label for="wms_bill_number" class="col-2 col-form-label text-right text-muted">WMS单号</label>
  46. <div class="col-8">
  47. <input type="text" class="form-control @error('wms_bill_number') is-invalid @enderror"
  48. name="wms_bill_number" autocomplete="off" value="{{ old('wms_bill_number') }}" >
  49. @error('wms_bill_number')
  50. <span class="invalid-feedback" role="alert">
  51. <strong>{{ $message }}</strong>
  52. </span>
  53. @enderror
  54. </div>
  55. </div>
  56. <div class="col-8" style="margin-left: 15%">
  57. <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='松江区泗砖仓'" style="transform: scale(0.9)">松江泗砖仓</button>
  58. <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='松江区九干仓'" style="transform: scale(0.9)">松江九干仓</button>
  59. <button type="button" class="btn btn-outline-primary btn-sm" @click="origination='嘉定区武乡仓'" style="transform: scale(0.9)">嘉定武乡仓</button>
  60. </div>
  61. <div class="form-group row">
  62. <label for="origination" class="col-2 col-form-label text-right text-primary">始发地址 *</label>
  63. <div class="col-8">
  64. <input type="text" class="form-control @error('origination') is-invalid @enderror"
  65. name="origination" autocomplete="off" value="{{ old('origination') }}" v-model="origination" required>
  66. @error('origination')
  67. <span class="invalid-feedback" role="alert">
  68. <strong>{{ $message }}</strong>
  69. </span>
  70. @enderror
  71. </div>
  72. </div>
  73. <div class="form-group row">
  74. <label for="destination" class="col-2 col-form-label text-right text-primary">目的地址 *</label>
  75. <div class="col-8">
  76. <input type="text" class="form-control @error('destination') is-invalid @enderror"
  77. name="destination" autocomplete="off" value="{{ old('destination') }}" required>
  78. @error('destination')
  79. <span class="invalid-feedback" role="alert">
  80. <strong>{{ $message }}</strong>
  81. </span>
  82. @enderror
  83. </div>
  84. </div>
  85. <div class="form-group row">
  86. <label for="recipient" class="col-2 col-form-label text-right text-primary">收件人 *</label>
  87. <div class="col-8">
  88. <input type="text" class="form-control @error('recipient') is-invalid @enderror"
  89. name="recipient" autocomplete="off" value="{{ old('recipient') }}" required>
  90. @error('recipient')
  91. <span class="invalid-feedback" role="alert">
  92. <strong>{{ $message }}</strong>
  93. </span>
  94. @enderror
  95. </div>
  96. </div>
  97. <div class="form-group row">
  98. <label for="recipient_mobile" class="col-2 col-form-label text-right text-primary">收件人电话 *</label>
  99. <div class="col-8">
  100. <input type="text" class="form-control @error('recipient_mobile') is-invalid @enderror"
  101. name="recipient_mobile" autocomplete="off" value="{{ old('recipient_mobile') }}" required>
  102. @error('recipient_mobile')
  103. <span class="invalid-feedback" role="alert">
  104. <strong>{{ $message }}</strong>
  105. </span>
  106. @enderror
  107. </div>
  108. </div>
  109. {{--zengjun start--}}
  110. {{-- @can('运输管理-运费')--}}
  111. <div class="form-group row">
  112. <label for="charge" class="col-2 col-form-label text-right ">运输收费(元)</label>
  113. <div class="col-8">
  114. <input type="text" class="form-control @error('charge') is-invalid @enderror"
  115. name="charge" autocomplete="off" value="{{ old('charge') }}" >
  116. @error('charge')
  117. <span class="invalid-feedback" role="alert">
  118. <strong>{{ $message }}</strong>
  119. </span>
  120. @enderror
  121. </div>
  122. </div>
  123. <div class="form-group row">
  124. <label for="other_charge" class="col-2 col-form-label text-right text-muted">其他收费(元)</label>
  125. <div class="col-8">
  126. <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
  127. name="other_charge" autocomplete="off" value="@if(old('other_charge')){{ old('other_charge') }}@endif" >
  128. @error('other_charge')
  129. <span class="invalid-feedback" role="alert">
  130. <strong>{{ $message }}</strong>
  131. </span>
  132. @enderror
  133. </div>
  134. </div>
  135. <div class="form-group row">
  136. <label for="other_charge_remark" class="col-2 col-form-label text-right text-muted">其他收费备注</label>
  137. <div class="col-8">
  138. <input type="text" class="form-control @error('other_charge') is-invalid @enderror"
  139. name="other_charge_remark" autocomplete="off" value="@if(old('other_charge_remark')){{ old('other_charge_remark') }}@endif" >
  140. @error('other_charge_remark')
  141. <span class="invalid-feedback" role="alert">
  142. <strong>{{ $message }}</strong>
  143. </span>·
  144. @enderror
  145. </div>
  146. </div>
  147. {{-- @endcan--}}
  148. {{--zengjun end--}}
  149. <div class="form-group row">
  150. <label for="collect_fee" class="col-2 col-form-label text-right text-muted">到付金额(元)</label>
  151. <div class="col-8">
  152. <input type="text" class="form-control @error('collect_fee') is-invalid @enderror"
  153. name="collect_fee" autocomplete="off" value="{{ old('collect_fee') }}" >
  154. @error('collect_fee')
  155. <span class="invalid-feedback" role="alert">
  156. <strong>{{ $message }}</strong>
  157. </span>
  158. @enderror
  159. </div>
  160. </div>
  161. <div class="form-group row">
  162. <label for="ordering_remark" class="col-2 col-form-label text-right text-muted">下单备注</label>
  163. <div class="col-8">
  164. <textarea class="form-control @error('ordering_remark') is-invalid @enderror"
  165. name="ordering_remark" autocomplete="off" >{{ old('ordering_remark') }}</textarea>
  166. @error('ordering_remark')
  167. <span class="invalid-feedback" role="alert">
  168. <strong>{{ $message }}</strong>
  169. </span>
  170. @enderror
  171. </div>
  172. </div>
  173. <div class="form-group row">
  174. <div class="col-8 offset-2">
  175. <input type="submit" class="btn btn-success form-control">
  176. </div>
  177. </div>
  178. </form>
  179. </div>
  180. </div>
  181. </div>
  182. @endsection
  183. @section('lastScript')
  184. <script>
  185. let vueList=new Vue({
  186. el:'#list',
  187. data:{
  188. owners:[
  189. @foreach($owners as $owner)
  190. {id:'{{$owner->id}}',name:'{{$owner->name}}'},
  191. @endforeach
  192. ],
  193. owner_id:'{{old('owner_id')}}',
  194. origination:'{{old('origination')}}',
  195. },
  196. methods:{
  197. owner_seek:function (e) {
  198. let _this=this;
  199. let $val=e.target.value;
  200. if($val==='')_this.owner_id='';
  201. else
  202. _this.owners.forEach(function (owner) {
  203. if (owner.name.includes($val)){
  204. _this.owner_id=owner.id;
  205. }
  206. });
  207. },
  208. },
  209. });
  210. </script>
  211. @endsection