7b3eddbfe92218a11d6fac3ce62406d9de38d40f.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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/document/document-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"><a href="javascript:;"><img id="back" title="返回" class="back" align="left" alt="返回" src="/nwyj/images/temp/back.png" onclick="goBack()"></img></a><font style="font-weight: bold;font-size: 20px;line-height: 45px;">导入企业文件</font></div>
  20. <form id="fillForm" method="post" enctype="multipart/form-data">
  21. <table width="100%" class="tableStyle">
  22. <tr style="display: none;">
  23. <td>
  24. <input type="hidden" name="classid"
  25. value="241" required="true" />
  26. </tr>
  27. <tr>
  28. <td width="10%">选择导入文件:</td>
  29. <td width="70%">
  30. <input name="import" fileWidth="300" id="import" type="file" contenteditable="false" />
  31. </td>
  32. <td width="10%"><div><input type="button" value="下载企业公文导入模版" onclick="xiazai()"/></div></td>
  33. <td width="10%" align="center"><div id="sure"><input type="button" value="确定" onclick="submitInfo()"/></div></td>
  34. </tr>
  35. </table>
  36. <div>
  37. <font class="colorpropretice">*录入说明:</font></br>
  38. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1、各级单位录入单位收到别的单位、企业发过来的公文。</font></br>
  39. <font class="colorpropretice">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、收到的企业公文尽快录入到系统。</font></br>
  40. </div>
  41. </form>
  42. <div class="padding_right5">
  43. <div id="maingrid"></div>
  44. </div>
  45. <script type="text/javascript">
  46. $(function(){
  47. $("#back").hover(function(){
  48. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  49. },function(){
  50. $(this).attr("src","/nwyj/images/temp/back.png");
  51. });
  52. });
  53. //导入方法
  54. function submitInfo() {
  55. /* var val= $("#import").val();
  56. var end = val.substring(val.indexOf(".")-15);
  57. if(end=="documentgongwen.xls"||end=="documentgongwen.xlsx"){ */
  58. addfn();
  59. /* }else{
  60. top.Dialog.alert("请导入正确的excel文件");
  61. return;
  62. } */
  63. };
  64. //保存
  65. function fileToSave($form,listGrid,msg){
  66. //showProgressBar("正在提交中...");
  67. //表单异步提交处理
  68. $form.ajaxSubmit({
  69. url:$.pathname() + "/ws/DocumentExcel/DocumentExcelToDBTableTool/importFile",
  70. //type : 'post',
  71. timeout : 15000,
  72. async: false,
  73. success: function(responseText, statusText, xhr, $form){
  74. encodeURI(responseText);
  75. //alert(responseText);
  76. responseText = eval('('+responseText+')');
  77. var length = responseText.rows.length;
  78. if(length>1000){
  79. top.Dialog.alert('导入的数据一次不能超过1000条,请分批次导入。');
  80. return;
  81. }
  82. var data = JSON.stringify(responseText);
  83. testData = JSON.parse(decodeURI(data));
  84. initGrid(testData);
  85. },
  86. error : function(e) {
  87. top.Dialog.alert('导入失败,请用正确的模板导入!', '访问服务失败!', 'error');
  88. }
  89. });
  90. }
  91. //导入excle
  92. function addfn() {
  93. var $form = $("#fillForm");
  94. fileToSave($form,'','');
  95. };
  96. </script>
  97. </body>
  98. </html>