| /** | 
|  * 初始化反馈管理详情对话框 | 
|  */ | 
| var language =$("#language").val() | 
| var TFeedbackInfoDlg = { | 
|     tFeedbackInfoData : {}, | 
|     validateFields: { | 
|         remark: { | 
|             validators: { | 
|                 notEmpty: { | 
|                     message:language==1?'备注不能为空':(language==2?"Remarks cannot be empty":"Keterangan tidak bisa kosong") | 
|                 }/*, | 
|                 regexp: { | 
|                     regexp: /^.{1,500}$/, | 
|                     message: '备注不能超过500个长度' | 
|                 }*/ | 
|             } | 
|         }, | 
|     } | 
| }; | 
|   | 
| /** | 
|  * 验证数据是否为空 | 
|  */ | 
| TFeedbackInfoDlg.validate = function () { | 
|     $('#feedbackInfoForm').data("bootstrapValidator").resetForm(); | 
|     $('#feedbackInfoForm').bootstrapValidator('validate'); | 
|     return $("#feedbackInfoForm").data('bootstrapValidator').isValid(); | 
| }; | 
|   | 
| /** | 
|  * 清除数据 | 
|  */ | 
| TFeedbackInfoDlg.clearData = function() { | 
|     this.tFeedbackInfoData = {}; | 
| } | 
|   | 
| /** | 
|  * 设置对话框中的数据 | 
|  * | 
|  * @param key 数据的名称 | 
|  * @param val 数据的具体值 | 
|  */ | 
| TFeedbackInfoDlg.set = function(key, val) { | 
|     this.tFeedbackInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; | 
|     return this; | 
| } | 
|   | 
| /** | 
|  * 设置对话框中的数据 | 
|  * | 
|  * @param key 数据的名称 | 
|  * @param val 数据的具体值 | 
|  */ | 
| TFeedbackInfoDlg.get = function(key) { | 
|     return $("#" + key).val(); | 
| } | 
|   | 
| /** | 
|  * 关闭此对话框 | 
|  */ | 
| TFeedbackInfoDlg.close = function() { | 
|     var type = $("#type").val(); | 
|     if (2 == type){ | 
|         parent.layer.close(window.parent.TFeedback.layerIndex); | 
|     }else if (1 == type){ | 
|         parent.layer.close(window.parent.TUserFeedback.layerIndex); | 
|     } | 
| } | 
|   | 
| /** | 
|  * 收集数据 | 
|  */ | 
| TFeedbackInfoDlg.collectData = function() { | 
|     this | 
|     .set('id') | 
|     .set('userId') | 
|     .set('handleUserId') | 
|     .set('content') | 
|     .set('insertTime') | 
|     .set('imgUrl') | 
|     .set('flag') | 
|     .set('state') | 
|     .set('cldate') | 
|     .set('remark') | 
|     .set('type'); | 
| } | 
|   | 
| /** | 
|  * 立即处理 | 
|  */ | 
| TFeedbackInfoDlg.immediately = function() { | 
|   | 
|     this.clearData(); | 
|     this.collectData(); | 
|     if(!this.validate()){ | 
|         return ; | 
|     } | 
|     var remark = $("#remark").val(); | 
|     if (remark.length > 500){ | 
|         if(language==1){ | 
|             Feng.info("备注不能超过500个字"); | 
|         }else if(language==2){ | 
|             Feng.info("Remarks should not exceed 500 words"); | 
|         }else { | 
|             Feng.info("Perhatian seharusnya tidak melebihi 500 kata"); | 
|         } | 
|         return; | 
|     } | 
|     //提交信息 | 
|     var ajax = new $ax(Feng.ctxPath + "/tFeedback/immediately", function(data){ | 
|         if(language==1){ | 
|             Feng.success("操作成功!"); | 
|         }else if(language==2){ | 
|             Feng.success("Operate successfully!"); | 
|         }else { | 
|             Feng.success("Operasi berhasil!"); | 
|         } | 
|         var type = $("#type").val(); | 
|         if (2 == type){ | 
|             window.parent.TFeedback.table.refresh(); | 
|         }else if (1 == type){ | 
|             window.parent.TUserFeedback.table.refresh(); | 
|         } | 
|         TFeedbackInfoDlg.close(); | 
|     },function(data){ | 
|         if(language==1){ | 
|             Feng.error("操作失败!" + data.responseJSON.message + "!"); | 
|         }else if(language==2){ | 
|             Feng.error("Fail!" + data.responseJSON.message + "!"); | 
|         }else { | 
|             Feng.error("Gagal!" + data.responseJSON.message + "!"); | 
|         } | 
|     }); | 
|     ajax.set("id",$("#id").val()); | 
|     ajax.set("remark",$("#remark").val()); | 
|     ajax.start(); | 
| } | 
|   | 
| $(function() { | 
|     Feng.initValidator("feedbackInfoForm", TFeedbackInfoDlg.validateFields); | 
| }); |