send_orders.blade.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. @extends('agents.app')
  2. @section('content')
  3. <!-- /.row -->
  4. <style>
  5. .searchable-select-dropdown{
  6. z-index: 9999;
  7. }
  8. </style>
  9. <div style="margin-top: 35px;" class="row">
  10. <div class="col-lg-12">
  11. <div class="panel panel-default">
  12. <div class="panel-heading">
  13. 派单列表
  14. </div>
  15. <!-- /.table-responsive -->
  16. {{--<div class="well">
  17. <div class="row" >
  18. <div class="col-xs-6 col-sm-4 col-md-4" style="display:flex;flex-direction: row;justify-content: flex-start;align-items: center;"><label style="line-height:20px;width:150px;">开始时间:</label><input onchange="updateTable()" style="background: #fff;" id="zstart" class="form-control" name="zstart" readonly/></div>
  19. <div class="col-xs-6 col-sm-4 col-md-4" style="display:flex;flex-direction: row;justify-content: flex-start;align-items: center;"><label style="line-height:20px;width:150px;">结束时间:</label><input onchange="updateTable()" style="background: #fff;" id="zend" class="form-control" name="zend" readonly/>&nbsp;</div>
  20. </div>
  21. </div>
  22. --}}
  23. <!-- /.panel-heading -->
  24. <div class="panel-body">
  25. <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
  26. <thead>
  27. <tr>
  28. <th>派单渠道名</th>
  29. <th>预计发送时间</th>
  30. <th>推广入口页面</th>
  31. <th>新增关注<br/>关注率</th>
  32. <th>注册用户<br/>付费用户</th>
  33. <th>充值总额</th>
  34. <th>成本(元)<br/>盈亏(元)<br/>充值/成本</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. </tbody>
  39. </table>
  40. <div id="pagination" style="float:right;" class="m-style">
  41. </div>
  42. </div>
  43. <!-- /.panel-body -->
  44. </div>
  45. <!-- /.panel -->
  46. </div>
  47. <!-- /.col-lg-12 -->
  48. </div>
  49. @endsection
  50. @push('scripts')
  51. <script>
  52. var table=null;
  53. $(function() {
  54. updateTable();
  55. $('#search').on('click',function(){
  56. updateTable();
  57. })
  58. //$('.search_select').searchableSelect()
  59. $('#import-btn').on('click',function(e) {
  60. e.preventDefault()
  61. //console.log('123456')
  62. $('#import-form').ajaxSubmit(function(res){
  63. if(res.code==0){
  64. layer.msg('导入成功!',{icon:1})
  65. updateTable()
  66. }else{
  67. layer.alert('导入失败. '+res.msg,{icon:5})
  68. }
  69. })
  70. })
  71. updateTable();
  72. $('#search').on('click',function(){
  73. updateTable();
  74. })
  75. });
  76. function updateTable(page=1,action='update'){
  77. var index1 = layer.load()
  78. $.ajax({
  79. url:'/sendorder/get_list',
  80. type:'POST',
  81. data:{
  82. 'page':page,
  83. 'pagesize':20,
  84. 'zstart':$('#zstart').val(),
  85. 'zend':$('#zend').val(),
  86. 'channel':$('#channel_select').val()
  87. },
  88. success:function(res){
  89. console.log(res)
  90. layer.close(index1)
  91. if(res.data.list.length<=0){
  92. res.data = [];
  93. }
  94. if(table != null) table.destroy();
  95. table = $('#dataTables-example').DataTable({
  96. data:res.data.list,
  97. responsive: true,
  98. paging:false,
  99. searching:false,
  100. retrieve: true,
  101. ordering: false,
  102. columns: [
  103. { data: 'name' },
  104. { data: 'pre_send_date'},
  105. { data:'promotion_url'},
  106. { data:'fansNum',render:function(data,type,row){
  107. return data+'<br/>'+row.fansNum/row.registerNum
  108. }},
  109. {data:'registerNum',render:function(data,type,row){
  110. return data+'<br/>'+row.payUserNum
  111. }},
  112. {data:'totalChargeAmount'},
  113. {data:'cost',render:function(data,type,row){
  114. return data+'<br/>'+(parseFloat(row.totalChargeAmount)-parseFloat(row.cost))+'<br/>'+(parseFloat(row.cost)/parseFloat(row.totalChargeAmount))
  115. }}
  116. ]
  117. });
  118. $("#pagination").pagination( {
  119. pageCount: res.data.meta.last_page,
  120. jump: true,
  121. coping: true,
  122. homePage: '首页',
  123. endPage: '末页',
  124. prevContent: '上页',
  125. nextContent: '下页',
  126. callback: function (api) {
  127. var current_page = api.getCurrent()
  128. updateTable(current_page,'page_change')
  129. }
  130. });
  131. }
  132. })
  133. }
  134. //$('.search_select').searchableSelect()
  135. </script>
  136. <!-- DataTables JavaScript -->
  137. <script src="/vendor/datatables/js/jquery.dataTables.min.js"></script>
  138. <script src="/vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
  139. <script src="/vendor/datatables-responsive/dataTables.responsive.js"></script>
  140. <script src="/vendor/pagination/jquery.pagination.js"></script>
  141. <script src="/vendor/jquery/jquery.searchableSelect.js"></script>
  142. <script src="http://apps.bdimg.com/libs/layer/2.1/layer.js"></script>
  143. <script src="/vendor/jquery/jquery.form.js"></script>
  144. <link rel="stylesheet" type="text/css" href="/vendor/pagination/common/reset.css" media="screen">
  145. <link rel="stylesheet" type="text/css" href="/vendor/pagination/common/highlight.min.css" media="screen">
  146. <link rel="stylesheet" type="text/css" href="/vendor/pagination/common/common.css" media="screen">
  147. <link rel="stylesheet" type="text/css" href="/vendor/pagination/pagination.css" media="screen">
  148. <link rel="stylesheet" type="text/css" href="/vendor/pagination/pagination.css" rel="stylesheet">
  149. <link rel="stylesheet" type="text/css" href="/vendor/datepick/bootstrap-datepicker.min.css" rel="stylesheet">
  150. <link rel="stylesheet" type="text/css" href="/vendor/jquery/jquery.searchableSelect.css" rel="stylesheet">
  151. <link rel="stylesheet" type="text/css" href="http://apps.bdimg.com/libs/layer/2.1/skin/layer.css" rel="stylesheet">
  152. @endpush