repair_workload.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .combined{
  5. width: 100%;
  6. height: auto;
  7. font-size: 22px;
  8. padding: 10px;
  9. background: #fff;
  10. }
  11. </style>
  12. <div class="ibox">
  13. <div class="ibox-content">
  14. <div class="row">
  15. <div class="col-xs-3">
  16. <div class="btn-group pull-left">
  17. <a href="javascript:;" onclick="printer()" class="btn btn-sm btn btn-primary"><i class="glyphicon glyphicon-print"></i> 打印</a>&nbsp;&nbsp;
  18. <a href="javascript:void(0)" id="exportBtn" class="btn btn-sm btn-danger"><i class="fa fa-cloud-download"> 导出</i></a>
  19. </div>
  20. </div>
  21. <div class="col-xs-9" style="text-align: right;">
  22. <form class="form-inline" id="form-search" action="{:url('repairWorkload',['mode'=>$mode])}">
  23. <div class="input-group">
  24. <input class="form-control" value="{$start}" id="start" readonly placeholder="开始时间" name="start" >
  25. </div>
  26. <div class="input-group">
  27. <input class="form-control" value="{$end}" id="end" readonly placeholder="结束时间" name="end" >
  28. </div>
  29. <div class="input-group">
  30. <span class="input-group-btn">
  31. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  32. </span> &nbsp;
  33. <span class="input-group-btn">
  34. <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  35. </span>
  36. </div>
  37. </form>
  38. </div>
  39. </div>
  40. </div>
  41. <div class="ibox-content">
  42. <div class="jqGrid_wrapper" id="printer">
  43. <table id="table" style="border-collapse: collapse"></table>
  44. <div id="pager"></div>
  45. </div>
  46. <!-- <div class="combined">合计:</div>-->
  47. </div>
  48. </div>
  49. {/block}
  50. {block name="script"}
  51. <script src="/static/layDate-v5.0.9/laydate.js"></script>
  52. <script src="/static/browser.js"></script>
  53. <script src="/static/jquery.jqprint-0.3.js"></script>
  54. <script>
  55. $(function () {
  56. laydate.render({
  57. elem: '#start',
  58. trigger: 'click' ,
  59. theme: '#284a94'
  60. });
  61. laydate.render({
  62. elem: '#end',
  63. trigger: 'click' ,
  64. theme: '#284a94'
  65. });
  66. });
  67. function printer(){
  68. $('#printer').jqprint();
  69. }
  70. $(function () {
  71. $(window).bind("resize",function(){
  72. var width=$(".jqGrid_wrapper").width();
  73. $("#table").setGridWidth(width);
  74. });
  75. $.jgrid.defaults.styleUI="Bootstrap";
  76. $("#table").jqGrid({
  77. url:"{:url('repairWorkload',['mode'=>$mode])}",
  78. datatype: "json",
  79. colModel:[
  80. {label:'姓名',name:'user_name',index:'user_name', width:80,sortable: false},
  81. {label:'总数',name:'nums',index:'nums', width:80,sortable: false},
  82. {label:'待领取',name:'nums1',index:'nums1', width:80,sortable: false},
  83. {label:'已接单',name:'nums2',index:'nums2', width:80,sortable: false},
  84. {label:'已完成',name:'nums3',index:'nums3', width:80,sortable: false},
  85. {label:'被员工驳回',name:'nums4',index:'nums4', width:80,sortable: false},
  86. {label:'客观原因无法完成',name:'nums5',index:'nums5', width:80,sortable: false},
  87. {label:'已取消',name:'nums6',index:'nums6', width:80,sortable: false},
  88. ],
  89. sortname: 'id',
  90. viewrecords: true,
  91. autowidth:true,
  92. mtype: 'post',
  93. height: 'auto',
  94. emptyrecords: "暂无数据",
  95. sortorder: "asc",
  96. caption:"{$title}",
  97. loadComplete: function (xhr) {
  98. if(xhr.code==0){
  99. layer.msg(xhr.msg);
  100. return false;
  101. }
  102. },
  103. });
  104. });
  105. $('#exportBtn').click(function (){
  106. var start = $('#start').val();
  107. var end = $('#end').val();
  108. var mode = '{$mode}';
  109. console.log(start,end);
  110. window.location.href = "{:url('OrderStatistics/repairWorkloadExport')}?start="+start+'&end='+end+'&mode='+mode;
  111. })
  112. </script>
  113. {/block}