From 387f61d55a8e20bc772b026cba4f8c34dfce5665 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期三, 07 二月 2024 11:20:28 +0800 Subject: [PATCH] 更新代码 --- ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tAdvertisement/tAdvertisement_info.js | 92 +++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 83 insertions(+), 9 deletions(-) diff --git a/ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tAdvertisement/tAdvertisement_info.js b/ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tAdvertisement/tAdvertisement_info.js index 202cbe6..b1c0a76 100644 --- a/ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tAdvertisement/tAdvertisement_info.js +++ b/ManagementIGOTravel/guns-admin/src/main/webapp/static/modular/system/tAdvertisement/tAdvertisement_info.js @@ -19,7 +19,7 @@ } } }, - provinceCode: { + cityId: { validators: { notEmpty: { message: '请先选择所属城市' @@ -149,10 +149,28 @@ if(!this.validate()){ return ; } + var isJump = $('#isJump').val(); var imgUrl = $("#imgUrl").valueOf(); if ("" == imgUrl){ Feng.info("请上传广告图图片"); return; + } + if(1 == isJump){ + var jumpType = $('#jumpType').val(); + if('' == jumpType){ + Feng.info("请选择跳转类型"); + return; + } + var jumpUrl = $('#jumpUrl').val(); + if(1 == jumpType && '' == jumpUrl){ + Feng.info("请输入外部跳转链接"); + return; + } + var editor = TAdvertisementInfoDlg.editor.getContent(); + if(2 == jumpType && ('' == editor || typeof editor == "undefined")){ + Feng.info("请输入内部跳转内容"); + return; + } } //提交信息 var ajax = new $ax(Feng.ctxPath + "/tAdvertisement/add", function(data){ @@ -174,6 +192,10 @@ Feng.info("请输入广告标题"); return; } + if ("" == editor){ + Feng.info("请输入发送内容"); + return; + } var subArr=[]; $(".timeClass").each(function () { subArr.push({ @@ -188,10 +210,26 @@ }) }); var sendType = $("input[name='sendType']:checked").val(); + var sendType1 = $("input[name='sendType1']:checked").val(); console.log(sendType) - if(sendType==2 && subArr.length <= 0){ + console.log(sendType1) + if(null == sendType && null == sendType1){ + Feng.error("请选择发送对象"); + return; + } + if(null != sendType && sendType==2 && subArr.length <= 0){ Feng.error("请选择用户"); return; + } + if(null != sendType1 && sendType1==2 && subArr1.length <= 0){ + Feng.error("请选择司机"); + return; + } + if(null == sendType){ + subArr = null; + } + if(null == sendType1){ + subArr1 = null; } console.log(subArr) console.log(subArr1) @@ -203,8 +241,8 @@ },function(data){ Feng.error("添加失败!" + data.responseJSON.message + "!"); }); - ajax.set("userId",JSON.stringify(subArr)) - ajax.set("driverId",JSON.stringify(subArr1)) + ajax.set("userId", null == subArr ? '' : JSON.stringify(subArr)) + ajax.set("driverId", null == subArr1 ? '' : JSON.stringify(subArr1)) ajax.set("name",name) ajax.set("content",editor) ajax.start(); @@ -218,6 +256,10 @@ Feng.info("请输入通知标题"); return; } + if ("" == editor){ + Feng.info("请输入发送内容"); + return; + } var subArr=[]; $(".timeClass").each(function () { subArr.push({ @@ -232,13 +274,26 @@ }) }); var sendType = $("input[name='sendType']:checked").val(); + var sendType1 = $("input[name='sendType1']:checked").val(); console.log(sendType) - if(sendType==2 && subArr.length <= 0){ + if(null == sendType && null == sendType1){ + Feng.error("请选择发送对象"); + return; + } + if(null != sendType && sendType==2 && subArr.length <= 0){ Feng.error("请选择用户"); return; } - console.log(subArr) - console.log(subArr1) + if(null != sendType1 && sendType1==2 && subArr1.length <= 0){ + Feng.error("请选择司机"); + return; + } + if(null == sendType){ + subArr = null; + } + if(null == sendType1){ + subArr1 = null; + } //提交信息 var ajax = new $ax(Feng.ctxPath + "/tAdvertisement/addInfo1", function(data){ Feng.success("添加成功!"); @@ -247,8 +302,8 @@ },function(data){ Feng.error("添加失败!" + data.responseJSON.message + "!"); }); - ajax.set("userId",JSON.stringify(subArr)) - ajax.set("driverId",JSON.stringify(subArr1)) + ajax.set("userId", null == subArr ? '' : JSON.stringify(subArr)) + ajax.set("driverId", null == subArr1 ? '' : JSON.stringify(subArr1)) ajax.set("name",name) ajax.set("content",editor) ajax.start(); @@ -264,11 +319,30 @@ if(!this.validate()){ return ; } + var isJump = $('#isJump').val(); var imgUrl = $("#imgUrl").valueOf(); if ("" == imgUrl){ Feng.info("请上传广告图图片"); return; } + if(1 == isJump){ + var jumpType = $('#jumpType').val(); + if('' == jumpType){ + Feng.info("请选择跳转类型"); + return; + } + var jumpUrl = $('#jumpUrl').val(); + if(1 == jumpType && '' == jumpUrl){ + Feng.info("请输入外部跳转链接"); + return; + } + var editor = TAdvertisementInfoDlg.editor.getContent(); + if(2 == jumpType && ('' == editor || typeof editor == "undefined")){ + Feng.info("请输入内部跳转内容"); + return; + } + } + //提交信息 var ajax = new $ax(Feng.ctxPath + "/tAdvertisement/update", function(data){ Feng.success("修改成功!"); -- Gitblit v1.7.1