|
@@ -174,7 +174,22 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
+ #companyInput{
|
|
|
+ background-color: #ECF1FA;
|
|
|
+ }
|
|
|
+
|
|
|
+ #phoneInput{
|
|
|
+ background-color: #ECF1FA;
|
|
|
+ }
|
|
|
+ #addressInput{
|
|
|
+ background-color: #ECF1FA;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
</style>
|
|
|
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.css">
|
|
|
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js"></script>
|
|
|
+
|
|
|
<script src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/axios.min.js"></script>
|
|
|
</head>
|
|
|
<body>
|
|
@@ -296,11 +311,14 @@
|
|
|
</#list>
|
|
|
|
|
|
<div class="company-info">
|
|
|
- <img src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/img.png" height="30" width="30" style="float: right; margin: 0 0 10px 10px;"/>
|
|
|
+ <img src="https://wl-resource.obs.cn-south-1.myhuaweicloud.com/static/img.png"
|
|
|
+ height="30" width="30"
|
|
|
+ style="float: right; margin: 0 0 10px 10px; cursor: pointer;"
|
|
|
+ onclick="editCellFoot()">
|
|
|
<table>
|
|
|
<tr>
|
|
|
<td>公司:</td>
|
|
|
- <td style="padding-left: 180px">
|
|
|
+ <td id="company" style="padding-left: 180px">
|
|
|
<#if companyMap["公司"]?has_content>
|
|
|
${companyMap["公司"]}
|
|
|
<#else>
|
|
@@ -310,7 +328,7 @@
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>电话:</td>
|
|
|
- <td style="padding-left: 180px">
|
|
|
+ <td id="phone" style="padding-left: 180px">
|
|
|
<#if companyMap["电话"]?has_content>
|
|
|
${companyMap["电话"]}
|
|
|
<#else>
|
|
@@ -320,7 +338,7 @@
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>地址:</td>
|
|
|
- <td style="padding-left: 180px">
|
|
|
+ <td id="address" style="padding-left: 180px">
|
|
|
<#if companyMap["地址"]?has_content>
|
|
|
${companyMap["地址"]}
|
|
|
<#else>
|
|
@@ -333,6 +351,8 @@
|
|
|
<p STYLE="font-size: 15px"><text style="color: red">*</text>该车辆检测报告仅对本次检查结果负责</p>
|
|
|
</div>
|
|
|
<script>
|
|
|
+
|
|
|
+
|
|
|
function editCell() {
|
|
|
var vin = document.getElementById('vin');
|
|
|
var year = document.getElementById('year');
|
|
@@ -341,6 +361,8 @@
|
|
|
var yearText = year.innerText;
|
|
|
var mileageText = mileage.innerText;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
vin.innerHTML = '<input type="text" id="vinInput" value="' + vinText + '" onblur="saveChanges(\'vin\', this.value)">';
|
|
|
year.innerHTML = '<input type="text" id="yearInput" value="' + yearText + '" onblur="saveChanges(\'year\', this.value)">';
|
|
|
mileage.innerHTML = '<input type="text" id="mileageInput" value="' + mileageText + '" onblur="saveChanges(\'mileage\', this.value)">';
|
|
@@ -348,25 +370,81 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
function saveChanges(field,value) {
|
|
|
if (value==''){
|
|
|
return
|
|
|
}
|
|
|
var input = document.getElementById(field);
|
|
|
+ var id = ${id};
|
|
|
// 这里可以进行保存操作,比如向服务器发送请求保存数据
|
|
|
// 保存完成后可以进行一些提示或其他操作
|
|
|
// 使用 Axios 发送 POST 请求
|
|
|
- axios.post('http://localhost:8888/your/api/endpoint', {
|
|
|
+ axios.post('http://localhost:8888/app/diagnosis/report/updateBase', {
|
|
|
+ id: id,
|
|
|
type: field,
|
|
|
value: value,
|
|
|
})
|
|
|
.then(function (response) {
|
|
|
- // 请求成功的处理
|
|
|
- console.log(response);
|
|
|
+
|
|
|
+ if (response.data.code==200){
|
|
|
+ swal("修改成功!", "", "success");
|
|
|
+ }else {
|
|
|
+ swal("修改失败!", "", "fail");
|
|
|
+ }
|
|
|
})
|
|
|
// 最后销毁输入框,恢复文本
|
|
|
input.innerHTML = value;
|
|
|
}
|
|
|
+
|
|
|
+ function editCellFoot() {
|
|
|
+ var address = document.getElementById('address');
|
|
|
+ var company = document.getElementById('company');
|
|
|
+ var phone = document.getElementById('phone');
|
|
|
+ var addressText = address.innerText;
|
|
|
+ var companyText = company.innerText;
|
|
|
+ var phoneText = phone.innerText;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ address.innerHTML = '<input type="text" id="addressInput" value="' +
|
|
|
+ addressText + '" onblur="saveChangesFoot(\'address\', this.value)">';
|
|
|
+
|
|
|
+ company.innerHTML = '<input type="text" id="companyInput" value="'
|
|
|
+ + companyText + '" onblur="saveChangesFoot(\'company\', this.value)">';
|
|
|
+
|
|
|
+ phone.innerHTML = '<input type="text" id="phoneInput" value="' +
|
|
|
+ phoneText + '" onblur="saveChangesFoot(\'phone\', this.value)">';
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function saveChangesFoot(field,value) {
|
|
|
+ if (value==''){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var input = document.getElementById(field);
|
|
|
+ var id = ${id};
|
|
|
+
|
|
|
+ // 使用 Axios 发送 POST 请求
|
|
|
+ axios.post('http://localhost:8888/app/diagnosis/report/updateCompany', {
|
|
|
+ id: id,
|
|
|
+ type: field,
|
|
|
+ value: value,
|
|
|
+ })
|
|
|
+ .then(function (response) {
|
|
|
+ if (response.data.code==200){
|
|
|
+ swal("修改成功!", "", "success");
|
|
|
+ // 最后销毁输入框,恢复文本
|
|
|
+ input.innerHTML = value;
|
|
|
+ }else {
|
|
|
+ swal("修改失败!", "", "fail");
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
|