12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <%@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="/nwyj/scripts/business/am/MsgUser/msguser-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="777" 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>
- </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() {
- addfn();
- };
-
- //保存
- function fileToSave($form,listGrid,msg){
- //showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- url:$.pathname() + "/ws/MsgUserExcel/MsgUserExcelToDBTableTool/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>
|