buy_intention.jsp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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() + path+"/";
  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="<%=basePath %>app/lib/flexible.js"></script>
  23. <script type="text/javascript" src="<%=basePath %>res/js/jquery.min.js"></script>
  24. <script type="text/javascript" src="<%=basePath %>res/js/layer/layer.min.js"></script>
  25. <link rel="stylesheet" href="<%=basePath %>app/lib/flexible.css">
  26. <link rel="stylesheet" href="<%=basePath %>app/css/basem.css">
  27. <link rel="stylesheet" href="<%=basePath %>app/css/logome.css">
  28. </head>
  29. <body>
  30. <div class="titbox blubg">
  31. <a class="titreturn left" href="javascript:void(0)" onclick="back()"><img src="<%=basePath %>app/img/fanhui16@2x.png" alt=""></a>
  32. <script type="text/javascript">
  33. function back(){
  34. window.history.go(-1);
  35. }
  36. </script>
  37. <h1>意向购买</h1>
  38. </div>
  39. <div class="whbg top50">
  40. <div class="safe">
  41. <input id="productId" value="${productId }" type="hidden"/>
  42. <ul>
  43. <li class="merecli">
  44. <p class="meaddle left">客户姓名:</p>
  45. <input class="meaddinpu left" id="customerName" value="${user.name }" type="text" placeholder="(必填)请输入客户姓名">
  46. </li>
  47. <li class="merecli">
  48. <p class="meaddle left">联系电话:</p>
  49. <input class="meaddinpu left blutxt" id="customerPhone" value="${user.phone }" type="text" placeholder="(必填)请输入客户联系电话">
  50. </li>
  51. <li class="merecli">
  52. <p class="meaddle left">工号:</p>
  53. <input class="meaddinpu left" type="text" id="jobNumber" readonly="readonly" value="${user.personnelcode }" placeholder="请输入您的工号">
  54. </li>
  55. <li class="merecli meaddlila">
  56. <p class="meaddle left">备注:</p>
  57. <textarea class="meaddinpu left" name="productIntent" id="productIntent" placeholder="请输入您的意向产品类型/价格/数量等"></textarea>
  58. </li>
  59. </ul>
  60. </div>
  61. </div>
  62. <a class="redbtn" id="tjia" href="javascript:void(0)" onclick="add()">完成</a>
  63. <script type="text/javascript">
  64. var tjia = 0;
  65. function add(){
  66. if($("#productId").val() == ""){
  67. layer.msg("未获取到产品信息");
  68. return false;
  69. }
  70. if($("#customerPhone").val() == ""){
  71. layer.msg("请输入客户手机号");
  72. return false;
  73. }
  74. if($("#customerName").val() == ""){
  75. layer.msg("请输入客户名称");
  76. return false;
  77. }
  78. /* if($("#jobNumber").val() == ""){
  79. layer.msg("请输入您的工号");
  80. return false;
  81. } */
  82. if($("#productIntent").val() == ""){
  83. layer.msg("请输入客户的产品意向");
  84. return false;
  85. }
  86. if(tjia == 1){
  87. return false;
  88. }
  89. tjia = 1;
  90. $.ajax({
  91. type: "POST",
  92. url: "<%=basePath%>web/mgmProduct/bnadd.cs",
  93. data: {
  94. productId:$("#productId").val(),
  95. customerPhone:$("#customerPhone").val(),
  96. jobNumber:$("#jobNumber").val(),
  97. productIntent:$("#productIntent").val(),
  98. customerName:$("#customerName").val()
  99. },
  100. dataType: "json",
  101. success: function(data){
  102. if(data.ret == 0){
  103. layer.msg(data.msg);
  104. tjia = 0;
  105. }else if(data.ret == 1){
  106. layer.msg("保存成功");
  107. window.history.go(-1);
  108. }
  109. }
  110. });
  111. }
  112. </script>
  113. </body>
  114. </html>