| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <%@ include file="/include/head.jsp"%>
- <%@ page contentType="text/html;charset=GBK"%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <HEAD>
- <TITLE>Excel导入</TITLE>
- <link href="main.css" rel="stylesheet" type="text/css"></link>
- <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
- rel="stylesheet" type="text/css"></link>
- <script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
- <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
- type="text/javascript"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript">
- $(function(){
- if(top.importWaitDlg)top.importWaitDlg.close();
- <c:if test="${result ne null}">
- var result = "${result}";
- if(result == "-1"){
- top.$.ligerDialog.error('导入失败:Excel文件中没有数据!');
- }else if(result == "-2"){
- showErrorDiv();
- //top.$.ligerDialog.error('数据验证不通过,请查询模板格式是否正确!');
- }else if(result == "0"){
- /* top.$.ligerDialog.success('操作成功!'); */
- showErrorDiv();
- }else{
- top.$.ligerDialog.success('成功导入'+result+'条数据!');
- }
- /* <c:if test="${fn:length(infoList) gt 0}">
- showInfoDiv();
- </c:if> */
- </c:if>
- });
- function importExcel(operner){
- var rs = $.validate({name:"files",model:[{type:"require",msg:"Excel文件不能为空!"}]});
- if(!rs)return;
- var mess = "确定要导入吗?";
- top.$.ligerDialog.confirm(mess, function (yes){
- if(yes){
- top.importWaitDlg = top.$.ligerDialog.waitting('正在导入中,请稍候...');
- $("#excelForm").submit();
- }}
- );
- }
- function showErrorDiv(){
- top.$.ligerDialog.open({ title:"数据验证不通过",height: 200, target : errorDiv , width: 400, slide: false, buttons: [ { text: '确定', onclick: function (item, dialog) { dialog.hidden(); } } ] });
- }
- function showInfoDiv(){
- top.$.ligerDialog.open({ title:"数据导入成功",height: 200, target : infoDiv , width: 400, slide: false, buttons: [ { text: '确定', onclick: function (item, dialog) { dialog.hidden(); } } ] });
- }
- </script>
- </HEAD>
- <BODY>
- <%@ include file="/include/message.jsp"%>
- <div class="l-content">
- <FORM method="post" name="excelForm" id="excelForm" action="hrImportAction.do?task=excelImporthr&type=${type }" enctype="multipart/form-data">
- <div class="forum-container">
- <center>
- <table border="0" cellspacing="1" cellpadding="0" class="l-table-edit line">
- <tr>
- <td width="25%"><b>Excel文件</b><font color="red">*</font>:</td>
- <td width="55%"><input type="file" name="files" id="files" /></td>
- <%--<td class="l-table-edit-td"><input type="button" onclick="submitExcelForm('supplier')" class="l-button" value="导入" /></td> --%>
- <td ><a href="${pageContext.request.contextPath}/yw/hr/import/${type }.xls" >下载模版</a> </td>
- </tr>
- </table>
- </center>
- </div>
- </FORM>
- </div>
- <div id="errorDiv" style="display: none;">
- <div style="color: red;margin:10px 0 10px 0 ">总共有${fn:length(errList)}条数据有问题,请修复后重新导入:</div>
- <c:forEach items="${errList}" var="err">
- <div style="color: red;">${err}</div>
- </c:forEach>
- </div>
- <div id="infoDiv" style="display: none;">
- <c:forEach items="${infoList}" var="info">
- <div style="color: green;">${info}</div>
- </c:forEach>
- </div>
- </BODY>
- </HTML>
|