renew.blade.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. @extends('admin/site/side_layout')
  2. @section('header_extend')
  3. @endsection
  4. @section('right')
  5. <div class="col-md-2">
  6. <div class="input-group">
  7. <span class="input-group-btn">
  8. <button type="button" class="btn btn-md btn-success" onclick="units.add(0,'{{$siteId}}')"
  9. style="margin-left: 10px;"><span class="glyphicon glyphicon-plus"></span> 添加</button>
  10. <button type="button" class="btn btn-md btn-danger" onclick="units.del()"
  11. style="margin-left: 10px"><span class="glyphicon glyphicon-remove"></span> 删除</button>
  12. </span>
  13. </div>
  14. </div>
  15. <body class="gray-bg">
  16. <div class="wrapper wrapper-content animated fadeInRight">
  17. <div class="row">
  18. <div class="col-sm-12">
  19. <div class="ibox float-e-margins">
  20. <div class="table-responsive">
  21. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. </body>
  28. @endsection
  29. @section('footer_extend')
  30. <script>
  31. var units = {
  32. del: function () {
  33. var ids = units.getIdsBySelections();
  34. if (ids.length === 0) {
  35. layer.alert('请先选择您所要操作的对象', {icon: 0});
  36. return;
  37. }
  38. layer.confirm('确定删除?', {icon: 3, title: '是否删除'}, function (index, layero) {
  39. layer.close(index);
  40. tips.ajax({
  41. url: '/admin/witness-project/delete-row/1',
  42. type: 'post',
  43. data: {ids: ids},
  44. tableRefresh: '#table'
  45. });
  46. });
  47. },
  48. add: function (id, siteId) {
  49. layer.open({
  50. type: 2,
  51. content: ['/admin/witness-project/renew-add/' + id + '/' + siteId],
  52. area: ['60%', '60%'],
  53. title: '编辑'
  54. });
  55. },
  56. save: function (id, siteId) {
  57. layer.open({
  58. type: 2,
  59. content: ['/admin/witness-project/renew-add/' + id + '/' + siteId],
  60. area: ['60%', '60%'],
  61. title: '编辑'
  62. });
  63. },
  64. getIdsBySelections: function () {
  65. var selections = $("#table").bootstrapTable('getSelections');
  66. var ids = [];
  67. $.each(selections, function (inx, val) {
  68. ids.push(val.id);
  69. });
  70. return ids;
  71. }
  72. };
  73. var config = {};
  74. config.url = '/admin/witness-project/renew/{{$siteId}}';
  75. config.pageSize = 20;
  76. config.showColumns = true;
  77. config.columns = [ //字段
  78. {checkbox: true},
  79. {
  80. title: '序号', align: 'center', formatter: function (value, item, index) {
  81. return index + 1;
  82. },
  83. width: '10px'
  84. },
  85. {title: '客户姓名', field: 'customer_name', align: 'center', width: '120px'},
  86. {title: '职位', field: 'position', align: 'center'},
  87. {title: '电话', field: 'tel', align: 'center'},
  88. {title: '续费次数', field: 'number_renewals', align: 'center'},
  89. {title: '续费时长', field: 'duration_renewals', align: 'center'},
  90. {title: '礼品名称', field: 'gift_name', align: 'center'},
  91. {title: '礼品金额(元)', field: 'gift_amount', align: 'center'},
  92. {title: '送礼时间', field: 'gift_time', align: 'center'},
  93. {title: '备注', field: 'remark', align: 'center'},
  94. {
  95. title: '操作', field: 'id', align: 'center',
  96. formatter: function (value, row) {
  97. return '<button onclick="units.save(' + row.id + ', ' + row.site_id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>';
  98. }
  99. }
  100. ];
  101. tips.bootstrapTable(config);
  102. </script>
  103. @endsection