atsAttencePolicyDialog.jsp 3.6 KB

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