From 9089e411c7e1a428e47400644f2f79a0cb460f22 Mon Sep 17 00:00:00 2001
From: dshclm <3321914460@qq.com>
Date: Thu, 14 Nov 2024 17:08:20 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=A8=E7=A6=81=E7=94=A8?=
 =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8B=E6=8C=89=E9=92=AE=E6=98=BE=E7=A4=BA?=
 =?UTF-8?q?=E4=B8=8D=E6=B8=85=E6=99=B0=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 .../system/user/userApply/applyDetail.html    | 26 ++++++++++++++++++-
 .../user/userexamine/examinedetail.html       | 26 ++++++++++++++++++-
 2 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html b/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html
index f0ebe263..4a32fcfa 100644
--- a/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html
+++ b/ruoyi-admin/src/main/resources/templates/system/user/userApply/applyDetail.html
@@ -118,7 +118,7 @@
                     
                     
                         
                     
                 
@@ -277,7 +277,31 @@
             }
         });
     }
+    document.addEventListener('DOMContentLoaded', function () {
+        // 获取所有name为role的radio按钮
+        var radios = document.querySelectorAll('input[type="radio"]');
 
+        // 遍历所有radio按钮,找到初始选中的按钮并将其设置为可操作状态
+        radios.forEach(function (radio) {
+            if (radio.checked) {
+                radio.disabled = false;
+            }
+
+            // 为每个radio按钮添加点击事件监听器
+            radio.addEventListener('click', function () {
+                // 遍历所有radio按钮
+                radios.forEach(function (otherRadio) {
+                    // 如果不是当前点击的按钮且未被选中,则设置为禁用状态
+                    if (otherRadio!== this &&!otherRadio.checked) {
+                        otherRadio.disabled = true;
+                    } else {
+                        // 确保当前选中的按钮及未选中但之前被操作过的按钮为可用状态
+                        otherRadio.disabled = false;
+                    }
+                });
+            });
+        });
+    });
     $("input[name='birthday']").datetimepicker({
         format: "yyyy-mm-dd",
         minView: "month",
diff --git a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html
index cc3715f6..29f191df 100644
--- a/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html
+++ b/ruoyi-admin/src/main/resources/templates/system/user/userexamine/examinedetail.html
@@ -118,7 +118,7 @@
                     
                     
                         
                     
                 
@@ -374,7 +374,31 @@
         };
         $.modal.openOptions(options);
     }
+    document.addEventListener('DOMContentLoaded', function () {
+        // 获取所有name为role的radio按钮
+        var radios = document.querySelectorAll('input[type="radio"]');
 
+        // 遍历所有radio按钮,找到初始选中的按钮并将其设置为可操作状态
+        radios.forEach(function (radio) {
+            if (radio.checked) {
+                radio.disabled = false;
+            }
+
+            // 为每个radio按钮添加点击事件监听器
+            radio.addEventListener('click', function () {
+                // 遍历所有radio按钮
+                radios.forEach(function (otherRadio) {
+                    // 如果不是当前点击的按钮且未被选中,则设置为禁用状态
+                    if (otherRadio!== this &&!otherRadio.checked) {
+                        otherRadio.disabled = true;
+                    } else {
+                        // 确保当前选中的按钮及未选中但之前被操作过的按钮为可用状态
+                        otherRadio.disabled = false;
+                    }
+                });
+            });
+        });
+    });
     function doSubmit(index, layero){
         var body = $.modal.getChildFrame(index);
         $("#treeId").val(body.find('#treeId').val());