addDataDictionary.jsp 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <Title>ERP添加数据字典</Title>
  8. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  9. <link href="/shares/xheditor/xheditor-1.1.14/demos/common.css" rel="stylesheet" type="text/css" media="screen" />
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/Gray/css/form.css" rel="stylesheet" type="text/css" />
  11. <link href="/shares/css/yw/erp2/erpCommon.css" rel="stylesheet" type="text/css" />
  12. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  13. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  14. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  15. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  18. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  19. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
  20. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  21. <script src="/shares/js/common.js" type="text/javascript"></script>
  22. <script type="text/javascript" src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js"></script>
  23. <script type="text/javascript" src="/shares/js/yw/erp2/system/erpDataDictionary.js"></script>
  24. <style type="text/css">
  25. .l-table-edit-text {
  26. width: 100px;
  27. font-weight: bold;
  28. color: #cc000
  29. }
  30. .default-select {
  31. width: 250px;
  32. height: 22px;
  33. line-height: 22px;
  34. }
  35. .short-select {
  36. width: 250px;
  37. height: 22px;
  38. line-height: 22px;
  39. }
  40. .default-text {
  41. width: 250px;
  42. height: 22px;
  43. line-height: 22px
  44. }
  45. .short-text {
  46. width: 150px;
  47. line-height: 22px;
  48. height: 22px;
  49. }
  50. .l-text{
  51. width: 150px;
  52. line-height: 22px;
  53. height: 22px;
  54. }
  55. .text {
  56. height: 22px;
  57. line-height: 22px;
  58. margin-right: 10px;
  59. display: inline-block;
  60. margin-left: 1px
  61. }
  62. .title {
  63. font-size: 20px;
  64. font-weight: bold;
  65. padding-bottom: 20px;
  66. padding-left: 5px;
  67. border-bottom: 1px solid #ededed;
  68. vertical-align: middle;
  69. }
  70. </style>
  71. <script type="text/javascript">
  72. $(function() {
  73. searchList();
  74. // showSuccessMsg('${i }');
  75. });
  76. </script>
  77. </head>
  78. <body>
  79. <form method='post' name="theForm" id="theForm"
  80. action="TmsDataDictionaryAction.do?task=doAddTmsDataDictionary" onsubmit="return checkForm();">
  81. <div id="title" class="form-button">
  82. <input type="submit" class="l-button" value="保存" />
  83. <input type="button" value="关闭" class="l-button" onclick="closeWindow();"/>
  84. </div>
  85. <div style="height: 400px; margin-top: 23px" >
  86. <div class="forum-container-2" >
  87. <table border="0" cellspacing="1" cellpadding="0"
  88. style="border: 1px solid #ededed; width:100%; margin-top: 0px";margin-right: 0px; margin-left: 0px;">
  89. <thead>
  90. <tr>
  91. <th colspan="5">
  92. <div class="l-table-edit line">请填写以下标准基本信息</div>
  93. </th>
  94. </tr>
  95. </thead>
  96. <tr>
  97. <td class="l-table-edit-text" style="width:89px;">标准名称<FONT COLOR="red">*</FONT>:
  98. </td>
  99. <td class="l-table-edit-td">
  100. <input type="hidden" name="universalid" id="universalid" value="${map.universalid }">
  101. <input type="text" class="default-text" name="dname" id="dname" value="${map.dname }">
  102. <label id="dnameMsg"></label>
  103. </td>
  104. <td></td>
  105. <td class="l-table-edit-text" style="width:89px;">摘要:
  106. </td>
  107. <td class="l-table-edit-td">
  108. <input type="text" class="default-text" name="remark" id="remark" value="${map.remark }" />
  109. </td>
  110. </tr>
  111. <tr>
  112. <td class="l-table-edit-text" style="width:89px;">编码<FONT COLOR="red">*</FONT>:
  113. </td>
  114. <td class="l-table-edit-td">
  115. <input type="text" class="default-text" name="dvalue" id="dvalue" value="${map.dvalue }" />
  116. <label id="dvalueMsg"></label>
  117. </td>
  118. <td></td>
  119. <td class="l-table-edit-text" style="width:89px;">排序号:
  120. </td>
  121. <td class="l-table-edit-td">
  122. <input type="text" class="default-text" name="dorder" id="dorder" value="${map.dorder }" />
  123. <label id="dorderMsg"></label>
  124. </td>
  125. </tr>
  126. <tr>
  127. <td class="l-table-edit-text" style="width:89px;">是否有效:
  128. </td>
  129. <td class="l-table-edit-td" colspan="4">
  130. <select name="isValid" id="isValid" class="default-select">
  131. <c:if test="${map.isValid eq '1' }">
  132. <option value="0" selected="selected">是</option>
  133. <option value="1">否</option>
  134. </c:if>
  135. <c:if test="${map.isValid eq '0' }">
  136. <option value="0" >是</option>
  137. <option value="1" selected="selected">否</option>
  138. </c:if>
  139. </select>
  140. </td>
  141. </tr>
  142. </table>
  143. </div>
  144. <div>
  145. <div id="title" style="background-color: #E5ECF9;padding-top: 3px;padding-bottom: 3px;">
  146. 标准项配置 &nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="l-button" disabled="disabled" value="新增标准项" />
  147. </div>
  148. <div id="maingrid1" style=" margin:0;padding: 0"></div>
  149. </div>
  150. </div>
  151. <%@ include file="/include/message.jsp"%>
  152. </form>
  153. </body>
  154. <script type="text/javascript">
  155. function showSuccessMsg(i){
  156. if(i > 0){
  157. var succMsg = '<a href="#">${map.dname }</a>&nbsp;新建成功!'
  158. +' <br/><br/>是否继续编辑标准?<br/><br/>是否继续?';
  159. $.ligerDialog({content:succMsg, title:"操作成功",type:"success",width:350,height:150,allowClose : false,
  160. buttons:[ { text:"是",onclick:function(){window.location.href="TmsDataDictionaryAction.do?task=toEditTmsDataDictionary&universalid="+i;} } ,
  161. {text:"否",onclick:function(){closeWindow();}}
  162. ]
  163. });
  164. }else{
  165. if( i == -98){
  166. $.ligerDialog.warn("操作失败,当前的标准名称或编码已存在!");
  167. }else if( i == -2){
  168. $.ligerDialog.warn("标准名不能为空!");
  169. }else if(i == -1){
  170. $.ligerDialog.warn("编码不能为空!");
  171. }else if(i == -99){
  172. $.ligerDialog.warn("数据异常,请刷新后重试!");
  173. }
  174. }
  175. }
  176. var manager;
  177. function searchList() {
  178. var parentId = document.getElementById("universalid");//父节点名称
  179. var jsonObject = {"parentId":""};
  180. if (parentId.value != "" && typeof (parentId.value) != "undefined") {
  181. jsonObject.parentId=parentId.value;
  182. }else{
  183. jsonObject.parentId=-1;
  184. }
  185. if(manager == undefined){
  186. $(function() {
  187. manager = $("#maingrid1").ligerGrid({
  188. columns : [
  189. {
  190. display : '字典项',
  191. name : 'dname',
  192. align : 'center',
  193. width : 220,
  194. render : function(rowdata, rowindex, value) {
  195. var h = "";
  196. h += "<a href='javascript:toDetails(\""
  197. + rowdata.universalid + "\")'>"
  198. + value + "</a> ";
  199. return h;
  200. }
  201. },
  202. {
  203. display : '编码',
  204. name : 'dvalue',
  205. width : 180,
  206. align : 'center'
  207. },
  208. {
  209. display : '排序号',
  210. name : 'dorder',
  211. width : 100,
  212. align : 'center'
  213. },{
  214. display : '是否默认',
  215. name : 'lose_false',
  216. width : 80,
  217. align : 'center',
  218. render : function(rowdata, rowindex, value) {
  219. var h = "";
  220. if(value == 1){
  221. h += "是 ";
  222. }else{
  223. h += "否";
  224. }
  225. return h;
  226. }
  227. },
  228. {
  229. display : '是否有效',
  230. name : 'lose_false',
  231. width : 80,
  232. align : 'center',
  233. render : function(rowdata, rowindex, value) {
  234. var h = "";
  235. if(value == 1){
  236. h += "<font style='color:#ff0000'>否</font> ";
  237. }else{
  238. h += "是";
  239. }
  240. return h;
  241. }
  242. }, {
  243. display : '操作',
  244. name : 'projtypename',
  245. width : 120,
  246. align : 'center',
  247. isSort: false,
  248. render : function(rowdata, rowindex, value) {
  249. var h = "";
  250. h += "<a href='javascript:seeUser("+ rowdata.pm + ")'>查看</a> ";
  251. h += "<a href='javascript:seeUser("+ rowdata.pm + ")'>修改</a> ";
  252. h += "<a href='javascript:seeUser("+ rowdata.pm + ")'>删除</a> ";
  253. return h;
  254. }
  255. }],
  256. pageSize : 20,
  257. width : "99.9%",
  258. height : "99%",
  259. parms :jsonObject,
  260. //where : f_getWhere(),
  261. //data: $.extend(true,{},CustomersData),
  262. //onSuccess: ,
  263. pageParmName : 'curPage', //页索引参数名,(提交给服务器)
  264. pagesizeParmName : 'pageSize' //页记录数参数名,(提交给服务器)
  265. });
  266. });
  267. }else{
  268. manager._setParms(jsonObject);
  269. manager.loadData();
  270. }
  271. }
  272. </script>
  273. </html>