dictionary_add.jsp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <title>数据字典添加</title>
  9. <link
  10. href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  11. rel="stylesheet" type="text/css" />
  12. <link href="/shares/xheditor/xheditor-1.1.14/demos/common.css"
  13. rel="stylesheet" type="text/css" media="screen" />
  14. <link href="/shares/css/yw/tms/task.css" rel="stylesheet"
  15. type="text/css" />
  16. <link href="${pageContext.request.contextPath }/main.css"
  17. rel="stylesheet" type="text/css" />
  18. <script
  19. src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js"
  20. type="text/javascript"></script>
  21. <script
  22. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js"
  23. type="text/javascript"></script>
  24. <script
  25. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js"
  26. type="text/javascript"></script>
  27. <script
  28. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js"
  29. type="text/javascript"></script>
  30. <script
  31. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js"
  32. type="text/javascript"></script>
  33. <script
  34. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js"
  35. type="text/javascript"></script>
  36. <script
  37. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js"
  38. type="text/javascript"></script>
  39. <script src="/shares/js/common.js" type="text/javascript"></script>
  40. <script
  41. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerTab.js"
  42. type="text/javascript"></script>
  43. <script
  44. src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js"
  45. type="text/javascript"></script>
  46. <script type="text/javascript"
  47. src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js"></script>
  48. <script type="text/javascript" src="/shares/js/common.js"></script>
  49. <style type="text/css">
  50. .l-table-edit-text {
  51. width: 100px;
  52. font-weight: bold;
  53. color: #cc000
  54. }
  55. .default-select {
  56. width: 500px;
  57. height: 22px;
  58. line-height: 22px;
  59. }
  60. .short-select {
  61. width: 273px;
  62. height: 22px;
  63. line-height: 22px;
  64. }
  65. .default-text {
  66. width: 270px;
  67. height: 22px;
  68. line-height: 22px
  69. }
  70. .short-text {
  71. width: 270px;
  72. line-height: 22px;
  73. height: 22px;
  74. }
  75. .l-text{
  76. width: 270px;
  77. line-height: 22px;
  78. height: 22px;
  79. }
  80. .text {
  81. height: 22px;
  82. line-height: 22px;
  83. margin-right: 10px;
  84. display: inline-block;
  85. margin-left: 1px
  86. }
  87. .title {
  88. font-size: 20px;
  89. font-weight: bold;
  90. padding-bottom: 20px;
  91. padding-left: 5px;
  92. border-bottom: 1px solid #ededed;
  93. vertical-align: middle;
  94. }
  95. .l-table-edit-td{
  96. width:270px;
  97. }
  98. .l-table-edit-text{
  99. width:89px;
  100. }
  101. .forum-container-2 .l-table-edit-text{
  102. width:99px;
  103. }
  104. .projectTable{margin: 5px}
  105. .projectTable tr{height: 25px; padding-bottom: 2px; margin: 10px auto}
  106. .projectTable .left-text {width: 80px; }
  107. </style>
  108. <script type="text/javascript">
  109. function dictionary_add(){
  110. var rs = $.validate({
  111. name : "dname",
  112. model : [ {
  113. type : "require",
  114. msg : "请输入子项名称!"
  115. }]
  116. });
  117. rs = $.validate({
  118. name : "dvalue",
  119. model : [ {
  120. type : "require",
  121. msg : "请输入子项值!"
  122. }]
  123. }) && rs;
  124. if(rs){
  125. var dvalue=$("#dvalue").val();
  126. var dname=$("#dname").val();
  127. var flag=true;
  128. $("#sub_obj option").each(function(i,obj){
  129. var dtext=$(obj).text().split("-");
  130. if(dvalue==$(obj).val()){
  131. $("#sub_value").html("子项值已存在");
  132. flag=false;
  133. }
  134. if(dname==dtext[0]){
  135. $("#sub_dname").html("子项名称已存在");
  136. flag=false;
  137. }
  138. });
  139. if(flag){
  140. $("#dictionary_add").submit();
  141. }
  142. }
  143. }
  144. </script>
  145. </head>
  146. <body>
  147. <form id="dictionary_add" action="pmDictionary.do?task=dictionary_add" method="post">
  148. <input type="hidden" name="remark" value="${parent_map.dname }"/>
  149. <input type="hidden" name="parentid" value="${parent_map.universalid }"/>
  150. <input type="hidden" id="tabid" name="tabid" value="${tabid }" />
  151. <div id="title" class="form-button">
  152. <input type="button" id="btnSave" class="l-button" value="保存" onclick="dictionary_add()" />
  153. </div>
  154. <div style=" margin-top: 33px">
  155. <div class="forum-container-2" style="overflow: hidden;">
  156. <table border="0" cellspacing="1" cellpadding="0" style="border: 1px solid #ededed;">
  157. <tr>
  158. <th colspan="4">
  159. <div class="l-table-edit line">数据子项添加</div>
  160. </th>
  161. </tr>
  162. <tr>
  163. <td class="l-table-edit-text11" style="width:15%">父类名称:</td>
  164. <td class="l-table-edit-td" style="width:85%">
  165. ${parent_map.dname}
  166. </td>
  167. </tr>
  168. <tr>
  169. <td class="l-table-edit-text11">已有子项:</td>
  170. <td class="l-table-edit-td">
  171. <select id="sub_obj" name="sub_obj" >
  172. <c:forEach items="${subList}" var="obj">
  173. <option value="${obj.dvalue}" >${obj.dname }-${obj.dvalue}</option>
  174. </c:forEach>
  175. </select>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td class="l-table-edit-text11">子项名称<font color="red">*</font>:</td>
  180. <td class="l-table-edit-td">
  181. <input type="text" name="dname" id="dname" maxlength="20" /><span class="span_l f7" id="sub_dname" style="color:red;"></span>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td class="l-table-edit-text11">子项值<font color="red">*</font>:</td>
  186. <td class="l-table-edit-td">
  187. <input type="text" name="dvalue" id="dvalue" maxlength="10" /><span class="span_l f7" id="sub_value" style="color:red;"></span>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td class="l-table-edit-text11">子项代码:</td>
  192. <td class="l-table-edit-td">
  193. <input type="text" name="code" id="code" maxlength="20" />
  194. </td>
  195. </tr>
  196. </table>
  197. </div>
  198. </div>
  199. </form>
  200. </body>
  201. </html>