addPrintConf.jsp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  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 href="${ pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  9. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  10. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  11. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
  12. <script type="text/javascript" src="/shares/js/constant.js"></script>
  13. <script type="text/javascript" src="/shares/js/common.js"></script>
  14. <script type="text/javascript">
  15. $(function (){
  16. $("#printConf\\.topmargin").focus();
  17. });
  18. function subPrintForm(){
  19. if(checkForm()){
  20. $("#printBtn").attr({"disabled":"disabled"});
  21. $("#printForm").submit();
  22. }
  23. }
  24. function getMac(){
  25. try{
  26. var locator =new ActiveXObject ("WbemScripting.SWbemLocator");
  27. var service = locator.ConnectServer(".");
  28. var properties = service.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled =True");
  29. var e = new Enumerator (properties);
  30. var p = e.item();
  31. //获取mac地址
  32. var myMac = p.MACAddress;
  33. $("#printConf\\.mac_address").val(myMac);
  34. }catch(e){
  35. //alert("请启用ActiveX控件!");
  36. }
  37. }
  38. //验证
  39. function checkForm() {
  40. var rs = $.validate({
  41. name : "printConf\\.type",
  42. model : [ {
  43. type : "require",
  44. msg : "打印类型不能为空!"
  45. }]
  46. });
  47. rs = $.validate({
  48. name : "printConf\\.portrait",
  49. model : [ {
  50. type : "require",
  51. msg : "打印指向不能为空!"
  52. }]
  53. }) && rs;
  54. rs = $.validate({
  55. name : "printConf.topmargin",
  56. model : [ {
  57. type : "require",
  58. msg : "打印上边距不能为空!"
  59. },{
  60. type : "isNumber",
  61. msg : "打印上边距必须为数字!"
  62. },{
  63. type : "size",
  64. min : 1,
  65. msg : "打印上边距必须大于0元!"
  66. }]
  67. }) && rs;
  68. rs = $.validate({
  69. name : "printConf.bottommargin",
  70. model : [ {
  71. type : "require",
  72. msg : "打印下边距不能为空!"
  73. },{
  74. type : "isNumber",
  75. msg : "打印下边距必须为数字!"
  76. },{
  77. type : "size",
  78. min : 1,
  79. msg : "打印下边距必须大于0元!"
  80. }]
  81. }) && rs;
  82. rs = $.validate({
  83. name : "printConf.leftmargin",
  84. model : [ {
  85. type : "require",
  86. msg : "打印左边距不能为空!"
  87. },{
  88. type : "isNumber",
  89. msg : "打印左边距必须为数字!"
  90. },{
  91. type : "size",
  92. min : 1,
  93. msg : "打印左边距必须大于0元!"
  94. }]
  95. }) && rs;
  96. rs = $.validate({
  97. name : "printConf.rightmargin",
  98. model : [ {
  99. type : "require",
  100. msg : "打印右边距不能为空!"
  101. },{
  102. type : "isNumber",
  103. msg : "打印右边距必须为数字!"
  104. },{
  105. type : "size",
  106. min : 1,
  107. msg : "打印右边距必须大于0元!"
  108. }]
  109. }) && rs;
  110. if (rs) {
  111. return true;
  112. }
  113. return false;
  114. }
  115. </script>
  116. </head>
  117. <body>
  118. <form id="printForm" action="erpPrintConfAction.do" method="post">
  119. <div id="title" class="form-button">
  120. <input id="printBtn" type="button" class="l-button" value="保存" onclick="subPrintForm()"/>
  121. <input onclick="closeWindow();" type="button" value="关闭" class="l-button">
  122. </div>
  123. <div class="container-layout">
  124. <div class="forum-container">
  125. <center>
  126. <table class="l-table-edit line">
  127. <tr>
  128. <th colspan="2">新增打印配置</th>
  129. </tr>
  130. <tr>
  131. <td class="l-table-edit-text">打印配置类型:</td>
  132. <td class="l-table-edit-td">
  133. <select id="printConf.type" name="printConf.type" style="width:150px;">
  134. <c:forEach items="${requestScope.type}" var="type">
  135. <option value="${type.dvalue }"
  136. <c:if test="${type.dvalue eq printConf.type }">selected="selected"</c:if>
  137. >${type.dname }</option>
  138. </c:forEach>
  139. </select>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td class="l-table-edit-text">打印指向:</td>
  144. <td class="l-table-edit-td">
  145. <select id="printConf.portrait" name="printConf.portrait" style="width:150px;">
  146. <option value="0" selected="selected">横向</option>
  147. <option value="1">纵向</option>
  148. </select>
  149. </td>
  150. </tr>
  151. <tr>
  152. <td class="l-table-edit-text">上边距<FONT COLOR="red">*</FONT>:</td>
  153. <td class="l-table-edit-td">
  154. <input id="printConf.topmargin" name="printConf.topmargin" type='text' value="${printConf.topmargin }" />
  155. </td>
  156. </tr>
  157. <tr>
  158. <td class="l-table-edit-text">下边距<FONT COLOR="red">*</FONT>:</td>
  159. <td class="l-table-edit-td">
  160. <input id="printConf.bottommargin" name="printConf.bottommargin" type='text' value="${printConf.bottommargin }" />
  161. </td>
  162. </tr>
  163. <tr>
  164. <td class="l-table-edit-text">左边距<FONT COLOR="red">*</FONT>:</td>
  165. <td class="l-table-edit-td">
  166. <input id="printConf.leftmargin" name="printConf.leftmargin" type='text' value="${printConf.leftmargin }" />
  167. </td>
  168. </tr>
  169. <tr>
  170. <td class="l-table-edit-text">右边距<FONT COLOR="red">*</FONT>:</td>
  171. <td class="l-table-edit-td">
  172. <input id="printConf.rightmargin" name="printConf.rightmargin" type='text' value="${printConf.rightmargin }" />
  173. </td>
  174. </tr>
  175. </table>
  176. <input type="hidden" id="task" name="task" value="add">
  177. <input type="hidden" id="printConf.universalid" name="printConf.universalid" value="${printConf.universalid}">
  178. <input type="hidden" id="printConf.mac_address" name="printConf.mac_address" value="${printConf.mac_address}">
  179. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
  180. </center>
  181. </div>
  182. </div>
  183. </form>
  184. <%@ include file="/include/message.jsp"%>
  185. </body>
  186. </html>