/**
|
* 初始化开发票列表详情对话框
|
*/
|
var TInvoiceInfoDlg = {
|
tInvoiceInfoData : {}
|
};
|
|
/**
|
* 清除数据
|
*/
|
TInvoiceInfoDlg.clearData = function() {
|
this.tInvoiceInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TInvoiceInfoDlg.set = function(key, val) {
|
this.tInvoiceInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TInvoiceInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
TInvoiceInfoDlg.close = function() {
|
parent.layer.close(window.parent.TInvoice.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
TInvoiceInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('money')
|
.set('orderNum')
|
.set('type')
|
.set('name')
|
.set('code')
|
.set('content')
|
.set('remark')
|
.set('address')
|
.set('bank')
|
.set('email')
|
.set('userId')
|
.set('state')
|
.set('insertTime');
|
}
|
|
/**
|
* 提交添加
|
*/
|
TInvoiceInfoDlg.addSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tInvoice/add", function(data){
|
Feng.success("添加成功!");
|
window.parent.TInvoice.table.refresh();
|
TInvoiceInfoDlg.close();
|
},function(data){
|
Feng.error("添加失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tInvoiceInfoData);
|
ajax.start();
|
}
|
|
/**
|
* 提交修改
|
*/
|
TInvoiceInfoDlg.editSubmit = function() {
|
|
this.clearData();
|
this.collectData();
|
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tInvoice/update", function(data){
|
Feng.success("修改成功!");
|
window.parent.TInvoice.table.refresh();
|
TInvoiceInfoDlg.close();
|
},function(data){
|
Feng.error("修改失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set(this.tInvoiceInfoData);
|
ajax.start();
|
}
|
|
$(function() {
|
|
});
|