index.blade.php 9.7 KB

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