From 640ff18d2d7f4be02ddb7f8f75e899f05545eb98 Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期一, 05 二月 2024 11:56:52 +0800 Subject: [PATCH] 更新bug修改 --- cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js | 248 ++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 220 insertions(+), 28 deletions(-) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js index b0b9dbc..f0cd5cd 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js @@ -5,7 +5,8 @@ var TSiteInfo = { layerIndex: -1, validateFields: { - } + }, + goodsPicArray:[], }; /** @@ -193,7 +194,17 @@ insuranceEndTime:"", name:"", insuranceImg:"", - managementPlan:"" + managementPlan:"", + operatorId:"", + typeName:"", + nextName:"", + ishalf:"", + cashPriceOne:"", + playPaiCoinOne:"", + halfName:"", + introduce:"", + imgs:"", + ids:"" }; data.province = $("#pCode").val() data.id = $("#id").val() @@ -209,23 +220,177 @@ data.name = $("#name").val() data.insuranceImg = $("#img").val() data.managementPlan = $('#courseVideo').val() + data.typeName = $('#siteTypeOne').val() var sh =data.appointmentStartTime.split(':')[0]; var sm =data.appointmentStartTime.split(':')[1]; var eh =data.appointmentEndTime.split(':')[0]; var em =data.appointmentEndTime.split(':')[1]; - if($("#pCode").val()==''){ - Feng.info("请选择省") + if (data.typeName === "智慧场地"){ + console.log("===========这是智慧球场") + + console.log("====="+data.appointmentStartTime) + + var value = data.appointmentStartTime; + var lastTwoDigits = value.slice(-2); + + if (lastTwoDigits === "00" || lastTwoDigits === "15" || lastTwoDigits === "30" || lastTwoDigits === "45") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.error("智慧场地的可预约时间段是15分钟的倍数") + return; + + } + + + var value1 = data.appointmentEndTime; + var lastTwoDigits1 = value1.slice(-2); + + if (lastTwoDigits1 === "00" || lastTwoDigits1 === "15" || lastTwoDigits1 === "30" || lastTwoDigits1 === "45") { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.error("智慧场地的可预约时间段是15分钟的倍数") + return; + + } + + + }else { + console.log("===========这是普通球场") + + console.log("====="+data.appointmentStartTime) + var value = data.appointmentStartTime; + var lastTwoDigits = value.slice(-2); + + if (lastTwoDigits === "00" || lastTwoDigits === "30" ) { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.info("普通场地可预约时间段需是30分钟的倍数") + return; + } + + + var value1 = data.appointmentEndTime; + var lastTwoDigits1 = value1.slice(-2); + + if (lastTwoDigits1 === "00"|| lastTwoDigits1 === "30" ) { + console.log("Last two digits are 00, 15, 30, or 45"); + } else { + Feng.info("普通场地可预约时间段需是30分钟的倍数") + return; + + } + + + + } + + + var SelectValue=""; + var getSelectValueMenbers = $("input[name='pt']:checked").each(function(j) { + if (j >= 0) { + SelectValue += $(this).val() + } + }); + if(SelectValue==''){ + let yys = $("#yys").val() + if(yys==""){ + Feng.info("请选择运营商") + return; + } + SelectValue= yys + } + data.operatorId= SelectValue; + + + + let num24 = $('input[name="name1"]'); + var nextName=""; + for (let i = 0; i < num24.length; i++) { + if($(num24[i]).val()==''){ + Feng.info("请填写场地名称") + return; + } + if(i==num24.length-1){ + nextName += $(num24[i]).val() + }else { + nextName += $(num24[i]).val()+"," + } + } + data.nextName= nextName; + + + var ishalf= $("input[name='ishalf']:checked").val(); + data.ishalf= ishalf; + var halfName=""; + if(ishalf==1){ + let cashPriceOne = $("#cashPriceOne").val() + if(cashPriceOne=='' ){ + Feng.info("请填写现金价格") + return; + } + data.cashPriceOne= cashPriceOne; + + let playPaiCoinOne = $("#playPaiCoinOne").val() + if(playPaiCoinOne=='' ){ + Feng.info("请填写玩湃币价格") + return; + } + + data.playPaiCoinOne= playPaiCoinOne; + let num2 = $('input[name="name2"]'); + for (let i = 0; i < num2.length; i++) { + if($(num2[i]).val()==''){ + Feng.info("请填写半场名称") + return; + } + if(i==num2.length-1){ + halfName += $(num2[i]).val() + }else { + halfName += $(num2[i]).val()+"," + } + } + } + + var objectType =$("#objectType").val() + data.halfName= halfName; + data.ids= $("#ids").val(); + if (objectType==1){ + introduce = TSiteInfo.editor.getContent(); + } + + console.log(introduce) + if(introduce==""){ + Feng.info("请输入公告内容") return; } - if($("#cCode").val()==''){ - Feng.info("请选择市") + data.introduce= introduce; + + + var goodImgs = TSiteInfo.goodsPicArray; + + if(goodImgs.length==0){ + Feng.info("请上传实景图") return; } - if($("#account").val()=='' ){ - Feng.info("请选择账号") - return; + var imgOne =""; + console.log(goodImgs) + console.log(goodImgs.length) + for (let i = 0; i <goodImgs.length; i++) { + console.log(goodImgs[i].response,11) + if(i==goodImgs.length-1){ + imgOne += (goodImgs[i].response) + }else { + imgOne+=(goodImgs[i].response+",") + } + } + console.log(imgOne) + data.imgs = imgOne + + + + if($("#store").val()=='' ){ Feng.info("请选择门店") return; @@ -334,6 +499,8 @@ data: JSON.stringify(data), contentType: "application/json", success: function (response) { + window.parent.TSite.table.refresh(); + TSiteInfo.close(); Feng.success("修改成功"); }, error: function (xhr, status, error) { @@ -349,6 +516,30 @@ }); }; + +TSiteInfo.oneChangeYys = function(e){ + var oneId=$(e).val(); + var SelectValue=""; + var getSelectValueMenbers = $("input[name='pt']:checked").each(function(j) { + if (j >= 0) { + SelectValue += $(this).val() + } + }); + if(SelectValue=='0' ){ + oneId=0 + } + var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){ + if(data!=null){ + var content='<option value="">选择门店</option>'; + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +}; /** * 关闭此对话框 */ @@ -359,26 +550,27 @@ $('#upFile').click(); } $(function () { + TSiteInfo.editor = UE.getEditor('editor'); // 限制分钟选项为 0 和 30 - var timeInputs = document.querySelectorAll('input[type="time"]'); - timeInputs.forEach(function(input) { - input.addEventListener('change', function() { - var selectedTime = input.value; - var hour = selectedTime.split(':')[0]; - var minute = selectedTime.split(':')[1]; - if (minute < 30 &&minute>0) { - minute = '30'; - } else if (minute >30) { - hour++; - minute = '00'; - if (hour<10){ - hour = '0'+hour; - } - } - input.value = hour + ':' + minute; - - }); - }); + // var timeInputs = document.querySelectorAll('input[type="time"]'); + // timeInputs.forEach(function(input) { + // input.addEventListener('change', function() { + // var selectedTime = input.value; + // var hour = selectedTime.split(':')[0]; + // var minute = selectedTime.split(':')[1]; + // if (minute < 30 &&minute>0) { + // minute = '30'; + // } else if (minute >30) { + // hour++; + // minute = '00'; + // if (hour<10){ + // hour = '0'+hour; + // } + // } + // input.value = hour + ':' + minute; + // + // }); + // }); Feng.initValidator("carInfoForm", TSiteInfo.validateFields); var carPhoto = new $WebUpload("img"); carPhoto.setUploadBarId("progressBar"); -- Gitblit v1.7.1