123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <%@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="../../../../include2.jsp" %>
- <!--框架必需end-->
- </head>
-
- <body>
- <form id="fileId" method="post" enctype="multipart/form-data" >
- <!-- <input type="hidden" name="classid" value="615"/> -->
- <table>
- <tr>
- <td width="10%" align="right"><span class="star">*</span>任务名称:</td>
- <td width="20%" id="renwu"></td>
-
- </tr>
-
- </table>
- <div id="fileDiv"></div>
- <div style="width: 100%; text-align:center"><input value="保存" type="button" onclick="javascript:saveAlertNotice();"/> <input value="重置" type="reset" /><br/></div>
- </form>
- <div> <a href="/nwyj/excels/list.xls" class="red underline">点击这里</a>下载导入的excel数据模板</div>
- <div class="padding_top5"> 说明:导入的excel需要遵循规定的格式,且导入的文件不能超过40M!</div>
- </html>
- <script type="text/javascript">
- var errorMessage=["请选择文件!","请选择正确的Excel文件!","导入Excel文件与模版不匹配!","选择导入的文件不能超过40M!"];
- <%-- var ifmHeight = "<%=request.getParameter("ifmHeight")%>"; --%>
- $(function(){
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- $("#renwu").append('<select editable=false name="TASK_ID_632" prompt="请选择" class="validate[required]" id="TASK_ID_632" selAlign="" selWidth="200"></select>')
- //$("#renwu").render();
- // $("#TASK_ID_632").attr("prompt", "请选择");
- $("#TASK_ID_632").initBgdDutySelect("610", "FD_OBJECTID", "PROGRAM_NAME", "TASK_STATE='1' and (INPUT_UNIT_ID='" + deptId + "' or GPS_AREA_ID like '%" + deptId + "%')");
- $('#fileDiv').getDutyUploadFileContent();
- //s$(parent.document.body).find("#frmright").height(ifmHeight);
- });
- function saveAlertNotice(){
- var fform = $("#fileId");
- //alert(fform+"--+++++_____")
- myFileToSave(fform);
- };
- function myFileToSave($form){
- showProgressBar("正在提交中...");
- var task_id = $("#TASK_ID_632").attr("relvalue");
- if(task_id==undefined || task_id==""){
- top.Dialog.alert("请选择任务名称!");
- return;
- }
- var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- //部门id
- var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
- //表单异步提交处理
- $form.ajaxSubmit({
- //url:$.pathname() +"/ws/uploadForm/FileUpDownService/fileUpLoad",
- url:$.pathname() + "/ws/duty/DutyRecordsService/mxbimportExcel?task_id="+ task_id+"&realName="+encodeURI(encodeURI(realName))+"&deptId="+deptId,
- //url:$.pathname() + "/ws/service0/BGDmingxibiao/saveBGDmingxibiao",
- //表单提交成功后的回调
- success : function(responseText, statusText, xhr, $form) {
- responseText = eval("(" + responseText + ")");
- closeProgress();
- //alert(responseText.success);//false
- if (responseText.success == 'true') {
-
- top.Dialog.alert("导入成功!",function(){
- if(top.Dialog || top.Dialog.close){
- top.Dialog.close();
- }
-
- });
- $('#frmright',window.parent.document).attr('src',$.pathname()+'/page/business/gps/queryStatistics/list/List.jsp');
- }else if(responseText.success == 'false'){
- if(responseText.info=='22'){
- top.Dialog.alert("导入的文档模版有误,请检查标题字段!");
- }else{
- var info = responseText.info;
- info = info.split("_");
- top.Dialog.alert("导入的文档第"+(parseInt(info[0])+1)+"行,第"+info[1]+"列数据有误,请按格式要求修改后再尝试导入!",function(){
- if(top.Dialog || top.Dialog.close){
- top.Dialog.close();
- }
- });
-
- }
- }else if(responseText.success == 'false1'){
- var info = responseText.info;
- info = info.split("_");
- top.Dialog.alert("导入的文档第"+(parseInt(info[0])+1)+"行,第"+info[1]+"列单位不在保供电责任单位之内,请检查修改后再尝试导入!",function(){
- if(top.Dialog || top.Dialog.close){
- top.Dialog.close();
- }
- });
-
- }
- },error:function( xhr,textStatus,errorThrown){
- top.Dialog.alert("导入失败!",function(){
- if(top.Dialog || top.Dialog.close){
- top.Dialog.close();
- }
- });
- }
-
- });
- }
- </script>
|