create.blade.php 9.3 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" 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" 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. @if($type=='直发车')
  111. <div class="form-group row">
  112. <label for="collect_fee" class="col-2 col-form-label text-right text-muted">到付金额(元)</label>
  113. <div class="col-8">
  114. <input type="text" class="form-control @error('collect_fee') is-invalid @enderror"
  115. name="collect_fee" autocomplete="off" value="{{ old('collect_fee') }}" >
  116. @error('collect_fee')
  117. <span class="invalid-feedback" role="alert">
  118. <strong>{{ $message }}</strong>
  119. </span>
  120. @enderror
  121. </div>
  122. </div>
  123. @endif
  124. <div class="form-group row">
  125. <label for="ordering_remark" class="col-2 col-form-label text-right text-muted">下单备注</label>
  126. <div class="col-8">
  127. <textarea class="form-control @error('ordering_remark') is-invalid @enderror"
  128. name="ordering_remark" autocomplete="off" >{{ old('ordering_remark') }}</textarea>
  129. @error('ordering_remark')
  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. <div class="col-8 offset-2">
  138. <input type="submit" class="btn btn-success form-control">
  139. </div>
  140. </div>
  141. </form>
  142. </div>
  143. </div>
  144. </div>
  145. @endsection
  146. @section('lastScript')
  147. <script>
  148. let vueList=new Vue({
  149. el:'#list',
  150. data:{
  151. owners:[
  152. @foreach($owners as $owner)
  153. {id:'{{$owner->id}}',name:'{{$owner->name}}'},
  154. @endforeach
  155. ],
  156. owner_name:'',
  157. },
  158. methods:{
  159. owner_id:function (e) {
  160. let _this=this;
  161. let $val=e.target.value;
  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