sri 저장 전 검증동작 추가. 오류수정.

master
강석 최 2023-03-23 14:59:19 +09:00
parent 5f05d5663c
commit b7a502ff6a
3 changed files with 32 additions and 10 deletions

View File

@ -6,6 +6,7 @@
<mapper namespace="com.dbnt.faisp.main.faRpt.mapper.SriMapper">
<sql id="selectSriWhere">
<where>
a.status &lt;> 'DST008'
<if test='activeTab == "send"'>
and a.wrt_user_seq = #{wrtUserSeq}
and a.ref_key is null

View File

@ -73,12 +73,37 @@ $(document).on('click', '#getMenuBtn', function (){
})
$(document).on('click', '.saveBtn', function (){
const state = $(this).attr("data-state")
if(state === "DST001" || sriDataCheck()){
if(confirm(this.textContent+" 하시겠습니까?")){
const activeTab = $(".tabLink.active")[0].id.replace('Tab', '');
saveSri($(this).attr("data-state"), this.textContent, activeTab);
saveSri(state, this.textContent, activeTab);
}
}
})
function sriDataCheck(){
if(!$("#faSriType").val()){
alert("분류를 선택해주세요.")
return false;
}
if(!$("#faSriEdate").val()){
alert("제출기한일을 선택해주세요.")
return false;
}
if(!$("#faSriETime").val()){
alert("제출기한 시간을 입력해주세요.")
return false;
}
if(!$("#title").val()){
alert("제목을 입력해주세요.")
return false;
}
if($(".readUserRow").length===0){
alert("수신자를 선택해주세요.")
return false;
}
return true;
}
function saveSri(faSriState, btnText, activeTab){
$("#status").val(faSriState);
contentFade("in");

View File

@ -89,17 +89,14 @@
<th>부서</th>
<th>분류</th>
<th>제출기한</th>
<th th:if="${searchParams.status ne 'receive'}">상태</th>
<th th:if="${searchParams.activeTab eq 'send'}">상태</th>
<th>작성자</th>
<th>작성일</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="faSriTr" th:each="sri,cnt:${SriList}">
<th:block>
<input type="hidden" class="faSriKey" th:value="${sri.faSriKey}">
</th:block>
<th:block th:unless="${sri.status eq 'DST008'}">
<!-- <td class="sriChk"><input type="checkbox" name="sriChk" class="trChkBox"></td>-->
<td th:text="${cnt.count}"></td>
<td th:text="${sri.title}"></td>
@ -119,14 +116,13 @@
</th:block>
</td>
<td th:text="${#temporals.format(sri.faSriEdate, 'yyyy-MM-dd HH:mm')}"></td>
<td th:if="${sri.status ne 'receive'}">
<td th:if="${searchParams.activeTab eq 'send'}">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<th:text th:if="${commonCode.itemCd eq sri.status}" th:text="${commonCode.itemValue}"></th:text>
</th:block>
</td>
<td th:text="${sri.wrtUserNm}"></td>
<td th:text="${#temporals.format(sri.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</th:block>
</tr>
</tbody>
</table>