index.blade.php 3.7 KB

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