recycle.blade.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. @extends('layouts.app')
  2. @section('title')回收站-运输管理@endsection
  3. @section('content')
  4. <div class=container-fluid">
  5. <div class="card" style="min-width: 2000px;">
  6. <div class="card-body" id="list">
  7. <div class="card">
  8. <div class="card-body">
  9. <div class="row">
  10. <table class="table mb-n3 table-sm table-bordered">
  11. <tr>
  12. <td>
  13. <span class="text-muted">每页显示记录:</span>
  14. </td>
  15. <td colspan="9">
  16. <select name="paginate" @change="submit()" id="setPaginate" class="tooltipTarget form-control-sm" v-model="filterParams.paginate" >
  17. <option value="50">50条</option>
  18. <option value="100">100条</option>
  19. <option value="200">200条</option>
  20. <option value="500">500条</option>
  21. <option value="1000">1000条</option>
  22. </select>
  23. </td>
  24. <td class="w-75"></td>
  25. </tr>
  26. <tr>
  27. <td class="text-muted">选定操作记录:</td>
  28. <td colspan="9">
  29. @can('运输管理-运单-删除')
  30. <span class="btn btn-sm" @click="restoreSelected" style="cursor: pointer"
  31. :class="[waybills_checkBoxes.length > 0?'btn-danger':'btn-outline-danger']">
  32. 恢复
  33. </span>
  34. @endcan
  35. </td>
  36. </tr>
  37. </table>
  38. </div>
  39. </div>
  40. </div>
  41. <table class="table table-striped table-sm table-bordered table-hover" style="background: #fff;">
  42. <tr>
  43. <th class="td-operation">
  44. <label for="all">
  45. <input id="all" type="checkbox" @click="checkAll($event)">
  46. </label>
  47. </th>
  48. <th >序号</th>
  49. <th class="td-operation">状态</th>
  50. <th >创建时间</th>
  51. <th >运单类型</th>
  52. <th >货主</th>
  53. <th >上游单号</th>
  54. <th >WMS订单号</th>
  55. <th >运单号</th>
  56. <th >收件人</th>
  57. <th >收件人电话</th>
  58. <th >始发地</th>
  59. <th >目的地</th>
  60. <th >承运商</th>
  61. <th >单号/车型</th>
  62. <th >仓库计抛</th>
  63. <th >承运商计抛</th>
  64. <th >仓库计重</th>
  65. <th >承运商计重</th>
  66. <th >计数</th>
  67. <th >里程</th>
  68. <th >运费</th>
  69. <th >提货费</th>
  70. <th >其他费用</th>
  71. <th >调度备注</th>
  72. </tr>
  73. <tr v-for="(waybill,i) in waybills" :id="'waybill'+waybill.id">
  74. <td>
  75. <input class="checkItem" type="checkbox" :value="waybill.id" v-model="waybills_checkBoxes" >
  76. </td>
  77. <td>@{{ i+1 }}</td>
  78. <td :class="[waybill.status=='已审核'?'text-success':'']">@{{waybill.status}}</td>
  79. <td class="text-muted">@{{waybill.created_at}}
  80. <td >@{{waybill.type}} </td>
  81. <td >@{{waybill.owner}}</td>
  82. <td >@{{waybill.source_bill}}</td>
  83. <td class="">@{{waybill.wms_bill_number}}</td>
  84. <td class="">@{{waybill.waybill_number}}</td>
  85. <td class="">@{{waybill.recipient}}</td>
  86. <td class="">@{{waybill.recipient_mobile}}</td>
  87. <td class="text-muted">@{{waybill.origination}}</td>
  88. <td class="text-muted">@{{waybill.destination}}</td>
  89. <td >@{{waybill.carrier}}</td>
  90. <td ><span v-if="waybill.type=='专线'">@{{waybill.carrier_bill}}</span>
  91. <span v-if="waybill.type=='直发车'">
  92. <span v-if="waybill.carType">@{{ waybill.carType.name }}<i v-if="waybill.carType.length">(@{{waybill.carType.length}}米)</i></span></span></td>
  93. <td ><span v-if="waybill.warehouse_weight">@{{waybill.warehouse_weight}} @{{waybill.warehouse_weight_unit}}</span></td>
  94. <td ><span v-if="waybill.carrier_weight">@{{waybill.carrier_weight}} @{{waybill.carrier_weight_unit}}</span></td>
  95. <td ><span v-if="waybill.warehouse_weight_other">@{{waybill.warehouse_weight_other}} @{{waybill.warehouse_weight_unit_other}}</span></td>
  96. <td ><span v-if="waybill.carrier_weight_other">@{{waybill.carrier_weight_other}} @{{waybill.carrier_weight_unit_other}}</span></td>
  97. <td ><span v-if="waybill.amount">@{{waybill.amount}} @{{waybill.amount_unit_name }}</span></td>
  98. <td >@{{waybill.mileage|km}}</td>
  99. @can('运输管理-运单-可见费用项')
  100. <td ><span v-if="waybill.type=='专线'"></span><span v-else>@{{waybill.fee}}</span></td>
  101. <td >@{{waybill.pick_up_fee}}</td>
  102. <td >@{{waybill.other_fee}}</td>
  103. @endcan
  104. <td >@{{waybill.dispatch_remark}}</td>
  105. </tr>
  106. </table>
  107. <div class="text-info h5 btn btn">{{$waybills->count()}}/{{$total}}</div>
  108. {{$waybills->appends($paginateParams)->links()}}
  109. </div>
  110. </div>
  111. </div>
  112. @endsection
  113. @section('lastScript')
  114. <script>
  115. let vueList = new Vue({
  116. el:'#list',
  117. data:{
  118. filterParams:{
  119. paginate:'{{$paginateParams['paginate']}}',
  120. },
  121. waybills_checkBoxes:[],
  122. waybills:[
  123. @foreach($waybills as $waybill)
  124. {
  125. id:'{{$waybill->id}}',
  126. created_at:'{{$waybill->created_at}}',
  127. updated_at:'{{$waybill->updated_at}}',
  128. status:'{{$waybill->status}}',
  129. type:'{{$waybill->type}}',
  130. waybill_number:'{{$waybill->waybill_number}}',
  131. owner:'{{ $waybill->order->owner->name ?? ($waybill->owner->name ?? '') }}',
  132. source_bill:'{{$waybill->source_bill}}',
  133. wms_bill_number:'{{$waybill->wms_bill_number}}',
  134. origination:'{{$waybill->origination}}',
  135. destination:'{{$waybill->order->address ?? $waybill->destination}}',
  136. recipient:'{{$waybill->order->consignee_name ?? $waybill->recipient}}',
  137. recipient_mobile:'{{$waybill->order->consignee_phone ?? $waybill->recipient_mobile}}',
  138. charge:'{{$waybill->charge}}',
  139. ordering_remark:'{{preg_replace("/[\n\s]/",' ',($waybill->ordering_remark??""))}}',
  140. carrier:'{{$waybill->logistic->name ?? ''}}',
  141. carrier_bill:'{{$waybill->carrier_bill}}',
  142. origination_city:'{{$waybill->origination_city ? $waybill->origination_city->name : ''}}',
  143. destination_city:'{{$waybill->order->city ?? ($waybill->destination_city->name ?? '')}}',
  144. warehouse_weight:'{{$waybill->warehouse_weight}}',
  145. warehouse_weight_unit:'{{$waybill->warehouse_weight_unit ? $waybill->warehouse_weight_unit->name : ''}}',
  146. carrier_weight:'{{$waybill->carrier_weight}}',
  147. carrier_weight_unit:'{{$waybill->carrier_weight_unit ? $waybill->carrier_weight_unit->name : ''}}',
  148. warehouse_weight_other:'{{$waybill->warehouse_weight_other}}',
  149. warehouse_weight_unit_other:'{{$waybill->warehouse_weight_unit_other ? $waybill->warehouse_weight_unit_other->name : ''}}',
  150. carrier_weight_other:'{{$waybill->carrier_weight_other}}',
  151. carrier_weight_unit_other:'{{$waybill->carrier_weight_unit_other ? $waybill->carrier_weight_unit_other->name : ''}}',
  152. amount_unit_name:'{{$waybill->amount_unit ? $waybill->amount_unit->name : ''}}',
  153. mileage:'{{$waybill->mileage}}',
  154. amount:'{{$waybill->amount}}',
  155. @if($waybill->carType)carType:{!! $waybill->carType !!},car_owner_info:'{{$waybill->car_owner_info}}',@endif
  156. @can('运输管理-运单-可见费用项') fee:'{{$waybill->fee}}',
  157. pick_up_fee:'{{$waybill->pick_up_fee}}',other_fee:'{{$waybill->other_fee}}',
  158. collect_fee:'{{$waybill->collect_fee}}', @endcan
  159. dispatch_remark:'{{$waybill->dispatch_remark}}',
  160. isBtn:false,
  161. waybillAuditLogs:{!! $waybill->waybillAuditLogs !!}
  162. },
  163. @endforeach
  164. ],
  165. },
  166. watch:{
  167. waybills_checkBoxes:{
  168. handler(){
  169. if (this.waybills_checkBoxes.length === this.waybills.length){
  170. document.querySelector('#all').checked = true;
  171. }else {
  172. document.querySelector('#all').checked = false;
  173. }
  174. },
  175. deep:true
  176. },
  177. },
  178. mounted:function(){
  179. },
  180. methods:{
  181. restoreSelected:function(){
  182. let _this = this;
  183. if(_this.waybills_checkBoxes.length === 0){
  184. tempTip.show("没有勾选记录");
  185. return;
  186. }
  187. if(!confirm("确定要恢复所有勾选的内容为'未删除'吗?")){return;}
  188. let ajaxUrl = '{{url('apiLocal/transport/waybill/recoverSelected')}}';
  189. axios.post(ajaxUrl,{ids:_this.waybills_checkBoxes}).then(function (response) {
  190. if(response.data.success){
  191. tempTip.setDuration(2000);
  192. tempTip.showSuccess('恢复勾选内容成功!');
  193. window.setTimeout(function () {
  194. window.location.href='{{url('transport/waybill/recycle')}}';
  195. },2000);
  196. }else{
  197. tempTip.setDuration(2500);
  198. tempTip.show('恢复勾选内容失败,错误:'+response.data.fail_info);
  199. setTimeout(function () {
  200. window.location.reload();
  201. },1000);
  202. }
  203. }).catch(function (err) {
  204. tempTip.setDuration(2500);
  205. tempTip.show('恢复勾选内容失败,错误:'+err);
  206. });
  207. },
  208. checkAll(e){
  209. if (e.target.checked){
  210. this.waybills.forEach((el,i)=>{
  211. if (this.waybills_checkBoxes.indexOf(el.id) == '-1'){
  212. this.waybills_checkBoxes.push(el.id);
  213. }
  214. });
  215. }else {
  216. this.waybills_checkBoxes = [];
  217. }
  218. },
  219. submit(){
  220. let url = decodeURI(location.href).split("?");
  221. location.href = url[0]+"?paginate="+ this.filterParams.paginate;
  222. }
  223. },
  224. filters:{
  225. km:function(value){
  226. if(!value)return '';
  227. return value + ' km';
  228. },
  229. }
  230. })
  231. </script>
  232. @endsection