@GetMapping(“/khxx”)
public String getCustomerInfo(@RequestParam(“acceptanceCustomerId”) Long acceptanceCustomerId, Model model) {
AcceptanceCustomer acceptanceCustomer = acceptanceCustomerService.findKhxx(acceptanceCustomerId);
model.addAttribute(“acceptanceCustomer”, acceptanceCustomer);
return FebsUtil.view(“bw/acceptanceCustomer/khxx”);
}如果我想用这个方法，我的这个html怎么改<!DOCTYPE html>
<html>
<head>
<meta charset=“utf-8”>
<title>客户信息展示</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
}

h1 {
color: #333;
margin-bottom: 20px;
}

.container {
max-width: 600px;
margin: 0 auto;
}

.customer-info {
background-color: #f9f9f9;
padding: 20px;
border-radius: 5px;
margin-bottom: 20px;
}

.customer-info p {
margin: 10px 0;
}

.status-buttons {
margin-bottom: 20px;
}

.status-buttons button {
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
padding: 10px 20px;
margin-right: 10px;
cursor: pointer;
}

.confirmation-section {
display: none;
margin-bottom: 20px;
}

.confirmation-section p {
margin-bottom: 10px;
}

.confirmation-section button {
background-color: #28a745;
color: #fff;
border: none;
border-radius: 5px;
padding: 10px 20px;
margin-right: 10px;
cursor: pointer;
}

.confirmation-section button.cancel {
background-color: #dc3545;
}

.alert {
background-color: #f8d7da;
color: #721c24;
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
}

.alert.success {
background-color: #d4edda;
color: #155724;
}
</style>
</head>
<body>
<div class=“container”>
<h1>客户信息</h1>
<div class=“customer-info” id=“customerInfo”></div>

<div class=“status-buttons”>
<p>请选择客户状态：</p>
<button onclick=“selectStatus(‘已见面’)”>已见面</button>
<button onclick=“selectStatus(‘已签约’)”>已签约</button>
<button onclick=“selectStatus(‘未签约’)”>未签约</button>
</div>

<div class=“confirmation-section” id=“statusConfirmation”>
<p>确定选择该状态吗？</p>
<button onclick=“confirmStatus()”>确定</button>
<button onclick=“cancelStatus()” class=“cancel”>取消</button>
</div>

<div class=“alert” id=“statusAlert” style=“display: none;”></div>
</div>

<script>
let selectedStatus = null;

// 获取acceptanceCustomerId的值
const urlParams = new URLSearchParams(window.location.search);
const customerId = urlParams.get(‘acceptanceCustomerId’);

// 发起GET请求，获取客户信息
fetch(‘/khxx?acceptanceCustomerId=’ + customerId, {
method: ‘GET’
})
.then(response => response.json())
.then(data => {
// 在页面上展示客户信息
const customerInfoDiv = document.getElementById(‘customerInfo’);
customerInfoDiv.innerHTML = <br/> &lt;p&gt;公司名称: ${data.acceptanceCustomer.companyName}&lt;/p&gt;<br/> &lt;p&gt;联系人1：${data.acceptanceCustomer.linkMan1}&lt;/p&gt;<br/> &lt;p&gt;联系方式1: ${data.acceptanceCustomer.contact1}&lt;/p&gt;<br/> &lt;p&gt;地址: ${data.acceptanceCustomer.address}&lt;/p&gt;<br/> &lt;p&gt;状态: ${data.acceptanceCustomer.status}&lt;/p&gt;;
})
.catch(error => console.error(error));


function selectStatus(status) {
selectedStatus = status;
document.getElementById(‘statusConfirmation’).style.display = ‘block’;
}

function confirmStatus() {
if (selectedStatus) {
// 发起POST请求，传递acceptanceCustomerId和状态selectedStatus给后端
fetch(‘/updateStatus’, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
},
body: JSON.stringify({
acceptanceCustomerId: customerId,
status: selectedStatus
})
})
.then(response => {
if (response.ok) {
return response.json(); // 解析JSON数据
} else {
// 遇到错误时抛出异常，使得控制流程进入后续的catch(…)
throw new Error(‘Network response was not ok.’);
}
})
.then(data => {
// 处理数据
// 这里假设后台返回了一些消息
showAlert(data.message || ‘状态更新成功！’, ‘success’);
})
.catch(error => {
// 处理错误情况
console.error(‘There was a problem with the fetch operation:’, error);
showAlert(‘状态更新失败，请重试。’, ‘error’);
});
cancelStatus();
}


function cancelStatus() {
selectedStatus = null;
document.getElementById(‘statusConfirmation’).style.display = ‘none’;
}

function showAlert(message, type) {
const alertDiv = document.getElementById(‘statusAlert’);
alertDiv.innerText = message;
alertDiv.style.display = ‘block’;
alertDiv.className = alert ${type};

setTimeout(() => {
alertDiv.style.display = ‘none’;
}, 3000);
}
}
</script>
</body>
</html>