listDevMaintain.jsp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  7. <title>设备列表</title>
  8. <link
  9. href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  10. rel="stylesheet" type="text/css" />
  11. <script
  12. src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js"
  13. type="text/javascript"></script>
  14. <script
  15. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js"
  16. type="text/javascript"></script>
  17. <script
  18. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js"
  19. type="text/javascript"></script>
  20. <script
  21. src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
  22. type="text/javascript"></script>
  23. <link href="${pageContext.request.contextPath}/main.css"
  24. rel="stylesheet" type="text/css" />
  25. <script type="text/javascript" src="/shares/js/constant.js"></script>
  26. <script type="text/javascript" src="/shares/js/common.js"></script>
  27. <script type="text/javascript">
  28. $(function() {
  29. loadDevMaintainList();
  30. });
  31. var grid = null;
  32. function loadDevMaintainList() {
  33. var checkbox = false;
  34. if ("${checkbox}" == 'false' || "${checkbox}" == '') {
  35. checkbox = false;
  36. } else {
  37. checkbox = true;
  38. }
  39. grid = $("#deviceGrid").ligerGrid(
  40. {
  41. columns : [ {
  42. display : '设备编号',
  43. name : 'm_dev_code',
  44. width : 120
  45. }, {
  46. display : '设备名称',
  47. name : 'm_dev_name',
  48. width : 120
  49. }, {
  50. display : '设备类别',
  51. name : 'm_dev_type_name',
  52. width : 120
  53. }, {
  54. display : '故障现象',
  55. name : 'm_bad_phe',
  56. width : 120
  57. }, {
  58. display : '故障开始时间',
  59. name : 'm_start_time',
  60. width : 120
  61. } , {
  62. display : '故障结束时间',
  63. name : 'm_end_time',
  64. width : 120
  65. } , {
  66. display : '维修类型',
  67. name : 'm_dev_main_type_name',
  68. width : 120
  69. } , {
  70. display : '维修工时',
  71. name : 'm_dev_main_hour',
  72. width : 120
  73. } , {
  74. display : '维修费用',
  75. name : 'm_dev_main_cost',
  76. width : 120
  77. } , {
  78. display : '录入时间',
  79. name : 'm_create_date',
  80. width : 120
  81. } , {
  82. display : '完成情况',
  83. name : 'm_finishmemo',
  84. width : 120
  85. } , {
  86. display : '备注',
  87. name : 'm_remark',
  88. width : 120
  89. } ],
  90. pageSize : 20,
  91. url : 'devMaintainAction.do?task=devMaintainList&time='
  92. + new Date().getTime(),
  93. pageParmName : 'p', //页索引参数名,(提交给服务器)
  94. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  95. width : 'auto',
  96. height : 'auto',
  97. checkbox : true
  98. });
  99. $("#pageloading").hide();
  100. }
  101. function f_select() {
  102. var rows = grid.getCheckedRows();
  103. return rows;
  104. }
  105. function editDevMaintain(){
  106. var rows = grid.getCheckedRows();
  107. if(rows.length == 1){
  108. window.parent.f_addTab('editDevMaintain', '修改维修记录', '${pageContext.request.contextPath }/devMaintainAction.do?task=toEditDevMaintain&m_id='+rows[0].m_id+'&tabid=' + getCurrentTabId());
  109. }else if(rows.length == 0){
  110. alert("请先选择一条记录");
  111. }else{
  112. alert("只能选择一条记录");
  113. }
  114. }
  115. function delDevMaintain(){
  116. var rows = grid.getCheckedRows();
  117. var m_ids = "";
  118. if(rows.length == 0){
  119. alert("请先选择要删除的记录");
  120. return;
  121. }else{
  122. for ( var i = 0; i < rows.length; i++) {
  123. m_ids += ("," + rows[i].m_id);
  124. }
  125. m_ids = m_ids.substring(1, m_ids.length);
  126. }
  127. if (confirm("确定要删除吗?")) {
  128. $.ajax({
  129. type:"POST",
  130. url:"devMaintainAction.do?task=delDevMaintain",
  131. data : {"m_ids":m_ids},
  132. timeout:10000,
  133. cache:false,
  134. dataType:"json",
  135. success:function(data){
  136. var success = data.success;
  137. if(success != undefined){
  138. $.ligerDialog.success("删除成功");
  139. }else{
  140. showAjaxError(null, data.error);
  141. }
  142. loadDevMaintainList();
  143. },
  144. error:showAjaxError
  145. });
  146. }
  147. }
  148. </script>
  149. </head>
  150. <body>
  151. <%@ include file="/include/message.jsp"%>
  152. <div class="container-layout">
  153. <c:if test="${requestScope.lookup == null or requestScope.looup == '' }">
  154. <div id="title" class="form-button">
  155. <input type="button" class="l-button" value="添加"
  156. onclick="window.parent.f_addTab('addDevMaintain', '新增维修记录', '${pageContext.request.contextPath }/devMaintainAction.do?task=toEditDevMaintain&tabid=' + getCurrentTabId());" />
  157. <input type="button" class="l-button" value="修改"
  158. onclick="editDevMaintain()" />
  159. <input type="button" class="l-button" value="删除"
  160. onclick="delDevMaintain();" />
  161. </div>
  162. </c:if>
  163. <div class="default_search" style="margin: 0;">
  164. <ul class="list_search">
  165. <li class="title">设备编号:</li>
  166. <li class="text"><input type="text" name="product_num"
  167. id="product_num"></li>
  168. </ul>
  169. <ul class="list_search">
  170. <li class="title">设备名称:</li>
  171. <li class="text"><input type="text" name="product_name"
  172. id="product_name"></li>
  173. </ul>
  174. <ul>
  175. <li class="search-button"><input type="button" class='l-button'
  176. name="search" onclick="searchByKword()" value="查询" /></li>
  177. </ul>
  178. </div>
  179. <div id="searchbar">
  180. <div style="overflow: hidden; clear: both;">
  181. <div id="deviceGrid" style="margin: 0; padding: 0"></div>
  182. </div>
  183. </div>
  184. </div>
  185. </body>
  186. </html>