enquiry.blade.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. @extends('admin/layout')
  2. @section('content')
  3. <body class="gray-bg">
  4. <div class="wrapper wrapper-content animated fadeInRight">
  5. <div class="row">
  6. <div class="col-sm-12">
  7. <div class="ibox float-e-margins">
  8. <div class="ibox-title"></div>
  9. <div class="ibox-content">
  10. <form class="row" id="searchForm">
  11. <div class="col-md-1 pull-right">
  12. <div class="input-group">
  13. {{--<input type="text" placeholder="请输入关键词" class="input-md form-control" name="keyword"--}}
  14. {{--id="keyword">--}}
  15. {{--<span class="input-group-btn">--}}
  16. {{--<button type="button" class="btn btn-md btn-primary"--}}
  17. {{--onclick="units.search()"> 搜索</button>--}}
  18. <button type="reset" class="btn btn-md btn-primary" onclick="units.fresh()"
  19. name="resetBtn"> 刷新
  20. </button>
  21. </span>
  22. </div>
  23. </div>
  24. {{--<div class="col-sm-2 pull-right" style="text-align: right">--}}
  25. {{--<button type="button" class="btn btn-md btn-primary" id="addBtn"> 添加</button>--}}
  26. {{--</div>--}}
  27. </form>
  28. <hr>
  29. <div class="table-responsive">
  30. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </body>
  38. @endsection
  39. @section('footer')
  40. <script>
  41. var units = {
  42. search: function () {
  43. tips.selectPage();
  44. },
  45. fresh: function () {
  46. tips.tableRefresh();
  47. },
  48. getIdsBySelections: function () {
  49. var selections = $("#table").bootstrapTable('getSelections');
  50. var ids = [];
  51. $.each(selections, function (inx, val) {
  52. ids.push(val.id);
  53. });
  54. return ids;
  55. },
  56. delete: function (id) {
  57. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
  58. var config = {url: '/admin/enquiry/destroy', type: 'delete', data: {id: id}};
  59. config.success = function (result) {
  60. layer.msg(result.message, {icon: 6, time: 1500});
  61. tips.tableRefresh('#table');
  62. };
  63. tips.ajax(config);
  64. });
  65. },
  66. detail: function (id) {
  67. layer.open({
  68. type: 2,
  69. content: ['/admin/enquiry/detail/' + id],
  70. area: ['50%', '60%'],
  71. title: '详情'
  72. });
  73. }
  74. };
  75. var config = {};
  76. config.url = '/admin/enquiry/list';
  77. config.columns = [ //字段
  78. {checkbox: true},
  79. {
  80. title: '序号', align: 'center', formatter: function (value, item, index) {
  81. return index + 1;
  82. }
  83. },
  84. {title: '公司名称', field: 'company_name', align: 'center'},
  85. {title: '姓名', field: 'name', align: 'center'},
  86. {title: '电话', field: 'phone', align: 'center'},
  87. {title: '类型', field: 'tx_type_title', align: 'center'},
  88. {title: '状态', field: 'tx_status_title', align: 'center'},
  89. {title: '创建时间', field: 'created_at', align: 'center'},
  90. {
  91. title: '操作', field: 'id', align: 'center',
  92. formatter: function (value) {
  93. return (
  94. '<button onclick="units.detail(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button>&nbsp;' +
  95. '<button onclick="units.delete(' + value + ')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>删除</button>'
  96. );
  97. }
  98. }
  99. ];
  100. tips.bootstrapTable(config);
  101. //
  102. // $(document).on('click', '#on', function () {
  103. // var ids = units.getIdsBySelections();
  104. // if (ids.length === 0) {
  105. // layer.alert('请先选择您所要操作的对象',{icon:0});
  106. // return;
  107. // }
  108. // tips.ajax({url: '/admin/system/users/on', type: 'put', data: {ids: ids}});
  109. // tips.tableRefresh('#table');
  110. // });
  111. //
  112. //
  113. // $(document).on('click', '#off', function () {
  114. // var ids = units.getIdsBySelections();
  115. // if (ids.length === 0) {
  116. // layer.alert('请先选择您所要操作的对象',{icon:0});
  117. // return;
  118. // }
  119. // tips.ajax({url: '/admin/system/users/off', type: 'put', data: {ids: ids}});
  120. // tips.tableRefresh('#table');
  121. // });
  122. $(document).on('click', '#allotStaff', function () {
  123. var ids = units.getIdsBySelections();
  124. if (ids.length === 0) {
  125. layer.alert('请先选择您所要操作的对象', {icon: 0});
  126. return;
  127. }
  128. var siteIds = '?';
  129. $.each(ids, function (inx, val) {
  130. siteIds += 'siteIds[]=' + val + '&';
  131. });
  132. layer.open({
  133. type: 2,
  134. content: ['/admin/project/site/allot' + siteIds],
  135. area: ['50%', '50%'],
  136. title: '修改'
  137. });
  138. });
  139. /**
  140. * 批量删除
  141. */
  142. $(document).on('click', '#batchDelete', function () {
  143. var ids = units.getIdsBySelections();
  144. if (ids.length === 0) {
  145. layer.alert('请先选择您所要操作的对象', {icon: 0});
  146. return;
  147. }
  148. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function () {
  149. tips.ajax({url: '/admin/project/sites', type: 'delete', data: {ids: ids}});
  150. tips.tableRefresh('#table');
  151. });
  152. });
  153. $(document).on('click', '#add', function () {
  154. layer.open({
  155. type: 2,
  156. content: ['/admin/project/site/show/0'],
  157. area: ['90%', '90%'],
  158. title: '添加'
  159. });
  160. });
  161. </script>
  162. @endsection