index.blade.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. @extends('layouts.app')
  2. @section('title')异常记录-包裹管理@endsection
  3. @section('content')
  4. <span id="nav2">
  5. @component('weight.menu')@endcomponent
  6. @component('weight.weightExcepted.menu')@endcomponent
  7. </span>
  8. <div class="d-none" id="list">
  9. <div class="container-fluid">
  10. <div class="card">
  11. <div>
  12. <form method="GET" action="{{url('package/weightExcepted/'.$view)}}" id="optionSubmit">
  13. <table class="table table-sm table-bordered table-hover text-nowrap ">
  14. <tr>
  15. <td style="width:200px;"> <div class="form-inline"><label style="margin-left: 2%" >页显示条数:</label>
  16. <select name="paginate" v-model="filterData.paginate" class="form-control-sm" @change="setPaginate">
  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></div></td>
  23. </tr>
  24. <tr>
  25. <td >
  26. <label style="margin-left: 5px"> 操作选定记录:</label>
  27. <span class="dropdown">
  28. <button class="btn btn-sm form-control-sm dropdown-toggle tooltipTarget"
  29. data-toggle="dropdown" title="导出所有页将会以搜索条件得到的筛选结果,将其全部记录(每一页)导出">
  30. 导出Excel
  31. </button>
  32. <div class="dropdown-menu">
  33. <a class="dropdown-item" @click="weightExport(false)" href="javascript:">导出勾选内容</a>
  34. <a class="dropdown-item" @click="weightExport(true)" href="javascript:">导出所有页</a>
  35. </div>
  36. </span>
  37. <input hidden type="submit">
  38. </td>
  39. </tr>
  40. </table>
  41. </form>
  42. </div>
  43. <div class="card-body">
  44. <table class="table table-striped table-sm text-nowrap td-min-width-80" id="table">
  45. <tr v-for="(weightExcepted,i) in weightExcepteds" :style="weightExcepted.status=='上传异常'||weightExcepted.status=='下发异常'?'':color"
  46. @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
  47. <td>
  48. <input class="checkItem" type="checkbox" :value="weightExcepted.id">
  49. </td>
  50. <td><span>@{{ i+1 }}</span></td>
  51. <td><span>@{{weightExcepted.logisticNumber}}</span></td>
  52. <td><span>@{{weightExcepted.carrierName}}</span></td>
  53. <td><span>@{{weightExcepted.batchNumber}}</span></td>
  54. <td><span>@{{weightExcepted.batchRule}}</span></td>
  55. @if($view=="indexIssued")
  56. <td><span>@{{weightExcepted.ownerName}}</span></td>
  57. <td><span>@{{weightExcepted.deliveryNumber}}</span></td>
  58. <td class="text-muted"><span>@{{weightExcepted.createdAt}}</span></td>
  59. <td><span>@{{weightExcepted.recipient}}</span></td>
  60. <td><span>@{{weightExcepted.recipientMobile}}</span></td>
  61. @else
  62. <td><span>@{{weightExcepted.measuringMachineName}}</span></td>
  63. <td class="text-muted"><span>@{{weightExcepted.weighedAt}}</span></td>
  64. <td><span>@{{weightExcepted.weight}}</span></td>
  65. <td><span>@{{weightExcepted.length}}</span></td>
  66. <td><span>@{{weightExcepted.width}}</span></td>
  67. <td><span>@{{weightExcepted.height}}</span></td>
  68. <td><span>@{{weightExcepted.bulk}}</span></td>
  69. <td><span>@{{weightExcepted.paperBoxName}}</span></td>
  70. <td><span>@{{weightExcepted.status}}</span></td>
  71. @endif
  72. </tr>
  73. </table>
  74. <div class="text-info h5 btn btn">{{$weightExcepteds->count()}}/{{$weightExcepteds->total()}}</div>
  75. {{$weightExcepteds->links()}}
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. @endsection
  81. @section('lastScript')
  82. <script type="text/javascript" src="{{mix('js/queryForm/header.js')}}"></script>{{--新版2--}}
  83. <script type="text/javascript" src="{{mix('js/queryForm/export.js')}}"></script>
  84. <script>
  85. let vue = new Vue({
  86. el:"#list",
  87. data:{
  88. weightExcepteds:[
  89. @foreach($weightExcepteds as $weightExcepted)
  90. @if($view=="indexIssued")
  91. {id:'{{$weightExcepted->id}}',ownerName:'{{$weightExcepted->owner_name}}',logisticNumber:'{{$weightExcepted->logistic_number}}',
  92. deliveryNumber:'{{$weightExcepted->delivery_number}}',createdAt:'{{$weightExcepted->created_at}}',
  93. batchNumber:'{{$weightExcepted->batch_number}}', batchRule:'{{$weightExcepted->batch_rule}}',recipient:'{{$weightExcepted->recipient}}',
  94. recipientMobile:'{{$weightExcepted->recipient_mobile}}',carrierName:'{{$weightExcepted->logistic_name}}'},
  95. @else
  96. {id:'{{$weightExcepted->id}}',logisticNumber:'{{$weightExcepted->logistic_number}}',carrierName:'{{$weightExcepted->logistic_name}}',
  97. measuringMachineName:'{{$weightExcepted->measuringMachine_name}}',weighedAt:'{{$weightExcepted->weighed_at}}',
  98. weight:'{{$weightExcepted->weight}}', length:'{{$weightExcepted->length}}',width:'{{$weightExcepted->width}}',height:'{{$weightExcepted->height}}',
  99. bulk:'{{$weightExcepted->bulk}}',paperBoxName:'{{$weightExcepted->paperBox_name}}',status:'{{$weightExcepted->status}}',},
  100. @endif
  101. @endforeach
  102. ],
  103. filterData:{paginate:50},
  104. color:'color: red',
  105. sum:{!! $weightExcepteds->total() !!},
  106. selectTr:0
  107. },
  108. mounted:function(){
  109. this.initInputs();
  110. $(".tooltipTarget").tooltip({'trigger':'hover'});
  111. $('#list').removeClass('d-none');
  112. let column = [
  113. {name:'index',value: '序号', neglect: true},
  114. {name:'logisticNumber',value: '快递单号'},
  115. {name:'carrierName',value: '物流公司'},
  116. {name:'batchNumber',value: '波次号'},
  117. {name:'batchRule',value: '波次规则'},
  118. @if($view=="indexIssued"){name:'ownerName',value: '货主'},
  119. {name:'deliveryNumber',value: '发货单号'},
  120. {name:'createdAt',value: '下发时间', class:"text-muted"},
  121. {name:'recipient',value: '收件人'},
  122. {name:'recipientMobile',value: '收件人电话'},
  123. @else{name:'measuringMachineName',value: '设备'},
  124. {name:'weighedAt',value: '称重时间', class:"text-muted"},
  125. {name:'weight',value: '重(KG)', neglect: true},
  126. {name:'length',value: '长(CM)', neglect: true},
  127. {name:'width',value: '宽(CM)', neglect: true},
  128. {name:'height',value: '高(CM)', neglect: true},
  129. {name:'bulk',value: '体积(CM³)', neglect: true},
  130. {name:'paperBoxName',value: '纸箱'},
  131. {name:'status',value: '异常类型'},@endif
  132. ];
  133. new Header({
  134. el: "table",
  135. name: "weightExcepted",
  136. column: column,
  137. data: this.weightExcepteds,
  138. }).init();
  139. },
  140. methods:{
  141. initInputs:function(){
  142. let data=this;
  143. let uriParts =decodeURI(location.href).split("?");
  144. if(uriParts.length>1){
  145. let params = uriParts[1].split('&');
  146. params.forEach(function(paramPair){
  147. let pair=paramPair.split('=');
  148. let key = pair[0], val = pair[1];
  149. $('input[name="'+key+'"]').val(val);
  150. $('select[name="'+key+'"]').val(val);
  151. decodeURI(data.filterData[key]=val);
  152. });
  153. }
  154. },
  155. setPaginate:function(e){
  156. this.filterData.paginate=e.target.value;
  157. var form = document.getElementById("optionSubmit");
  158. form.submit();
  159. },
  160. weightExport(checkAllSign){
  161. let url = '{{url('package/weightExcepted/export/'.$view)}}';
  162. let token='{{ csrf_token() }}';
  163. excelExport(checkAllSign,checkData,url,this.sum,token);
  164. }
  165. }
  166. });
  167. </script>
  168. @endsection