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/resource/team/teamer-import-inside.js"></script>
- </head>
-
- <body>
- <div style="height: 50px;background: #F8F8F8;" align="center"><a href="javascript:;"><img id="back" class="back" align="left" title="返回" alt="返回" src="/nwyj/images/temp/back.png" onclick="window.history.back()"></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 class="tableStyle" width="100%">
- <tr style="display: none;">
- <td>
- <input type="hidden" name="classid" value="262" required="true" />
- </td>
- </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(".")-18);
-
- if(end=="teamerduiwurenyuan.xls"||end=="teamerduiwurenyuan.xlsx"){ */
- addfn();
- /* }else{
- top.Dialog.alert("请导入正确的excel文件");
- return;
- } */
- };
-
- //保存
- function fileToSave($form,listGrid,msg){
- //showProgressBar("正在提交中...");
- //表单异步提交处理
- $form.ajaxSubmit({
- url:$.pathname() + "/ws/ExcelTeamer/TeamerExcelToDBTableTool/importInTeamer",
- //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>
|