/**
|
* 初始化投诉管理详情对话框
|
*/
|
var AppComplaintsInfoDlg = {
|
appComplaintsInfoData : {}
|
};
|
|
/**
|
* 清除数据
|
*/
|
AppComplaintsInfoDlg.clearData = function() {
|
this.appComplaintsInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
AppComplaintsInfoDlg.set = function(key, val) {
|
this.appComplaintsInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
AppComplaintsInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
AppComplaintsInfoDlg.close = function() {
|
parent.layer.close(window.parent.AppComplaints.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
AppComplaintsInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('addTime')
|
.set('userId')
|
.set('content')
|
.set('reMark')
|
.set('phone');
|
}
|
|
/**
|
* 提交添加
|
*/
|
AppComplaintsInfoDlg.addSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
if($("#phone").val()==null || $("#phone").val()==''){
|
Feng.info("请输入手机号");
|
return ;
|
}
|
if($("#content").val()==null || $("#content").val()==''){
|
Feng.info("请输入内容");
|
return ;
|
}
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/appComplaints/add", function(data){
|
if(data=="1"){
|
Feng.info("该手机号没有注册");
|
return;
|
}
|
Feng.success("添加成功!");
|
window.parent.AppComplaints.table.refresh();
|
AppComplaintsInfoDlg.close();
|
},function(data){
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.appComplaintsInfoData);
|
ajax.start();
|
}
|
|
/**
|
* 提交修改
|
*/
|
AppComplaintsInfoDlg.editSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/appComplaints/update", function(data){
|
Feng.success("修改成功!");
|
window.parent.AppComplaints.table.refresh();
|
AppComplaintsInfoDlg.close();
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.appComplaintsInfoData);
|
ajax.start();
|
}
|
|
$(function() {
|
|
});
|