atsAttendanceFileDialog.jsp 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <%@page pageEncoding="UTF-8" import="com.hotent.platform.model.system.SysUser"%>
  2. <%@include file="/commons/include/html_doctype.html"%>
  3. <html>
  4. <head>
  5. <%@include file="/commons/include/form.jsp" %>
  6. <title>选择考勤档案</title>
  7. <script type="text/javascript">
  8. /*KILLDIALOG*/
  9. var dialog = frameElement.dialog; //调用页面的dialog对象(ligerui对象)
  10. var isSingle='${isSingle}';
  11. $(function(){
  12. //布局
  13. $("#listLayout").ligerLayout({
  14. bottomHeight :40,
  15. height: '90%',
  16. allowBottomResize:false,
  17. minLeftWidth:200,
  18. allowLeftResize:false
  19. });
  20. initData();
  21. });
  22. function initData(){
  23. var obj=dialog.get("params");
  24. if(obj&&obj.length>0){
  25. for(var i=0,c;c=obj[i++];){
  26. var data = c.id+'#'+c.userName+'#'+c.account+'#'+c.orgName ;
  27. add(data);
  28. }
  29. }
  30. }
  31. function selectMulti(obj) {
  32. if ($(obj).attr("checked") == "checked") {
  33. var data = $(obj).val();
  34. add(data);
  35. }
  36. };
  37. function add(data) {
  38. var aryTmp = data.split("#");
  39. var fileId = aryTmp[0];
  40. var len = $("#attendanceFile_" + fileId).length;
  41. if (len > 0) return;
  42. var attendanceFileTemplate = $("#attendanceFileTemplate").val();
  43. var html = attendanceFileTemplate.replace("#fileId", fileId)
  44. .replace("#data", data)
  45. .replace("#name", aryTmp[1]);
  46. $("#attendanceFileList").append(html);
  47. };
  48. function del(obj) {
  49. var tr = $(obj).closest("tr");
  50. $(tr).remove();
  51. };
  52. function dellAll() {
  53. $("#attendanceFileList").empty();
  54. };
  55. function selectData(){
  56. var chIds;
  57. if(isSingle=='true'){
  58. chIds =$('#listFrame').contents().find(":input[name='data'][checked]");
  59. }else{
  60. chIds = $("input[name='file']", $("#attendanceFileList"));
  61. }
  62. var ids =[],userNames =[],accounts=[],orgNames=[];
  63. $.each(chIds,function(i,ch){
  64. var aryTmp=$(ch).val().split("#");
  65. ids.push(aryTmp[0]);
  66. userNames.push(aryTmp[1]);
  67. accounts.push(aryTmp[2]);
  68. orgNames.push(aryTmp[3]);
  69. });
  70. var obj={id:ids.join(","),userName:userNames.join(","),account:accounts.join(","),orgName:orgNames.join(",")};
  71. dialog.get('sucCall')(obj);
  72. dialog.close();
  73. }
  74. function clearData(){
  75. var obj={id:'',name:''};
  76. dialog.get('sucCall')(obj);
  77. dialog.close();
  78. }
  79. </script>
  80. <style type="text/css">
  81. div.bottom{text-align: center;padding-top: 10px;}
  82. html,body{width:100%;height:100%;margin: 0 0 0 0;padding: 0 0 0 0 ;overflow: hidden;}
  83. </style>
  84. </head>
  85. <body>
  86. <div id="listLayout" style="height:100%;">
  87. <div position="center">
  88. <iframe id="listFrame" name="listFrame" height="95%" width="100%" frameborder="0"
  89. src="${ctx}/platform/ats/atsAttendanceFile/selector.ht?isSingle=${isSingle}"
  90. ></iframe>
  91. </div>
  92. <c:if test="${param.isSingle==false}">
  93. <div position="right" title="<span><a onclick='javascript:dellAll();' class='link del'>清空 </a><input type='text' class='quick-find' title='快速查询'/></span>" style="overflow: auto;height:95%;width:170px;">
  94. <table width="145" class="table-grid table-list" cellpadding="1" cellspacing="1">
  95. <tbody id="attendanceFileList">
  96. <tr class="hidden"></tr>
  97. </tbody>
  98. </table>
  99. </div>
  100. </c:if>
  101. <textarea style="display: none;" id="attendanceFileTemplate">
  102. <tr id="attendanceFile_#fileId">
  103. <td>
  104. <input type="hidden" name="file" value="#data"><span>#name</span>
  105. </td>
  106. <td style="width: 30px;" nowrap="nowrap"><a onclick="javascript:del(this);" class="link del" title="删除">&nbsp;</a> </td>
  107. </tr>
  108. </textarea>
  109. </div>
  110. <div position="bottom" class="bottom" style="margin-top:10px;">
  111. <a href="javascript:;" class="button" onclick="selectData()" style="margin-right:10px;" ><span class="icon ok"></span><span >选择</span></a>
  112. <a href="javascript:;" class="button" onclick="clearData()"><span class="icon cancel" ></span><span class="chosen" >清空</span></a>
  113. <a href="javascript:;" class="button" style="margin-left:10px;" onclick="dialog.close()"><span class="icon cancel"></span><span >取消</span></a>
  114. </div>
  115. </body>
  116. </html>