admissionTicket.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('约球购票列表')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="formId">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. <label>门票日期:</label>
  15. <input type="text" class="time-input" placeholder="请选择门票日期" name="ticketDate" th:value="${ticketDate}"/>
  16. </li>
  17. <li>
  18. <label>场地名称:</label>
  19. <input type="text" name="siteName" th:value="${siteName}" data-template="请输入场地名称"/>
  20. </li>
  21. <li>
  22. <label>场地类型:</label>
  23. <select name="siteType" th:with="type=${@dict.getType('site_type')}">
  24. <option value="">所有</option>
  25. <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
  26. th:value="${dict.dictValue}"></option>
  27. </select>
  28. </li>
  29. <li>
  30. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  31. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  32. </li>
  33. </ul>
  34. </div>
  35. </form>
  36. </div>
  37. <div class="col-sm-12 select-table table-striped">
  38. <table id="bootstrap-table"></table>
  39. </div>
  40. </div>
  41. </div>
  42. <th:block th:include="include :: footer" />
  43. <script th:inline="javascript">
  44. var editFlag = [[${@permission.hasPermi('admissionticket:AdmissionTicket:edit')}]];
  45. var removeFlag = [[${@permission.hasPermi('admissionticket:AdmissionTicket:remove')}]];
  46. var siteTypeDatas = [[${@dict.getType('site_type')}]];
  47. var prefix = ctx + "admissionticket";
  48. $(function() {
  49. var options = {
  50. url: prefix + "/list",
  51. createUrl: prefix + "/add",
  52. updateUrl: prefix + "/edit/{id}",
  53. removeUrl: prefix + "/remove",
  54. exportUrl: prefix + "/export",
  55. modalName: "约球购票",
  56. columns: [{
  57. checkbox: true
  58. },
  59. {
  60. field: 'venueName',
  61. title: '场馆名称'
  62. },
  63. {
  64. field: 'siteName',
  65. title: '场地名称'
  66. },
  67. {
  68. field: 'siteType',
  69. title: '场地类型',
  70. formatter: function(value, row, index) {
  71. return $.table.selectDictLabel(siteTypeDatas, value);
  72. }
  73. },
  74. {
  75. field: 'session',
  76. title: '场地时段'
  77. },
  78. {
  79. field: 'price',
  80. title: '时段价格'
  81. },
  82. {
  83. field: 'ticketDate',
  84. title: '门票日期'
  85. },
  86. {
  87. field: 'admissionTicketStatus',
  88. title: '预定状态',
  89. formatter: function (value, row, index) {
  90. return statusTools(row);
  91. }
  92. }]
  93. };
  94. $.table.init(options);
  95. });
  96. function statusTools(row) {
  97. if (row.admissionTicketStatus === "0") {
  98. return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')"></i> ';
  99. }else if(row.admissionTicketStatus === "1"){
  100. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
  101. }else if(row.admissionTicketStatus === "2"){
  102. return "已预定"
  103. }else if(row.admissionTicketStatus === "3"){
  104. return "已锁定"
  105. }
  106. /*else {
  107. return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')"></i> ';
  108. }*/
  109. }
  110. /* 用户管理-停用 */
  111. function disable(id) {
  112. $.operate.post(prefix + "/makeAnAppointment", { "id": id, "admissionTicketStatus": "0" });
  113. }
  114. /* 用户管理启用 */
  115. function enable(id) {
  116. $.operate.post(prefix + "/makeAnAppointment", { "id": id, "admissionTicketStatus": "1" });
  117. }
  118. </script>
  119. </body>
  120. </html>