...
|
...
|
@@ -46,7 +46,10 @@ |
|
|
<a id="allBtn" class="btn-info">全部</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="margin-left: 20px;margin-top: 10px">
|
|
|
<a id="btnBatchAllow" class="btn-long" style="background-color: #5CB85C;">批量通过</a>
|
|
|
<a id="btnBatchBan" class="btn-long" style="background-color: #ffa951;">批量拒绝</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div region="center" id="labelGroupList" style="margin-left: 20px">
|
...
|
...
|
@@ -87,7 +90,24 @@ |
|
|
$("#labelGroupListTable").datagrid("load", {});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$("#btnBatchAllow").click(function(){
|
|
|
batchUpdateStatus(1);
|
|
|
});
|
|
|
$("#btnBatchBan").click(function(){
|
|
|
batchUpdateStatus(2);
|
|
|
});
|
|
|
function batchUpdateStatus(status){
|
|
|
var rows = $('#labelGroupListTable').datagrid('getSelections');
|
|
|
if(!rows||rows.length == 0){
|
|
|
$.messager.alert("提示", "请先选择数据!", "warn");
|
|
|
return;
|
|
|
}
|
|
|
var ids = [];
|
|
|
rows.forEach(function(value,i){
|
|
|
ids.push(value.id);
|
|
|
})
|
|
|
updateStatus(ids,status)
|
|
|
}
|
|
|
$("#searchBtn").linkbutton({
|
|
|
iconCls : "icon-search",
|
|
|
onClick : function() {
|
...
|
...
|
@@ -128,6 +148,11 @@ |
|
|
},
|
|
|
columns: [[
|
|
|
{
|
|
|
field: "ck",
|
|
|
checkbox:true,
|
|
|
align: "left"
|
|
|
},
|
|
|
{
|
|
|
title: "评论ID",
|
|
|
field: "id",
|
|
|
width: 15,
|
...
|
...
|
@@ -223,7 +248,7 @@ |
|
|
pageSize: 10,
|
|
|
pageList: [10],
|
|
|
idField: "id",
|
|
|
singleSelect: true,
|
|
|
singleSelect: false,
|
|
|
onLoadSuccess: function (data) {
|
|
|
if(index != ""){
|
|
|
$(this).datagrid("scrollTo",index);
|
...
|
...
|
@@ -235,7 +260,7 @@ |
|
|
onClick : function() {
|
|
|
index = $(this).attr("index");
|
|
|
var row = $("#labelGroupListTable").datagrid('getData').rows[index];
|
|
|
updateStatus(row.id,1);
|
|
|
updateStatus([row.id],1);
|
|
|
}
|
|
|
});
|
|
|
$(this).datagrid("getPanel").find("a[role='banStatus']").linkbutton({
|
...
|
...
|
@@ -243,37 +268,40 @@ |
|
|
onClick : function() {
|
|
|
index = $(this).attr("index");
|
|
|
var row = $("#labelGroupListTable").datagrid('getData').rows[index];
|
|
|
updateStatus(row.id,2);
|
|
|
updateStatus([row.id],2);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function updateStatus(id,status){
|
|
|
$.ajax(
|
|
|
{
|
|
|
type : 'post',
|
|
|
url : serverContextPath + "/grassGoodsComment/modifyStatus",
|
|
|
dataType : 'json',
|
|
|
data : {
|
|
|
id:id,
|
|
|
status:status
|
|
|
},
|
|
|
success : function(result){
|
|
|
if(result.code==200){
|
|
|
$("#labelGroupListTable").datagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "审核成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
}else{
|
|
|
$.messager.alert("审核失败", result.message, "error");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
function updateStatus(ids,status){
|
|
|
var param={
|
|
|
ids:ids,
|
|
|
status:status
|
|
|
};
|
|
|
$.ajax(
|
|
|
{
|
|
|
type : 'post',
|
|
|
url : serverContextPath + "/grassGoodsComment/modifyStatus",
|
|
|
dataType : 'json',
|
|
|
data : JSON.stringify(param),
|
|
|
contentType : 'application/json',
|
|
|
dataType : 'json',
|
|
|
success : function(result){
|
|
|
if(result.code==200){
|
|
|
$("#labelGroupListTable").datagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "审核成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
}else{
|
|
|
$.messager.alert("审核失败", result.message, "error");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
</script>
|
...
|
...
|
|