1e3733e0cdd4079a7e43817a04d14cd171c5adae.svn-base 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="/nwyj/scripts/business/am/MsgUser/msguser-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="777" 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. </form>
  40. <div class="padding_right5">
  41. <div id="maingrid"></div>
  42. </div>
  43. <script type="text/javascript">
  44. $(function(){
  45. $("#back").hover(function(){
  46. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  47. },function(){
  48. $(this).attr("src","/nwyj/images/temp/back.png");
  49. });
  50. });
  51. //导入方法
  52. function submitInfo() {
  53. addfn();
  54. };
  55. //保存
  56. function fileToSave($form,listGrid,msg){
  57. //showProgressBar("正在提交中...");
  58. //表单异步提交处理
  59. $form.ajaxSubmit({
  60. url:$.pathname() + "/ws/MsgUserExcel/MsgUserExcelToDBTableTool/importFile",
  61. //type : 'post',
  62. timeout : 15000,
  63. async: false,
  64. success: function(responseText, statusText, xhr, $form){
  65. encodeURI(responseText);
  66. //alert(responseText);
  67. responseText = eval('('+responseText+')');
  68. var length = responseText.rows.length;
  69. if(length>1000){
  70. top.Dialog.alert('导入的数据一次不能超过1000条,请分批次导入。');
  71. return;
  72. }
  73. var data = JSON.stringify(responseText);
  74. testData = JSON.parse(decodeURI(data));
  75. initGrid(testData);
  76. },
  77. error : function(e) {
  78. top.Dialog.alert('导入失败,请用正确的模板导入!', '访问服务失败!', 'error');
  79. }
  80. });
  81. }
  82. //导入excle
  83. function addfn() {
  84. var $form = $("#fillForm");
  85. fileToSave($form,'','');
  86. };
  87. </script>
  88. </body>
  89. </html>