calc.blade.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. @extends('admin/layout')
  2. @section('content')
  3. <style>
  4. .btn-danger, .btn-primary, .btn-info {
  5. background: #009688 !important;
  6. border-color: #009688 !important;
  7. }
  8. .table-striped > tbody > tr:nth-of-type(odd) {
  9. background: #f8f8f8 !important;
  10. }
  11. .table-striped > tbody > tr .btn {
  12. background: none !important;
  13. }
  14. .table-striped > tbody > tr td {
  15. font-size: 14px !important;
  16. }
  17. .table-striped > tbody > tr:hover {
  18. background: #ffebd8 !important;
  19. }
  20. .table-striped > tbody > tr:hover .btn {
  21. background: #009688 !important;
  22. color: #fff !important;
  23. }
  24. .table-striped > tbody > tr:hover .btn .glyphicon {
  25. color: #fff !important;
  26. }
  27. </style>
  28. <body class="gray-bg">
  29. <div class="wrapper wrapper-content animated fadeInRight">
  30. <div class="row">
  31. <div class="col-sm-12">
  32. <div class="ibox float-e-margins">
  33. <div class="ibox-content">
  34. <form class="form-inline" id="searchForm" onsubmit="units.search();return false;">
  35. <div class="form-group">
  36. <div class="input-group">
  37. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  38. <input type="text" class="form-control lay-datetime" id="start_at" name="start_at" title="">
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <div class="input-group">
  43. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  44. <input type="text" class="form-control lay-datetime" id="end_at" name="end_at" title="">
  45. </div>
  46. </div>
  47. <div class="form-group" style="margin-top: 5px;">
  48. <div class="input-group">
  49. <input type="text" placeholder="用户名" class="input-md form-control" name="username"
  50. id="username">
  51. <span class="input-group-btn">
  52. <button type="button" class="btn btn-md btn-primary"
  53. onclick="units.search()"> 搜索</button>
  54. <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px"
  55. name="resetBtn"> 重置</button>
  56. <button type="button" class="btn btn-md btn-warning" style="margin-left: 10px"
  57. onclick="units.settle()">结算</button>
  58. </span>
  59. </div>
  60. </div>
  61. </form>
  62. <hr>
  63. <div class="table-responsive">
  64. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </body>
  72. @endsection
  73. @section('footer')
  74. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  75. <script>
  76. var units = {
  77. search: function () {
  78. tips.selectPage();
  79. },
  80. getTaskIdsBySelections: function () {
  81. var selections = $("#table").bootstrapTable('getSelections');
  82. var ids = [];
  83. $.each(selections, function (inx, val) {
  84. ids = ids.concat(val.article_ids);
  85. });
  86. return ids;
  87. },
  88. settle: function () {
  89. var ids = units.getTaskIdsBySelections();
  90. if (ids.length === 0) {
  91. layer.alert('请先选择您所要操作的对象', {icon: 0});
  92. return;
  93. }
  94. layer.confirm('您确定要进行结算吗?', {icon: 3, title: '删除信息'}, function () {
  95. tips.ajax({url: '/admin/articles/calc/settle', type: 'put', data: {ids: ids}});
  96. tips.tableRefresh('#table');
  97. });
  98. }
  99. };
  100. var config = {};
  101. config.url = '/admin/articles/calc';
  102. config.columns = [ //字段
  103. {checkbox: true},
  104. {
  105. title: '序号', align: 'center', formatter: function (value, item, index) {
  106. return index + 1;
  107. }
  108. },
  109. {title: '翻译人员', field: 'username', align: 'center'},
  110. {title: '质量平均分', field: 'avgScore', align: 'center'},
  111. {title: '支付宝', field: 'translator_name', align: 'center'},
  112. {title: '等级', field: 'site_title', align: 'center'},
  113. {title: '已翻词数', field: 'totalWords', align: 'center'},
  114. {title: '结算金额', field: 'amount', align: 'center'},
  115. {
  116. visible: false, field: 'article_ids'
  117. }
  118. ];
  119. tips.bootstrapTable(config);
  120. laydate.render({
  121. elem: '#start_at', //指定元素
  122. type: 'datetime'
  123. });
  124. laydate.render({
  125. elem: '#end_at', //指定元素
  126. type: 'datetime'
  127. });
  128. </script>
  129. @endsection