out.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. {% extends "../theme.html" %}
  2. {% block content %}
  3. {%include 'inc/menu.html'%}
  4. <div class="pannel">
  5. <form action="/device/out" method="get" style="height: 500px;">
  6. <input type="hidden" name="type" id="type" value="{{data['input']['type']}}" />
  7. <input type="hidden" name="id" id="id" value="{{data['input']['id']}}" />
  8. <input type="hidden" name="method" id="method" value="mx" />
  9. <select multiple="multiple" name="device" id="device" style="height: 500px;">
  10. {% for v in data['device'] %}
  11. <option value="{{v['id']}}" {% if 'device' in data['search'] and data['search']['device'] == v['id'] %}selected{% end %}>{{v['name']}}</option>
  12. {% end %}
  13. </select>
  14. <input type="text" name="start" id="start" readonly class="form_datetime" value="{% if 'start' in data['search'] %}{{data['search']['start']}}{% end %}" style="width:150px;">
  15. ~
  16. <input type="text" name="end" id="end" readonly class="form_datetime" value="{% if 'end' in data['search'] %}{{data['search']['end']}}{% end %}" style="width:150px;">
  17. <input type="submit" value="导出报表">
  18. </form>
  19. </div>
  20. {% end %}
  21. {% block script %}
  22. <script type="text/javascript" src="{{static_url('pc/lib/laydate/laydate.js')}}"></script>
  23. <script type="text/javascript">
  24. dateTheme = '#247ed0'
  25. laydate.render({
  26. elem: '#start'
  27. ,theme: dateTheme
  28. ,max: 0
  29. ,type: 'datetime'
  30. /*
  31. ,mark: {
  32. '0-9-14': '浇水'
  33. ,'0-9-26': '施肥' //每年的日期
  34. }
  35. */
  36. ,done: function(value, date){
  37. /*
  38. if(date.year === 2017 && date.month === 9 && date.date === 14){
  39. alert('我都干了什么啊');
  40. }
  41. */
  42. var start = value
  43. var end = $("#end").val()
  44. if (start || end) {
  45. $("#group").hide();
  46. } else {
  47. $("#group").show();
  48. }
  49. }
  50. });
  51. laydate.render({
  52. elem: '#end'
  53. ,theme: dateTheme
  54. //,min: $('#start').val()
  55. ,max: 0
  56. ,type: 'datetime'
  57. ,done: function(value, date){
  58. var start = $("#start").val()
  59. var end = value
  60. if (start || end) {
  61. $("#group").hide();
  62. } else {
  63. $("#group").show();
  64. }
  65. }
  66. });
  67. </script>
  68. {% end %}