From cbeeaa361e7898509485d144a904fb36eea766e4 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 10 四月 2023 11:55:12 +0800 Subject: [PATCH] 修改日志存储 --- management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent_info.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 46 insertions(+), 2 deletions(-) diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent_info.js b/management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent_info.js index 3077a02..b0c4ab7 100644 --- a/management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent_info.js +++ b/management/guns-admin/src/main/webapp/static/modular/system/tAgent/tAgent_info.js @@ -2,7 +2,43 @@ * 初始化详情对话框 */ var TAgentInfoDlg = { - tAgentInfoData : {} + tAgentInfoData : {}, + validateFields: { + principal: { + validators: { + notEmpty: { + message: '负责人姓名不能为空' + } + } + }, + principalPhone: { + validators: { + notEmpty: { + message: '联系电话不能为空' + }, + regexp: { + regexp: /^1[3-9]\d{9}$/, + message: '请输入合法手机号' + } + } + }, + area: { + validators: { + notEmpty: { + message: '请选择代理区域' + } + } + }, + } +}; + +/** + * 验证数据是否为空 + */ +TAgentInfoDlg.validate = function () { + $('#tAgentInfoForm').data("bootstrapValidator").resetForm(); + $('#tAgentInfoForm').bootstrapValidator('validate'); + return $("#tAgentInfoForm").data('bootstrapValidator').isValid(); }; /** @@ -67,6 +103,10 @@ this.clearData(); this.collectData(); + if(!this.validate()){ + return ; + } + //提交信息 var ajax = new $ax(Feng.ctxPath + "/tAgent/add", function(data){ if(data.code == 500){ @@ -91,6 +131,10 @@ this.clearData(); this.collectData(); + if(!this.validate()){ + return ; + } + //提交信息 var ajax = new $ax(Feng.ctxPath + "/tAgent/update", function(data){ Feng.success("修改成功!"); @@ -104,5 +148,5 @@ } $(function() { - + Feng.initValidator("tAgentInfoForm", TAgentInfoDlg.validateFields); }); -- Gitblit v1.7.1