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.js |  123 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 107 insertions(+), 16 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js
index 14fbd63..5251cd8 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite.js
@@ -23,7 +23,7 @@
         {field: 'selectItem', checkbox: true},
         {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'},
         {
-            title: '所属运营商', field: 'operator', visible: true, align: 'center', valign: 'middle',
+            title: '所属运营商', field: 'operator', visible: objectType==3?false:true, align: 'center', valign: 'middle',
             formatter: function(value, row, index) {
                 if (!value || value.trim() === '' || value.trim() === 0) {
                     return '平台';
@@ -170,18 +170,30 @@
     ajax.start();
 };
 TSite.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 oneId;
+
+    var checkbox = document.querySelector('input[name="pt"]');
+    if (checkbox.checked) {
+        oneId=0;
+        console.log("选中是平台");
+    } else {
+        oneId = $("#yys").val();
+        console.log("运营商");
     }
     var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){
         if(data!=null){
+            // var content1 = '<option value="0">平台</option>';
+            if (oneId == 0) {
+                console.log("锁住")
+                $("#yys").prop('disabled', true);
+            }else{
+                console.log("放开")
+                $("#yys").prop('disabled', false);
+            }
+
+            console.log("看看返回数据")
+            console.log(data)
             var content='<option value="">选择门店</option>';
             $.each(data, function(k,v) {
                 content += "<option value='"+v.id+"'>"+v.name+"</option>";
@@ -189,8 +201,20 @@
             $("#store").empty().append(content);
         }
     });
+
+    if (typeof(oneId) == "undefined"){
+        console.log("===============")
+        oneId = $("#yys").val()
+        var button = document.getElementById("yys");
+        button.removeAttribute("disabled");
+
+    }
+
     ajax.set("oneId",oneId);
     ajax.start();
+
+
+
 };
 // 场地管理首页 选择对应的省市
 // 传1是场地管理首页 传2是场地管理添加页面
@@ -418,6 +442,7 @@
         halfName:"",
         introduce:"",
         imgs:"",
+        introduce:"",
         ids:""
     };
     data.province            = $("#pCode").val()
@@ -441,6 +466,66 @@
 
 
     console.log(data.typeName)
+
+
+    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) {
@@ -511,9 +596,10 @@
 
     data.halfName= halfName;
     data.ids= $("#ids").val();
-    let introduce  = TSite.editor.getContent();
-
-
+    let introduce ;
+    if (objectType==1){
+       introduce  = TSite.editor.getContent();
+    }
 
     console.log(introduce)
     if(introduce==""){
@@ -524,10 +610,13 @@
 
 
     var goodImgs = this.goodsPicArray;
-    if(goodImgs.length==0){
-        Feng.info("请上传实景图")
-        return;
+    if(objectType==1){
+        if(goodImgs.length==0){
+            Feng.info("请上传实景图")
+            return;
+        }
     }
+
     var imgOne ="";
     for (let i = 0; i <goodImgs.length; i++) {
         if(i==goodImgs.length-1){
@@ -675,6 +764,7 @@
     // 门店名称
     queryData['storeName'] = $("#storeName").val();
     queryData['opId'] = $("#opId").val();
+    queryData['storeName'] = $("#storeName").val();
 
     TSite.table.refresh({query: queryData});
 };
@@ -689,6 +779,7 @@
     $("#name").val("");
     $("#insuranceEndTime").val("");
     $("#opId").val("");
+    $("#storeName").val("");
     TSite.search();
 };
 

--
Gitblit v1.7.1