123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <%--
- time:2015-07-14 09:13:58
- desc:edit the OA_LINKMAN
- --%>
- <%@page language="java" pageEncoding="UTF-8"%>
- <%@include file="/commons/include/html_doctype.html"%>
- <html>
- <head>
- <title>编辑联系人</title>
- <%@include file="/commons/include/form.jsp" %>
- <script type="text/javascript" src="${ctx}/js/hotent/CustomValid.js"></script>
- <script type="text/javascript" src="${ctx}/js/hotent/platform/system/SysDialog.js"></script>
- <script type="text/javascript" src="${ctx}/js/hotent/platform/system/FlexUploadDialog.js"></script>
- <script type="text/javascript" src="${ctx}/js/hotent/platform/system/HtmlUploadDialog.js" ></script>
- <script type="text/javascript">
- $(function() {
- $("a.save").click(function() {
- $("#oaLinkmanForm").attr("action","save.ht");
- $("#saveData").val(1);
- submitForm();
- });
- });
- //提交表单
- function submitForm(){
- var options={};
- if(showResponse){
- options.success=showResponse;
- }
- var frm=$('#oaLinkmanForm').form();
- frm.ajaxForm(options);
- if(frm.valid()){
- frm.submit();
- }
- }
-
- function showResponse(responseText) {
- var obj = new com.hotent.form.ResultMessage(responseText);
- if (obj.isSuccess()) {
- $.ligerDialog.confirm(obj.getMessage()+",是否继续操作","提示信息", function(rtn) {
- if(rtn){
- window.location.href = window.location.href;
- }else{
- window.location.href = "${ctx}/platform/oa/oaLinkman/list.ht";
- }
- });
- } else {
- $.ligerDialog.err("提示信息","联系人保存失败!",obj.getMessage());
- }
- }
- //点击按钮,动态添加文件上传控件
- function produceInputElement(){
- //定义一个变量,表示当前input文本框的id值的前缀
- var id_prefix = "phone_";
- //获取隐藏标签,从隐藏标签中获取id,达到动态获取id的目的
- var hidden_input = document.getElementById("hidden_input");
- //定义一个变量,表示当前input文本框的id值的后缀
- var id_suffix = hidden_input.value;
- //当前input文本框的id值
- var id_current = id_prefix + id_suffix;
- if(id_suffix == 2){
- $.ligerDialog.warn("移动电话号码只允许添加两组!","提示信息");
- }else{
- //生成新标签
- $('<tr><th></th><td><input type="text" id="' + id_current + '" name="' + id_current + '" validate="{phone:true}" style="width:240px !important" class="inputText"/></td></tr>').appendTo($("#file_input_1"));
- //为新添加的按钮,设置CSS样式
- var current_input = document.getElementById(id_current);
- //定义一个变量,用来表示需要保存到隐藏标签中的值
- var new_input = new String(parseInt(hidden_input.value) + 1);
- //更新隐藏标签的值
- hidden_input.value = new_input;
- }
- }
- </script>
- </head>
- <body>
- <div class="panel">
- <div class="panel-top">
- <div class="tbar-title">
- <c:choose>
- <c:when test="${oaLinkman.id !=null}">
- <span class="tbar-label"><span></span>编辑联系人</span>
- </c:when>
- <c:otherwise>
- <span class="tbar-label"><span></span>添加联系人</span>
- </c:otherwise>
- </c:choose>
- </div>
- <div class="panel-toolbar">
- <div class="toolBar">
- <div class="group"><a class="link save" id="dataFormSave" href="#"><span></span>保存</a></div>
- <div class="l-bar-separator"></div>
- <div class="group"><a class="link back" href="list.ht"><span></span>返回</a></div>
- </div>
- </div>
- </div>
- <div class="panel-body">
- <form id="oaLinkmanForm" method="post" action="save.ht">
- <div id="tabMyInfo" class="panel-nav" style="overflow:hidden; position:relative;">
- <div title="基本信息" tabid="linkmandetail" icon="${ctx}/styles/default/images/resicon/user.gif">
- <table class="table-detail" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <th width="18%">姓名: <span class="required red">*</span></th>
- <td ><input type="text" id="name" name="name" value="${oaLinkman.name}" validate="{required:true,maxlength:50}" style="width:240px !important" class="inputText"/></td>
- <th>性别: <span class="required red">*</span></th>
- <td >
- <select name="sex" class="select" style="width:265px !important">
- <option value="男" <c:if test="${oaLinkman.sex=='男'}">selected</c:if> >男</option>
- <option value="女" <c:if test="${oaLinkman.sex=='女'}">selected</c:if> >女</option>
- </select>
- </td>
- </tr>
-
- <tr>
- <th>办公电话: </th>
- <td ><input type="text" id="officephone" name="officephone" value="${oaLinkman.officephone}" validate="{officephone:true}" style="width:240px !important" class="inputText"/></td>
- <th>移动电话:</th>
- <td >
- <input type="text" id="phone" name="phone" value="${oaLinkman.phone}" validate="{phone:true}" style="width:240px !important" class="inputText"/>
- <c:if test="${oaLinkman.phone_1 == null}">
- <a style="text-decoration: none;background: #5aa5ea; padding: 5px 8px;border-radius: 5px;border: 1px solid #056aa2;
- color: #fff;cursor: pointer;" href="#" onclick="produceInputElement()">+增加</a>
- </c:if>
- <c:if test="${oaLinkman.phone_1 != null}">
- <tr>
- <th></th>
- <td >
- <input type="text" id="phone_1" name="phone_1" value="${oaLinkman.phone_1}" validate="{phone:true}" style="width:240px !important" class="inputText"/>
- </td>
- </tr>
- </c:if>
- <!-- 隐藏标签,用来保存新生成的input 文件上传控件的 id 值的后缀 初始值为1 -->
- <input type="hidden" id="hidden_input" value="1">
- <div id="container">
- <tbody id="file_input_1">
- </tbody>
- </div>
- </td>
- <th>邮箱地址: </th>
- <td ><input type="text" id="email" name="email" value="${oaLinkman.email}" validate="{email:true}" style="width:240px !important" class="inputText"/></td>
- <th>部门: </th>
- <td ><input type="text" id="company" name="company" value="${oaLinkman.company}" style="width:240px !important" class="inputText"/></td>
- </tr>
- <tr>
- <th>工作: </th>
- <td ><input type="text" id="job" name="job" value="${oaLinkman.job}" style="width:240px !important" class="inputText"/></td>
- <th>地址: </th>
- <td ><input type="text" id="address" name="address" value="${oaLinkman.address}" style="width:240px !important" class="inputText"/></td>
- </tr>
- <tr>
- <th>创建时间: </th>
- <td>
- <input type="text" id="createtime" style="width:240px !important" name="createtime" value="<fmt:formatDate value='${oaLinkman.createtime}' pattern='yyyy-MM-dd'/>" class="inputText date" validate="{date:true}" />
- </td>
- <th>当前状态: </th>
- <td>
- <select name="status" class="select" style="width:265px !important" >
- <option value="1" <c:if test="${oaLinkman.status==1}">selected</c:if> >启用</option>
- <option value="0" <c:if test="${oaLinkman.status==0}">selected</c:if> >禁用</option>
- </select>
- </td>
- </tr>
- </table>
-
- </div>
- <input type="hidden" name="id" value="${oaLinkman.id}" />
- <input type="hidden" name="saveData" id="saveData" />
- <input type="hidden" name="executeType" value="start" />
- </form>
-
- </div>
- </div>
- </body>
- </html>
|