atsScheduleShiftImport.jsp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 exportTemp(){
  25. AtsImport({
  26. url:__ctx + '/platform/ats/atsScheduleShift/exportTemp.ht',
  27. title:'导出排班列表模版',
  28. params:$('#template').val(),
  29. width:700,
  30. height:500
  31. });
  32. }
  33. function submitForm(){
  34. var options={};
  35. if(showResponse){
  36. options.success=showResponse;
  37. }
  38. var frm=$('#importForm').form();
  39. frm.ajaxForm(options);
  40. if(frm.valid()){
  41. frm.submit();
  42. }
  43. }
  44. function showResponse(responseText){
  45. var obj=new com.hotent.form.ResultMessage(responseText);
  46. if(obj.isSuccess()){//成功
  47. $.ligerDialog.closeWaitting();
  48. var message = obj.getMessage();
  49. if(message){
  50. message =message.replaceAll("###","\'").replaceAll("!!!","<font ").replaceAll("%%%","</font>").replaceAll("&gt;",">").replaceAll("&lt;","<");
  51. }
  52. $.ligerDialog.tipDialog('提示信息',"导入结果如下:",message,null,function(){
  53. dialog.get('sucCall')("/");
  54. dialog.close();
  55. });
  56. }else{//失败
  57. $.ligerDialog.closeWaitting();
  58. $.ligerDialog.err("提示信息","打卡记录导入失败!",obj.getMessage());
  59. }
  60. }
  61. </script>
  62. </head>
  63. <body>
  64. <div class="panel-top">
  65. <div class="tbar-title">
  66. <span class="tbar-label">打卡记录导入</span>
  67. </div>
  68. <div class="panel-toolbar">
  69. <div class="toolBar">
  70. <div class="group"><a class="link save" id="btnSave"><span></span>导入</a></div>
  71. <div class="l-bar-separator"></div>
  72. <div class="group"><a class="link export" id="btnExport" onclick="javasrcipt:exportTemp()" ><span></span>导出排班模板</a></div>
  73. <div class="l-bar-separator"></div>
  74. <div class="group"><a class="link del" onclick="javasrcipt:dialog.close()"><span></span>关闭</a></div>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="panel-body">
  79. <form id="importForm" name="importForm" method="post" target="win" action="importData.ht" enctype="multipart/form-data">
  80. <div class="row">
  81. <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
  82. <tr>
  83. <th width="20%">选择文件:</th>
  84. <td width="80%" colspan="3"><input type="file" size="40" name="file" id="file"/></td>
  85. </tr>
  86. <tr>
  87. <th width="20%">导入模版:</th>
  88. <td>
  89. <select id="template" name="template">
  90. <option value="2" selected="selected">模版二(列表模式)</option>
  91. <option value="1">模版一(日历模式)</option>
  92. </select>
  93. </td>
  94. </tr>
  95. <tr>
  96. <th width="20%">节假日处理:</th>
  97. <td>
  98. <select id="holidayHandle" name="holidayHandle">
  99. <option value="2" >不替换</option>
  100. <option value="1" >替换</option>
  101. </select>
  102. </td>
  103. </tr>
  104. </table>
  105. </div>
  106. </form>
  107. </div><!-- end of panel-body -->
  108. </body>
  109. </html>