create.blade.php 11 KB

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