/**
|
* 初始化用户端协议管理详情对话框
|
*/
|
var TAgreementInfoDlg = {
|
tAgreementInfoData : {}
|
};
|
|
/**
|
* 清除数据
|
*/
|
TAgreementInfoDlg.clearData = function() {
|
this.tAgreementInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TAgreementInfoDlg.set = function(key, val) {
|
this.tAgreementInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TAgreementInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
TAgreementInfoDlg.close = function() {
|
parent.layer.close(window.parent.TAgreement.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
TAgreementInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('use')
|
.set('content')
|
.set('type')
|
.set('flag')
|
.set('insertTime')
|
.set('insertUser')
|
.set('updateTime')
|
.set('updateUser');
|
}
|
|
/**
|
* 提交添加
|
*/
|
TAgreementInfoDlg.addSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tAgreement/add", function(data){
|
Feng.success("添加成功!");
|
window.parent.TAgreement.table.refresh();
|
TAgreementInfoDlg.close();
|
},function(data){
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tAgreementInfoData);
|
ajax.start();
|
}
|
|
/**
|
* 提交修改
|
*/
|
TAgreementInfoDlg.editSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tAgreement/update", function(data){
|
Feng.success("修改成功!");
|
window.parent.TAgreement.table.refresh();
|
TAgreementInfoDlg.close();
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tAgreementInfoData);
|
ajax.start();
|
}
|
|
$(function() {
|
|
});
|