create.blade.php 10.0 KB

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