|
@@ -0,0 +1,196 @@
|
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
|
+<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
|
|
|
|
+<html>
|
|
|
|
+<head>
|
|
|
|
+ <title>呵呵商品管理</title>
|
|
|
|
+ <meta name="decorator" content="default"/>
|
|
|
|
+ <style type="text/css">
|
|
|
|
+ .table th{text-align: center;}
|
|
|
|
+ .table td{text-align: center;}
|
|
|
|
+ </style>
|
|
|
|
+ <script type="text/javascript">
|
|
|
|
+ $(document).ready(function() {
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ function page(n,s){
|
|
|
|
+ $("#pageNo").val(n);
|
|
|
|
+ $("#pageSize").val(s);
|
|
|
|
+ $("#searchForm").submit();
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ </script>
|
|
|
|
+</head>
|
|
|
|
+<body>
|
|
|
|
+ <ul class="nav nav-tabs">
|
|
|
|
+ <li><a href="${ctx}/hehe/cmHeheFloor/">商品楼层列表</a></li>
|
|
|
|
+ <li class="active"><a href="${ctx}/hehe/cmHeheFloorProduct/list?floorId=${cmHeheFloorProduct.floorId}">商品列表</a></li>
|
|
|
|
+ </ul>
|
|
|
|
+ <form:form id="searchForm" modelAttribute="cmHeheFloorProduct" action="${ctx}/hehe/cmHeheFloorProduct/list" method="post" class="breadcrumb form-search">
|
|
|
|
+ <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
|
|
+ <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
|
|
|
+ <div class="ul-form">
|
|
|
|
+ <form:hidden path="floorId"/>
|
|
|
|
+ <label>商品ID:</label>
|
|
|
|
+ <form:input path="productId" htmlEscape="false" class="input-medium"/>
|
|
|
|
+ <label>商品名称:</label>
|
|
|
|
+ <form:input path="productName" htmlEscape="false" class="input-medium"/>
|
|
|
|
+ <label>供应商名称:</label>
|
|
|
|
+ <form:input path="shopName" htmlEscape="false" class="input-medium"/>
|
|
|
|
+ <label>商品状态:</label>
|
|
|
|
+ <form:select path="validFlag" class="input-small">
|
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
|
+ <form:option value="1" label="已上架"/>
|
|
|
|
+ <form:option value="0" label="已下架"/>
|
|
|
|
+ </form:select>
|
|
|
|
+ <label>推荐状态:</label>
|
|
|
|
+ <form:select path="recommend" class="input-small">
|
|
|
|
+ <form:option value="" label="请选择"/>
|
|
|
|
+ <form:option value="1" label="推荐"/>
|
|
|
|
+ <form:option value="0" label="不推荐"/>
|
|
|
|
+ </form:select>
|
|
|
|
+ <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
|
|
|
+ <input class="btn btn-primary" type="button" value="一键排序" onclick="batchSaveSort()" style="margin-left: 15px"/>
|
|
|
|
+ <input class="btn btn-primary" style="width: 80px" onclick="showSelect()" value="上线商品"/>
|
|
|
|
+ <div class="clearfix"></div>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="margin-top: 10px">
|
|
|
|
+ <label><font color="#a9a9a9">注:排序值越小越靠前</font></label>
|
|
|
|
+ </div>
|
|
|
|
+ </form:form>
|
|
|
|
+ <sys:message content="${message}"/>
|
|
|
|
+ <table id="contentTable" class="table table-striped table-bordered table-condensed">
|
|
|
|
+ <thead>
|
|
|
|
+ <tr>
|
|
|
|
+ <th>商品ID</th>
|
|
|
|
+ <th>商品图片</th>
|
|
|
|
+ <th>商品名称</th>
|
|
|
|
+ <th>供应商名称</th>
|
|
|
|
+ <th>商品状态</th>
|
|
|
|
+ <th>排序</th>
|
|
|
|
+ <th>推荐状态</th>
|
|
|
|
+ <th>添加时间</th>
|
|
|
|
+ <th>操作</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody>
|
|
|
|
+ <c:forEach items="${page.list}" var="product">
|
|
|
|
+ <tr>
|
|
|
|
+ <input class="check-item" type="hidden" id="preferredProductSort${product.id}" value='${product.id}-${product.sort}'/>
|
|
|
|
+ <td>
|
|
|
|
+ ${product.productId}
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <img src="${product.mainImage}" width="50px" height="50px">
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ ${product.productName}
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ ${product.shopName}
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <c:if test="${product.validFlag eq 1}">
|
|
|
|
+ <font color="green"><b>已上架</b></font>
|
|
|
|
+ </c:if>
|
|
|
|
+ <c:if test="${product.validFlag eq 0}">
|
|
|
|
+ <font color="red"><b>已下架</b></font>
|
|
|
|
+ </c:if>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <input id="sort" name="sort" style="width:50px;" value="${product.sort}" onkeyup="onlynum(this)" onchange="changeSort(${product.id},this)">
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <img src="/static/images/${product.recommend eq "1" ? "yes" : "no"}.gif" width="15px" border="none"/>
|
|
|
|
+ </td>
|
|
|
|
+
|
|
|
|
+ <td>
|
|
|
|
+ <fmt:formatDate value="${product.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
|
+ </td>
|
|
|
|
+ <td>
|
|
|
|
+ <a href="${ctx}/hehe/cmHeheFloorProduct/save?id=${product.id}&validFlag=${product.validFlag eq 1?0:1}&floorId=${product.floorId}" onclick="return confirmx('确认要${product.validFlag eq 1 ? "下架":"上架"}该商品吗?', this.href)">${product.validFlag eq 1 ? '下架':'上架'}</a>
|
|
|
|
+ <a href="${ctx}/hehe/cmHeheFloorProduct/save?id=${product.id}&recommend=${product.recommend eq 1?0:1}&floorId=${product.floorId}" onclick="return confirmx('${product.recommend eq 0 ? "确定将该商品设为推荐商品吗?":"确定取消推荐吗?"}', this.href)">${product.recommend eq 0 ? '设为':'取消'}推荐</a>
|
|
|
|
+ <a href="${ctx}/hehe/cmHeheFloorProduct/delete?id=${product.id}" onclick="return confirmx('确认要删除该商品吗?', this.href)">删除</a>
|
|
|
|
+ </td>
|
|
|
|
+ </tr>
|
|
|
|
+ </c:forEach>
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ <div class="pagination">${page}</div>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ //修改排序值
|
|
|
|
+ function changeSort(id, sortThis) {
|
|
|
|
+ var value = sortThis.value;
|
|
|
|
+ $("#preferredProductSort" + id).val(id + "-" + value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //批量保存排序
|
|
|
|
+ function batchSaveSort() {
|
|
|
|
+ var items = new Array();
|
|
|
|
+ var $items = $('.check-item');
|
|
|
|
+ $items.each(function(){
|
|
|
|
+ items.push($(this).val());
|
|
|
|
+ });
|
|
|
|
+ //保存批量排序
|
|
|
|
+ $.post("${ctx}/hehe/cmHeheFloorProduct/batchSaveSort?sortList="+items, function(data) {
|
|
|
|
+ if(true==data.success){
|
|
|
|
+ $.jBox.tip(data.msg, 'info');
|
|
|
|
+ $("#searchForm").submit();
|
|
|
|
+ } else {
|
|
|
|
+ $.jBox.tip(data.msg,'error');
|
|
|
|
+ }
|
|
|
|
+ },"JSON");//这里返回的类型有:json,html,xml,text
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * @param obj
|
|
|
|
+ * jquery控制input只能输入数字
|
|
|
|
+ */
|
|
|
|
+ function onlynum(obj) {
|
|
|
|
+ obj.value = obj.value.replace(/[^\d]/g, ""); //清除"数字"以外的字符
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ */
|
|
|
|
+ <%--function showSelect() {--%>
|
|
|
|
+ <%-- var url = '${ctx}/hehe/cmHeheFloorProduct/findProductPage?floorId=${cmHeheFloorProduct.floorId}';--%>
|
|
|
|
+ <%-- window.location=--%>
|
|
|
|
+ <%--}--%>
|
|
|
|
+
|
|
|
|
+ //选择添加商品
|
|
|
|
+ function showSelect() {
|
|
|
|
+ var title = '选择商品';
|
|
|
|
+ var floorId = ${cmHeheFloorProduct.floorId};
|
|
|
|
+ var productUrl = '${ctx}/hehe/cmHeheFloorProduct/findProductPage?floorId=${cmHeheFloorProduct.floorId}';
|
|
|
|
+ var addUrl = '${ctx}/hehe/cmHeheFloorProduct/addProduct';
|
|
|
|
+ title = "选择商品";
|
|
|
|
+ top.$.jBox("iframe:" + productUrl, {
|
|
|
|
+ iframeScrolling: 'yes',
|
|
|
|
+ width: $(top.document).width() - 600,
|
|
|
|
+ height: $(top.document).height() - 160,
|
|
|
|
+ persistent: true,
|
|
|
|
+ title: title,
|
|
|
|
+ buttons: {"确定": '1', "关闭": '-1'},
|
|
|
|
+ submit: function (v, h, f) {
|
|
|
|
+ //确定
|
|
|
|
+ var $jboxFrame = top.$('#jbox-iframe');
|
|
|
|
+ var $mainFrame = top.$('#mainFrame');
|
|
|
|
+ if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
|
|
|
|
+ var productIds = $jboxFrame[0].contentWindow.getCheckedItems();
|
|
|
|
+ if (productIds != '') {
|
|
|
|
+ $.post(addUrl,{"floorId":floorId, "productIds":productIds},function (data) {
|
|
|
|
+ })
|
|
|
|
+ $.jBox.tip('上线商品成功', 'info');
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ $("#searchForm").submit();
|
|
|
|
+ },1000)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+</body>
|
|
|
|
+</html>
|