atsAttenceGroupDialog.jsp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. });
  21. function selectMulti(obj) {
  22. if ($(obj).attr("checked") == "checked") {
  23. var data = $(obj).val();
  24. add(data);
  25. }
  26. };
  27. function add(data) {
  28. var aryTmp = data.split("#");
  29. var groupId = aryTmp[0];
  30. var len = $("#attenceGroup_" + groupId).length;
  31. if (len > 0) return;
  32. var attenceGroupTemplate = $("#attenceGroupTemplate").val();
  33. var html = attenceGroupTemplate.replace("#groupId", groupId)
  34. .replace("#data", data)
  35. .replace("#name", aryTmp[1]);
  36. $("#attenceGroupList").append(html);
  37. };
  38. function del(obj) {
  39. var tr = $(obj).closest("tr");
  40. $(tr).remove();
  41. };
  42. function dellAll() {
  43. $("#attenceGroupList").empty();
  44. };
  45. function selectData(){
  46. var chIds;
  47. if(isSingle=='true'){
  48. chIds =$('#listFrame').contents().find(":input[name='data'][checked]");
  49. }else{
  50. chIds = $("input[name='group']", $("#attenceGroupList"));
  51. }
  52. var ids =[],
  53. names =[],
  54. codes = [];
  55. $.each(chIds,function(i,ch){
  56. var aryTmp=$(ch).val().split("#");
  57. ids.push(aryTmp[0]);
  58. names.push(aryTmp[1]);
  59. codes.push(aryTmp[2]);
  60. });
  61. var obj={id:ids.join(","),name:names.join(","),code:codes.join(",")};
  62. dialog.get('sucCall')(obj);
  63. dialog.close();
  64. }
  65. function clearData(){
  66. var obj={id:'',name:''};
  67. dialog.get('sucCall')(obj);
  68. dialog.close();
  69. }
  70. </script>
  71. <style type="text/css">
  72. div.bottom{text-align: center;padding-top: 10px;}
  73. html,body{width:100%;height:100%;margin: 0 0 0 0;padding: 0 0 0 0 ;overflow: hidden;}
  74. </style>
  75. </head>
  76. <body>
  77. <div id="listLayout" style="height:100%;">
  78. <div position="center">
  79. <iframe id="listFrame" name="listFrame" height="95%" width="100%" frameborder="0"
  80. src="${ctx}/platform/ats/atsAttenceGroup/selector.ht?isSingle=${isSingle}"
  81. ></iframe>
  82. </div>
  83. <c:if test="${param.isSingle==false}">
  84. <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;">
  85. <table width="145" class="table-grid table-list" cellpadding="1" cellspacing="1">
  86. <tbody id="attenceGroupList">
  87. <tr class="hidden"></tr>
  88. </tbody>
  89. </table>
  90. </div>
  91. </c:if>
  92. <textarea style="display: none;" id="attenceGroupTemplate">
  93. <tr id="attenceGroup_#groupId">
  94. <td>
  95. <input type="hidden" name="group" value="#data"><span>#name</span>
  96. </td>
  97. <td style="width: 30px;" nowrap="nowrap"><a onclick="javascript:del(this);" class="link del" title="删除">&nbsp;</a> </td>
  98. </tr>
  99. </textarea>
  100. </div>
  101. <div position="bottom" class="bottom" style="margin-top:10px;">
  102. <a href="javascript:;" class="button" onclick="selectData()" style="margin-right:10px;" ><span class="icon ok"></span><span >选择</span></a>
  103. <a href="javascript:;" class="button" onclick="clearData()"><span class="icon cancel" ></span><span class="chosen" >清空</span></a>
  104. <a href="javascript:;" class="button" style="margin-left:10px;" onclick="dialog.close()"><span class="icon cancel"></span><span >取消</span></a>
  105. </div>
  106. </body>
  107. </html>