信阳市12345_前端

WorkTimeList.html 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../js/huayi.load.js"></script>
  6. <title>工作时间</title>
  7. <style>
  8. .toolBar {
  9. padding: 15px 0;
  10. border-bottom: 1px solid #ccc;
  11. }
  12. .toolBar select {
  13. width: 150px;
  14. padding: 2px 2px 2px 10px;
  15. height: 32px;
  16. border: 1px solid rgb(204, 204, 204);
  17. }
  18. .tool_downs {
  19. display: flex;
  20. justify-content: center;
  21. }
  22. .tool_downs span {
  23. display: block;
  24. width: 100%;
  25. height: 100%;
  26. text-align: center;
  27. }
  28. .tool_downs a {
  29. display: block;
  30. list-style: none;
  31. float: left;
  32. padding-left: 10px;
  33. }
  34. </style>
  35. <script>
  36. $(document).ready(function () {
  37. initTable();
  38. $(".searchGo").click(function () {
  39. initTable();
  40. });
  41. $(".addBtn").click(function () {
  42. layer.open({
  43. type: 2,
  44. content: "./WorkTimeAdd.html", //iframe的url,no代表不显示滚动条
  45. title: "工作时间",
  46. area: ["500px", "600px"], //宽高
  47. });
  48. });
  49. });
  50. function initTable() {
  51. //先销毁表格
  52. $("#tableList").bootstrapTable("destroy");
  53. //初始化表格,动态从服务器加载数据
  54. $("#tableList").bootstrapTable({
  55. method: "post", //使用get请求到服务器获取数据
  56. url: huayi.config.callcenter_url + "SystemApi/GetWorkTimeList", //获取数据的Servlet地址
  57. contentType: "application/x-www-form-urlencoded",
  58. striped: true, //表格显示条纹
  59. pagination: true, //启动分页
  60. pageSize: 10, //每页显示的记录数
  61. pageNumber: 1, //当前第几页
  62. pageList: [10, 20, 50, 100], //记录数可选列表
  63. search: false, //是否启用查询
  64. showColumns: false, //显示下拉框勾选要显示的列
  65. showRefresh: false, //显示刷新按钮
  66. sidePagination: "server", //表示服务端请求
  67. //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
  68. //设置为limit可以获取limit, offset, search, sort, order
  69. queryParamsType: "undefined",
  70. queryParams: function queryParams(params) {
  71. //设置查询参数
  72. var param = {
  73. currentPage: params.pageNumber,
  74. pageSize: params.pageSize,
  75. name: $("#keyvalue").val()
  76. };
  77. return param;
  78. },
  79. onLoadSuccess: function () {
  80. //加载成功时执行
  81. //layer.msg("加载成功");
  82. },
  83. onLoadError: function () {
  84. //加载失败时执行
  85. //layer.msg("加载数据失败", { time: 1500, icon: 2 });
  86. },
  87. });
  88. }
  89. function operation(val, row) {
  90. return (
  91. '<div class="tool_downs">' +
  92. '<a href="javascript:;" class="aBtn" authorize="yes" onclick="editBtn(' +
  93. row.id +
  94. ')" title="编辑">编辑</a>' +
  95. '<a href="javascript:;" class="aBtn" authorize="yes" onclick="deleteBtn(' +
  96. row.id +
  97. ')" title="删除">删除</a>' +
  98. "</div>"
  99. );
  100. }
  101. function editBtn(id) {
  102. layer.open({
  103. type: 2,
  104. content: "./WorkTimeAdd.html?id=" + id, //iframe的url,no代表不显示滚动条
  105. title: "工作时间",
  106. area: ["500px", "600px"], //宽高
  107. });
  108. }
  109. function deleteBtn(id) {
  110. layer.confirm('确定删除吗?', {
  111. btn: ['是', '否'] //按钮
  112. }, function () {
  113. $.getJSON(huayi.config.callcenter_url + "SystemApi/DeleteWorkTime", {
  114. id: id
  115. }, function (result) {
  116. if (result.state.toLowerCase() == "success") {
  117. layer.msg("删除成功");
  118. initTable();
  119. }
  120. })
  121. });
  122. }
  123. </script>
  124. </head>
  125. <body class="gray-bg">
  126. <div class="container-fluid wrapper-content animated fadeInRight">
  127. <div class="toolBar clearfix">
  128. <div class="toolRight">
  129. <span>
  130. 名称:
  131. <input id="keyvalue" type="text" class="">
  132. </span>
  133. <button class="btns searchGo">搜索</button>
  134. <button class="btns addBtn">添加</button>
  135. </div>
  136. </div>
  137. <div class="treeTable clearfix">
  138. <div class="tableCon col-md-12">
  139. <table id="tableList" data-row-style="rowStyle" data-query-params="queryParams" data-pagination="true">
  140. <thead>
  141. <tr>
  142. <th data-field="name" data-align="center">名称</th>
  143. <th data-field="startTime" data-align="center">开始时间</th>
  144. <th data-field="endTime" data-align="center">结束时间</th>
  145. <th data-field="remark" data-align="center">备注</th>
  146. <th data-align="center" data-formatter="operation" data-width="150">操作</th>
  147. </tr>
  148. </thead>
  149. <tbody id="tbody"></tbody>
  150. </table>
  151. </div>
  152. </div>
  153. </div>
  154. </body>
  155. </html>