|
@@ -28,11 +28,12 @@
|
|
|
</head>
|
|
|
<body>
|
|
|
<ul class="nav nav-tabs">
|
|
|
- <li class=${cmBaikeProduct.commodityType eq 1?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1">产品</a></li>
|
|
|
- <li class=${cmBaikeProduct.commodityType eq 2?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=2">仪器</a></li>
|
|
|
+ <li class=${cmBaikeProduct.commodityType eq 1?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=1&publishSource=2">产品</a></li>
|
|
|
+ <li class=${cmBaikeProduct.commodityType eq 2?"active":""}><a href="${ctx}/baike/cmBaikeProduct/?commodityType=2&publishSource=2">仪器</a></li>
|
|
|
</ul>
|
|
|
<form:form id="searchForm" modelAttribute="cmBaikeProduct" action="${ctx}/baike/cmBaikeProduct/" method="post" class="breadcrumb form-search">
|
|
|
<form:hidden path="commodityType"/>
|
|
|
+ <form:hidden path="publishSource"/>
|
|
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
|
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
|
|
<div class="ul-form">
|
|
@@ -40,25 +41,19 @@
|
|
|
<form:input path="id" htmlEscape="false" class="input-medium"/>
|
|
|
<label>${commodityType}名称:</label>
|
|
|
<form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
|
|
|
- <label>首页置顶:</label>
|
|
|
- <form:select path="topFlag" class="input-medium">
|
|
|
- <form:option value="" label="全部"/>
|
|
|
- <form:option value="1" label="是"/>
|
|
|
- <form:option value="0" label="否"/>
|
|
|
- </form:select>
|
|
|
<label>${commodityType}分类:</label>
|
|
|
<form:select path="typeId" class="input-medium">
|
|
|
<form:option value="" label="全部"/>
|
|
|
<form:options items="${typeList}" itemLabel="name" itemValue="id" htmlEscape="false"/>
|
|
|
</form:select>
|
|
|
- <label>状态:</label>
|
|
|
- <form:select path="status" class="input-medium">
|
|
|
+ <label>审核状态:</label>
|
|
|
+ <form:select path="auditStatus" class="input-mini">
|
|
|
<form:option value="" label="全部"/>
|
|
|
- <form:option value="1" label="启用"/>
|
|
|
- <form:option value="0" label="停用"/>
|
|
|
+ <form:option value="1" label="待审核"/>
|
|
|
+ <form:option value="2" label="审核通过"/>
|
|
|
+ <form:option value="3" label="审核失败"/>
|
|
|
</form:select>
|
|
|
<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
|
|
|
- <a class="btn btn-primary" style="width: 50px" href="${ctx}/baike/cmBaikeProduct/form?commodityType=${cmBaikeProduct.commodityType}">添加</a>
|
|
|
<div class="clearfix"></div>
|
|
|
</div>
|
|
|
</form:form>
|
|
@@ -69,12 +64,11 @@
|
|
|
<th>ID</th>
|
|
|
<th>${commodityType}名称</th>
|
|
|
<th>${commodityType}分类</th>
|
|
|
- <th>基础浏览量</th>
|
|
|
- <th>实际浏览量</th>
|
|
|
- <th>首页置顶位</th>
|
|
|
+ <th>浏览量</th>
|
|
|
+ <th>审核状态</th>
|
|
|
<th>发布时间</th>
|
|
|
+ <th>供应商</th>
|
|
|
<th>添加时间</th>
|
|
|
- <th>状态</th>
|
|
|
<th>操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
@@ -90,58 +84,31 @@
|
|
|
<td>
|
|
|
${cmBaikeProduct.typeName}
|
|
|
</td>
|
|
|
- <td>
|
|
|
- ${cmBaikeProduct.basePv}
|
|
|
- </td>
|
|
|
<td>
|
|
|
${cmBaikeProduct.actualPv}
|
|
|
</td>
|
|
|
<td>
|
|
|
- ${cmBaikeProduct.topPosition eq 1?'第一位':cmBaikeProduct.topPosition eq 2?'第二位':cmBaikeProduct.topPosition eq 3?'第三位':''}
|
|
|
+ <font color="${cmBaikeProduct.auditStatus eq 1?'black':cmBaikeProduct.auditStatus eq 2?'#2FA4E7':cmBaikeProduct.auditStatus eq 3?'red':'#2FA4E7'}"> ${cmBaikeProduct.auditStatus eq 1?'待审核':cmBaikeProduct.auditStatus eq 2?'审核通过':cmBaikeProduct.auditStatus eq 3?'审核失败':'审核通过'}</font>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ <c:if test="${cmBaikeProduct.auditStatus eq 2}">
|
|
|
+ <fmt:formatDate value="${cmBaikeProduct.publishTime}" pattern="yyyy-MM-dd HH:mm"/>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${cmBaikeProduct.auditStatus ne 2}">
|
|
|
+ --
|
|
|
+ </c:if>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
+ ${cmBaikeProduct.shopName}
|
|
|
</td>
|
|
|
<td>
|
|
|
- <c:if test="${cmBaikeProduct.status eq 1 }">
|
|
|
- <font color="green">已启用</font>
|
|
|
- <a href="javascript:void(0);" onclick="updateStatus(0,${cmBaikeProduct.id});" >
|
|
|
- 停用
|
|
|
- </a>
|
|
|
- </c:if>
|
|
|
- <c:if test="${cmBaikeProduct.status ne 1 }">
|
|
|
- <font color="red">已停用</font>
|
|
|
- <a href="javascript:void(0)" onclick="updateStatus(1,${cmBaikeProduct.id});">
|
|
|
- 启用
|
|
|
- </a>
|
|
|
- </c:if>
|
|
|
+ <fmt:formatDate value="${cmBaikeProduct.addTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <a target="_blank" href="${fns:getConfig('wwwServer')}encyclopedia/${cmBaikeProduct.commodityType eq 1?'product':'instrument'}-${cmBaikeProduct.id}.html">查看</a>
|
|
|
- <a href="${ctx}/baike/cmBaikeProduct/form?id=${cmBaikeProduct.id}">编辑</a>
|
|
|
- <a href="${ctx}/baike/cmBaikeProduct/delete?id=${cmBaikeProduct.id}" onclick="return confirmx('确认要删除该产品吗?', this.href)">删除</a>
|
|
|
- <a onclick="showTopSelect(${index.index},'open')" href="javascript:void(0)">首页置顶</a>
|
|
|
- <c:if test="${cmBaikeProduct.topPosition ne null}">
|
|
|
- <a onclick="updateTopPosition('','${cmBaikeProduct.id}','clearTopPosition')" href="javascript:void(0)">清除置顶</a>
|
|
|
- </c:if>
|
|
|
- <div style="display: none" class="topSelect" id="topSelect${index.index}" onmouseleave="showTopSelect(${index.index},'close')">
|
|
|
- <table style="border: 2px solid #000000;" cellpadding="0" cellspacing="0">
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <td><a onclick="updateTopPosition('1',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第一位</a></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td><a onclick="updateTopPosition('2',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第二位</a></td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <td><a onclick="updateTopPosition('3',${cmBaikeProduct.id},'setTopPosition')" href="javascript:void(0)">置顶第三位</a></td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <a href="javascript:;" style="display: ${cmBaikeProduct.auditStatus eq 1 or cmBaikeProduct.auditStatus eq 3?'':'none'}"
|
|
|
+ onclick="auditBaike(${cmBaikeProduct.id})">审核</a>
|
|
|
+ <a href="${ctx}/baike/cmBaikeProduct/check?id=${cmBaikeProduct.id}
|
|
|
+ &commodityType=${cmBaikeProduct.commodityType}&publishSource=2">查看</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
@@ -149,73 +116,46 @@
|
|
|
</table>
|
|
|
<div class="pagination">${page}</div>
|
|
|
<script type="text/javascript">
|
|
|
- function updateStatus(status, productId) {
|
|
|
- var commodityType = '${commodityType}'
|
|
|
- var msg='确定启用该'+commodityType+'吗?';
|
|
|
- if(0==status) {
|
|
|
- msg = '确定停用该'+commodityType+'吗?';
|
|
|
- }
|
|
|
- top.$.jBox.confirm(msg,'系统提示',function(v,h,f){
|
|
|
- if(v=='ok'){
|
|
|
- $.post("${ctx}/baike/cmBaikeProduct/updateStatus",{'status':status,'productId':productId}, function(data) {
|
|
|
- if(true==data.success){
|
|
|
- $.jBox.tip(data.msg, 'cmBaikeProduct');
|
|
|
+ function auditBaike(productId) {
|
|
|
+ var url = "${ctx}/baike/cmBaikeProduct/toAuditPage?id=" + productId;
|
|
|
+ var title = "审核";
|
|
|
+ top.$.jBox("iframe:"+url, {
|
|
|
+ iframeScrolling: 'yes',
|
|
|
+ width: 800,
|
|
|
+ height: 350,
|
|
|
+ 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 items = $jboxFrame[0].contentWindow.getCheckedItems(0);
|
|
|
+ if (items.length > 0) {
|
|
|
+ var auditStatus = items[0].auditStatus;
|
|
|
+ var failReason = items[0].failReason.trim();
|
|
|
+ if (auditStatus === '2') {
|
|
|
+ failReason = '';
|
|
|
+ }
|
|
|
+ if (auditStatus === '3' && failReason === '') {
|
|
|
+ top.$.jBox.tip("请输入失败原因");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $.post("${ctx}/baike/cmBaikeProduct/auditBaike?id="+productId+"&auditStatus=" + auditStatus + "&failReason=" + failReason, function (data) {
|
|
|
+ top.$.jBox.tip("审核成功");
|
|
|
+ setTimeout(function () {
|
|
|
+ $("#searchForm").submit();
|
|
|
+ }, 200);
|
|
|
+ });
|
|
|
} else {
|
|
|
- $.jBox.tip(data.msg,'error');
|
|
|
+ top.$.jBox.tip("请先勾选商品...");
|
|
|
+ return false;
|
|
|
}
|
|
|
- setTimeout(function () {
|
|
|
- $("#searchForm").submit();
|
|
|
- },1000)
|
|
|
- },"JSON");//这里返回的类型有:json,html,xml,text
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
- return;
|
|
|
- },{buttonsFocus:1,persistent: true});
|
|
|
- }
|
|
|
-
|
|
|
- //展示置顶选项
|
|
|
- function showTopSelect(index,status) {
|
|
|
- if ('open' == status) {
|
|
|
- document.getElementById("topSelect" + index).style.cssText = "display:block";
|
|
|
- }else if ('close' == status) {
|
|
|
- document.getElementById("topSelect" + index).style.cssText = "display:none";
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //更新置顶
|
|
|
- function updateTopPosition(topPosition,id,type) {
|
|
|
- var msg = '';
|
|
|
- if ('setTopPosition' == type) {
|
|
|
- msg = '确认置顶该文章吗?';
|
|
|
- //已有的置顶文章数量
|
|
|
- var topLength = ${topLength};
|
|
|
- if (topPosition - 1 > topLength) {
|
|
|
- var emptyPosition = topLength == 0 ? '一' : '二' ;
|
|
|
- msg = '由于当前没有第'+ emptyPosition +'位的置顶文章,将直接把该条文章置顶为第'+emptyPosition+'位';
|
|
|
- topPosition = topLength == 0 ? 1 : topLength == 1 ? 2 : topLength == 2 ? 3 : topLength == 3 ? 4 : 5;
|
|
|
- }
|
|
|
- }
|
|
|
- if ('clearTopPosition' == type) {
|
|
|
- msg = '确认清除该条数据的置顶位吗?清除后这条数据将不会在商城首页展示';
|
|
|
- }
|
|
|
- top.$.jBox.confirm(msg, '系统提示', function (v, h, f) {
|
|
|
- if (v == 'ok') {
|
|
|
- $.post("${ctx}/baike/cmBaikeProduct/updateTopPosition", {
|
|
|
- 'topPosition': topPosition,
|
|
|
- 'id': id,
|
|
|
- 'type':type
|
|
|
- }, function (data) {
|
|
|
- if (true == data.success) {
|
|
|
- $.jBox.tip(data.msg, 'info');
|
|
|
- } else {
|
|
|
- $.jBox.tip(data.msg, 'error');
|
|
|
- }
|
|
|
- setTimeout(function () {
|
|
|
- $("#searchForm").submit();
|
|
|
- },800)
|
|
|
- }, "JSON");//这里返回的类型有:json,html,xml,text
|
|
|
- }
|
|
|
- return;
|
|
|
- }, {buttonsFocus: 1, persistent: true});
|
|
|
+ });
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|