8b70b7d8bea37ab3b73122798971a1a169f25051.svn-base 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <%@page language="java" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>导入法律法规</title>
  7. <!--框架必需start-->
  8. <%@include file="../../../../include.jsp" %>
  9. <!--框架必需end-->
  10. <style type="text/css">
  11. .back{
  12. margin:10px 0px 10px 15px;
  13. }
  14. </style>
  15. <script type="text/javascript" src="../../../../../scripts/business/am/fileManager/laws/laws-import.js"></script>
  16. <link rel="stylesheet" type="text/css" href="/nwyj/page/business/am/colorpropretice/colorpropretice.css" />
  17. </head>
  18. <body>
  19. <div style="height: 50px;background: #F8F8F8;" align="center">
  20. <a href="javascript:;"><img id="back" class="back" align="left" alt="返回" title="返回" src="/nwyj/images/temp/back.png" onclick="goBack()"></img></a>
  21. <font style="font-weight: bold;font-size: 20px;line-height: 45px;">导入法律法规</font>
  22. </div>
  23. <form id="fillForm" method="post" enctype="multipart/form-data">
  24. <table width="100%" class="tableStyle">
  25. <tr style="display: none;">
  26. <td>
  27. <input type="hidden" name="classid"
  28. value="243" required="true" />
  29. </tr>
  30. <tr>
  31. <td width="10%">选择导入文件:</td>
  32. <td width="70%">
  33. <input name="import" fileWidth="300" id="import" type="file" contenteditable="false" />
  34. </td>
  35. <td width="10%"><div><input type="button" value="下载法律法规导入模版" onclick="xiazai()"/></div></td>
  36. <td width="10%" align="center"><div id="sure"><input type="button" value="确定" onclick="submitInfo()"/></div></td>
  37. </tr>
  38. </table>
  39. <div>
  40. <font class="colorpropretice">*录入说明:</font></br>
  41. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、网公司录入国家范围的法律法规文件,共享后全网都可以查看,下属单位不需要重复录入。</font></br>
  42. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、分子公司录入省级范围的法律法规文件,下属单位不需要重复录入。</font></br>
  43. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3、地市局录入地市范围的法律法规文件,下属单位不需要重复录入。</font></br>
  44. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4、县区局、分局录入县级范围的法律法规文件,下属单位不需要重复录入。</font></br>
  45. </div>
  46. </form>
  47. <div class="padding_right5">
  48. <div id="maingrid"></div>
  49. </div>
  50. <script type="text/javascript">
  51. $(function(){
  52. $("#back").hover(function(){
  53. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  54. },function(){
  55. $(this).attr("src","/nwyj/images/temp/back.png");
  56. });
  57. });
  58. //导入方法
  59. function submitInfo() {
  60. var val= $("#import").val();
  61. var end = val.substring(val.indexOf(".")-13);
  62. if(end=="lawsfalvfagui.xls"||end=="lawsfalvfagui.xlsx"){
  63. addfn();
  64. }else{
  65. top.Dialog.alert("请导入正确的excel文件");
  66. return;
  67. }
  68. };
  69. //保存
  70. function fileToSave($form,listGrid,msg){
  71. //showProgressBar("正在提交中...");
  72. //表单异步提交处理
  73. $form.ajaxSubmit({
  74. url:$.pathname() + "/ws/LawsExcel/LawsExcelToDBTableTool/importFile",
  75. //type : 'post',
  76. timeout : 15000,
  77. async: false,
  78. success: function(responseText, statusText, xhr, $form){
  79. encodeURI(responseText);
  80. //alert(responseText);
  81. responseText = eval('('+responseText+')');
  82. var length = responseText.rows.length;
  83. if(length>1000){
  84. top.Dialog.alert('导入的数据一次不能超过1000条,请分批次导入。');
  85. return;
  86. }
  87. var data = JSON.stringify(responseText);
  88. testData = JSON.parse(decodeURI(data));
  89. initGrid(testData);
  90. },
  91. error : function(e) {
  92. top.Dialog.alert('导入失败,请用正确的模板导入!', '访问服务失败!', 'error');
  93. }
  94. });
  95. }
  96. //导入excle
  97. function addfn() {
  98. var $form = $("#fillForm");
  99. fileToSave($form,'','');
  100. };
  101. </script>
  102. </body>
  103. </html>