cmSpForm.jsp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <%--
  2. Created by IntelliJ IDEA.
  3. User: Administrator
  4. Date: 2020/4/12
  5. Time: 12:05
  6. To change this template use File | Settings | File Templates.
  7. --%>
  8. <%@ page contentType="text/html;charset=UTF-8" %>
  9. <%@ include file="/WEB-INF/views/include/taglib.jsp"%>
  10. <html>
  11. <head>
  12. <title>协销人员管理</title>
  13. <meta name="decorator" content="default"/>
  14. <script type="text/javascript">
  15. $(document).ready(function() {
  16. //$("#name").focus();
  17. $("#inputForm").validate({
  18. submitHandler: function(form){
  19. loading('正在提交,请稍等...');
  20. form.submit();
  21. },
  22. errorContainer: "#messageBox",
  23. errorPlacement: function(error, element) {
  24. $("#messageBox").text("输入有误,请先更正。");
  25. if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
  26. error.appendTo(element.parent().parent());
  27. } else {
  28. error.insertAfter(element);
  29. }
  30. }
  31. });
  32. });
  33. function formSubmit() {
  34. $.ajax({
  35. //几个参数需要注意一下
  36. type: "POST",//方法类型
  37. dataType: "json",//预期服务器返回的数据类型
  38. url: "${ctx}/new/user/cmSp/cmSpCreate" ,//url
  39. data: $('#inputForm').serialize(),
  40. success: function (result) {
  41. console.log(result);//打印服务端返回的数据(调试用)
  42. if (result.success) {
  43. window.location.href="${ctx}/new/user/cmSp/cmSpList";
  44. } else {
  45. alert(result.msg);
  46. }
  47. },
  48. error : function() {
  49. alert("服务异常!");
  50. }
  51. });
  52. }
  53. </script>
  54. </head>
  55. <body>
  56. <ul class="nav nav-tabs">
  57. <li><a href="${ctx}/new/user/cmSp/cmSpList/">协销人员列表</a></li>
  58. <li class="active"><a href="${ctx}/new/user/cmSp/cmSpForm?id=${cmSp.id}"><shiro:hasPermission name="user:newCmClub:edit">${not empty cmSp.id?'编辑':'添加'}</shiro:hasPermission><shiro:lacksPermission name="user:newCmClub:edit">查看</shiro:lacksPermission>协销人员</a></li>
  59. <li><a href="${ctx}/serviceteam/cmServiceteamRole/">协销小组</a></li>
  60. <li><a href="${ctx}/new/user/cmSp/leader/">协销总管理员</a></li>
  61. </ul><br/>
  62. <form id="inputForm" onsubmit="return false" action="##" method="post" class="form-horizontal">
  63. <div class="control-group">
  64. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>协销名称</label>
  65. <div class="controls">
  66. <input name="linkMan" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
  67. </div>
  68. </div>
  69. <div class="control-group">
  70. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>手机号</label>
  71. <div class="controls">
  72. <input name="mobile" type="number" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
  73. </div>
  74. </div>
  75. <div class="control-group">
  76. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>登录密码</label>
  77. <div class="controls">
  78. <input name="password" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
  79. </div>
  80. </div>
  81. <div class="control-group">
  82. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>确认密码</label>
  83. <div class="controls">
  84. <input name="passWordConfirm" type="text" htmlEscape="false" maxlength="11" class="input-xlarge required"/>
  85. </div>
  86. </div>
  87. <div class="control-group">
  88. <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>职位</label>
  89. <div class="controls">
  90. <%--<input name="duty" htmlEscape="false" maxlength="11" class="input-xlarge required"/>--%>
  91. <select name="duty">
  92.         <option value="0">协销员工</option>
  93. <c:if test="${hasManager}==0">
  94. <option value="1">协销经理</option>
  95. </c:if>
  96.  </select>
  97. </div>
  98. </div>
  99. <div class="form-actions">
  100. <shiro:hasPermission name="user:newCmClub:edit">
  101. <input id="btnSubmit" class="btn btn-primary" type="button" onclick="formSubmit()" value="保 存"/>
  102. </shiro:hasPermission>
  103. <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
  104. </div>
  105. </form>
  106. </body>
  107. </html>