view.jsp 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!doctype html>
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <%@ include file="../../common/head.jsp"%>
  8. <link rel="stylesheet" type="text/css" href="../res/js//plugins/webuploader/webuploader.css">
  9. <link rel="stylesheet" type="text/css" href="../res/css/demo/webuploader-demo.css">
  10. <script type="text/javascript" src="../res/js/plugins/webuploader/webuploader.js"></script>
  11. <script type="text/javascript" src="../res/js/plugins/webuploader/uploader.js"></script>
  12. <script type="text/javascript" charset="utf-8" src="<%=basePath %>res/js/plugins/UEditor/ueditor.config.js"></script>
  13. <script type="text/javascript" charset="utf-8" src="<%=basePath %>res/js/plugins/UEditor/ueditor.all.min.js"> </script>
  14. <cs:initFile/>
  15. <script type="text/javascript">
  16. $(function () {
  17. $("#airportDiv").hide();
  18. $("#airwaysDiv").hide();
  19. });
  20. function dotype(type){
  21. if(type == 0){
  22. $("#airportDiv").hide();
  23. $("#airwaysDiv").hide();
  24. }else if(type == 1){
  25. $("#airportDiv").show();
  26. $("#airwaysDiv").hide();
  27. }else if(type ==2){
  28. $("#airportDiv").show();
  29. $("#airwaysDiv").show();
  30. }
  31. }
  32. function doItem(id) {
  33. $('#airwaysId').empty();
  34. $('#airwaysId').html('<option value="">--无--</option>');
  35. $.getJSON('../machine/getAirways.cs', {
  36. 'airportId': $('#airportId').val()
  37. }, function (data) {
  38. $.each(data, function (i, obj) {
  39. $("#airwaysId").append('<option value="' + obj.id+'">' + obj.name + '</option>');
  40. });
  41. });
  42. }
  43. </script>
  44. <script>
  45. function initUe(){
  46. var productImg = $("input[name='productImg']");
  47. var productGroupImg = $("#input[name='productGroupImg']");
  48. if(productImg.length > 2){
  49. layer.msg("主图只能有1个");
  50. return false;
  51. }
  52. if(productGroupImg.length > 6){
  53. layer.msg("组图最多5个");
  54. return false;
  55. }
  56. $("#newsContent").val(ue.getContent());
  57. $("#addUserForm").submit();
  58. return true;
  59. }
  60. </script>
  61. </head>
  62. <body>
  63. <div class="wrapper wrapper-content">
  64. <div class="row">
  65. <div class="col-sm-12">
  66. <cs:form_validate formId="addUserForm"/><!-- action="edit.cs" -->
  67. <form class="form-horizontal" id="addUserForm" method="POST" onsubmit="return false;">
  68. <input name="id" id="id" type="hidden" value="${mgmProduct.id }"/>
  69. <div class="form-group">
  70. <label class="col-sm-3 control-label">产品名称:</label>
  71. <div class="col-sm-6">
  72. <input id="productName" name="productName" value="${mgmProduct.productName }" readonly="readonly" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}" >
  73. </div>
  74. </div>
  75. <div class="form-group">
  76. <label class="col-sm-3 control-label">产品型号:</label>
  77. <div class="col-sm-6">
  78. <input id="productModel" name="productModel" value="${mgmProduct.productModel }" readonly="readonly" class="form-control" validate="{required:true}" validateMessage="{required:'请输入型号'}" >
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <label class="col-sm-3 control-label">产品标示:</label>
  83. <div class="col-sm-6">
  84. <input id="productRemark" name="productRemark" value="${mgmProduct.productRemark }" readonly="readonly" class="form-control" >
  85. </div>
  86. </div>
  87. <div class="form-group">
  88. <label class="col-sm-3 control-label">佣金比例:</label>
  89. <div class="col-sm-6">
  90. <input id="commissionRate" name="commissionRate" value="${mgmProduct.commissionRate }" readonly="readonly" class="form-control" validate="{required:true}" validateMessage="{required:'请输入佣金比例'}" >
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label class="col-sm-3 control-label">联系电话:</label>
  95. <div class="col-sm-6">
  96. <input id="hotline" name="hotline" class="form-control" value="${mgmProduct.hotline }" readonly="readonly" validate="{required:true}" validateMessage="{required:'请输入联系电话'}" >
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <label class="col-sm-3 control-label">产品价格:</label>
  101. <div class="col-sm-6">
  102. <input id="productPrice" name="productPrice" value="${mgmProduct.productPrice }" readonly="readonly" class="form-control" validate="{required:true}" validateMessage="{required:'请输入产品价格'}" >
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <label class="col-sm-3 control-label">单位:</label>
  107. <div class="col-sm-6">
  108. <input id="unit" name="unit" value="${mgmProduct.unit }" class="form-control" readonly="readonly" validate="{required:true}" validateMessage="{required:'请输入单位'}" >
  109. </div>
  110. </div>
  111. <div class="form-group">
  112. <label class="col-sm-3 control-label">权重:</label>
  113. <div class="col-sm-6">
  114. <input id="weight" name="weight" value="${mgmProduct.weight }" class="form-control" readonly="readonly" validate="{required:true,min:0}" validateMessage="{required:'请输入权重,内容为数字'}" >
  115. </div>
  116. </div>
  117. <div class="form-group col-sm-12">
  118. <div class="form-group col-sm-6">
  119. <label class="col-sm-4 control-label">是否推荐:</label>
  120. <div class="col-sm-8">
  121. <div class="radio i-checks">
  122. <label><input type="radio" name ="isHome" value="1" readonly="readonly" <c:if test="${mgmProduct.isHome == '1' }">checked="checked"</c:if>> <i></i> 是</label>
  123. <label><input type="radio" name="isHome" value="0" readonly="readonly" <c:if test="${mgmProduct.isHome == '0' }">checked="checked"</c:if>> <i></i> 否</label>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="form-group col-sm-6">
  128. <label class="col-sm-4 control-label">是否公开:</label>
  129. <div class="col-sm-8">
  130. <select id="openFlag" name="openFlag" class="form-control">
  131. <option value="1" <c:if test="${mgmProduct.openFlag}">selected</c:if>>公开</option>
  132. <option value="0" <c:if test="${!mgmProduct.openFlag}">selected</c:if>>内部</option>
  133. </select>
  134. </div>
  135. </div>
  136. </div>
  137. <div class="form-group" style="display:none;">
  138. <label class="col-sm-3 control-label">上级分类:</label>
  139. <div class="col-sm-6">
  140. <select class="form-control m-b" id="gcId" name="gcId" onchange="menuChange(this)" readonly="readonly" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  141. <option value="">请选择</option>
  142. <c:forEach items="${firstCategory }" var="superMenu">
  143. <option value="${superMenu.id }" >${superMenu.gcName}</option>
  144. </c:forEach>
  145. </select>
  146. </div>
  147. </div>
  148. <script type="text/javascript">
  149. function menuChange(obj){
  150. var ss = $(obj).children('option:selected').val();
  151. $("#tlb").css("display","none");
  152. $("#thlb").css("display","none");
  153. $("#folb").css("display","none");
  154. $('#dcfllb').css("display","none");
  155. $("#gcParentId").empty();
  156. $("#gcThreeId").empty();
  157. $("#gcFourId").empty();
  158. $.ajax({
  159. type: "get",
  160. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  161. data: {id:ss},
  162. dataType: "json",
  163. success: function(data){
  164. if(data.mlist.length > 0){
  165. $("#tlb").css("display","block");
  166. $("#gcParentId").empty();
  167. $("#gcParentId").append("<option value='0'>请选择</option>");
  168. data.mlist.forEach(function(val,index,arr){
  169. $("#gcParentId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  170. });
  171. }
  172. if(data.type == "1"){
  173. $('#dcfllb').css("display","block");
  174. }
  175. }
  176. });
  177. }
  178. function twoMenuChange(obj){
  179. var ss = $(obj).children('option:selected').val();
  180. $("#thlb").css("display","none");
  181. $("#folb").css("display","none");
  182. $("#gcThreeId").empty();
  183. $("#gcFourId").empty();
  184. $.ajax({
  185. type: "get",
  186. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  187. data: {id:ss},
  188. dataType: "json",
  189. success: function(data){
  190. if(data.mlist.length > 0){
  191. $("#thlb").css("display","block");
  192. $("#gcThreeId").empty();
  193. $("#gcThreeId").append("<option value='0'>请选择</option>");
  194. data.mlist.forEach(function(val,index,arr){
  195. $("#gcThreeId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  196. });
  197. }
  198. }
  199. });
  200. }
  201. function threeMenuChange(obj){
  202. var ss = $(obj).children('option:selected').val();
  203. $("#folb").css("display","none");
  204. $("#gcFourId").empty();
  205. $.ajax({
  206. type: "get",
  207. url: "<%=basePath%>mgmProductCategoryCtl/nextCategory.cs",
  208. data: {id:ss},
  209. dataType: "json",
  210. success: function(data){
  211. if(data.mlist.length > 0){
  212. $("#folb").css("display","block");
  213. $("#gcFourId").empty();
  214. $("#gcFourId").append("<option value='0'>请选择</option>");
  215. data.mlist.forEach(function(val,index,arr){
  216. $("#gcFourId").append("<option value='"+val.id+"'>"+ val.gcName+"</option>");
  217. });
  218. }
  219. }
  220. });
  221. }
  222. </script>
  223. <div id="tlb" class="form-group" style="display:none;">
  224. <label class="col-sm-3 control-label">二级分类:</label>
  225. <div class="col-sm-6">
  226. <select class="form-control m-b" id="gcParentId" name="gcParentId" readonly="readonly" onchange="twoMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  227. <option value="0">请选择</option>
  228. </select>
  229. </div>
  230. </div>
  231. <div id="thlb" class="form-group" style="display:none;">
  232. <label class="col-sm-3 control-label">三级分类:</label>
  233. <div class="col-sm-6">
  234. <select class="form-control m-b" id="gcThreeId" name="gcThreeId" readonly="readonly" onchange="threeMenuChange(this)" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  235. <option value="0">请选择</option>
  236. </select>
  237. </div>
  238. </div>
  239. <div id="folb" class="form-group" style="display:none;">
  240. <label class="col-sm-3 control-label">四级分类:</label>
  241. <div class="col-sm-6">
  242. <select class="form-control m-b" id="gcFourId" name="gcFourId" readonly="readonly" validate="{required:true}" validateMessage="{required:'请选择分类'}">
  243. <option value="0">请选择</option>
  244. </select>
  245. </div>
  246. </div>
  247. <!-- //地产项目分类 -->
  248. <div id="dcfllb" class="form-group" <c:if test="${mgmProduct.productType != '1' }">style="display:none;"</c:if>>
  249. <label class="col-sm-3 control-label">地产项目分类:</label>
  250. <div class="col-sm-6">
  251. <select class="form-control m-b" id="xmCode" name="xmCode" readonly="readonly" validate="{required:true}" validateMessage="{required:'请输入地产项目分类'}">
  252. <option value="">请选择</option>
  253. <c:forEach items="${diclist }" var="superMenu">
  254. <option value="${superMenu.code }" <c:if test="${mgmProduct.xmCode == superMenu.code }">selected</c:if>>${superMenu.name}</option>
  255. </c:forEach>
  256. </select>
  257. </div>
  258. </div>
  259. <div class="form-group">
  260. <label class="col-sm-3 control-label">商品主图:</label>
  261. <div class="col-sm-6">
  262. <cs:file name="productImg" type="100" url="${mgmProduct.productImg }" num="1"></cs:file>
  263. </div>
  264. </div>
  265. <div class="form-group">
  266. <label class="col-sm-3 control-label">商品组图:</label>
  267. <div class="col-sm-6">
  268. <cs:file name="productGroupImg" type="100" url="${mgmProduct.productGroupImg }" num="5"></cs:file>
  269. </div>
  270. </div>
  271. <div class="form-group">
  272. <label class="col-sm-3 control-label">产品说明:</label>
  273. <div class="col-sm-6">
  274. <div class="content">
  275. <!-- <script id="editor" type="text/plain" style="width:100%;height:500px;"></script>
  276. <script type="text/javascript">
  277. //实例化编辑器
  278. //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  279. var ue = UE.getEditor('editor');
  280. ue.ready(function(){
  281. ue.setContent('${mgmProduct.productMsg }');
  282. });
  283. ue.addListener('selectionchange',function(){
  284. $("#productMsg").val(ue.getContent());
  285. console.log("选区已经变化!");
  286. })
  287. </script> -->
  288. ${mgmProduct.productMsg }
  289. <!-- <textarea rows="" cols="" id="productMsg" readonly="readonly" name="productMsg"></textarea> -->
  290. </div>
  291. </div>
  292. </div>
  293. <div class="form-group">
  294. <label class="col-sm-3 control-label">产品参数:</label>
  295. <div class="col-sm-6">
  296. <div class="content">
  297. <!-- <script id="editor1" type="text/plain" style="width:100%;height:500px;"></script>
  298. <script type="text/javascript">
  299. //实例化编辑器
  300. //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  301. var ue1 = UE.getEditor('editor1');
  302. ue1.ready(function(){
  303. ue1.setContent('${mgmProduct.productAttr }');
  304. });
  305. ue1.addListener('selectionchange',function(){
  306. $("#productAttr").val(ue1.getContent());
  307. console.log("选区已经变化!");
  308. })
  309. </script> -->
  310. <!-- <textarea rows="" cols="" id="productAttr" style="display:none;" name="productAttr"></textarea> -->
  311. ${mgmProduct.productAttr }
  312. </div>
  313. </div>
  314. </div>
  315. <div class="form-group">
  316. <label class="col-sm-3 control-label">产品详情:</label>
  317. <div class="col-sm-6">
  318. <div class="content">
  319. <!-- <script id="editor2" type="text/plain" style="width:100%;height:500px;"></script>
  320. <script type="text/javascript">
  321. //实例化编辑器
  322. //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  323. var ue2 = UE.getEditor('editor2');
  324. ue2.ready(function(){
  325. ue2.setContent('${mgmProduct.productBody }');
  326. });
  327. ue2.addListener('selectionchange',function(){
  328. $("#productBody").val(ue2.getContent());
  329. console.log("选区已经变化!");
  330. })
  331. </script>
  332. <textarea rows="" cols="" id="productBody" style="display:none;" name="productBody"></textarea> -->
  333. ${mgmProduct.productBody }
  334. </div>
  335. </div>
  336. </div>
  337. <div class="form-group">
  338. <label class="col-sm-3 control-label">佣金说明:</label>
  339. <div class="col-sm-6">
  340. <div class="content">
  341. <!-- <script id="editor3" type="text/plain" style="width:100%;height:500px;"></script>
  342. <script type="text/javascript">
  343. //实例化编辑器
  344. //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  345. var ue3 = UE.getEditor('editor3');
  346. ue3.ready(function(){
  347. ue3.setContent('${mgmProduct.commissionRemark }');
  348. });
  349. ue3.addListener('selectionchange',function(){
  350. $("#commissionRemark").val(ue3.getContent());
  351. console.log("选区已经变化!");
  352. })
  353. </script>
  354. <textarea rows="" cols="" id="commissionRemark" style="display:none;" name="commissionRemark"></textarea> -->
  355. ${mgmProduct.commissionRemark }
  356. </div>
  357. </div>
  358. </div>
  359. <div class="form-group">
  360. <label class="col-sm-3 control-label">优惠政策:</label>
  361. <div class="col-sm-6">
  362. <div class="content">
  363. <!-- <script id="editor4" type="text/plain" style="width:100%;height:500px;"></script>
  364. <script type="text/javascript">
  365. //实例化编辑器
  366. //建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
  367. var ue4 = UE.getEditor('editor4');
  368. ue4.ready(function(){
  369. ue4.setContent('${mgmProduct.policy }');
  370. });
  371. ue4.addListener('selectionchange',function(){
  372. $("#policy").val(ue4.getContent());
  373. console.log("选区已经变化!");
  374. })
  375. </script>
  376. <textarea rows="" cols="" id="policy" name=policy style="display:none;"></textarea> -->
  377. ${mgmProduct.policy }
  378. </div>
  379. </div>
  380. </div>
  381. <!-- <div class="form-group">
  382. <label class="col-sm-3 control-label">省:</label>
  383. <div class="col-sm-6">
  384. <select id="provinceCode" name="provinceCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
  385. <option value="" disabled selected hidden>省</option>
  386. </select>
  387. <input type="hidden" id="province" name="province"/>
  388. </div>
  389. </div>
  390. <div class="form-group">
  391. <label class="col-sm-3 control-label">市:</label>
  392. <div class="col-sm-6">
  393. <select id="cityCode" name="cityCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
  394. <option value="" disabled selected hidden>市</option>
  395. </select>
  396. <input type="hidden" id="city" name="city"/>
  397. </div>
  398. </div>
  399. <div class="form-group">
  400. <label class="col-sm-3 control-label">区 / 县:</label>
  401. <div class="col-sm-6">
  402. <select id="countyCode" name="countyCode" class="form-control" validate="{required:true}" validateMessage="{required:'请输入名称'}">
  403. <option value="" disabled selected hidden>区 / 县</option>
  404. </select>
  405. <input type="hidden" id="county" name="county"/>
  406. </div>
  407. </div> -->
  408. <!-- <div class="form-group">
  409. <div class="col-sm-4 col-sm-offset-3 pull-left">
  410. <button class="btn btn-default btn-dlg-close">取消</button>
  411. <button class="btn btn-primary" type="button" onclick="initUe();">提交</button>
  412. </div>
  413. </div> -->
  414. </form>
  415. </div>
  416. </div>
  417. </div>
  418. <script type="text/javascript">
  419. <%-- $.get('<%=basePath%>area/getProvice.cs',function(data){
  420. for(var i in data){
  421. var _option = '';
  422. if(curProvinceCode ==data[i].code ){
  423. _option = '<option value="' + data[i].code + '" selected>' + data[i].name + '</option>';
  424. $('#province').val(data[i].name);
  425. }else{
  426. _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  427. }
  428. $('#provinceCode').append(_option);
  429. }
  430. });
  431. if(curProvinceCode != ''){
  432. $.get('<%=basePath%>area/getByParentCode.cs',{'param': curProvinceCode}, function(data){
  433. for(var i in data){
  434. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  435. $('#cityCode').append(_option);
  436. }
  437. });
  438. }
  439. ///省
  440. $("#provinceCode").change(function(){
  441. var self = $(this);
  442. $('#cityCode').empty();
  443. var _option = '<option>请选择</option>';
  444. $('#cityCode').append(_option);
  445. $('#city').val("");
  446. $('#countyCode').empty();
  447. var _option = '<option>请选择</option>';
  448. $('#countyCode').append(_option);
  449. $('#county').val("");
  450. $('#townshipCode').empty();
  451. var _option = '<option>请选择</option>';
  452. $('#townshipCode').append(_option);
  453. $('#township').val("");
  454. $.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
  455. for(var i in data){
  456. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  457. $('#cityCode').append(_option);
  458. }
  459. });
  460. $('#province').val(self.find("option:selected").text());
  461. });
  462. ///城市
  463. $("#cityCode").change(function(){
  464. var self = $(this);
  465. $('#countyCode').empty();
  466. var _option = '<option>请选择</option>';
  467. $('#countyCode').append(_option);
  468. $('#county').val("");
  469. $('#townshipCode').empty();
  470. var _option = '<option>请选择</option>';
  471. $('#townshipCode').append(_option);
  472. $('#township').val("");
  473. $.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
  474. for(var i in data){
  475. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  476. //if(num == 1){
  477. $('#countyCode').append(_option);
  478. // }
  479. }
  480. });
  481. $('#city').val(self.find("option:selected").text());
  482. });
  483. ///县、区
  484. $("#countyCode").change(function(){
  485. var self = $(this);
  486. $('#townshipCode').empty();
  487. var _option = '<option>请选择</option>';
  488. $('#townshipCode').append(_option);
  489. $('#township').val("");
  490. $.get('<%=basePath%>area/getByParentCode.cs',{'param': self.val()}, function(data){
  491. for(var i in data){
  492. var _option = '<option value="' + data[i].code + '" >' + data[i].name + '</option>';
  493. //if(num == 1){
  494. $('#townshipCode').append(_option);
  495. // }
  496. }
  497. });
  498. $('#county').val(self.find("option:selected").text());
  499. }); --%>
  500. </script>
  501. </body>
  502. </html>