wechatstoreedit.jsp 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <%@ page language="java" contentType="text/html;charset=GBK" import="java.util.*,java.net.*" pageEncoding="GBK"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  6. <title>列表</title>
  7. <script type="text/javascript">
  8. var pictype = "0";
  9. </script>
  10. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  12. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  13. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  14. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  15. <script src="/shares/js/yw/sales/ligerui.all.js" type="text/javascript"></script>
  16. <script type="text/javascript" src="/shares/js/constant.js"></script>
  17. <script type="text/javascript" src="/shares/js/common.js"></script>
  18. <script src="/shares/js/yw/sales/publicutils.js" type="text/javascript"></script>
  19. <style type="text/css">
  20. body {padding: 5px; margin: 0;}
  21. #layout1 {width:99%; margin:0; padding:0;}
  22. .l-button {margin-left: 1px;}
  23. .l-layout-left {overflow-y: auto;}
  24. </style>
  25. <script type="text/javascript">
  26. /**
  27. * 新增,修改
  28. */
  29. function onSubmitForm(){
  30. if(!functionisvaldate("areaid","区域",1,20)){
  31. return;
  32. }
  33. if(!functionisvaldate("storeid","门店编码",1,10)){
  34. return;
  35. }
  36. if(!functionisvaldate("storename","门店名称",1,20)){
  37. return;
  38. }
  39. var supervisor = $("#supervisor").val();
  40. if(supervisor == "" || supervisor == null || supervisor == undefined || "null" == supervisor){
  41. alert("主管不能为空");
  42. $("#supervisor").focus();
  43. return;
  44. }
  45. var checkText=$("#supervisor").find("option:selected").text();
  46. $("#supervisorname").attr("value",checkText);
  47. var locationx = $("#locationx").val();
  48. var locationy = $("#locationy").val();
  49. if(locationx == ""){
  50. alert("经度不能为空");
  51. $("#locationx").focus();
  52. return;
  53. }
  54. if(locationy == ""){
  55. alert("纬度不能为空");
  56. $("#locationy").focus();
  57. return;
  58. }
  59. if("" != locationx.replace(/^(-?\d*)\.?\d{1,10}$/,"")) {
  60. alert("经度只能输入数字,并且小数点后最多保留10位");
  61. $("#locationx").focus();
  62. return;
  63. }
  64. if(locationx < 0 || locationx > 180){
  65. alert("经度的取值范围在0-180 之间");
  66. $("#locationx").focus();
  67. return;
  68. }
  69. if("" != locationy.replace(/^(-?\d*)\.?\d{1,10}$/,"")) {
  70. alert("纬度只能输入数字,并且小数点后最多保留10位");
  71. $("#locationy").focus();
  72. return;
  73. }
  74. if(locationy < 0 || locationy > 90){
  75. alert("纬度的取值范围在0-90 之间");
  76. $("#locationy").focus();
  77. return;
  78. }
  79. var selectText = $("#supervisor").find('option:selected').text();
  80. $("#supervisorname").val(selectText);
  81. if(!functionisvaldate("address","地址",0,80)){
  82. return;
  83. }
  84. if(!functionisvaldate("areaid","区域",1,20)){
  85. return;
  86. }
  87. $("#form1").submit();
  88. }
  89. function getautogeneration(v){
  90. $.ajax({
  91. type: "post",
  92. url: "${pageContext.request.contextPath }/yw/sales/basicInformation/ajax.jsp",
  93. data: "",
  94. success: function (vv){
  95. $("#" + v +"").attr("value", vv);
  96. }
  97. });
  98. }
  99. function onOpenBDMap(){
  100. var params = "?locationx=" + $("#locationx").val() + "&locationy=" + $("#locationy").val();
  101. window.top.$.ligerDialog.open({title: "选择经纬度", height: 450,width:900, url: PROJECT_NAME +'/yw/sales/basicInformation/selectmap.jsp' + params, isResize: true,
  102. buttons: [
  103. { text: '确定', onclick: function (item, dialog) {
  104. var txtPointX = dialog.frame.$("#txtPointX").html();
  105. var txtPointY = dialog.frame.$("#txtPointY").html();
  106. if(txtPointX == ""){
  107. alert("请在地图上选择坐标");
  108. return;
  109. }
  110. $("#locationx").attr("value",txtPointX);
  111. $("#locationy").attr("value",txtPointY);
  112. dialog.close();
  113. }
  114. },
  115. { text: '取消', onclick: function (item, dialog) {dialog.close(); }}]
  116. });
  117. }
  118. </script>
  119. </head>
  120. <body>
  121. <form id="form1" name="form1" action="BasicInformationAction.do" method="post">
  122. <div id="title" class="form-button">
  123. <input type="button" value="关闭" class="l-button" onclick="closeWindow();"/>
  124. <input id="btnSave" type="button" class="l-button" value="保存" onclick="onSubmitForm()"/>
  125. </div>
  126. <div class="container-layout">
  127. <div class="forum-container">
  128. <table class="l-table-edit line">
  129. <tr><th colspan="2"><%="create".equals(request.getParameter("task")) ? "新增微信门店":"修改微信门店" %></th></tr>
  130. <tr>
  131. <td class="l-table-edit-text" width="10%">区域<font color="red">*</font>:</td>
  132. <td class="l-table-edit-td">
  133. <input type="text" id="areaname" name="areaname" style="width: 310px;" />
  134. <input type="hidden" id="areaid" name="areaid" style="width: 200px;" />
  135. <script type="text/javascript">
  136. $("#areaname").ligerComboBox({
  137. selectBoxWidth: 320,
  138. selectBoxHeight: 280,
  139. valueField: "id", // 选中值的id
  140. valueFieldID : "areaid", // 把选中的值放到隐藏框里面
  141. treeLeafOnly: true, <%--是否只选择叶子 tree 是 false 不是 --%>
  142. tree: {
  143. url: "${pageContext.request.contextPath}/UtilsAction.do?task=tree&treetype=areatree&select=ALL&time=" + new Date().getTime(),
  144. checkbox: false,
  145. textFieldName:"text",
  146. idFieldName:"id",
  147. parentIDFieldName:"pid"
  148. }
  149. });
  150. </script>
  151. <style>
  152. .l-box-select-inner{
  153. background-color:#eeeeee;
  154. border :1px solid Silver;
  155. }
  156. .l-text {
  157. position:relative;
  158. height:28px;
  159. line-height:28px;
  160. width:320px;
  161. text-shadow: 0 1px 1px rgba(255,255,255,0.75);
  162. </style>
  163. </td>
  164. </tr>
  165. <tr>
  166. <td class="l-table-edit-text" width="10%">门店编码<font color="red">*</font>:</td>
  167. <td class="l-table-edit-td">
  168. <input type="text" id="storeid" name="storeid" value="${result.storeid }" style="width: 200px"/>
  169. </td>
  170. </tr>
  171. <tr>
  172. <td class="l-table-edit-text" width="10%">门店名称<font color="red">*</font>:</td>
  173. <td class="l-table-edit-td">
  174. <input type="text" id="storename" name="storename" value="${result.storename }" style="width: 200px"/>
  175. </td>
  176. </tr>
  177. <tr>
  178. <td class="l-table-edit-text" width="10%">主管<font color="red">*</font>:</td>
  179. <td class="l-table-edit-td">
  180. <select name="supervisor" id="supervisor" style="width: 208px"></select>
  181. <script type="text/javascript">
  182. getselect("user", "supervisor", "<%=request.getParameter("menu_code") %>","${result.supervisor }");
  183. </script>
  184. </td>
  185. </tr>
  186. <tr>
  187. <td class="l-table-edit-text" width="10%">地址<font color="red"></font>:</td>
  188. <td class="l-table-edit-td">
  189. <input type="text" id="address" name="address" value="${result.address }" style="width: 200px"/>
  190. </td>
  191. </tr>
  192. <tr>
  193. <td class="l-table-edit-text" width="10%">经度<font color="red">*</font>:</td>
  194. <td class="l-table-edit-td">
  195. <input type="text" id="locationx" name="locationx" value="${result.locationx }" style="width: 200px"/>
  196. &nbsp;&nbsp;&nbsp;<input id="btnSave" type="button" class="l-button" value="地图选择" onclick="onOpenBDMap()"/>
  197. </td>
  198. </tr>
  199. <tr>
  200. <td class="l-table-edit-text" width="10%">纬度<font color="red">*</font>:</td>
  201. <td class="l-table-edit-td">
  202. <input type="text" id="locationy" name="locationy" value="${result.locationy }" style="width: 200px"/>
  203. </td>
  204. </tr>
  205. </table>
  206. </div>
  207. <input type="hidden" id="columnname" name="columnname" value="storeid,storename,supervisor,supervisorname,locationx,locationy,address,areaid,areaname">
  208. <input type="hidden" id="supervisorname" name="supervisorname" value="">
  209. <input type="hidden" id="columisvaldate" name="columisvaldate" value="storeid,storename,supervisor,areaid"> <%-- 验证次字段不能为空 只能验证一个 --%>
  210. <input type="hidden" id="columnvalue" name="columnvalue" value="已有相同的门店"><%-- 验证此字段不能为空,弹出框的值 --%>
  211. <input type="hidden" id="title" name="title" value="微信门店信息">
  212. <input type="hidden" id="tabid" name="tabid" value="<%=request.getParameter("tabid").replace("amp;","&") %>">
  213. <input type="hidden" id="task" name="task" value="<%="create".equals(request.getParameter("task")) ? request.getParameter("task"):"edit" %>">
  214. <input type="hidden" id="select_type_id" name="select_type_id" value="${result.id }">
  215. <input type="hidden" id="menu_code" name="menu_code" value="<%=request.getParameter("menu_code") %>">
  216. <input type="hidden" id="supervisorname" name="supervisorname" value="">
  217. </div>
  218. </form>
  219. </body>
  220. <script type="text/javascript">
  221. var tt = setTimeout("setareaid()",200);
  222. function setareaid(){
  223.  $("#areaid").attr("value","${result.areaid }");
  224. $("#areaname").attr("value","${result.areaname }");
  225. clearTimeout(tt);
  226. }
  227. $("#supervisor").attr("value","${result.supervisor }");
  228. </script>
  229. </html>