create.blade.php 9.6 KB

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