atsShiftInfoDialog.jsp 3.7 KB

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