create.blade.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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" href="{{url('waybill/create/ZX')}}" :class="{active:isActive('ZX',3)}">专线</a>
  11. </li>
  12. <li class="nav-item">
  13. <a class="nav-link" href="{{url('waybill/create/ZF')}}" :class="{active:isActive('ZF',3)}">直发车</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/ZX')}}">专线</a></li>
  28. <li class="nav-item"><a class="nav-link @if($type!='专线') active @endif" href="{{url('files')}}">直发车</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. <div class="form-group row">
  109. <label for="charge" class="col-2 col-form-label text-right ">收费(元)</label>
  110. <div class="col-8">
  111. <input type="text" class="form-control @error('charge') is-invalid @enderror"
  112. name="charge" autocomplete="off" value="{{ old('charge') }}" >
  113. @error('charge')
  114. <span class="invalid-feedback" role="alert">
  115. <strong>{{ $message }}</strong>
  116. </span>
  117. @enderror
  118. </div>
  119. </div>
  120. <div class="form-group row">
  121. <label for="collect_fee" class="col-2 col-form-label text-right text-muted">到付金额(元)</label>
  122. <div class="col-8">
  123. <input type="text" class="form-control @error('collect_fee') is-invalid @enderror"
  124. name="collect_fee" autocomplete="off" value="{{ old('collect_fee') }}" >
  125. @error('collect_fee')
  126. <span class="invalid-feedback" role="alert">
  127. <strong>{{ $message }}</strong>
  128. </span>
  129. @enderror
  130. </div>
  131. </div>
  132. <div class="form-group row">
  133. <label for="ordering_remark" class="col-2 col-form-label text-right text-muted">下单备注</label>
  134. <div class="col-8">
  135. <textarea class="form-control @error('ordering_remark') is-invalid @enderror"
  136. name="ordering_remark" autocomplete="off" >{{ old('ordering_remark') }}</textarea>
  137. @error('ordering_remark')
  138. <span class="invalid-feedback" role="alert">
  139. <strong>{{ $message }}</strong>
  140. </span>
  141. @enderror
  142. </div>
  143. </div>
  144. <div class="form-group row">
  145. <div class="col-8 offset-2">
  146. <input type="submit" class="btn btn-success form-control">
  147. </div>
  148. </div>
  149. </form>
  150. </div>
  151. </div>
  152. </div>
  153. @endsection
  154. @section('lastScript')
  155. <script>
  156. let vueList=new Vue({
  157. el:'#list',
  158. data:{
  159. owners:[
  160. @foreach($owners as $owner)
  161. {id:'{{$owner->id}}',name:'{{$owner->name}}'},
  162. @endforeach
  163. ],
  164. owner_id:'{{old('owner_id')}}',
  165. origination:'{{old('origination')}}',
  166. },
  167. methods:{
  168. owner_seek:function (e) {
  169. let _this=this;
  170. let $val=e.target.value;
  171. if($val==='')_this.owner_id='';
  172. else
  173. _this.owners.forEach(function (owner) {
  174. if (owner.name.includes($val)){
  175. _this.owner_id=owner.id;
  176. }
  177. });
  178. },
  179. },
  180. });
  181. </script>
  182. @endsection