[BO] 수정사항 반영 (1)

This commit is contained in:
kangsunlee
2025-07-16 11:48:14 +09:00
parent 1e3e61422c
commit 78dee1f4fe
9 changed files with 67 additions and 14 deletions

View File

@@ -29,9 +29,7 @@
<if test="employmentType != null and employmentType != ''">
employment_type = #{employmentType},
</if>
<if test="memo != null and memo != ''">
memo = #{memo},
</if>
<include refid="common.fields.UpdateBaseSet"/>
WHERE seq = #{householdSeq}
</update>

View File

@@ -259,10 +259,14 @@ uiUtil.uploadFile = (fileUploadType, input) => {
},
statusCode: {
// 실패 - validation fail
400: (res) => {
alert(res.responseJSON.message);
},
422: (res) => {
const resJson = res.responseJSON;
$(input).parent().find('.invalid-feedback').text(resJson.message);
$(input).addClass('is-invalid');
alert(resJson.message);
}
}
});

View File

@@ -81,9 +81,7 @@
<table>
<thead>
<tr>
<th>
</th>
<th>선택</th>
<th>조사원명</th>
<th>전화번호</th>
<th>실사</th>
@@ -117,8 +115,13 @@
<script th:inline="javascript">
let researcherList = [];
const showResearcherModal = () => {
document.querySelector(".modal-researcher-mapping").ui.open();
const showResearcherModal = (type) => {
const checked = document.querySelectorAll('input[name="chkBox"]:checked');
if(type === 'LIST' && checked.length === 0) {
alert("임가를 선택해주세요.");
return;
}
// 실사 공통코드 가져오기
ajaxUtil._ajaxMethod(
@@ -141,6 +144,8 @@
'json'
);
document.querySelector(".modal-researcher-mapping").ui.open();
getResearchers(document.reqResearcherForm.page.value);
}

View File

@@ -31,7 +31,7 @@
<td colspan="3">
<div class="input-file-group">
<label for="file" class="input-file-btn">
<input type="file" name="multipartAttachments" id="file" onchange="uiUtil.uploadFile('NOTICE', this);" >
<input type="file" name="multipartAttachments" id="file" onchange="validateFileSize(this) && uiUtil.uploadFile('NOTICE', this);" >
<span class="file-txt">파일첨부</span>
</label>
<p class="desc">첨부 가능 파일 형식: 문서(pdf, docx, xlsx, pptx, hwp), 이미지(jpg, jpeg, png, gif), 기타(zip,
@@ -177,6 +177,18 @@
});
}
// JavaScript 함수 추가
function validateFileSize(input) {
const maxSize = 5 * 1024 * 1024; // 5MB
const file = input.files[0];
if (file && file.size > maxSize) {
alert('파일 크기는 5MB 이하만 업로드 가능합니다.');
input.value = ''; // 파일 선택 초기화
return false;
}
return true;
}
</script>
</section>

View File

@@ -32,7 +32,7 @@
<td colspan="3">
<div class="input-file-group">
<label for="file" class="input-file-btn">
<input type="file" name="multipartAttachments" id="file" onchange="uiUtil.uploadFile('NOTICE', this);" >
<input type="file" name="multipartAttachments" id="file" onchange="validateFileSize(this) && uiUtil.uploadFile('NOTICE', this);" >
<span class="file-txt">파일첨부</span>
</label>
<p class="desc">첨부 가능 파일 형식: 문서(pdf, docx, xlsx, pptx, hwp), 이미지(jpg, jpeg, png, gif), 기타(zip,
@@ -231,6 +231,19 @@
}
});
}
// JavaScript 함수 추가
function validateFileSize(input) {
const maxSize = 5 * 1024 * 1024; // 5MB
const file = input.files[0];
if (file && file.size > maxSize) {
alert('파일 크기는 5MB 이하만 업로드 가능합니다.');
input.value = ''; // 파일 선택 초기화
return false;
}
return true;
}
</script>
</section>

View File

@@ -281,8 +281,8 @@
onclick="location.href='/households/create'">
<span class="btn-txt">임가 등록</span>
</button>
<!-- 관리자, 지방실사만 노출 -->
<button type="button" class="btn" th:if="${userRole != 'ROLE_RESEARCHER'}" onclick="showResearcherModal();">
<!-- 관리자만 노출 -->
<button type="button" class="btn" th:if="${userRole == 'ROLE_ADMIN'}" onclick="showResearcherModal('LIST');">
<span class="btn-txt">조사원 매핑</span>
</button>
</div>

View File

@@ -381,7 +381,7 @@
JSON.stringify(dataOj),
function(response) { // 성공
alert("등록이 완료되었습니다.");
location.href = '/households';
location.href = '/households/' + f.householdSeq.value;
},
function (code, rstData) {
if(code == 422) alert(rstData.responseText);

View File

@@ -112,9 +112,9 @@
</tbody>
</table>
<div class="component-btns bottom-btn-group">
<div class="component-btns bottom-btn-group" th:if="${userRole == 'ROLE_ADMIN'}">
<div class="btns-row align-right">
<button type="button" class="btn" th:if="${userRole == 'ROLE_ADMIN'}" onclick="showResearcherModal();">
<button type="button" class="btn" onclick="showResearcherModal();">
<span class="btn-txt">조사원 매핑</span>
</button>
<button type="button" class="btn btn-primary" onclick="goUpdateForm();">