|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8" />
|
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/pfcms/js/include.js"></script>
|
|
|
<script src="/pfcms/js/ajaxfileupload.js"></script>
|
|
|
<style>
|
|
|
.btn-long {
|
|
|
width: 120px;
|
|
|
height: 37px;
|
|
|
line-height: 37px;
|
|
|
font-size: 15px;
|
|
|
color: white;
|
|
|
border-radius: 5px;
|
|
|
display: inline-block;
|
|
|
cursor: pointer;
|
|
|
text-align: center;
|
|
|
}
|
|
|
.btn-long:hover {
|
|
|
opacity: 0.9;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
</head>
|
|
|
<body class="easyui-layout" >
|
|
|
<div region="north" style="height: 200px;">
|
|
|
<script>
|
|
|
document.write(addHead('种草社区管理', '种草渠道管理'));
|
|
|
</script>
|
|
|
|
|
|
<div style="margin-left: 20px;margin-top: 10px">
|
|
|
|
|
|
<input class="easyui-textbox" id="labelNameParam" style="width: 140px">
|
|
|
|
|
|
</input>
|
|
|
|
|
|
<input class="easyui-combobox" id="statusParam" >
|
|
|
</input>
|
|
|
|
|
|
<a id="searchBtn" class="btn-info">查询</a>
|
|
|
<!--<a id="addActivityBtn" class="btn-success">新增</a>-->
|
|
|
<a id="allBtn" class="btn-info">全部</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div style="margin-left: 20px;margin-top: 10px">
|
|
|
<a id="addBtn" class="btn-long" style="background-color: #5CB85C;">+新建渠道</a>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div region="center" id="labelList" style="margin-left: 20px">
|
|
|
<table id="labelListTable"></table>
|
|
|
</div>
|
|
|
|
|
|
</body>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
$(function() {
|
|
|
//用于页面刷新后的数据行定位
|
|
|
var index ="";
|
|
|
$("#allBtn").linkbutton({
|
|
|
iconCls : "icon-search",
|
|
|
onClick : function() {
|
|
|
$("#labelListTable").datagrid("load", {});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#labelNameParam").textbox({
|
|
|
required:false,
|
|
|
prompt: "请输入渠道名称"
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#statusParam").combobox({
|
|
|
valueField : "value",
|
|
|
textField : "text",
|
|
|
required:false,
|
|
|
prompt: "请选择状态",
|
|
|
data:[{text:"请选择状态",value:""},{text:"开启",value:"1"},{text:"关闭",value:"0"}]
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#searchBtn").linkbutton({
|
|
|
iconCls : "icon-search",
|
|
|
onClick : function() {
|
|
|
$("#labelListTable").datagrid("load", {
|
|
|
channelName: $("#labelNameParam").textbox("getValue"),
|
|
|
status: $("#statusParam").combobox("getValue")
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#addBtn").click(function () {
|
|
|
getEditDialog(null);
|
|
|
});
|
|
|
|
|
|
|
|
|
// 检索按钮
|
|
|
$("#labelListTable").myDatagrid({
|
|
|
fit: true,
|
|
|
fitColumns: true,
|
|
|
striped: true,
|
|
|
/*queryParams: {
|
|
|
rewardName: $("#rewardName1").textbox("getValue"),
|
|
|
status: $("#rewardstatus1").combobox("getValue"),
|
|
|
type: $("#rewardtype1").combobox("getValue")
|
|
|
},*/
|
|
|
url: serverContextPath + "/grassChannelManage/getGrassChannelList",
|
|
|
method: 'POST',
|
|
|
loadFilter: function (data) {
|
|
|
var tmp = defaultLoadFilter(data);
|
|
|
tmp.rows = tmp.list;
|
|
|
return tmp;
|
|
|
},
|
|
|
columns: [[
|
|
|
{
|
|
|
title: "ID",
|
|
|
field: "id",
|
|
|
width: 15,
|
|
|
align: "center"
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "渠道名称",
|
|
|
field: "channelName",
|
|
|
width: 30,
|
|
|
align: "left"
|
|
|
},
|
|
|
{
|
|
|
title: "状态",
|
|
|
field: "status",
|
|
|
width: 25,
|
|
|
align: "left",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
if(value == '0'){
|
|
|
return "关闭";
|
|
|
}
|
|
|
if(value == '1'){
|
|
|
return "开启";
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: "操作",
|
|
|
field: "ddg",
|
|
|
width: 40,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var str = "<a role='edit' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #31b0d5' index='"+ rowIndex +"'>编辑</a>";
|
|
|
return str;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
]],
|
|
|
cache: false,
|
|
|
pagination: true,
|
|
|
pageSize: 10,
|
|
|
pageList: [10],
|
|
|
idField: "id",
|
|
|
singleSelect: true,
|
|
|
onLoadSuccess: function (data) {
|
|
|
|
|
|
if(index != ""){
|
|
|
$(this).datagrid("scrollTo",index);
|
|
|
index = "";
|
|
|
}
|
|
|
$(this).datagrid("getPanel").find("a[role='close']").linkbutton({
|
|
|
iconCls: "icon-redo",
|
|
|
onClick: function () {
|
|
|
var close_id = $(this).attr("dataId");
|
|
|
index = $(this).attr("index");
|
|
|
$.messager.confirm("确认", "确认删除该渠道吗?", function (flag) {
|
|
|
if(flag){
|
|
|
$.post(serverContextPath + "/grassChannelManage/deleteGrassChannel", {
|
|
|
id : close_id
|
|
|
}, function(data) {
|
|
|
if (data.code == CODE_SUCCESS) {
|
|
|
$("#labelListTable").datagrid("reload");
|
|
|
window.self.$.messager.show({
|
|
|
title : "提示",
|
|
|
msg : "删除成功!"
|
|
|
});
|
|
|
} else {
|
|
|
window.self.$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// 编辑
|
|
|
$(this).datagrid("getPanel").find("a[role='edit']").linkbutton({
|
|
|
iconCls : "icon-edit",
|
|
|
onClick : function() {
|
|
|
|
|
|
index = $(this).attr("index");
|
|
|
var row = $("#labelListTable").datagrid('getData').rows[index];
|
|
|
getEditDialog(row);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// 编辑分组
|
|
|
function getEditDialog(data){
|
|
|
var labelList = $("<div id='labelList'>").appendTo($(document.body));
|
|
|
var title = data == null ? "新建渠道":"修改渠道";
|
|
|
var textVar = data == null ? "保存":"保存";
|
|
|
|
|
|
window.self.paramObject.mkData = data;
|
|
|
$(labelList).myDialog({
|
|
|
title: title,
|
|
|
width: "70%",
|
|
|
height: "80%",
|
|
|
resizable:false,
|
|
|
buttons:[{
|
|
|
id : "saveBtn",
|
|
|
text:textVar,
|
|
|
iconCls : "icon-save",
|
|
|
handler:function(){
|
|
|
|
|
|
|
|
|
$("#activityAddForm").form("submit", {
|
|
|
url: serverContextPath + "/grassChannelManage/addUpGrassChannel",
|
|
|
onSubmit: function (param) {
|
|
|
if(data != null){
|
|
|
param.id = data.id;
|
|
|
}
|
|
|
|
|
|
if (!$("#activityAddForm").form("validate")) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后..."
|
|
|
});
|
|
|
return true;
|
|
|
},
|
|
|
success: function (data) {
|
|
|
$.messager.progress("close");
|
|
|
data = JSON.parse(data);
|
|
|
if (data.code == 200) {
|
|
|
$(labelList).dialog("close");
|
|
|
$("#labelListTable").datagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: title + "成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", "操作失败", "error");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}, {
|
|
|
text: "关闭",
|
|
|
iconCls: "icon-cancel",
|
|
|
handler: function () {
|
|
|
$.messager.confirm("确认", "确认关闭吗?", function (flag) {
|
|
|
if(flag){
|
|
|
$(labelList).dialog("close");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}],
|
|
|
modal: true,
|
|
|
href: contextPath + "/html/grass/channelManage/channelEdit.html"
|
|
|
});
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|