recycle.blade.php 13 KB

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