index.blade.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. @extends('layouts.app')
  2. @section('title')客户@endsection
  3. @section('content')
  4. <div id="nav2">
  5. @component('customer.menu')@endcomponent
  6. @component('customer.customer.menu')@endcomponent
  7. </div>
  8. <div class="d-none container-fluid" id="container">
  9. <div class="card">
  10. <div class="card-body">
  11. @include("customer.customerLogStatus._edit")
  12. <div class="row pull-right">
  13. @can("客户管理-客户-客户状态-录入")<button class="btn btn-outline-info mb-1 mr-3" @click="openModal()"><span class="fa fa-plus"></span>&nbsp;新&nbsp;&nbsp;增</button>@endcan
  14. </div>
  15. <table class="table table-striped table-bordered table-hover">
  16. <tr>
  17. <th>序号</th>
  18. <th>名称</th>
  19. <th>说明</th>
  20. <th>创建时间</th>
  21. <th>修改时间</th>
  22. <th>操作</th>
  23. </tr>
  24. <tr v-for="(model,i) in models">
  25. <td>@{{ i+1 }}</td>
  26. <td>@{{ model.name }}</td>
  27. <td>@{{ model.description }}</td>
  28. <td>@{{ model.createdAt }}</td>
  29. <td>@{{ model.updatedAt }}</td>
  30. <td>
  31. @can("客户管理-客户-客户状态-编辑")<button class="btn btn-sm btn-outline-info" @click="openModal(model)">改</button>@endcan
  32. @can("客户管理-客户-客户状态-删除")<button class="btn btn-sm btn-outline-danger" @click="deleteModel(model)">删</button>@endcan
  33. </td>
  34. </tr>
  35. </table>
  36. </div>
  37. </div>
  38. </div>
  39. @stop
  40. @section("lastScript")
  41. <script>
  42. new Vue({
  43. el:"#container",
  44. data:{
  45. status:{},
  46. models:[
  47. @foreach($customerLogStatuses as $customerLogStatus)
  48. {id:"{{$customerLogStatus->id}}",'name':"{{$customerLogStatus->name}}", 'description':"{{$customerLogStatus->description}}"
  49. , 'createdAt':"{{$customerLogStatus->created_at}}"
  50. , 'updatedAt':"{{$customerLogStatus->updated_at}}"},
  51. @endforeach
  52. ],
  53. },
  54. mounted(){
  55. $("#container").removeClass("d-none");
  56. },
  57. methods:{
  58. openModal(model){
  59. if (model) this.status={id:model.id,name:model.name,description:model.description};
  60. else this.status={id:"",name:"",description:""};
  61. $("#modal").modal("show");
  62. },
  63. deleteModel(model){
  64. window.tempTip.postBasicRequest();
  65. },
  66. },
  67. });
  68. </script>
  69. @endsection