deviceMgr.jsp 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <HEAD>
  5. <TITLE>设备管理</TITLE>
  6. <SCRIPT type=text/javascript
  7. src="${pageContext.request.contextPath}/js/jquery-1.3.2.min.js"></SCRIPT>
  8. <link href="main.css" rel="stylesheet" type="text/css"></link>
  9. <script type="text/javascript" src="js/lr-page.js"></script>
  10. <script type="text/javascript" src="/shares/js/constant.js"></script>
  11. <script type="text/javascript" src="/shares/js/common.js"></script>
  12. <script type="text/javascript"
  13. src="/shares/js/yw/erp/deviceTypeTree.js"></script>
  14. <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  15. rel="stylesheet" type="text/css"></link>
  16. <script src="./liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  17. <script src="./liger/lib/ligerUI/js/plugins/ligerLayout.js"
  18. type="text/javascript"></script>
  19. <script
  20. src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
  21. type="text/javascript"></script>
  22. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
  23. <script src="${pageContext.request.contextPath}/ligerlib/ligerUI/js/plugins/ligerMenuBar.js" type="text/javascript"></script>
  24. <script src="${pageContext.request.contextPath}/ligerlib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
  25. <script type="text/javascript">
  26. var menu1 = { items:
  27. [
  28. { text: '打印设备台帐', click: toPrintPage },
  29. { text: '打印设备条码', click: toPrintDevBarcode },
  30. // { line: true },
  31. { text: '打印设备卡片', click: itemclick }
  32. ]
  33. };
  34. function itemclick(item)
  35. {
  36. alert(item.text);
  37. }
  38. function toPrintPage(){
  39. var selectDeviceType = $("#selectDeviceType").val();
  40. window.open("deviceMgrAction.do?task=toPrintDeviceList&d_type_id="
  41. + selectDeviceType + '&tabid=' + getCurrentTabId(),"printDeviceList");
  42. }
  43. function toPrintDevBarcode(){
  44. var selectDeviceType = $("#selectDeviceType").val();
  45. window.open("deviceMgrAction.do?task=toPrintDevBarcode&d_type_id="
  46. + selectDeviceType + '&tabid=' + getCurrentTabId(),"printDeviceBarcode");
  47. }
  48. $(function() {
  49. $("#layout1").ligerLayout({
  50. leftWidth : 250,
  51. height : '99%'
  52. });
  53. $("#topmenu").ligerMenuBar({ items: [
  54. { text: '增加', click: addDevice , icon:'add'},
  55. {
  56. text : '打印',
  57. menu : menu1
  58. } ]
  59. });
  60. });
  61. function addDevice() {
  62. var selectDeviceType = $("#selectDeviceType").val();
  63. if (selectDeviceType == "1") {
  64. alert("根目录无法上传设备!");
  65. return;
  66. }
  67. window.parent.f_addTab('addDevice', '新增设备',
  68. 'deviceMgrAction.do?task=toEditDevice&d_type_id='
  69. + selectDeviceType + '&tabid=' + getCurrentTabId());
  70. }
  71. function editDevice(dev_id) {
  72. window.parent.f_addTab('editDevice', '编辑设备',
  73. 'deviceMgrAction.do?task=toEditDevice&dev_id=' + dev_id
  74. + '&tabid=' + getCurrentTabId());
  75. }
  76. function viewDevice(dev_id) {
  77. window.parent.f_addTab('viewDevice', '查看设备',
  78. 'deviceMgrAction.do?task=viewDevice&dev_id=' + dev_id
  79. + '&tabid=' + getCurrentTabId());
  80. }
  81. function delDevice(dev_id) {
  82. var selectDeviceType = $("#selectDeviceType").val();
  83. if (confirm("确定要删除吗?")) {
  84. $.ajax({
  85. type : "POST",
  86. url : "deviceMgrAction.do?task=delDevice",
  87. data : {
  88. "dev_id" : dev_id
  89. },
  90. timeout : 10000,
  91. cache : false,
  92. dataType : "json",
  93. success : function(data) {
  94. var success = data.success;
  95. if (success != undefined) {
  96. $.ligerDialog.success("删除成功");
  97. } else {
  98. showAjaxError(null, data.error);
  99. }
  100. loadDeviceList();
  101. },
  102. error : showAjaxError
  103. });
  104. }
  105. }
  106. function f_reload() {
  107. var manager = $("#deviceGrid").ligerGetGridManager();
  108. manager.loadData();
  109. }
  110. function loadDeviceList() {
  111. var grid = null;
  112. var selectDeviceType = document.getElementById("selectDeviceType").value;
  113. grid = $("#deviceGrid")
  114. .ligerGrid(
  115. {
  116. columns : [
  117. {
  118. display : '${customDevice.dev_code }',
  119. name : 'dev_code',
  120. width : 120
  121. },
  122. {
  123. display : '${customDevice.dev_name }',
  124. name : 'dev_name',
  125. width : 120
  126. },
  127. {
  128. display : '${customDevice.dev_type_name }',
  129. name : 'dev_type_name',
  130. width : 120
  131. },
  132. {
  133. display : '${customDevice.dev_brand }',
  134. name : 'dev_brand',
  135. width : 120
  136. },
  137. {
  138. display : '${customDevice.dev_model }',
  139. name : 'dev_model',
  140. width : 120
  141. },
  142. {
  143. display : '操作',
  144. isAllowHide : false,
  145. render : function(row) {
  146. var html = '<a href=\"#\" onclick=\"viewDevice('
  147. + row.dev_id
  148. + ')\">查看</a>&nbsp;';
  149. html += '<a href=\"#\" onclick=\"editDevice('
  150. + row.dev_id
  151. + ')\">编辑</a>&nbsp;';
  152. html += '<a href=\"#\" onclick=\"delDevice('
  153. + row.dev_id
  154. + ')\">删除</a>&nbsp;';
  155. return html;
  156. }
  157. } ],
  158. pageSize : 20,
  159. url : 'deviceMgrAction.do?task=deviceList&d_type_id='
  160. + selectDeviceType
  161. + '&time='
  162. + new Date().getTime(),
  163. pageParmName : 'p', //页索引参数名,(提交给服务器)
  164. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  165. width : '99.9%',
  166. height : '99.9%'
  167. });
  168. $("#pageloading").hide();
  169. }
  170. </script>
  171. <style type="text/css">
  172. body {
  173. padding: 5px;
  174. margin: 0;
  175. }
  176. #layout1 {
  177. width: 100%;
  178. margin: 0;
  179. padding: 0;
  180. }
  181. .l-button {
  182. margin-left: 1px;
  183. }
  184. #deptBtn {
  185. width: 100%;
  186. background: #e5ecf9;
  187. text-align: center;
  188. height: 25px;
  189. padding-top: 3px
  190. }
  191. .l-layout-left {
  192. overflow-y: auto;
  193. }
  194. </style>
  195. </HEAD>
  196. <BODY>
  197. <%@ include file="/include/button.jsp"%>
  198. <%@ include file="/include/message.jsp"%>
  199. <div class="l-content">
  200. <form name="userRoleForm" method="post">
  201. <input type="hidden" name="selectDeviceType" id="selectDeviceType" />
  202. <div id="layout1">
  203. <div position="left" title="设备类别" class="user-tree-style">
  204. <div id="deptBtn">
  205. <input type="button" value="新增" class="l-button" onclick="addDeviceType()" id="addDeviceTypeBtn" />
  206. <input type="button" value="修改" class="l-button" onclick="editDeviceType()" id="editDeviceTypeBtn" />
  207. <input type="button" value="删除" class="l-button" onclick="delDeviceType()" id="delDeviceTypeBtn" />
  208. </div>
  209. <ul id="deviceTypeTree" class="tree" style="margin-top: 3px;">
  210. </div>
  211. <div position="center" id="center" title="设备列表">
  212. <div id="topmenu"></div>
  213. <!-- <div id="deptBtn" style="text-align:left;"> -->
  214. <!-- <input type="button" value="新增" class="l-button" onclick="addDevice();" id="addDeviceBtn"> -->
  215. <!-- </div> -->
  216. <div id="deviceGrid" style="margin:0; padding:0"></div>
  217. </div>
  218. </div>
  219. </form>
  220. </div>
  221. </BODY>
  222. </HTML>