|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8"/>
|
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/ufoPlatform/js/include.js"></script>
|
|
|
<script src="/ufoPlatform/js/ajaxfileupload.js"></script>
|
|
|
</head>
|
|
|
<body class="easyui-layout" fit="true">
|
|
|
<div region="north" style="height: 230px">
|
|
|
<script>
|
|
|
document.write(addHead('品牌管理', ''));
|
|
|
</script>
|
|
|
<style>
|
|
|
.div_search input {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.div_search .textbox {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.div_search .easyui-linkbutton {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
</style>
|
|
|
<div style="margin-left: 30px;" class="div_search">
|
|
|
<input id="brandName" type="text">
|
|
|
<input id="brandStatus" class="easyui-combobox" value="" data-options="
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{
|
|
|
id: '',
|
|
|
text: '选择状态'
|
|
|
}, {
|
|
|
id: '1',
|
|
|
text: '开启'
|
|
|
}, {
|
|
|
id: '2',
|
|
|
text: '关闭'
|
|
|
}]"/>
|
|
|
|
|
|
<a id="searchLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">筛选</a>
|
|
|
<a id="searchAllLinkButton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">全部</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div region="center">
|
|
|
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
|
|
|
<table id="brandTable"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
$(function () {
|
|
|
var brandMyDatagrid = $("#brandTable");
|
|
|
brandMyDatagrid.myDatagrid({
|
|
|
fit: true,
|
|
|
fitColumns: true,
|
|
|
nowrap: false,
|
|
|
url: contextPath + "/operations/consult/getList",
|
|
|
method: 'POST',
|
|
|
queryParams: getParams(),
|
|
|
loadFilter: function (data) {
|
|
|
var temp = defaultLoadFilter(data);
|
|
|
temp.rows = temp.list;
|
|
|
return temp;
|
|
|
},
|
|
|
columns: [[{
|
|
|
title: "ID",
|
|
|
field: "id",
|
|
|
width: 40,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "品牌LOGO",
|
|
|
field: "brandLogo",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return rowData.askUserName + "(" + rowData.askUserId + ")";
|
|
|
}
|
|
|
}, {
|
|
|
title: "品牌名称",
|
|
|
field: "brandName",
|
|
|
width: 100,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return "<a href='" + rowData.productUrl + "' target='_blank'>" + rowData.productName + "</a><br>SKN:" + rowData.skn + "<br>品牌:" + brandDataObj[rowData.brandId];
|
|
|
}
|
|
|
}, {
|
|
|
title: "英文名称",
|
|
|
field: "brandNameEn",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return "大类:" + rowData.maxSortName + "<br>中类:" + rowData.middleSortName + "<br>小类:" + rowData.smallSortName;
|
|
|
}
|
|
|
}, {
|
|
|
title: "品牌搜索词",
|
|
|
field: "brandSearch",
|
|
|
width: 170,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "状态",
|
|
|
field: "status",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
if (value == 1) {
|
|
|
return '开启';
|
|
|
}
|
|
|
return '关闭';
|
|
|
}
|
|
|
}, {
|
|
|
title: "创建时间",
|
|
|
field: "createTime",
|
|
|
width: 170,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
field: "operations",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
var str = "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>编辑</a>";
|
|
|
if (1 == rowData.status) {
|
|
|
str += "<a role='closeBrand' dataId='" + rowData.id + "' style='margin-left:10px'>关闭品牌</a>";
|
|
|
} else {
|
|
|
str += "<a role='openBrand' dataId='" + rowData.id + "' style='margin-left:10px'>开启品牌</a>";
|
|
|
}
|
|
|
return str;
|
|
|
}
|
|
|
}]],
|
|
|
cache: false,
|
|
|
pagination: true,
|
|
|
pageSize: 10,
|
|
|
pageList: [10],
|
|
|
idField: "id",
|
|
|
singleSelect: false,
|
|
|
checkOnSelect: false,
|
|
|
onLoadSuccess: function () {
|
|
|
// 编辑
|
|
|
$(this).myDatagrid("getPanel").find("a[role='edit']").linkbutton({
|
|
|
iconCls: "icon-edit",
|
|
|
onClick: function () {
|
|
|
var id = $(this).attr("dataId");
|
|
|
editRow(id);
|
|
|
}
|
|
|
});
|
|
|
// 关闭品牌
|
|
|
$(this).myDatagrid("getPanel").find("a[role='closeBrand']").linkbutton({
|
|
|
iconCls: "icon-more",
|
|
|
onClick: function () {
|
|
|
deleteRow($(this).attr("dataId"));
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 开启品牌
|
|
|
$(this).myDatagrid("getPanel").find("a[role='openBrand']").linkbutton({
|
|
|
iconCls: "icon-more",
|
|
|
onClick: function () {
|
|
|
deleteRow($(this).attr("dataId"));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// 搜索
|
|
|
$("#searchLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var param = getParams();
|
|
|
brandMyDatagrid.myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 搜索全部
|
|
|
$("#searchAllLinkButton").linkbutton({
|
|
|
onClick: function () {
|
|
|
$('#brandStatus').combobox('clear');
|
|
|
var param = {};
|
|
|
brandMyDatagrid.myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 提取出搜索参数
|
|
|
*/
|
|
|
function getParams() {
|
|
|
var brandName = $('#brandName').val();
|
|
|
var status = $('#brandStatus').combobox('getValue');
|
|
|
|
|
|
var param = {};
|
|
|
if (undefined !== brandName && null !== brandName && "" !== brandName) {
|
|
|
param.brandName = brandName;
|
|
|
}
|
|
|
if (undefined !== status && null !== status && "" !== status) {
|
|
|
param.status = status;
|
|
|
}
|
|
|
return param;
|
|
|
}
|
|
|
|
|
|
|
|
|
function editRow(id) {
|
|
|
window.paramObject.id = id;
|
|
|
var div = $("<div>").appendTo($(document.body));
|
|
|
var title = "编辑品牌";
|
|
|
$(div).myDialog({
|
|
|
width: "475px",
|
|
|
height: "267px",
|
|
|
title: title,
|
|
|
href: contextPath + "/html/brandManage/editBrand.html",
|
|
|
queryParams: {
|
|
|
id: id
|
|
|
},
|
|
|
modal: true,
|
|
|
collapsible: true,
|
|
|
cache: false,
|
|
|
buttons: [{
|
|
|
id: "saveBtn",
|
|
|
text: "保存",
|
|
|
handler: function () {
|
|
|
$("#consult_reply_form").form("submit", {
|
|
|
url: contextPath + "/operations/consult/reply",
|
|
|
onSubmit: function () {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
return true;
|
|
|
},
|
|
|
success: function (data) {
|
|
|
$.messager.progress("close");
|
|
|
data = JSON.parse(data);
|
|
|
if (data.code == 200) {
|
|
|
$(div).dialog("close");
|
|
|
$("#brandTable").myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: title + "成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
function deleteRow(id) {
|
|
|
if (undefined === id || null === id || "" === id) {
|
|
|
$.messager.alert("提示消息", "请选择要删除的咨询!");
|
|
|
return;
|
|
|
}
|
|
|
$.messager.confirm("确认", "确认要删除该咨询吗?", function (flag) {
|
|
|
if (flag) {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
$.post(contextPath + "/operations/consult/del?id=" + id, function (data) {
|
|
|
$.messager.progress("close");
|
|
|
if (data.code == 200) {
|
|
|
$("#brandTable").myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "删除成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function restoreRow(id) {
|
|
|
if (undefined === id || null === id || "" === id) {
|
|
|
$.messager.alert("提示消息", "请选择要恢复的咨询!");
|
|
|
return;
|
|
|
}
|
|
|
$.messager.confirm("确认", "确认要恢复该咨询吗?", function (flag) {
|
|
|
if (flag) {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
$.post(contextPath + "/operations/consult/restore?id=" + id, function (data) {
|
|
|
$.messager.progress("close");
|
|
|
if (data.code == 200) {
|
|
|
$("#brandTable").myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "恢复成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|