| | |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TAgentInfoDlg = { |
| | | tAgentInfoData : {} |
| | | tAgentInfoData : {}, |
| | | validateFields: { |
| | | principal: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '负责人姓名不能为空' |
| | | } |
| | | } |
| | | }, |
| | | principalPhone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '联系电话不能为空' |
| | | } |
| | | } |
| | | }, |
| | | area: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择代理区域' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TAgentInfoDlg.validate = function () { |
| | | $('#tAgentInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#tAgentInfoForm').bootstrapValidator('validate'); |
| | | return $("#tAgentInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/add", function(data){ |
| | | if(data.code == 500){ |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgent/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | Feng.initValidator("tAgentInfoForm", TAgentInfoDlg.validateFields); |
| | | }); |