refactor: 코드 정리
parent
c59244be99
commit
f644aad05d
@ -1,57 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<c:set var="prefixName" scope="request">폐기 통보[결과] 처리</c:set>
|
||||
|
||||
<div class="wrapper" style="padding-top:2em">
|
||||
|
||||
<input type="file" id="img1" name="img" accept="image/*"><br>
|
||||
<input type="file" id="img2" name="img" accept="image/*"><br>
|
||||
<button id="btnSave">save</button>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.querySelector("#btnSave").addEventListener("click", function () {
|
||||
|
||||
let dsuseMgtRslt =
|
||||
{
|
||||
"dscdmngId": "2024060001",
|
||||
"userId": "suji",
|
||||
"prgrsSttsCd": "06",
|
||||
"hdrDe": "20240105",
|
||||
"dsuseSeCd": "1",
|
||||
"dsuseMthCd": "3",
|
||||
"dsuseLoc": "보건소 소각장",
|
||||
"dsuseDe": "20240506"
|
||||
};
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append("dsuseMgtRsltJsonStr", JSON.stringify(dsuseMgtRslt));
|
||||
|
||||
$("input[type=file]").each(function (i) {
|
||||
formData.append("dsuseDsuseImgFiles", $('input[type=file]')[i].files[0]);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '<c:url value="${apiHost}/api/biz/nims/v1/saveDsuseMgtRslt" />',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
if (!res.success) {
|
||||
alert(res.code + ':' + res.message);
|
||||
return false;
|
||||
}
|
||||
console.log(res.data);
|
||||
},
|
||||
error: function (error) {
|
||||
console.log(error);
|
||||
if (error.responseJSON && typeof error.responseJSON === 'object') {
|
||||
console.log(error.responseJSON);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, {passive: true});
|
||||
</script>
|
Loading…
Reference in New Issue