| 
					
				 | 
			
			
				@@ -20,6 +20,8 @@ and open the template in the editor. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             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> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -40,9 +42,10 @@ and open the template in the editor. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                 <option value="">全部</option> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                             </select> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         </th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        <th width="10%">标签</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        <th width="70%">人才认定标准</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        <th width="10%">选择</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <th width="5%">标签</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <th width="40%">人才认定标准</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <th width="5%">选择</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        <th width="35%">附件(多个换行)</th> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     </tr> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 </thead> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 <tbody> 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -51,31 +54,72 @@ and open the template in the editor. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                         <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}></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]"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    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); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if (confirm("确定提交当前页面共" + data.length + "条人才认定标准?")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            url: "/admin/policy/submit", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            type: "post", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            data: {data: data}, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            success: function (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                alert(res.msg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                                lock = false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $("input[type=checkbox]").change(function () { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                var data = {}; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data.id = $(this).data("id"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                data.checked = 2; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                if ($(this).is(":checked")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    data.checked = 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if ($(this).is(":checked") == false) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $(this).parents("tr").find("textarea").val(""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $.ajax({ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    url: "/admin/policy/checked", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    type: "post", 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    data: data, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    success: function (res) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                        if (res.code != 200) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                            alert(res.msg); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                /*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 = {}; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -85,7 +129,7 @@ and open the template in the editor. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             if (selLvl) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("tbody tr[data-level!='" + selLvl + "']").css("display", "none"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("tbody tr[data-level='" + selLvl + "']").css("display", "table-row"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $("tbody tr[data-level]").css("display", "table-row"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 |