index.blade.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @extends('layouts.app')
  2. @section('title','查询')
  3. @section('content')
  4. <span id="nav2">
  5. @component('maintenance.menu')@endcomponent
  6. @component('maintenance.expressPrinting.menu')@endcomponent
  7. @component('maintenance.expressPrinting.template.menu')@endcomponent
  8. </span>
  9. <div class="container-fluid" id="part-template">
  10. <table class="table table-striped table-sm table-hover">
  11. <tr>
  12. <th>序号</th>
  13. <th>名称</th>
  14. <th>内容</th>
  15. <th>操作</th>
  16. </tr>
  17. <tr v-for="(template,i) in templates">
  18. <td>@{{ i+1 }}</td>
  19. <td>@{{ template.name }}</td>
  20. <td>@{{ template.value }}</td>
  21. <td>
  22. <button type="button" class="btn btn-danger" @click="destroy(template.id,i)">删除</button>
  23. </td>
  24. </tr>
  25. </table>
  26. </div>
  27. @endsection
  28. @section('lastScript')
  29. <script>
  30. let vue = new Vue({
  31. el:'#part-template',
  32. data:{
  33. templates:{!! $templates !!},
  34. },
  35. methods:{
  36. destroy(id,i){
  37. if (!confirm('是否删除当前模板')) return;
  38. tempTip.setDuration(3000);
  39. window.tempTip.postBasicRequest("{{url('apiLocal/maintenance/expressPrinting/template/destroy')}}",{id:id},res=>{
  40. tempTip.showSuccess('删除成功');
  41. this.$delete(this.templates,i);
  42. });
  43. }
  44. }
  45. });
  46. </script>
  47. @endsection