123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <title>审核单位设置</title>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <script src="/static/js/jquery.min.js"></script>
- <style>
- *{margin:0;padding:0;transition:background-color .25s ease;}
- body{color:#434343;}
- .content{width:1210px;margin:0 auto;padding:20px;}
- table{border-collapse:collapse;}
- td,th{border:1px solid #ddd;padding:5px 5px;text-align:center;}
- td:nth-child(3){text-align:left;}
- tr:hover{background:#e0edff}
- select{background:#fff;border:1px solid #ddd;padding:5px;}
- input[type=checkbox]{width:30px;height:30px;cursor:pointer;}
- .btnBox{width:1210px;position:fixed;bottom:0;left:50%;margin-left:-605px;}
- #submit{width:100px;height:40px;border:none;background:#078ef0;;color:#fff;float:right;box-shadow:2px 2px 1px #ddd;margin:0 15px 15px 0;}
- </style>
- </head>
- <body>
- <div class="content">
- <div style="text-align:right;color:#ac0835;padding:5px;">设置单位:{$company.name}</div>
- <table>
- <thead>
- <tr>
- <th width="15%">人才层次
- <select id="level" onchange="Policy.levelChange(event);" autocomplete="off">
- <option value="1">一</option>
- <option value="2">二</option>
- <option value="3">三</option>
- <option value="4">四</option>
- <option value="5">五</option>
- <option value="6">六</option>
- <option value="7">七</option>
- <option value="">全部</option>
- </select>
- </th>
- <th width="15%">标签</th>
- <th width="30%">人才认定标准</th>
- <th width="5%">选择</th>
- <th width="35%">附件清单(请填写上传人才认定标准佐证材料清单,多个材料请换行填报)</th>
- </tr>
- </thead>
- <tbody>
- {volist name="policys" id="policy"}
- <tr data-level="{$policy.level}" {gt name="policy.level" value="1"}style="display:none;"{/gt}>
- <td>{$policy.level}</td>
- <td>{$policy.tag}</td>
- <td>{$policy.policy_name}</td>
- <td><input type="checkbox" data-id="{$policy.id}" {if condition="$policy['checked']"}checked="checked"{/if} autocomplete="off"></td>
- <td>
- <textarea class="files" style="width:100%;height:100%;" placeholder="一个材料清单一行,多个请换行" autocomplete="off">{$policy.files}</textarea>
- </td>
- </tr>
- {/volist}
- </tbody>
- </table>
- <div class="btnBox">
- <button type="button" id="submit">提交</button>
- </div>
- </div
- </body>
- <script>
- $(document).ready(function () {
- var lock = false;
- $("#submit").click(function () {
- lock = true;
- if (lock) {
- var data = [];
- var selLvl = $("#level").val();
- if (selLvl) {
- lines = $("tbody tr[data-level='" + selLvl + "']");
- } else {
- lines = $("tbody tr[data-level]");
- }
- var chks = 0;
- for (var i = 0; i < lines.length; i++) {
- let line = lines.eq(i);
- let d = {};
- d.id = line.find("[data-id]").data("id");
- d.checked = line.find("[data-id]").is(":checked") ? 1 : 2;
- d.files = line.find("textarea.files").val();
- data.push(d);
- chks += d.checked == 1 ? 1 : 0;
- }
- if (confirm("确定提交当前页面共" + data.length + "条(勾选" + chks + "条)人才认定标准?")) {
- $.ajax({
- url: "/admin/policy/submit",
- type: "post",
- data: {data: data},
- success: function (res) {
- alert(res.msg);
- lock = false;
- }
- })
- }
- }
- })
- $("input[type=checkbox]").change(function () {
- if ($(this).is(":checked") == false) {
- $(this).parents("tr").find("textarea").val("");
- }
- /*var data = {};
- data.id = $(this).data("id");
- data.checked = 2;
- if ($(this).is(":checked")) {
- data.checked = 1;
- }
- $.ajax({
- url: "/admin/policy/checked",
- type: "post",
- data: data,
- success: function (res) {
- if (res.code != 200)
- alert(res.msg);
- }
- })*/
- })
- })
- var Policy = {};
- Policy.levelChange = function (e) {
- var that = e.target;
- var selLvl = $(that).val();
- if (selLvl) {
- $("tbody tr[data-level!='" + selLvl + "']").css("display", "none");
- $("tbody tr[data-level='" + selLvl + "']").css("display", "table-row");
- } else {
- $("tbody tr[data-level]").css("display", "table-row");
- }
- }
- </script>
- </html>
|