client_data.blade.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/flow/clientDel',
  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/flow/clientAdd/' + id + '/' + siteId],
  52. area: ['60%', '60%'],
  53. title: '编辑'
  54. });
  55. },
  56. save: function (id, siteId) {
  57. layer.open({
  58. type: 2,
  59. content: ['/admin/flow/clientAdd/' + 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/flow/clientData/{{$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: 'page', align: 'center', width: '120px'},
  86. {title: '样式参考', field: 'style_path', align: 'center'},
  87. {title: '替换资料要求', field: 'data_memo', align: 'center'},
  88. {title: '提交资料deadline', field: 'deadline', align: 'center'},
  89. {
  90. title: '操作', field: 'id', align: 'center',
  91. formatter: function (value, row) {
  92. var str = '<button onclick="units.save(' + row.id + ', ' + row.site_id + ')" class="btn btn-xs"><span class="glyphicon glyphicon-edit"></span>编辑</button>';
  93. return str;
  94. }
  95. }
  96. ];
  97. tips.bootstrapTable(config);
  98. </script>
  99. @endsection