|
|
|
@ -446,7 +446,7 @@ |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label for="date">开具日期:</label> |
|
|
|
<input type="date" id="date" name="date" required> |
|
|
|
<input type="datetime-local" id="date" name="date" required> |
|
|
|
</div> |
|
|
|
<div class="form-group"> |
|
|
|
<label>手写签名:</label> |
|
|
|
@ -709,16 +709,25 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 设置日期输入框的默认值和最大值 |
|
|
|
// 设置日期时间输入框的默认值和最大值 |
|
|
|
function setupDateInput() { |
|
|
|
const dateInput = document.getElementById('date'); |
|
|
|
if (dateInput) { |
|
|
|
// 获取当前日期,格式为YYYY-MM-DD |
|
|
|
const today = new Date().toISOString().split('T')[0]; |
|
|
|
// 设置默认值为今天 |
|
|
|
dateInput.value = today; |
|
|
|
// 设置最大值为今天,只能选择今天或之前的日期 |
|
|
|
dateInput.max = today; |
|
|
|
// 获取当前时间,格式为YYYY-MM-DDTHH:MM:SS |
|
|
|
const now = new Date(); |
|
|
|
// 格式化时间,确保秒数正确 |
|
|
|
const year = now.getFullYear(); |
|
|
|
const month = String(now.getMonth() + 1).padStart(2, '0'); |
|
|
|
const day = String(now.getDate()).padStart(2, '0'); |
|
|
|
const hours = String(now.getHours()).padStart(2, '0'); |
|
|
|
const minutes = String(now.getMinutes()).padStart(2, '0'); |
|
|
|
const seconds = String(now.getSeconds()).padStart(2, '0'); |
|
|
|
const formattedNow = `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`; |
|
|
|
|
|
|
|
// 设置默认值为当前时间 |
|
|
|
dateInput.value = formattedNow; |
|
|
|
// 设置最大值为当前时间,只能选择当前时间或之前的时间 |
|
|
|
dateInput.max = formattedNow; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|