atsAttendanceFileImport.jsp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/commons/include/html_doctype.html" %>
  3. <html>
  4. <head>
  5. <title>考勤档案导入</title>
  6. <%@include file="/commons/include/form.jsp" %>
  7. <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
  8. <script type="text/javascript" src="${ctx}/js/hotent/platform/ats/AtsDialog.js"></script>
  9. <script type="text/javascript">
  10. /*KILLDIALOG*/
  11. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  12. $(function(){
  13. $("#btnSave").click(function(){
  14. var path = $('#file').val();
  15. var extName = path.split('.').pop().toLowerCase();
  16. if(extName=='xls' || extName=='xlsx'){
  17. $.ligerDialog.waitting('正在导入中,请稍候...');
  18. submitForm();
  19. }else{
  20. $.ligerDialog.warn("请选择 excel文件进行导入!");
  21. }
  22. });
  23. });
  24. function submitForm(){
  25. var options={};
  26. if(showResponse){
  27. options.success=showResponse;
  28. }
  29. var frm=$('#importForm').form();
  30. frm.ajaxForm(options);
  31. if(frm.valid()){
  32. frm.submit();
  33. }
  34. }
  35. function showResponse(responseText){
  36. var obj=new com.hotent.form.ResultMessage(responseText);
  37. if(obj.isSuccess()){//成功
  38. $.ligerDialog.closeWaitting();
  39. var message = obj.getMessage();
  40. if(message){
  41. message =message.replaceAll("###","\'").replaceAll("!!!","<font ").replaceAll("%%%","</font>").replaceAll("&gt;",">").replaceAll("&lt;","<");
  42. }
  43. $.ligerDialog.tipDialog('提示信息',"导入结果如下:",message,null,function(){
  44. dialog.get('sucCall')("/");
  45. dialog.close();
  46. });
  47. }else{//失败
  48. $.ligerDialog.closeWaitting();
  49. $.ligerDialog.err("提示信息","打卡记录导入失败!",obj.getMessage());
  50. }
  51. }
  52. function exportTemp(){
  53. AtsImport({
  54. url:__ctx + '/platform/ats/atsAttendanceFile/exportTemp.ht',
  55. title:'导出考勤档案列表模版',
  56. width:700,
  57. height:500
  58. });
  59. }
  60. </script>
  61. </head>
  62. <body>
  63. <div class="panel-top">
  64. <div class="tbar-title">
  65. <span class="tbar-label">打卡记录导入</span>
  66. </div>
  67. <div class="panel-toolbar">
  68. <div class="toolBar">
  69. <div class="group"><a class="link save" id="btnSave"><span></span>导入</a></div>
  70. <div class="l-bar-separator"></div>
  71. <div class="group"><a class="link export" id="btnExport" onclick="javasrcipt:exportTemp();"><span></span>导出考勤档案数据模板</a></div>
  72. <div class="l-bar-separator"></div>
  73. <div class="group"><a class="link del" onclick="javasrcipt:dialog.close()"><span></span>关闭</a></div>
  74. </div>
  75. </div>
  76. </div>
  77. <div class="panel-body">
  78. <form id="importForm" name="importForm" method="post" target="win" action="importData.ht" enctype="multipart/form-data">
  79. <div class="row">
  80. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  81. <tr>
  82. <th width="20%">选择文件:</th>
  83. <td width="80%" colspan="3"><input type="file" size="40" name="file" id="file"/></td>
  84. </tr>
  85. </table>
  86. </div>
  87. </form>
  88. </div><!-- end of panel-body -->
  89. <form id="exportForm" name="exportForm" method="post" action="exportData.ht">
  90. <input type="hidden" name="isTemplate" value="true"/>
  91. </form>
  92. </body>
  93. </html>