|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="UTF-8"/>
|
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/union/js/include.js"></script>
|
|
|
<script src="/union/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="maxSortCombobox">
|
|
|
<input id="middleSortCombobox">
|
|
|
<input id="smallSortCombobox">
|
|
|
<input id="brandCombobox">
|
|
|
<input id="keyTypeCombobox" class="easyui-combobox" value="1" data-options="
|
|
|
valueField: 'id',
|
|
|
editable: false,
|
|
|
textField: 'text',
|
|
|
data: [{
|
|
|
id: '1',
|
|
|
text: '咨询内容'
|
|
|
}, {
|
|
|
id: '2',
|
|
|
text: '回复者ID'
|
|
|
}, {
|
|
|
id: '3',
|
|
|
text: 'SKN'
|
|
|
}, {
|
|
|
id: '4',
|
|
|
text: '用户ID'
|
|
|
}]"/>
|
|
|
<input id="keywordTextbox" class="easyui-textbox"/>
|
|
|
<input id="isReplyCombobox" class="easyui-combobox" value="1" data-options="
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{
|
|
|
id: '1',
|
|
|
text: '已回复'
|
|
|
}, {
|
|
|
id: '2',
|
|
|
text: '未回复'
|
|
|
}]"/>
|
|
|
<input id="isDeleteCombobox" class="easyui-combobox" value="1" data-options="
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{
|
|
|
id: '1',
|
|
|
text: '未删除'
|
|
|
}, {
|
|
|
id: '0',
|
|
|
text: '已删除'
|
|
|
}]"/>
|
|
|
<input id="answerStartDatetimebox" type="text">
|
|
|
<input id="answerEndDatetimebox" type="text">
|
|
|
<input id="askStartDatetimebox" type="text">
|
|
|
<input id="askEndDatetimebox" type="text">
|
|
|
<a id="searchLinkbutton" class="easyui-linkbutton btn-info" data-options="iconCls:'icon-search'">搜索</a>
|
|
|
<a id="exportLinkbutton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">导出</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div region="center">
|
|
|
<div style="margin-left: 30px;margin-top: 20px;">
|
|
|
<a id="batchDelLinkbutton" style="padding: 5px" class="easyui-linkbutton btn-danger"
|
|
|
data-options="iconCls:'icon-edit'">批量删除</a>
|
|
|
<div style="margin-right:10px;float: right">
|
|
|
<label for="uidTextbox">输入用户UID:</label>
|
|
|
<input id="uidTextbox" class="easyui-textbox" name="uidTextbox"/>
|
|
|
<a id="delByUidLinkbutton" style="padding: 5px;" class="easyui-linkbutton btn-danger"
|
|
|
data-options="iconCls:'icon-edit'">删除</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="margin-left: 30px;margin-top: 20px;height: 660px">
|
|
|
<table id="consultTable"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
$(function () {
|
|
|
// combobox 下拉框初始化:productSort 物理分类;brand 品牌
|
|
|
var sortComboboxUrl = contextPath + "/product/queryPSListByParentIdWhenStatusGet?param=";
|
|
|
var brandComboboxReloadUrl = contextPath + "/product/brandSort/getBrandListBySort";
|
|
|
var mxSortCombobox = $("#maxSortCombobox");
|
|
|
var mdSortCombobox = $("#middleSortCombobox");
|
|
|
var smSortCombobox = $("#smallSortCombobox");
|
|
|
var brandCombobox = $("#brandCombobox");
|
|
|
/**
|
|
|
* maxSort
|
|
|
*/
|
|
|
mxSortCombobox.combobox({
|
|
|
url: sortComboboxUrl + "0",
|
|
|
method: "get",
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "请选择分类"});
|
|
|
return data;
|
|
|
},
|
|
|
onSelect: function (rec) {
|
|
|
if (0 === rec.id) {
|
|
|
try {
|
|
|
mdSortCombobox.combobox('disable');
|
|
|
mdSortCombobox.combobox('setValue', '0');
|
|
|
smSortCombobox.combobox('disable');
|
|
|
smSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) { }
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
mdSortCombobox.combobox('reload', sortComboboxUrl + rec.id);
|
|
|
mdSortCombobox.combobox('enable');
|
|
|
mdSortCombobox.combobox('setValue', '0');
|
|
|
smSortCombobox.combobox('disable');
|
|
|
smSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) { }
|
|
|
}
|
|
|
});
|
|
|
/**
|
|
|
* middleSort
|
|
|
*/
|
|
|
mdSortCombobox.combobox({
|
|
|
method: "get",
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{ text: '请选择分类', id: '0'}],
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "请选择分类"});
|
|
|
return data;
|
|
|
},
|
|
|
onSelect: function (rec) {
|
|
|
if (0 === rec.id) {
|
|
|
try {
|
|
|
smSortCombobox.combobox('disable');
|
|
|
smSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) { }
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
smSortCombobox.combobox('reload', sortComboboxUrl + rec.id);
|
|
|
smSortCombobox.combobox('enable');
|
|
|
smSortCombobox.combobox('setValue', '0');
|
|
|
} catch (e) { }
|
|
|
}
|
|
|
});
|
|
|
mdSortCombobox.combobox('disable');
|
|
|
/**
|
|
|
* smallSort
|
|
|
*/
|
|
|
smSortCombobox.combobox({
|
|
|
method: "get",
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
data: [{ text: '请选择分类', id: '0'}],
|
|
|
loadFilter: function (data) {
|
|
|
data = defaultLoadFilter(data);
|
|
|
data.unshift({id: 0, text: "请选择分类"});
|
|
|
return data;
|
|
|
},
|
|
|
onSelect: function (rec) {
|
|
|
var mxSortId = mxSortCombobox.combobox('getValue');
|
|
|
var mdSortId = mdSortCombobox.combobox('getValue');
|
|
|
var smSortId = rec.id;
|
|
|
if (!(0 < mxSortId && 0 < mdSortId && 0 < smSortId)) {
|
|
|
return;
|
|
|
}
|
|
|
// brandCombobox.combobox("reload", brandComboboxReloadUrl + "?maxSortId=" + mxSortId + "&middleSortId=" + mdSortId + "&smallSortId=" + smSortId);
|
|
|
}
|
|
|
});
|
|
|
smSortCombobox.combobox('disable');
|
|
|
/**
|
|
|
* brand
|
|
|
*/
|
|
|
var brandDataObj = {};
|
|
|
brandCombobox.myCombobox({
|
|
|
editable: false,
|
|
|
valueField: 'id',
|
|
|
textField: 'text',
|
|
|
url: contextPath + "/erpproduct/brands/getAllBrands",
|
|
|
loadFilter: function (data) {
|
|
|
var brandData = defaultLoadFilter(data);
|
|
|
if ([] == brandData) {
|
|
|
return brandCombobox.combobox("getData");
|
|
|
}
|
|
|
brandData.unshift({id: 0, text: "请选择品牌"});
|
|
|
// 过滤掉 text 为空的
|
|
|
var array = new Array();
|
|
|
for (var i in brandData) {
|
|
|
if (brandData[i].text){
|
|
|
array.push(brandData[i]);
|
|
|
}
|
|
|
brandDataObj[brandData[i].id] = brandData[i].text;
|
|
|
}
|
|
|
return array;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
// textbox 输入框初始化
|
|
|
var keywordTextbox = $("#keywordTextbox");
|
|
|
/**
|
|
|
* keyword
|
|
|
*/
|
|
|
keywordTextbox.textbox({});
|
|
|
|
|
|
// datetimebox 日期时间框初始化
|
|
|
var ansStDatetimebox = $("#answerStartDatetimebox");
|
|
|
var ansEnDatetimebox = $("#answerEndDatetimebox");
|
|
|
var askStDatetimebox = $("#askStartDatetimebox");
|
|
|
var askEnDatetimebox = $("#askEndDatetimebox");
|
|
|
/**
|
|
|
* answerStart
|
|
|
*/
|
|
|
ansStDatetimebox.datetimebox({
|
|
|
editable: false,
|
|
|
prompt: "回复开始时间",
|
|
|
showSeconds: false
|
|
|
});
|
|
|
/**
|
|
|
* answerEnd
|
|
|
*/
|
|
|
ansEnDatetimebox.datetimebox({
|
|
|
editable: false,
|
|
|
prompt: "回复结束时间",
|
|
|
showSeconds: false
|
|
|
});
|
|
|
/**
|
|
|
* askStart
|
|
|
*/
|
|
|
askStDatetimebox.datetimebox({
|
|
|
editable: false,
|
|
|
prompt: "咨询开始时间",
|
|
|
showSeconds: false
|
|
|
});
|
|
|
/**
|
|
|
* askEnd
|
|
|
*/
|
|
|
askEnDatetimebox.datetimebox({
|
|
|
editable: false,
|
|
|
prompt: "咨询结束时间",
|
|
|
showSeconds: false
|
|
|
});
|
|
|
|
|
|
// 咨询列表
|
|
|
var consultMyDatagrid = $("#consultTable");
|
|
|
consultMyDatagrid.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: "全选",
|
|
|
field: "first",
|
|
|
width: 10,
|
|
|
align: "center",
|
|
|
checkbox: true
|
|
|
}, {
|
|
|
title: "ID",
|
|
|
field: "id",
|
|
|
width: 40,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "用户名(uid)",
|
|
|
field: "second",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return rowData.askUserName + "(" + rowData.askUserId + ")";
|
|
|
}
|
|
|
}, {
|
|
|
title: "商品名称",
|
|
|
field: "third",
|
|
|
width: 100,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return rowData.productName + "<br>SKN:" + rowData.skn + "<br>品牌:" + brandDataObj[rowData.brandId];
|
|
|
}
|
|
|
}, {
|
|
|
title: "分类名称",
|
|
|
field: "forth",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return "大类:" + rowData.maxSortName + "<br>中类:" + rowData.middleSortName + "<br>小类:" + rowData.smallSortName;
|
|
|
}
|
|
|
}, {
|
|
|
title: "咨询内容",
|
|
|
field: "ask",
|
|
|
width: 170,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "回答人(pid)",
|
|
|
field: "fifth",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
return rowData.answerUserName + "(" + rowData.answerUserId + ")";
|
|
|
}
|
|
|
}, {
|
|
|
title: "回答内容",
|
|
|
field: "answer",
|
|
|
width: 170,
|
|
|
align: "center"
|
|
|
}, {
|
|
|
title: "咨询与回答时间",
|
|
|
field: "sixth",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
var str = "咨询:" + rowData.askTime;
|
|
|
if (undefined !== rowData.answerTime && null !== rowData.answerTime && "" !== rowData.answerTime) {
|
|
|
str += "<br>回复:" + rowData.answerTime;
|
|
|
}
|
|
|
return str;
|
|
|
}
|
|
|
}, {
|
|
|
title: "操作",
|
|
|
field: "seventh",
|
|
|
width: 80,
|
|
|
align: "center",
|
|
|
formatter: function (value, rowData) {
|
|
|
var str = "";
|
|
|
if (undefined === rowData.answer || null === rowData.answer || "" === rowData.answer) {
|
|
|
str += "<a role='edit' dataId='" + rowData.id + "' style='margin-left:10px'>回复</a>";
|
|
|
} else {
|
|
|
str += "<a role='edit' dataId='" + rowData.id + "' data-answer='"+rowData.answer+"' data-isProductDisplay='"+rowData.isProductDisplay+"' style='margin-left:10px'>修改</a>";
|
|
|
}
|
|
|
if (1 == rowData.status) {
|
|
|
str += "<a role='delete' dataId='" + rowData.id + "' style='margin-left:10px'>删除</a>";
|
|
|
} else {
|
|
|
str += "<a role='restore' 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");
|
|
|
var isDisplay = $(this).attr("data-isProductDisplay");
|
|
|
var answer = $(this).attr("data-answer");
|
|
|
editRow(id, answer, isDisplay);
|
|
|
}
|
|
|
});
|
|
|
$(this).myDatagrid("getPanel").find("a[role='delete']").linkbutton({
|
|
|
iconCls: "icon-more",
|
|
|
onClick: function () {
|
|
|
deleteRow($(this).attr("dataId"));
|
|
|
}
|
|
|
});
|
|
|
$(this).myDatagrid("getPanel").find("a[role='restore']").linkbutton({
|
|
|
iconCls: "icon-more",
|
|
|
onClick: function () {
|
|
|
restoreRow($(this).attr("dataId"));
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
// linkbutton点击事件注册
|
|
|
/**
|
|
|
* searchLinkbutton
|
|
|
*/
|
|
|
$("#searchLinkbutton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var param = getParams();
|
|
|
consultMyDatagrid.myDatagrid("load", param);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$("#exportLinkbutton").linkbutton({
|
|
|
onClick : function() {
|
|
|
var param = getParams();
|
|
|
|
|
|
window.open(contextPath + "/batch/export.do?queryConf="+JSON.stringify(param)+"&type=exportConsultServiceExport");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
/**
|
|
|
* 提取出搜索参数
|
|
|
*/
|
|
|
function getParams() {
|
|
|
var mxSortId = mxSortCombobox.combobox('getValue');
|
|
|
var mdSortId = mdSortCombobox.combobox('getValue');
|
|
|
var smSortId = smSortCombobox.combobox('getValue');
|
|
|
var brandId = brandCombobox.combobox('getValue');
|
|
|
var k_type = $("#keyTypeCombobox").combobox('getValue');
|
|
|
var keyword = keywordTextbox.textbox('getValue');
|
|
|
var isReply = $("#isReplyCombobox").combobox('getValue');
|
|
|
var isDelete = $("#isDeleteCombobox").combobox("getValue");
|
|
|
var answerStartTime = ansStDatetimebox.datetimebox('getValue');
|
|
|
var answerEndTime = ansEnDatetimebox.datetimebox('getValue');
|
|
|
var askStartTime = askStDatetimebox.datetimebox('getValue');
|
|
|
var askEndTime = askEnDatetimebox.datetimebox('getValue');
|
|
|
|
|
|
var param = {};
|
|
|
if (undefined !== mxSortId && null !== mxSortId && "" !== mxSortId) {
|
|
|
param.maxSortId = mxSortId;
|
|
|
}
|
|
|
if (undefined !== mdSortId && null !== mdSortId && "" !== mdSortId) {
|
|
|
param.middleSortId = mdSortId;
|
|
|
}
|
|
|
if (undefined !== smSortId && null !== smSortId && "" !== smSortId) {
|
|
|
param.smallSortId = smSortId;
|
|
|
}
|
|
|
if (undefined !== brandId && null !== brandId && "" !== brandId) {
|
|
|
param.brandId = brandId;
|
|
|
}
|
|
|
if (undefined !== k_type && null !== k_type && "" !== k_type) {
|
|
|
param.k_type = k_type;
|
|
|
}
|
|
|
if (undefined !== keyword && null !== keyword && "" !== keyword) {
|
|
|
param.keyword = keyword;
|
|
|
}
|
|
|
if (undefined !== isReply && null !== isReply && "" !== isReply) {
|
|
|
param.isReply = isReply;
|
|
|
}
|
|
|
if (undefined !== isDelete && null !== isDelete && "" !== isDelete) {
|
|
|
param.isDelete = isDelete;
|
|
|
}
|
|
|
if (undefined !== answerStartTime && null !== answerStartTime && "" !== answerStartTime) {
|
|
|
param.answerStartTime = answerStartTime;
|
|
|
}
|
|
|
if (undefined !== answerEndTime && null !== answerEndTime && "" !== answerEndTime) {
|
|
|
param.answerEndTime = answerEndTime;
|
|
|
}
|
|
|
if (undefined !== askStartTime && null !== askStartTime && "" !== askStartTime) {
|
|
|
param.askStartTime = askStartTime;
|
|
|
}
|
|
|
if (undefined !== askEndTime && null !== askEndTime && "" !== askEndTime) {
|
|
|
param.askEndTime = askEndTime;
|
|
|
}
|
|
|
return param;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* batchDelLinkbutton
|
|
|
*/
|
|
|
$("#batchDelLinkbutton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var rowDataArr = consultMyDatagrid.myDatagrid('getChecked');
|
|
|
if (undefined === rowDataArr || null === rowDataArr || 0 === rowDataArr.length) {
|
|
|
$.messager.alert("提示消息", "请选择要删除的咨询!");
|
|
|
return;
|
|
|
}
|
|
|
var idStr = "";
|
|
|
for (var i in rowDataArr) {
|
|
|
idStr += rowDataArr[i].id + ",";
|
|
|
}
|
|
|
idStr = idStr.substr(0, idStr.length - 1);
|
|
|
$.messager.confirm("确认", "确认要删除选中的咨询吗?", function (flag) {
|
|
|
if (flag) {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
$.post(contextPath + "/operations/consult/batchDel?id=" + idStr, function (data) {
|
|
|
$.messager.progress("close");
|
|
|
if (data.code == 200) {
|
|
|
consultMyDatagrid.myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "删除成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
/**
|
|
|
* delByUidLinkbutton
|
|
|
*/
|
|
|
$("#delByUidLinkbutton").linkbutton({
|
|
|
onClick: function () {
|
|
|
var uid = $("#uidTextbox").textbox('getValue');
|
|
|
if (undefined === uid || null === uid || "" === uid) {
|
|
|
$.messager.alert("提示消息", "请输入用户UID,再删除!");
|
|
|
return;
|
|
|
}
|
|
|
$.messager.confirm("确认", "确认要删除该用户所有的咨询吗?", function (flag) {
|
|
|
if (flag) {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
$.post(contextPath + "/operations/consult/delByUid?uid=" + uid, function (data) {
|
|
|
$.messager.progress("close");
|
|
|
if (data.code == 200) {
|
|
|
consultMyDatagrid.myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "删除成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
function editRow(id, answer, isDisplay) {
|
|
|
window.paramObject.id = id;
|
|
|
window.paramObject.answer = answer;
|
|
|
window.paramObject.isProductDisplay = isDisplay;
|
|
|
var div = $("<div>").appendTo($(document.body));
|
|
|
var title = "回答咨询内容";
|
|
|
$(div).myDialog({
|
|
|
width: "475px",
|
|
|
height: "267px",
|
|
|
title: title,
|
|
|
href: contextPath + "/html/operations/consult/reply.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 () {
|
|
|
// if (!$("#consult_reply_form").form("validate")) {
|
|
|
// return false;
|
|
|
// }
|
|
|
$.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");
|
|
|
$("#consultTable").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) {
|
|
|
$("#consultTable").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) {
|
|
|
$("#consultTable").myDatagrid("reload");
|
|
|
$.messager.show({
|
|
|
title: "提示",
|
|
|
msg: "恢复成功!",
|
|
|
height: 120
|
|
|
});
|
|
|
} else {
|
|
|
$.messager.alert("失败", data.message, "error");
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
</html> |
|
|
\ No newline at end of file |
...
|
...
|
|