me_people_add.jsp 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
  5. <%
  6. String path = request.getContextPath();
  7. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort() + path2+"/";
  8. request.setAttribute("contextPath", basePath);
  9. String redirectUrl= request.getParameter("redirectUrl");
  10. request.setAttribute("redirectUrl", redirectUrl);
  11. %>
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. <head>
  15. <base href="<%=basePath%>">
  16. <meta charset="UTF-8">
  17. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  18. <meta name="apple-mobile-web-app-capable" content="yes">
  19. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  20. <meta name="format-detection" content="telephone=no">
  21. <title>添加客户</title>
  22. <script src="${contextPath }res/js/jquery.min.js" type="text/javascript"></script>
  23. <script type="text/javascript" src="${contextPath }res/js/layer/layer.min.js"></script>
  24. <script src="${contextPath }app/lib/flexible.js"></script>
  25. <link rel="stylesheet" href="${contextPath }app/lib/flexible.css">
  26. <link rel="stylesheet" href="${contextPath }app/css/basem.css">
  27. <link rel="stylesheet" href="${contextPath }app/css/logome.css">
  28. <link rel="stylesheet" href="<%=basePath %>app/css/index.css">
  29. <script type="text/javascript">
  30. <%-- $(function(){
  31. $('#button').click(function(){
  32. var name=$("input[name='name']").val();
  33. var phone=$("input[name='phone']").val();
  34. var company=$("input[name='company']").val();
  35. var attributionArea=$("input[name='attributionArea']").val();
  36. var address=$("#address").val();
  37. if(name=="" && phone=="" && company=="" && attributionArea==""&&address==""){
  38. window.location.href = '${contextPath }web/mgmUserCtl/index.cs';
  39. }else{
  40. var pram='{"name":"'+name+'","phone":"'+phone+'","company":"'+company+'","attributionArea":"'+attributionArea+'","address":"'+address+'"}';
  41. $.post('${contextPath}web/mgmProduct/addCustomer.cs', {
  42. "data" : pram
  43. }, function(data) {
  44. var datas=eval(data.data);
  45. if (data.ret == 1) {
  46. /* window.history.go(-1); */
  47. window.location.href="<%=basePath%>web/mgmProduct/recommend.cs?productids=${pids}" ;
  48. }else{
  49. layer.msg(data.msg);
  50. }
  51. }, "json");
  52. }
  53. });
  54. }) --%>
  55. </script>
  56. </head>
  57. <body>
  58. <div id="tj_client">
  59. <div class="titbox blubg">
  60. <a class="titreturn left" href="javascript:void(0)" onclick="back()"><img src="${contextPath }app/img/fanhui16@2x.png" alt=""></a>
  61. <h1>添加客户</h1>
  62. <script type="text/javascript">
  63. function back(){
  64. window.history.go(-1);
  65. }
  66. </script>
  67. </div>
  68. <form action="#" name="loginForm" id="loginForm" method="post">
  69. <div class="whbg top50">
  70. <div class="safe">
  71. <ul>
  72. <li class="merecli">
  73. <p class="meaddle left">客户姓名:</p>
  74. <input class="meaddinpu left" type="text" name="name" placeholder="请输入客户姓名">
  75. </li>
  76. <li class="merecli">
  77. <p class="meaddle left">联系电话:</p>
  78. <input class="meaddinpu left blutxt" type="text" name="phone" placeholder="请输入客户联系电话">
  79. </li>
  80. <li class="merecli">
  81. <p class="meaddle left">工作单位:</p>
  82. <input class="meaddinpu left" type="text" name="company" placeholder="请输入客户工作单位">
  83. </li>
  84. <li class="merecli">
  85. <p class="meaddle left">所在区域:</p>
  86. <input id="pcarea" name="attributionArea" class="meaddinpu left" readonly="readonly" type="text" placeholder="请选择客户所在区域">
  87. <input id="province" name="province" class="meaddinpu left" type="hidden">
  88. <input id="city" name="city" class="meaddinpu left" type="hidden">
  89. <input id="area" name="area" class="meaddinpu left" type="hidden">
  90. </li>
  91. <li class="merecli meaddlila">
  92. <p class="meaddle left">详细地址:</p>
  93. <textarea class="meaddinpu left" name="address" id="address" placeholder="请输入客户详细地址"></textarea>
  94. </li>
  95. <li class="merecli meaddlila">
  96. <p class="meaddle left">客户备注:</p>
  97. <textarea class="meaddinpu left" name="remarks" id="remarks" placeholder="请输入客户备注"></textarea>
  98. </li>
  99. </ul>
  100. </div>
  101. </div>
  102. <a class="redbtn" href="javascript:void(0);" id="button">完成</a>
  103. </form>
  104. </div>
  105. <!-- 城市弹窗 -->
  106. <div class="cityMask hide">
  107. <div class="titbox blubg">
  108. <a class="titreturn left" href="javascript:void(0)" onclick="backper()"><img src="<%=basePath %>app/img/fanhui16@2x.png" alt=""></a>
  109. <h1>选择城市</h1>
  110. </div>
  111. <div class="top50">
  112. <ul class="cityul">
  113. <li>
  114. <a href="#">
  115. 北京
  116. <img src="<%=basePath %>app/img/fanh3@2x.png" alt="">
  117. </a>
  118. </li>
  119. </ul>
  120. </div>
  121. </div>
  122. </body>
  123. <script type="text/javascript" src="<%=basePath %>app/js/public.js"></script>
  124. <script type="text/javascript">
  125. $(function(){
  126. $('#button').click(function(){
  127. var recommendId="${USER_ID}";
  128. var name=$("input[name='name']").val();
  129. var phone=$("input[name='phone']").val();
  130. var company=$("input[name='company']").val();
  131. var attributionArea=$("input[name='attributionArea']").val();
  132. var address=$("#address").val();
  133. var province=$("input[name='province']").val();
  134. var city=$("input[name='city']").val();
  135. var area=$("input[name='area']").val();
  136. var remarks=$("textarea[name='remarks']").val();
  137. if(name=="" && phone=="" && company=="" && attributionArea==""&&address==""){
  138. layer.msg("请完善客户信息");
  139. }else{
  140. var pram='{"recommendId":"'+recommendId+'","name":"'+name+'","phone":"'+phone+'","company":"'+company+'","attributionArea":"'+attributionArea+'","address":"'+address+'","province":"'+province+'","city":"'+city+'","area":"'+area+'","remarks":"'+remarks+'"}';
  141. $.post('${contextPath}web/mgmCustomerWebCtl/addCustomer.cs', {
  142. "data" : pram
  143. }, function(data) {
  144. var datas=eval(data.data);
  145. if (data.ret == 1) {
  146. layer.msg('添加成功!', {
  147. time: 20000,
  148. btn: ['确定'] //按钮
  149. }, function(){
  150. window.location.href="<%=basePath%>web/mgmProduct/recommend.cs?productids=${pids}" ;
  151. });
  152. }else{
  153. layer.msg(data.msg);
  154. }
  155. }, "json");
  156. }
  157. });
  158. })
  159. $("#pcarea").click(function(){
  160. $(".cityul").html('');
  161. $.get('<%=basePath%>area/getProvice.cs',function(data){
  162. var html = "";
  163. for(var i in data){
  164. html += "<li onclick='proclick(\""+data[i].code+"\",\""+data[i].name+"\")'>";
  165. html += "<a href='javascript:void(0)'>";
  166. html += data[i].name;
  167. html += " <img src='<%=basePath %>app/img/fanh3@2x.png' alt=''>";
  168. html += "</a>";
  169. html += "</li>";
  170. }
  171. $(".cityul").html(html);
  172. });
  173. $("#tj_client").hide();
  174. $(".cityMask").show();
  175. })
  176. function proclick(code, name){
  177. var html = "";
  178. $.get('<%=basePath%>area/getByParentCode.cs',{'param': code}, function(data){
  179. for(var i in data){
  180. html += "<li onclick='cityclick(\""+data[i].code+"\",\""+data[i].name+"\")'>";
  181. html += "<a href='javascript:void(0)'>";
  182. html += data[i].name;
  183. html += " <img src='<%=basePath %>app/img/fanh3@2x.png' alt=''>";
  184. html += "</a>";
  185. html += "</li>";
  186. }
  187. $(".cityul").html(html);
  188. });
  189. $('#province').val(name);
  190. }
  191. function cityclick(code, name){
  192. var html = "";
  193. $.get('<%=basePath%>area/getByParentCode.cs',{'param': code}, function(data){
  194. for(var i in data){
  195. html += "<li onclick='countyclick(\""+data[i].code+"\",\""+data[i].name+"\")'>";
  196. html += "<a href='javascript:void(0)'>";
  197. html += data[i].name;
  198. html += " <img src='<%=basePath %>app/img/fanh3@2x.png' alt=''>";
  199. html += "</a>";
  200. html += "</li>";
  201. }
  202. $(".cityul").html(html);
  203. });
  204. $('#city').val(name);
  205. }
  206. function countyclick(code, name){
  207. $("#tj_client").show();
  208. $(".cityMask").hide();
  209. $('#area').val(name);
  210. $('#pcarea').val($('#province').val()+" " + $('#city').val()+" " + $('#area').val());
  211. replace(categoryid, num, type, twotype, '2', '1');
  212. }
  213. function backper(){
  214. $("#tj_client").show();
  215. $(".cityMask").hide();
  216. }
  217. </script>
  218. </html>