index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <!--
  3. To change this license header, choose License Headers in Project Properties.
  4. To change this template file, choose Tools | Templates
  5. and open the template in the editor.
  6. -->
  7. <html>
  8. <head>
  9. <title>审核单位设置</title>
  10. <meta charset="UTF-8">
  11. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  12. <script src="/static/js/jquery.min.js"></script>
  13. <style>
  14. *{margin:0;padding:0;transition:background-color .25s ease;}
  15. body{color:#434343;}
  16. .content{width:1210px;margin:0 auto;padding:20px;}
  17. table{border-collapse:collapse;}
  18. td,th{border:1px solid #ddd;padding:5px 5px;text-align:center;}
  19. td:nth-child(3){text-align:left;}
  20. tr:hover{background:#e0edff}
  21. select{background:#fff;border:1px solid #ddd;padding:5px;}
  22. input[type=checkbox]{width:30px;height:30px;cursor:pointer;}
  23. </style>
  24. </head>
  25. <body>
  26. <div class="content">
  27. <div style="text-align:right;color:#ac0835;padding:5px;">设置单位:{$company.name}</div>
  28. <table>
  29. <thead>
  30. <tr>
  31. <th width="15%">人才层次
  32. <select id="level" onchange="Policy.levelChange(event);" autocomplete="off">
  33. <option value="1">一</option>
  34. <option value="2">二</option>
  35. <option value="3">三</option>
  36. <option value="4">四</option>
  37. <option value="5">五</option>
  38. <option value="6">六</option>
  39. <option value="7">七</option>
  40. <option value="">全部</option>
  41. </select>
  42. </th>
  43. <th width="10%">标签</th>
  44. <th width="70%">人才认定标准</th>
  45. <th width="10%">选择</th>
  46. </tr>
  47. </thead>
  48. <tbody>
  49. {volist name="policys" id="policy"}
  50. <tr data-level="{$policy.level}" {gt name="policy.level" value="1"}style="display:none;"{/gt}>
  51. <td>{$policy.level}</td>
  52. <td>{$policy.tag}</td>
  53. <td>{$policy.policy_name}</td>
  54. <td><input type="checkbox" data-id="{$policy.id}" {if condition="$policy['checked']"}checked="checked"{/if}></td>
  55. </tr>
  56. {/volist}
  57. </tbody>
  58. </table>
  59. </div
  60. </body>
  61. <script>
  62. $(document).ready(function () {
  63. $("input[type=checkbox]").change(function () {
  64. var data = {};
  65. data.id = $(this).data("id");
  66. data.checked = 2;
  67. if ($(this).is(":checked")) {
  68. data.checked = 1;
  69. }
  70. $.ajax({
  71. url: "/admin/policy/checked",
  72. type: "post",
  73. data: data,
  74. success: function (res) {
  75. if (res.code != 200)
  76. alert(res.msg);
  77. }
  78. })
  79. })
  80. })
  81. var Policy = {};
  82. Policy.levelChange = function (e) {
  83. var that = e.target;
  84. var selLvl = $(that).val();
  85. if (selLvl) {
  86. $("tbody tr[data-level!='" + selLvl + "']").css("display", "none");
  87. $("tbody tr[data-level='" + selLvl + "']").css("display", "table-row");
  88. }else{
  89. $("tbody tr[data-level]").css("display", "table-row");
  90. }
  91. }
  92. </script>
  93. </html>