/**
|
* 初始化投诉列表详情对话框
|
*/
|
var TComplaintInfoDlg = {
|
tComplaintInfoData : {},
|
validateFields: {
|
handleResult: {
|
validators: {
|
notEmpty: {
|
message: '备注不能为空'
|
}/*,
|
regexp: {
|
regexp: /^.{1,500}$/,
|
message: '备注不能超过500个长度'
|
}*/
|
}
|
},
|
}
|
};
|
|
/**
|
* 验证数据是否为空
|
*/
|
TComplaintInfoDlg.validate = function () {
|
$('#complaintFormInfo').data("bootstrapValidator").resetForm();
|
$('#complaintFormInfo').bootstrapValidator('validate');
|
return $("#complaintFormInfo").data('bootstrapValidator').isValid();
|
};
|
|
/**
|
* 清除数据
|
*/
|
TComplaintInfoDlg.clearData = function() {
|
this.tComplaintInfoData = {};
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TComplaintInfoDlg.set = function(key, val) {
|
this.tComplaintInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
|
return this;
|
}
|
|
/**
|
* 设置对话框中的数据
|
*
|
* @param key 数据的名称
|
* @param val 数据的具体值
|
*/
|
TComplaintInfoDlg.get = function(key) {
|
return $("#" + key).val();
|
}
|
|
/**
|
* 关闭此对话框
|
*/
|
TComplaintInfoDlg.close = function() {
|
parent.layer.close(window.parent.TComplaint.layerIndex);
|
}
|
|
/**
|
* 收集数据
|
*/
|
TComplaintInfoDlg.collectData = function() {
|
this
|
.set('id')
|
.set('userId')
|
.set('reason')
|
.set('driverId')
|
.set('description')
|
.set('isHandle')
|
.set('insertTime')
|
.set('handleResult')
|
.set('handleUserId');
|
}
|
|
/**
|
* 立即处理
|
*/
|
TComplaintInfoDlg.immediately = function() {
|
|
this.clearData();
|
this.collectData();
|
if(!this.validate()){
|
return ;
|
}
|
var handleResult = $("#handleResult").val();
|
if (handleResult.length > 500){
|
Feng.info("备注不能超过500个字");
|
return;
|
}
|
//提交信息
|
var ajax = new $ax(Feng.ctxPath + "/tComplaint/immediately", function(data){
|
Feng.success("处理成功!");
|
window.parent.TComplaint.table.refresh();
|
TComplaintInfoDlg.close();
|
},function(data){
|
Feng.error("处理失败!" + data.responseJSON.message + "!");
|
});
|
ajax.set("id",$("#id").val());
|
ajax.set("handleResult",$("#handleResult").val());
|
ajax.start();
|
}
|
|
$(function() {
|
Feng.initValidator("complaintFormInfo", TComplaintInfoDlg.validateFields);
|
});
|