123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <%@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/ContingercyPlan/ContingercyPlan-import.js"></script>
- </head>
-
- <body>
- <div style="height: 50px;background: #F8F8F8;" align="center"><a href="javascript:;"><img id="back" class="back" title="返回" 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>
- <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="214" 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() {
- /* var val= $("#import").val();
- var end = val.substring(val.indexOf(".")-15);
- if(end=="contingencyyuan.xls"||end=="contingencyyuan.xlsx"){ */
- addfn();
- /* }else{
- top.Dialog.alert("请导入正确的excel文件");
- return;
- } */
- };
-
- //保存
- function fileToSave($form,listGrid,msg){
- //showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- url:$.pathname() + "/ws/ContingercyPlanExcel/ContingercyPlanExcelToDBTableTool/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>
|