| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
- <%@include file="/context/mytags.jsp"%>
- <!DOCTYPE html>
- <html>
- <head>
- <title>岗位表</title>
- <t:base type="jquery,easyui,tools,DatePicker"></t:base>
- <style type="text/css">
- .combo_self{height: 22px !important;width: 150px !important;}
- .layout-header .btn {
- margin:0;
- float: none !important;
- }
- .btn-default {
- height: 35px;
- line-height: 35px;
- font-size:14px;
- }
- .clearTd input{
- border-radius: 3px;
- display: inline-block;
- letter-spacing: 3px;
- line-height: 1;
- margin-left: 6px;
- overflow: visible;
- padding: 3px 10px 3px 12px;
- text-align: center;
- /* text-shadow: 0 1px 1px rgba(255, 255, 255, 1); */
- transition: box-shadow 0.2s linear 0s;
- cursor: pointer;
- }
- .clearBtn{
- background: #5187c9 none repeat scroll 0 0;
- border: 1px solid #437ABD;
- color: #fff;
- text-shadow: 0 -1px 1px #1c6a9e;
- height: 30px;
- }
- </style>
-
- <script type="text/javascript">
- $(function(){
- $(".combo").removeClass("combo").addClass("combo combo_self");
- $(".combo").each(function(){
- $(this).parent().css("line-height","0px");
- });
- });
-
- /**树形列表数据转换**/
- function convertTreeData(rows, textField) {
- for(var i = 0; i < rows.length; i++) {
- var row = rows[i];
- row.text = row[textField];
- if(row.children) {
- row.state = "open";
- convertTreeData(row.children, textField);
- }
- }
- }
- /**树形列表加入子元素**/
- function joinTreeChildren(arr1, arr2) {
- for(var i = 0; i < arr1.length; i++) {
- var row1 = arr1[i];
- for(var j = 0; j < arr2.length; j++) {
- if(row1.id == arr2[j].id) {
- var children = arr2[j].children;
- if(children) {
- row1.children = children;
- }
-
- }
- }
- }
- }
- </script>
- <script type="text/javascript">
- //编写自定义JS代码
- </script>
- </head>
- <body>
- <t:formvalid formid="formobj" dialog="true" usePlugin="password" beforeSubmit="checkPostName" layout="table" action="postController.do?doAdd" >
- <input id="id" name="id" type="hidden" value="${postPage.id }"/>
- <table style="width: 600px;" cellpadding="0" cellspacing="1" class="formtable">
- <!-- <tr>
- <td align="right">
- <label class="Validform_label">
- 岗位编码:
- </label>
- </td>
- <td class="value">
- <input id="postCode" name="postCode" type="text" style="width: 150px" class="inputxt" datatype="s6-18" ignore="checked" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">岗位编码</label>
- </td>
- </tr> -->
- <tr>
- <td align="right">
- <label class="Validform_label">
- 岗位名称:
- </label>
- </td>
- <td class="value">
- <input id="postName" name="postName" type="text" style="width: 150px" class="inputxt" onchange="checkPostName()" datatype="s1-18" ignore="checked" />
- <span class="Validform_checktip" id="vpostname"></span>
- <label class="Validform_label" style="display: none;">岗位名称</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">
- 上级岗位:
- </label>
- </td>
- <td class="value">
- <input id="parentPostid" name="parentPostid" type="text" style="width: 150px" class="inputxt easyui-combotree" ignore="ignore"
- data-options="panelHeight:'220',
- url: 'postController.do?datagrid&field=id,postName',
- loadFilter: function(data) {
- var rows = data.rows || data;
- var win = frameElement.api.opener;
- var listRows = win.getDataGrid().treegrid('getData');
- joinTreeChildren(rows, listRows);
- convertTreeData(rows, 'postName');
- return rows;
- },
- onSelect:function(node){
- $('#parentPostid').val(node.id);
- },
- onLoadSuccess: function() {
- var win = frameElement.api.opener;
- var currRow = win.getDataGrid().treegrid('getSelected');
- if(!'${postPage.id}') {
- //增加时,选择当前父菜单
- if(currRow) {
- $('#parentPostid').combotree('setValue', currRow.id);
- }
- }else {
- //编辑时,选择当前父菜单
- if(currRow) {
- $('#parentPostid').combotree('setValue', currRow.parentPostid);
- }
- }
- }"/>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">上级岗位</label>
- <span class="clearTd">
- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" onclick="clearParentPostid()">清空</a>
- </span>
- </td>
- </tr>
-
- <tr>
- <td align="right">
- <label class="Validform_label">
- 岗位津贴:
- </label>
- </td>
- <td class="value">
- <input id="money" name="money" type="text" style="width: 150px" class="inputxt" datatype="n" ignore="ignore" />
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">岗位津贴</label>
- </td>
- </tr>
- <tr>
- <td align="right">
- <label class="Validform_label">
- 岗位描述:
- </label>
- </td>
- <td class="value" >
- <textarea style="width:300px; height:100px;" class="inputxt" rows="6" id="postDesc" name="postDesc" maxlength="100" ignore="ignore" ></textarea>
- <span class="Validform_checktip"></span>
- <label class="Validform_label" style="display: none;">岗位描述</label>
- </td>
- </tr>
- </table>
- </t:formvalid>
- </body>
- <script src = "webpage/cn/com/lzt/post/post.js"></script>
- <script type="text/javascript">
- function clearParentPostid(){
- $(".combo-text").val("");
- $(".combo-value").val("");
- }
-
- function checkPostName(){
- var result =false;
- $.ajax({
- type : "post",
- url : "postController.do?checkPostName",
- data : {id:$("#id").val(),postName:$("#postName").val(),parentPostid:$(".combo-value").val()},
- dataType : "json",
- async : false,
- cache : false,
- success : function(json) {
- if(!json.flag){
- $("#vpostname").html("岗位名称重复");
- $("#vpostname").addClass("Validform_wrong");
- result = false;
- }else{
- result = true;
- }
- }
- });
- return result;
- }
-
- </script>
|