index.blade.php 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container-fluid mt-3">
  4. <div class="card">
  5. <div class="card-body">
  6. @if(Session::has('successTip'))
  7. <div class="alert alert-success h1">{{Session::get('successTip')}}</div>
  8. @endif
  9. <table class="table table-striped table-sm" id="list">
  10. <tr>
  11. <th>波次号</th>
  12. <th>状态</th>
  13. <th>类型(WMS)</th>
  14. <th>创建时间</th>
  15. {{-- <th>操作</th>--}}
  16. </tr>
  17. <tr v-for="batch in batches" @click="selectTr===batch.id?selectTr=0:selectTr=batch.id" :class="selectTr===batch.id ? 'focusing' : ''">
  18. <td class="text-muted">@{{batch.batch_id}}</td>
  19. <td class="text-muted">@{{batch.status}}</td>
  20. <td>@{{batch.remote_type}}</td>
  21. <td class="text-muted">@{{batch.created_at}}</td>
  22. {{-- <td>--}}
  23. {{-- @can('物流公司-编辑')--}}
  24. {{-- <button class="btn btn-sm btn-outline-primary" @click="edit(batch.id)">改</button> @endcan--}}
  25. {{-- @can('物流公司-删除')--}}
  26. {{-- <button class="btn btn-sm btn-outline-dark" @click="destroy(batch)">删</button> @endcan--}}
  27. {{-- </td>--}}
  28. </tr>
  29. </table>
  30. {{$batches->links()}}
  31. </div>
  32. </div>
  33. </div>
  34. @endsection
  35. @section('lastScript')
  36. <script>
  37. new Vue({
  38. el:"#list",
  39. data:{
  40. batches:{!! json_encode($batches->toArray()['data'],true)??"\'\'" !!},
  41. },
  42. methods:{
  43. {{--edit:function(id){--}}
  44. {{-- location.href = "{{url('maintenance/batch')}}/"+id+"/edit";--}}
  45. {{--},--}}
  46. {{--destroy:function(batch){--}}
  47. {{-- if(!confirm('确定要删除物流公司“' + batch.name + '”吗?')){return};--}}
  48. {{-- let data=this;--}}
  49. {{-- let url = "{{url('maintenance/batch')}}/"+batch.id;--}}
  50. {{-- axios.delete(url,{id:batch.id})--}}
  51. {{-- .then(function (response) {--}}
  52. {{-- if(response.data.success){--}}
  53. {{-- for (let i = 0; i < data.batches.length; i++) {--}}
  54. {{-- if (data.batches[i].id===batch.id){--}}
  55. {{-- data.batches.splice(i,1);--}}
  56. {{-- break;--}}
  57. {{-- }--}}
  58. {{-- }--}}
  59. {{-- tempTip.setDuration(1000);--}}
  60. {{-- tempTip.showSuccess('删除物流公司"'+batch.name+'"成功!')--}}
  61. {{-- }else{--}}
  62. {{-- tempTip.setDuration(1000);--}}
  63. {{-- tempTip.show('删除物流公司"'+batch.name+'"失败!')--}}
  64. {{-- }--}}
  65. {{-- })--}}
  66. {{-- .catch(function (err) {--}}
  67. {{-- tempTip.setDuration(3000);--}}
  68. {{-- tempTip.show('删除物流公司失败!'+'网络错误:' + err)--}}
  69. {{-- console.log(err);--}}
  70. {{-- });--}}
  71. {{--},--}}
  72. }
  73. });
  74. </script>
  75. @endsection