calc.blade.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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-content">
  9. <form class="form-inline" id="searchForm" onsubmit="units.search();return false;">
  10. <div class="input-group">
  11. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  12. <input type="text" title="开始时间" class="form-control lay-datetime" id="start_at"
  13. name="start_at">
  14. </div>
  15. <div class="input-group">
  16. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  17. <input type="text" title="结束时间" class="form-control lay-datetime" id="end_at"
  18. name="end_at">
  19. </div>
  20. <div class="form-group" style="margin-top: 5px;">
  21. <div class="input-group">
  22. <input type="text" placeholder="请输入用户名" class="input-md form-control" name="keyword"
  23. id="keyword">
  24. <span class="input-group-btn">
  25. <button type="button" class="btn btn-md btn-primary"
  26. onclick="units.search()" style="border-radius:2px;"> 搜索</button>
  27. <button type="reset" class="btn btn-md btn-primary"
  28. style="margin-left: 10px;border-radius:2px;"
  29. name="resetBtn"> 重置</button>
  30. <button type="button" class="btn btn-md btn-warning"
  31. style="margin-left: 10px;border-radius:2px;"
  32. onclick="units.settle()">结算</button>
  33. </span>
  34. </div>
  35. </div>
  36. </form>
  37. <hr>
  38. <div class="table-responsive">
  39. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. </body>
  47. @endsection
  48. @section('footer')
  49. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  50. <script>
  51. var units = {
  52. // getTaskIdsBySelections: function () {
  53. // var selections = $("#table").bootstrapTable('getSelections');
  54. // var ids = [];
  55. // $.each(selections, function (inx, val) {
  56. // console.log(val);
  57. // ids = ids.concat(val.task_ids);
  58. // });
  59. // return ids;
  60. // },
  61. getDataBySelections: function () {
  62. var selections = $("#table").bootstrapTable('getSelections');
  63. var dataList = [];
  64. $.each(selections, function (inx, val) {
  65. dataList.push({
  66. user_id: val['user_id'],
  67. username: val['username'],
  68. task_ids: val['task_ids'],
  69. amount: val['amount'],
  70. url_num: val['url_num']
  71. });
  72. });
  73. return dataList;
  74. },
  75. search: function () {
  76. tips.selectPage();
  77. },
  78. // settle: function () {
  79. // var ids = units.getTaskIdsBySelections();
  80. // return;
  81. //
  82. // if (ids.length === 0) {
  83. // layer.alert('请先选择您所要操作的对象', {icon: 0});
  84. // return;
  85. // }
  86. // layer.confirm('您确定要进行结算吗?', {icon: 3, title: '删除信息'}, function () {
  87. // tips.ajax({url: '/admin/link/calc/settle', type: 'put', data: {ids: ids}});
  88. // tips.tableRefresh('#table');
  89. // });
  90. // },
  91. settle: function () {
  92. var dataList = units.getDataBySelections();
  93. if (dataList.length === 0) {
  94. layer.alert('请先选择您所要操作的对象', {icon: 0});
  95. return;
  96. }
  97. layer.confirm('您确定要进行结算吗?', {icon: 3, title: '删除信息'}, function () {
  98. tips.ajax({url: '/admin/link/calc/settle', type: 'post', data: {dataList: dataList}});
  99. tips.tableRefresh('#table');
  100. });
  101. }
  102. };
  103. var config = {};
  104. config.url = '/admin/link/calc';
  105. config.columns = [ //字段
  106. {checkbox: true},
  107. {
  108. title: '序号', align: 'center', formatter: function (value, item, index) {
  109. return index + 1;
  110. }
  111. },
  112. {title: '兼职人员', field: 'username', align: 'center'},
  113. {title: '外链质量分', field: 'avgScore', align: 'center'},
  114. // {title: '合法外链数', field: 'valid_url', align: 'center'},
  115. {title: '合法外链数', field: 'url_num', align: 'center'},
  116. {title: '结算金额', field: 'amount', align: 'center'},
  117. {
  118. visible: false, field: 'task_ids'
  119. }, {
  120. visible: false, field: 'user_id'
  121. }
  122. ];
  123. tips.bootstrapTable(config);
  124. laydate.render({
  125. elem: '#start_at', //指定元素
  126. type: 'datetime'
  127. });
  128. laydate.render({
  129. elem: '#end_at', //指定元素
  130. type: 'datetime'
  131. });
  132. </script>
  133. @endsection