export.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-title">
  7. <h5>{$meta_title}</h5>
  8. <div class="ibox-tools">
  9. <a class="toback" href="{:url('index')}">
  10. 返回上一页
  11. </a>
  12. </div>
  13. </div>
  14. <div class="ibox-content">
  15. <div class="" style="background-color: #d9edf7;
  16. padding: 15px 20px 20px 20px;margin-bottom: 20px;font-size: 14px">
  17. <span><i class="fa fa-info-circle">考虑服务器承受力,尽量导出数据量不要超过一个月</i></span>
  18. </div>
  19. <form method="post" action="{:url('export')}" class="form-horizontal">
  20. <div class="form-group">
  21. <label class="col-sm-1 control-label">开始日期</label>
  22. <div class="col-sm-6">
  23. <input id="Ymd" readonly class="form-control" name="start" value="">
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-1 control-label">结束日期</label>
  28. <div class="col-sm-6">
  29. <input id="Ymd1" readonly class="form-control" name="end" value="">
  30. </div>
  31. </div>
  32. <div class="hr-line-dashed"></div>
  33. <div class="form-group">
  34. <div class="col-sm-6 col-sm-offset-2">
  35. <button class="btn btn-primary " target-form="form-horizontal" type="submit">导出并下载文件</button>
  36. </div>
  37. </div>
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. {/block}
  44. {block name="script"}
  45. <script type="text/javascript" src="/static/layDate-v5.0.9/laydate.js"></script>
  46. <script>
  47. var time =new Date();
  48. var Htime= time.toLocaleDateString()+3;
  49. console.log(Htime);
  50. laydate.render({
  51. elem: '#Ymd',
  52. showBottom: false,
  53. trigger: 'click' ,
  54. format:'yyyyMMdd',
  55. value:dateFormat()
  56. });
  57. laydate.render({
  58. elem: '#Ymd1',
  59. showBottom: false,
  60. trigger: 'click' ,
  61. format:'yyyyMMdd',
  62. value:dateFormatH()
  63. });
  64. //当前日期格式化
  65. function dateFormat() {
  66. var year=time.getFullYear();
  67. var mouth=time.getMonth()+ 1;
  68. if(mouth < 10){
  69. var mouths='0'+mouth;
  70. }else {
  71. var mouths=mouth;
  72. }
  73. var day=time.getDate();
  74. if(day < 10){
  75. var days='0'+day;
  76. }else {
  77. var days=day;
  78. }
  79. var dateStr=year+mouths+days;
  80. return dateStr;
  81. }
  82. //当前日期格式化
  83. function dateFormatH() {
  84. var year=time.getFullYear();
  85. var mouth=time.getMonth()+ 1;
  86. if(mouth < 10){
  87. var mouths='0'+mouth;
  88. }else {
  89. var mouths=mouth;
  90. }
  91. var day=time.getDate()+3;
  92. if(day < 10){
  93. var days='0'+day;
  94. }else {
  95. var days=day;
  96. }
  97. var dateStr=year+mouths+days;
  98. return dateStr;
  99. }
  100. </script>
  101. {/block}