123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <%@page language="java" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>导入法律法规</title>
- <!--框架必需start-->
- <%@include file="../../../../include.jsp" %>
- <!--框架必需end-->
- <style type="text/css">
- .back{
- margin:10px 0px 10px 15px;
- }
- </style>
- <script type="text/javascript" src="../../../../../scripts/business/am/fileManager/laws/laws-import.js"></script>
- <link rel="stylesheet" type="text/css" href="/nwyj/page/business/am/colorpropretice/colorpropretice.css" />
- </head>
-
- <body>
- <div style="height: 50px;background: #F8F8F8;" align="center">
- <a href="javascript:;"><img id="back" class="back" align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" onclick="goBack()"></img></a>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;">导入法律法规</font>
- </div>
- <form id="fillForm" method="post" enctype="multipart/form-data">
- <table width="100%" class="tableStyle">
- <tr style="display: none;">
- <td>
- <input type="hidden" name="classid"
- value="243" required="true" />
- </tr>
- <tr>
- <td width="10%">选择导入文件:</td>
- <td width="70%">
- <input name="import" fileWidth="300" id="import" type="file" contenteditable="false" />
- </td>
- <td width="10%"><div><input type="button" value="下载法律法规导入模版" onclick="xiazai()"/></div></td>
- <td width="10%" align="center"><div id="sure"><input type="button" value="确定" onclick="submitInfo()"/></div></td>
- </tr>
- </table>
- <div>
- <font class="colorpropretice">*录入说明:</font></br>
- <font class="colorpropretice"> 1、网公司录入国家范围的法律法规文件,共享后全网都可以查看,下属单位不需要重复录入。</font></br>
- <font class="colorpropretice"> 2、分子公司录入省级范围的法律法规文件,下属单位不需要重复录入。</font></br>
- <font class="colorpropretice"> 3、地市局录入地市范围的法律法规文件,下属单位不需要重复录入。</font></br>
- <font class="colorpropretice"> 4、县区局、分局录入县级范围的法律法规文件,下属单位不需要重复录入。</font></br>
- </div>
- </form>
- <div class="padding_right5">
- <div id="maingrid"></div>
- </div>
- <script type="text/javascript">
- $(function(){
- $("#back").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
- });
-
- //导入方法
- function submitInfo() {
- var val= $("#import").val();
- var end = val.substring(val.indexOf(".")-13);
- if(end=="lawsfalvfagui.xls"||end=="lawsfalvfagui.xlsx"){
- addfn();
- }else{
- top.Dialog.alert("请导入正确的excel文件");
- return;
- }
- };
-
- //保存
- function fileToSave($form,listGrid,msg){
- //showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- url:$.pathname() + "/ws/LawsExcel/LawsExcelToDBTableTool/importFile",
- //type : 'post',
- timeout : 15000,
- async: false,
- success: function(responseText, statusText, xhr, $form){
- encodeURI(responseText);
- //alert(responseText);
- responseText = eval('('+responseText+')');
- var length = responseText.rows.length;
- if(length>1000){
- top.Dialog.alert('导入的数据一次不能超过1000条,请分批次导入。');
- return;
- }
-
- var data = JSON.stringify(responseText);
- testData = JSON.parse(decodeURI(data));
- initGrid(testData);
- },
- error : function(e) {
- top.Dialog.alert('导入失败,请用正确的模板导入!', '访问服务失败!', 'error');
- }
- });
-
- }
- //导入excle
- function addfn() {
- var $form = $("#fillForm");
- fileToSave($form,'','');
-
- };
- </script>
- </body>
- </html>
|