editPrintConf.jsp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. }
  36. }
  37. //验证
  38. function checkForm() {
  39. var rs = $.validate({
  40. name : "printConf\\.type",
  41. model : [ {
  42. type : "require",
  43. msg : "打印类型不能为空!"
  44. }]
  45. });
  46. rs = $.validate({
  47. name : "printConf\\.portrait",
  48. model : [ {
  49. type : "require",
  50. msg : "打印指向不能为空!"
  51. }]
  52. }) && rs;
  53. rs = $.validate({
  54. name : "printConf.topmargin",
  55. model : [ {
  56. type : "require",
  57. msg : "打印上边距不能为空!"
  58. },{
  59. type : "isNumber",
  60. msg : "打印上边距必须为数字!"
  61. },{
  62. type : "size",
  63. min : 1,
  64. msg : "打印上边距必须大于0元!"
  65. }]
  66. }) && rs;
  67. rs = $.validate({
  68. name : "printConf.bottommargin",
  69. model : [ {
  70. type : "require",
  71. msg : "打印下边距不能为空!"
  72. },{
  73. type : "isNumber",
  74. msg : "打印下边距必须为数字!"
  75. },{
  76. type : "size",
  77. min : 1,
  78. msg : "打印下边距必须大于0元!"
  79. }]
  80. }) && rs;
  81. rs = $.validate({
  82. name : "printConf.leftmargin",
  83. model : [ {
  84. type : "require",
  85. msg : "打印左边距不能为空!"
  86. },{
  87. type : "isNumber",
  88. msg : "打印左边距必须为数字!"
  89. },{
  90. type : "size",
  91. min : 1,
  92. msg : "打印左边距必须大于0元!"
  93. }]
  94. }) && rs;
  95. rs = $.validate({
  96. name : "printConf.rightmargin",
  97. model : [ {
  98. type : "require",
  99. msg : "打印右边距不能为空!"
  100. },{
  101. type : "isNumber",
  102. msg : "打印右边距必须为数字!"
  103. },{
  104. type : "size",
  105. min : 1,
  106. msg : "打印右边距必须大于0元!"
  107. }]
  108. }) && rs;
  109. if (rs) {
  110. return true;
  111. }
  112. return false;
  113. }
  114. </script>
  115. </head>
  116. <body>
  117. <form id="printForm" action="erpPrintConfAction.do" method="post">
  118. <div id="title" class="form-button">
  119. <input id="printBtn" type="button" class="l-button" value="保存" onclick="subPrintForm()"/>
  120. <input onclick="closeWindow();" type="button" value="关闭" class="l-button">
  121. </div>
  122. <div class="container-layout">
  123. <div class="forum-container">
  124. <center>
  125. <table class="l-table-edit line">
  126. <tr>
  127. <th colspan="2">新增打印配置</th>
  128. </tr>
  129. <tr>
  130. <td class="l-table-edit-text">打印配置类型:</td>
  131. <td class="l-table-edit-td">
  132. <select id="printConf.type" name="printConf.type" style="width:150px;">
  133. <c:forEach items="${requestScope.type}" var="type">
  134. <option value="${type.dvalue }"
  135. <c:if test="${type.dvalue eq printConf.type }">selected="selected"</c:if>
  136. >${type.dname }</option>
  137. </c:forEach>
  138. </select>
  139. </td>
  140. </tr>
  141. <tr>
  142. <td class="l-table-edit-text">打印配置指向:</td>
  143. <td class="l-table-edit-td">
  144. <select id="printConf.portrait" name="printConf.portrait" style="width:150px;">
  145. <option value="0" <c:if test="${0 eq printConf.portrait }">selected="selected"</c:if>>横向</option>
  146. <option value="1" <c:if test="${1 eq printConf.portrait }">selected="selected"</c:if>>纵向</option>
  147. </select>
  148. </td>
  149. </tr>
  150. <tr>
  151. <td class="l-table-edit-text">上边距<FONT COLOR="red">*</FONT>:</td>
  152. <td class="l-table-edit-td">
  153. <input id="printConf.topmargin" name="printConf.topmargin" type='text' value="${printConf.topmargin }" />
  154. </td>
  155. </tr>
  156. <tr>
  157. <td class="l-table-edit-text">下边距<FONT COLOR="red">*</FONT>:</td>
  158. <td class="l-table-edit-td">
  159. <input id="printConf.bottommargin" name="printConf.bottommargin" type='text' value="${printConf.bottommargin }" />
  160. </td>
  161. </tr>
  162. <tr>
  163. <td class="l-table-edit-text">左边距<FONT COLOR="red">*</FONT>:</td>
  164. <td class="l-table-edit-td">
  165. <input id="printConf.leftmargin" name="printConf.leftmargin" type='text' value="${printConf.leftmargin }" />
  166. </td>
  167. </tr>
  168. <tr>
  169. <td class="l-table-edit-text">右边距<FONT COLOR="red">*</FONT>:</td>
  170. <td class="l-table-edit-td">
  171. <input id="printConf.rightmargin" name="printConf.rightmargin" type='text' value="${printConf.rightmargin }" />
  172. </td>
  173. </tr>
  174. </table>
  175. <input type="hidden" id="task" name="task" value="edit">
  176. <input type="hidden" id="printConf.universalid" name="printConf.universalid" value="${printConf.universalid}">
  177. <input type="hidden" id="printConf.mac_address" name="printConf.mac_address" value="${printConf.mac_address}">
  178. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
  179. </center>
  180. </div>
  181. </div>
  182. </form>
  183. <%@ include file="/include/message.jsp"%>
  184. </body>
  185. </html>