| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <%@ page language="java" contentType="text/html;charset=GBK" pageEncoding="GBK"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=GBK">
- <title>编辑出库部门</title>
- <script type=text/javascript src="./liger/lib/jquery/jquery-1.5.2.min.js"></script>
- <script type="text/javascript" src="/shares/js/constant.js"></script>
- <script type="text/javascript" src="/shares/js/common.js"></script>
- <link href="main.css" rel="stylesheet" type="text/css" ></link>
- <link href="${pageContext.request.contextPath}/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
- <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
- <script type="text/javascript">
- $(function (){
- $("input[type='text']:first").focus();
- });
- function checkForm(){
- var rs = $.validate({
- name : "dept_name",
- model : [ {
- type : "require",
- msg : "部门名称不能为空!"
- }, {
- type : "len",
- min : 1,
- max : 100,
- msg : "部门名称长度不能超过100个字!"
- } ]
- });
- rs = $.validate({
- name : "dept_num",
- model : [{
- type : "require",
- msg : "部门编号不能为空!"
- }]
- }) && rs;
- if (rs) {
- return true;
- }else{
- return false;
- }
- }
- function isCodeExists(){
- var code = $("#dept_num").val();
- var oldCode = "${requestScope.dept.dept_num}";
- $.ajax({
- type:"POST",
- url:"erpDeptAction.do?task=isCodeExixts",
- data : {"oldCode":oldCode,"code":code},
- timeout:10000,
- cache:false,
- dataType:"json",
- success:function(data){
- var success = data.success;
- if(success != undefined){
- if(success==0){
- $("#btnSave").attr({"disabled":"disabled"});
- $("#deptForm").submit();
- }else if(success==1){
- $.ligerDialog.warn("部门编号已存在!");
- }else{
- $.ligerDialog.error("判断部门编号是否存在失败!");
- }
-
- }else{
- showAjaxError(null, data.error);
- }
- },
- error:showAjaxError
- });
- }
- function refresh(obj){
- if(obj == "1"){
- refreshWindow();
- window.parent.loadTree();
- }
- }
- //表单提交
- function checkFormProType(){
- if(checkForm()){
- isCodeExists();
- }
- }
- </script>
- </head>
- <body onload="refresh(${msgEvent})">
- <%@ include file="/include/message.jsp"%>
- <form id="deptForm" action="erpDeptAction.do" method="post">
- <div id="title" class="form-button">
- <input id="btnSave" type="button" class="l-button" value="保存" onclick="checkFormProType();"/>
- </div>
- <div class="container-layout">
- <div class="forum-container">
-
- <center>
- <table class="l-table-edit line">
- <tr>
- <th colspan="2">
- <c:if test="${dept.universalid == '' or dept.universalid == null }">添加出库部门</c:if>
- <c:if test="${dept.universalid != null }">编辑出库部门</c:if>
- </th>
- </tr>
-
- <tr>
- <td class="l-table-edit-text">上级部门:</td>
- <td class="l-table-edit-td">
- ${parentDept.dept_name }
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">上级编号:</td>
- <td class="l-table-edit-td">
- ${parentDept.dept_num }
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">部门编号<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" id="dept_num" name="dept_num" value="${requestScope.dept.dept_num}">
- </td>
- </tr>
- <tr>
- <td class="l-table-edit-text">部门名称<FONT COLOR="red">*</FONT>:</td>
- <td class="l-table-edit-td">
- <input type="text" id="dept_name" name="dept_name" value="${requestScope.dept.dept_name }" style="width:250px">
- </td>
- </tr>
- <tr>
- <td colspan="2" style="text-align: center;">
-
- </td>
- </tr>
- </table>
- <input type="hidden" id="universalid" name="universalid" value="${requestScope.dept.universalid }">
- <input type="hidden" id="dept_pid" name="dept_pid" value="${requestScope.dept.dept_pid }">
- <input type="hidden" id="unit_id" name="unit_id" value="${requestScope.dept.unit_id }">
- <%--<input type="hidden" id="ptype_level" name="ptype_level" value="${requestScope.erpDept.level }"> --%>
- <input type="hidden" id="task" name="task" value="update">
- </center>
- </div>
- </div>
- </form>
- </body>
- </html>
|