post-update-postAllowance.jsp 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>岗位表</title>
  7. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <style type="text/css">
  9. .combo_self{height: 22px !important;width: 150px !important;}
  10. .layout-header .btn {
  11. margin:0;
  12. float: none !important;
  13. }
  14. .btn-default {
  15. height: 35px;
  16. line-height: 35px;
  17. font-size:14px;
  18. }
  19. </style>
  20. <script type="text/javascript">
  21. $(function(){
  22. $(".combo").removeClass("combo").addClass("combo combo_self");
  23. $(".combo").each(function(){
  24. $(this).parent().css("line-height","0px");
  25. });
  26. });
  27. /**树形列表数据转换**/
  28. function convertTreeData(rows, textField) {
  29. for(var i = 0; i < rows.length; i++) {
  30. var row = rows[i];
  31. row.text = row[textField];
  32. if(row.children) {
  33. row.state = "open";
  34. convertTreeData(row.children, textField);
  35. }
  36. }
  37. }
  38. /**树形列表加入子元素**/
  39. function joinTreeChildren(arr1, arr2) {
  40. for(var i = 0; i < arr1.length; i++) {
  41. var row1 = arr1[i];
  42. for(var j = 0; j < arr2.length; j++) {
  43. if(row1.id == arr2[j].id) {
  44. var children = arr2[j].children;
  45. if(children) {
  46. row1.children = children;
  47. }
  48. }
  49. }
  50. }
  51. }
  52. </script>
  53. <script type="text/javascript">
  54. //编写自定义JS代码
  55. </script>
  56. </head>
  57. <body>
  58. <t:formvalid formid="formobj" dialog="true" usePlugin="password" beforeSubmit="checkPostName" layout="table" action="postController.do?doUpdate" >
  59. <input id="id" name="id" type="hidden" value="${postPage.id }"/>
  60. <input id="combo-value" type="hidden" value="${postPage.parentPostid }"/>
  61. <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
  62. <%-- <tr>
  63. <td align="right">
  64. <label class="Validform_label">
  65. 岗位编码:
  66. </label>
  67. </td>
  68. <td class="value">
  69. <input id="postCode" name="postCode" type="text" style="width: 150px" class="inputxt" datatype="s6-18" ignore="checked" value='${postPage.postCode}'/>
  70. <span class="Validform_checktip"></span>
  71. <label class="Validform_label" style="display: none;">岗位编码</label>
  72. </td>
  73. </tr> --%>
  74. <tr>
  75. <td align="right">
  76. <label class="Validform_label">
  77. 岗位名称:
  78. </label>
  79. </td>
  80. <td class="value">
  81. <input id="postName" name="postName" onchange="checkPostName()" type="text" style="width: 150px" class="inputxt" readonly="readonly" ignore="checked" value='${postPage.postName}'/>
  82. <span class="Validform_checktip" id="vpostname"></span>
  83. <label class="Validform_label" style="display: none;">岗位名称</label>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td align="right">
  88. <label class="Validform_label">
  89. 上级岗位:
  90. </label>
  91. </td>
  92. <td class="value">
  93. <input type="text" style="width: 150px" class="inputxt" readonly="readonly" value='${postPage.parentPost.postName}'>
  94. <span class="Validform_checktip"></span>
  95. <label class="Validform_label" style="display: none;">上级岗位</label>
  96. </td>
  97. <%-- <td class="value">
  98. <input id="parentPostid" name="parentPostid" type="text" style="width: 150px" class="inputxt easyui-combotree" ignore="ignore"
  99. value='${postPage.parentPostid}'
  100. data-options="
  101. panelHeight:'220',
  102. url: 'postController.do?datagrid&field=id,postName',
  103. loadFilter: function(data) {
  104. var rows = data.rows || data;
  105. var win = frameElement.api.opener;
  106. var listRows = win.getDataGrid().treegrid('getData');
  107. joinTreeChildren(rows, listRows);
  108. convertTreeData(rows, 'postName');
  109. return rows;
  110. },
  111. onSelect:function(node){
  112. $('#parentPostid').val(node.id);
  113. },
  114. onLoadSuccess: function() {
  115. var win = frameElement.api.opener;
  116. var currRow = win.getDataGrid().treegrid('getSelected');
  117. if(!'${postPage.id}') {
  118. //增加时,选择当前父菜单
  119. if(currRow) {
  120. $('#parentPostid').combotree('setValue', currRow.id);
  121. }
  122. }else {
  123. //编辑时,选择当前父菜单
  124. if(currRow) {
  125. $('#parentPostid').combotree('setValue', currRow.parentPostid);
  126. }
  127. }
  128. }
  129. "
  130. >
  131. <span class="Validform_checktip"></span>
  132. <label class="Validform_label" style="display: none;">上级岗位</label>
  133. </td> --%>
  134. </tr>
  135. <tr>
  136. <td align="right">
  137. <label class="Validform_label">
  138. 岗位津贴:
  139. </label>
  140. </td>
  141. <td class="value">
  142. <input id="money" name="money" type="text" style="width: 150px" class="inputxt" datatype="n" ignore="checked" value='${postPage.money}'/>
  143. <span class="Validform_checktip"></span>
  144. <label class="Validform_label" style="display: none;">岗位津贴</label>
  145. </td>
  146. </tr>
  147. </table>
  148. </t:formvalid>
  149. </body>
  150. <script src = "webpage/cn/com/lzt/post/post.js"></script>
  151. <script type="text/javascript">
  152. function checkPostName(){
  153. var result =false;
  154. $.ajax({
  155. type : "post",
  156. url : "postController.do?checkPostName",
  157. data : {id:$("#id").val(),postName:$("#postName").val(),parentPostid:$("#combo-value").val()},
  158. dataType : "json",
  159. async : false,
  160. cache : false,
  161. success : function(json) {
  162. if(!json.flag){
  163. $("#vpostname").html("岗位名称重复");
  164. $("#vpostname").addClass("Validform_wrong");
  165. result = false;
  166. }else{
  167. result = true;
  168. }
  169. }
  170. });
  171. return result;
  172. }
  173. </script>