cmPageActivityCentreList.jsp 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <%@ page contentType="text/html;charset=UTF-8" %>
  2. <%@ include file="/WEB-INF/views/include/taglib.jsp" %>
  3. <html>
  4. <head>
  5. <title>分类详情商品楼层</title>
  6. <meta name="decorator" content="default"/>
  7. <style type="text/css">
  8. .table th {
  9. text-align: center;
  10. }
  11. .table td {
  12. text-align: center;
  13. }
  14. </style>
  15. <script type="text/javascript">
  16. $(document).ready(function () {
  17. });
  18. function page(n, s) {
  19. $("#pageNo").val(n);
  20. $("#pageSize").val(s);
  21. $("#searchForm").submit();
  22. return false;
  23. }
  24. //PC端状态修改
  25. function updateEnabledStatus(status, ids) {
  26. var msg = '确定启用该楼层吗?';
  27. if ('0' == status) {
  28. msg = '确定停用该楼层吗?';
  29. }
  30. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  31. if (v == 'ok') {
  32. $.post("${ctx}/cmpage/cmPageCentre/updateEnabledStatus", {
  33. 'enabledStatus': status,
  34. 'ids': ids
  35. }, function (data) {
  36. if (true == data.success) {
  37. $.jBox.tip(data.msg, 'info');
  38. } else {
  39. $.jBox.tip(data.msg, 'error');
  40. }
  41. window.location = "${ctx}/cmpage/cmPageCentre/?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}";
  42. }, "JSON");//这里返回的类型有:json,html,xml,text
  43. }
  44. return;
  45. }, {buttonsFocus: 1, persistent: true});
  46. }
  47. //CRM端状态修改
  48. function updateCrmEnabledStatusByIds(status, ids) {
  49. var msg = '确定启用该楼层吗?';
  50. if ('0' == status) {
  51. msg = '确定停用该楼层吗?';
  52. }
  53. top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
  54. if (v == 'ok') {
  55. $.post("${ctx}/cmpage/cmPageCentre/updateCrmEnabledStatusByIds", {
  56. 'crmEnabledStatus': status,
  57. 'ids': ids
  58. }, function (data) {
  59. if (true == data.success) {
  60. $.jBox.tip(data.msg, 'info');
  61. } else {
  62. $.jBox.tip(data.msg, 'error');
  63. }
  64. window.location = "${ctx}/cmpage/cmPageCentre/?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}";
  65. }, "JSON");//这里返回的类型有:json,html,xml,text
  66. }
  67. return;
  68. }, {buttonsFocus: 1, persistent: true});
  69. }
  70. /**
  71. * @param obj
  72. * jquery控制input只能输入数字
  73. */
  74. function onlynum(obj) {
  75. obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
  76. }
  77. //批量保存排序
  78. function batchSaveSort() {
  79. var items = new Array();
  80. var $items = $('.check-item');
  81. $items.each(function () {
  82. items.push($(this).val());
  83. });
  84. //保存批量排序
  85. $.post("${ctx}/cmpage/cmPageCentre/batchSaveSort?sortList=" + items, function (data) {
  86. if (true == data.success) {
  87. $.jBox.tip(data.msg, 'info');
  88. window.location.href = "${ctx}/cmpage/cmPageCentre/?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}";
  89. } else {
  90. $.jBox.tip(data.msg, 'error');
  91. }
  92. }, "JSON");//这里返回的类型有:json,html,xml,text
  93. }
  94. //修改排序值
  95. function changeSort(id, sortThis) {
  96. var value = sortThis.value;
  97. $("#preferredProductSort" + id).val(id + "-" + value);
  98. }
  99. </script>
  100. </head>
  101. <body>
  102. <ul class="nav nav-tabs">
  103. <li><a href="${ctx}/cmpage/cmPage/?flag=2">网页列表</a></li>
  104. <li class="active"><a href="${ctx}/cmpage/cmPageCentre/?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}">活动专题商品楼层</a>
  105. </li>
  106. </ul>
  107. <div>
  108. <label style="font-weight: bold;margin:10px 15px">网页标题:${pageTitle}</label>
  109. </div>
  110. <form:form action="" class="breadcrumb form-search">
  111. <input class="btn btn-primary" style="width: 70px" onclick="batchSaveSort()" value="一键排序"/>&nbsp;&nbsp;&nbsp;&nbsp;
  112. <input class="btn btn-primary" style="width: 70px"
  113. onclick="window.location='${ctx}/cmpage/cmPageCentre/form?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}'"
  114. value="添加楼层"/>
  115. <div style="margin-top: 10px">
  116. <label><font color="#a9a9a9">注:排序值越小越靠前</font></label>
  117. </div>
  118. </form:form>
  119. <sys:message content="${message}"/>
  120. <table id="contentTable" class="table table-striped table-bordered table-condensed">
  121. <thead>
  122. <tr>
  123. <th>ID</th>
  124. <th>楼层名称</th>
  125. <th>描述</th>
  126. <th>网站状态</th>
  127. <th>小程序状态</th>
  128. <th>排序</th>
  129. <th>创建时间</th>
  130. <shiro:hasPermission name="newhome:newPageFloor:edit">
  131. <th>操作</th>
  132. </shiro:hasPermission>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. <c:forEach items="${page.list}" var="newPageFloor">
  137. <tr>
  138. <input class="check-item" type="hidden" id="preferredProductSort${newPageFloor.id}"
  139. value='${newPageFloor.id}-${newPageFloor.sort}'/>
  140. <td>${newPageFloor.id}</td>
  141. <td>${newPageFloor.title}</td>
  142. <td>${newPageFloor.description}</td>
  143. <td>
  144. <c:if test="${newPageFloor.enabledStatus eq 1 }">
  145. <font color="green">已启用</font>
  146. <a href="javascript:void(0);" onclick="updateEnabledStatus('0','${newPageFloor.id}');">
  147. 停用
  148. </a>
  149. </c:if>
  150. <c:if test="${newPageFloor.enabledStatus ne 1 }">
  151. <font color="red">已停用</font>
  152. <a href="javascript:void(0)" onclick="updateEnabledStatus('1','${newPageFloor.id}');">
  153. 启用
  154. </a>
  155. </c:if>
  156. </td>
  157. <td>
  158. <c:if test="${newPageFloor.crmEnabledStatus eq 1 }">
  159. <font color="green">已启用</font>
  160. <a href="javascript:void(0);" onclick="updateCrmEnabledStatusByIds('0','${newPageFloor.id}');">
  161. 停用
  162. </a>
  163. </c:if>
  164. <c:if test="${newPageFloor.crmEnabledStatus ne 1 }">
  165. <font color="red">已停用</font>
  166. <a href="javascript:void(0)" onclick="updateCrmEnabledStatusByIds('1','${newPageFloor.id}');">
  167. 启用
  168. </a>
  169. </c:if>
  170. </td>
  171. <td><input id="sort" name="sort" style="width:50px;" value="${newPageFloor.sort}" onkeyup="onlynum(this)"
  172. onchange="changeSort(${newPageFloor.id},this)"></td>
  173. <td><fmt:formatDate value="${newPageFloor.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
  174. <td>
  175. <a href="${ctx}/cmpage/cmPageCentre/form?pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}&id=${newPageFloor.id}">编辑</a>
  176. <a href="${ctx}/cmpage/cmPageCentre/goContentPage?centreId=${newPageFloor.id}&pageId=${cmPageCentre.pageId}&type=${cmPageCentre.type}">内容</a>
  177. <a href="${ctx}/cmpage/cmPageCentre/delete?id=${newPageFloor.id}&type=${cmPageCentre.type}"
  178. onclick="return confirmx('是否删除该数据,删除后,对应的楼层数据也将被全部删除,确认是否删除', this.href)">删除</a>
  179. </td>
  180. </tr>
  181. </c:forEach>
  182. </tbody>
  183. </table>
  184. <div class="pagination">${page}</div>
  185. </body>
  186. </html>