select박스 동적 처리
parent
aba6c6cbbf
commit
fe7da0d847
|
|
@ -28,6 +28,30 @@ $(document).on('click', '.tr', function (){
|
||||||
getIcaViewModal($(this).data('key'));
|
getIcaViewModal($(this).data('key'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('change', 'select[name="organ"]', function (){
|
||||||
|
$('select[name="department"]').empty();
|
||||||
|
const parent_organ = $(this).val();
|
||||||
|
let department = '';
|
||||||
|
organConfigList.forEach(function (organConfig) {
|
||||||
|
if (organConfig.parentOrgan != null && organConfig.organType != 'OGC002' && organConfig.parentOrgan == parent_organ) {
|
||||||
|
department += '<option value="' + organConfig.organCd + '">' + organConfig.organNm + '</option>';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('select[name="department"]').append('<option value="">경찰서 선택</option>' + department);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('change', 'select[name="crimeType"]', function (){
|
||||||
|
$('select[name="violationType"]').empty();
|
||||||
|
let violationType = '';
|
||||||
|
let code = $(this).val();
|
||||||
|
commonCode[code].forEach(function (item) {
|
||||||
|
violationType += '<option value="' + item.itemCd + '">' + item.itemValue + '</option>';
|
||||||
|
});
|
||||||
|
|
||||||
|
$('select[name="violationType"]').append('<option value="">선택</option>' + violationType);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
$(document).on('change', '#crimeForm', function (){
|
$(document).on('change', '#crimeForm', function (){
|
||||||
$('#crimeFormDiv').next().remove();
|
$('#crimeFormDiv').next().remove();
|
||||||
|
|
@ -125,7 +149,7 @@ $(document).on('change', '#crimeType', function (){
|
||||||
smugglingAmount += '<option value="'+ item.itemCd +'">' + item.itemValue +'</option>';
|
smugglingAmount += '<option value="'+ item.itemCd +'">' + item.itemValue +'</option>';
|
||||||
})
|
})
|
||||||
|
|
||||||
if ($(this).val() == 'CTH002') {
|
if ($(this).val() == 'CTH2') {
|
||||||
makeArrestAreaDiv('장소');
|
makeArrestAreaDiv('장소');
|
||||||
$('#smugglingAmountDiv').append(
|
$('#smugglingAmountDiv').append(
|
||||||
'<label class="col-sm-2 col-form-label text-center">밀수입출 품목</label>'
|
'<label class="col-sm-2 col-form-label text-center">밀수입출 품목</label>'
|
||||||
|
|
@ -162,7 +186,7 @@ $(document).on('change', '#violationType', function (){
|
||||||
$('.entryVisa').remove();
|
$('.entryVisa').remove();
|
||||||
$('#violationAmountDiv').remove();
|
$('#violationAmountDiv').remove();
|
||||||
|
|
||||||
if ($(this).val() == 'VLT001') {
|
if ($(this).val() == 'CTH101') {
|
||||||
makeSpiInfoDiv('피의자 정보');
|
makeSpiInfoDiv('피의자 정보');
|
||||||
makeArrestAreaDiv('지역');
|
makeArrestAreaDiv('지역');
|
||||||
makeSeaAreaDiv('밀입국');
|
makeSeaAreaDiv('밀입국');
|
||||||
|
|
@ -171,7 +195,7 @@ $(document).on('change', '#violationType', function (){
|
||||||
makeDestinationDiv('밀입국 출발지(국가)');
|
makeDestinationDiv('밀입국 출발지(국가)');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).val() == 'VLT002') {
|
if ($(this).val() == 'CTH102') {
|
||||||
makeSpiInfoDiv('피의자 정보');
|
makeSpiInfoDiv('피의자 정보');
|
||||||
makeArrestAreaDiv('지역');
|
makeArrestAreaDiv('지역');
|
||||||
makeSeaAreaDiv('도외이탈');
|
makeSeaAreaDiv('도외이탈');
|
||||||
|
|
@ -179,7 +203,7 @@ $(document).on('change', '#violationType', function (){
|
||||||
makePurposeDiv('도외이탈');
|
makePurposeDiv('도외이탈');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).val() == 'VLT003') {
|
if ($(this).val() == 'CTH103') {
|
||||||
makeSpiInfoDiv('피의자 정보');
|
makeSpiInfoDiv('피의자 정보');
|
||||||
makeArrestAreaDiv('지역');
|
makeArrestAreaDiv('지역');
|
||||||
makeSeaAreaDiv('밀출국');
|
makeSeaAreaDiv('밀출국');
|
||||||
|
|
@ -188,7 +212,7 @@ $(document).on('change', '#violationType', function (){
|
||||||
makeDestinationDiv('밀출국 행선지(도착예정지)');
|
makeDestinationDiv('밀출국 행선지(도착예정지)');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).val() == 'VLT004') {
|
if ($(this).val() == 'CTH104') {
|
||||||
makeSpiInfoDiv('피의자 정보');
|
makeSpiInfoDiv('피의자 정보');
|
||||||
makeArrestAreaDiv('지역');
|
makeArrestAreaDiv('지역');
|
||||||
makeSeaAreaDiv('밀항');
|
makeSeaAreaDiv('밀항');
|
||||||
|
|
@ -197,15 +221,18 @@ $(document).on('change', '#violationType', function (){
|
||||||
makeDestinationDiv('밀항 행선지(도착예정지)');
|
makeDestinationDiv('밀항 행선지(도착예정지)');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).val() == 'VLT005') {
|
if ($(this).val() == 'CTH105') {
|
||||||
makeSpiInfoDiv('불법체류 및 취업');
|
makeSpiInfoDiv('불법체류 및 취업');
|
||||||
makeEntryVisaDiv();
|
makeEntryVisaDiv();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($(this).val() == 'VLT301') {
|
if ($(this).val() == 'CTH401') {
|
||||||
makeViolationAmountDiv();
|
makeViolationAmountDiv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($(this).val() == 'CTH201' || $(this).val() == 'CTH202' || $(this).val() == 'CTH203' || $(this).val() == 'CTH204') {
|
||||||
|
makeArrestAreaDiv('장소');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on('change', '#smugglingAmount', function (){
|
$(document).on('change', '#smugglingAmount', function (){
|
||||||
|
|
@ -321,7 +348,7 @@ function makeArrestAreaDiv(name) {
|
||||||
|
|
||||||
function makeMeansDiv(name, code) {
|
function makeMeansDiv(name, code) {
|
||||||
let means = '';
|
let means = '';
|
||||||
if (code == 'VLT001') {
|
if (code == 'CTH101') {
|
||||||
commonCode.MS1.forEach(function (item){
|
commonCode.MS1.forEach(function (item){
|
||||||
means += '<option value="'+ item.itemCd +'">' + item.itemValue +'</option>';
|
means += '<option value="'+ item.itemCd +'">' + item.itemValue +'</option>';
|
||||||
})
|
})
|
||||||
|
|
@ -500,10 +527,6 @@ function saveInternationalCrimeArrest(contentState){
|
||||||
|
|
||||||
function contentCheck(){
|
function contentCheck(){
|
||||||
let flag = true;
|
let flag = true;
|
||||||
if(!$('select[name="organ"]').val()){
|
|
||||||
alert("지방청을 선택해주세요.")
|
|
||||||
flag = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
const internationalCrimeArrest = [[${internationalCrimeArrest}]];
|
const internationalCrimeArrest = [[${internationalCrimeArrest}]];
|
||||||
const commonCode = [[${session.commonCode}]];
|
const commonCode = [[${session.commonCode}]];
|
||||||
|
const organConfigList = [[${organConfigList}]];
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" th:src="@{/js/faStatistics/internationalCrimeArrest.js}"></script>
|
<script type="text/javascript" th:src="@{/js/faStatistics/internationalCrimeArrest.js}"></script>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
|
@ -44,7 +45,7 @@
|
||||||
</th:block>
|
</th:block>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto" id="departmentDiv">
|
||||||
<select class="form-select form-select-sm" name="department">
|
<select class="form-select form-select-sm" name="department">
|
||||||
<option value="">경찰서 선택</option>
|
<option value="">경찰서 선택</option>
|
||||||
<th:block th:each="organConfig:${organConfigList}">
|
<th:block th:each="organConfig:${organConfigList}">
|
||||||
|
|
@ -63,10 +64,12 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<select class="form-select form-select-sm" name="violationType">
|
<select class="form-select form-select-sm" name="violationType" id="violationType">
|
||||||
<option value="">위반유형</option>
|
<option value="">위반유형 선택</option>
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('VLT')}">
|
<th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CTH')))}">
|
||||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.violationType}"></option>
|
<th:block th:each="commonCode:${session.commonCode.get('CTH'+num)}">
|
||||||
|
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${internationalCrimeArrest.violationType eq commonCode.itemCd}"></option>
|
||||||
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -138,12 +141,14 @@
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('CTH')}">
|
<th:block th:each="commonCode:${session.commonCode.get('CTH')}">
|
||||||
<td th:if="${internationalCrimeArrest.crimeType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
<td th:if="${internationalCrimeArrest.crimeType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
<th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CTH')))}">
|
||||||
|
<th:block th:each="commonCode:${session.commonCode.get('CTH'+num)}">
|
||||||
|
<td th:if="${internationalCrimeArrest.violationType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
||||||
|
</th:block>
|
||||||
|
</th:block>
|
||||||
<th:block th:if="${internationalCrimeArrest.violationType eq null || internationalCrimeArrest.violationType eq ''}">
|
<th:block th:if="${internationalCrimeArrest.violationType eq null || internationalCrimeArrest.violationType eq ''}">
|
||||||
<td></td>
|
<td></td>
|
||||||
</th:block>
|
</th:block>
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('VLT')}">
|
|
||||||
<td th:if="${internationalCrimeArrest.violationType eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
|
|
||||||
</th:block>
|
|
||||||
<td th:text="${internationalCrimeArrest.crimeName}"></td>
|
<td th:text="${internationalCrimeArrest.crimeName}"></td>
|
||||||
<td th:text="${internationalCrimeArrest.occurTable}"></td>
|
<td th:text="${internationalCrimeArrest.occurTable}"></td>
|
||||||
<td th:text="${internationalCrimeArrest.arrestTable}"></td>
|
<td th:text="${internationalCrimeArrest.arrestTable}"></td>
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<label class="col-sm-2 col-form-label text-center">관할서</label>
|
<label class="col-sm-2 col-form-label text-center">관할서</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2" id="departmentDiv">
|
||||||
<select class="form-select form-select-sm" name="department">
|
<select class="form-select form-select-sm" name="department">
|
||||||
<option value="">선택</option>
|
<option value="">선택</option>
|
||||||
<th:block th:each="organConfig:${organConfigList}">
|
<th:block th:each="organConfig:${organConfigList}">
|
||||||
|
|
@ -65,9 +65,10 @@
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select class="form-select form-select-sm" name="violationType" id="violationType">
|
<select class="form-select form-select-sm" name="violationType" id="violationType">
|
||||||
<option value="">선택</option>
|
<option value="">선택</option>
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('VLT')}">
|
<th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CTH')))}">
|
||||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
|
<th:block th:if="${'CTH'+num == internationalCrimeArrest.crimeType}" th:each="commonCode:${session.commonCode.get('CTH'+num)}">
|
||||||
th:selected="${commonCode.itemCd eq internationalCrimeArrest.violationType}"></option>
|
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${internationalCrimeArrest.violationType eq commonCode.itemCd}"></option>
|
||||||
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,14 @@
|
||||||
</div>
|
</div>
|
||||||
<label class="col-sm-2 col-form-label text-center">관할서</label>
|
<label class="col-sm-2 col-form-label text-center">관할서</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
|
<select class="form-select form-select-sm" name="department" disabled>
|
||||||
|
<option value="">선택</option>
|
||||||
<th:block th:each="organConfig:${organConfigList}">
|
<th:block th:each="organConfig:${organConfigList}">
|
||||||
<th:block th:if="${organConfig.parentOrgan ne null && organConfig.organType ne 'OGC002'}">
|
<th:block th:if="${organConfig.parentOrgan ne null && organConfig.organType ne 'OGC002'}">
|
||||||
<div th:utext="${organConfig.organCd eq internationalCrimeArrest.department ? organConfig.organNm : ''}"></div>
|
<option th:value="${organConfig.organCd}" th:text="${organConfig.organNm}" th:selected="${organConfig.organCd eq internationalCrimeArrest.department}"></option>
|
||||||
</th:block>
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<th:block th:if="${internationalCrimeArrest.crimeType ne 'CTH002'}">
|
<th:block th:if="${internationalCrimeArrest.crimeType ne 'CTH002'}">
|
||||||
<div class="col-sm-4 row" id="crimeNameDiv">
|
<div class="col-sm-4 row" id="crimeNameDiv">
|
||||||
|
|
@ -52,7 +55,7 @@
|
||||||
<label class="col-sm-2 col-form-label text-center">범죄테마</label>
|
<label class="col-sm-2 col-form-label text-center">범죄테마</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select class="form-select form-select-sm" name="crimeType" id="crimeType" disabled>
|
<select class="form-select form-select-sm" name="crimeType" id="crimeType" disabled>
|
||||||
<option value="">범죄테마</option>
|
<option value="">선택</option>
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('CTH')}">
|
<th:block th:each="commonCode:${session.commonCode.get('CTH')}">
|
||||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
|
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
|
||||||
th:selected="${commonCode.itemCd eq internationalCrimeArrest.crimeType}"></option>
|
th:selected="${commonCode.itemCd eq internationalCrimeArrest.crimeType}"></option>
|
||||||
|
|
@ -62,10 +65,11 @@
|
||||||
<label class="col-sm-2 col-form-label text-center">위반유형</label>
|
<label class="col-sm-2 col-form-label text-center">위반유형</label>
|
||||||
<div class="col-sm-2">
|
<div class="col-sm-2">
|
||||||
<select class="form-select form-select-sm" name="violationType" id="violationType" disabled>
|
<select class="form-select form-select-sm" name="violationType" id="violationType" disabled>
|
||||||
<option value="">위반유형</option>
|
<option value="">선택</option>
|
||||||
<th:block th:each="commonCode:${session.commonCode.get('VLT')}">
|
<th:block th:each="num : ${#numbers.sequence(1,#lists.size(session.commonCode.get('CTH')))}">
|
||||||
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"
|
<th:block th:if="${'CTH'+num == internationalCrimeArrest.crimeType}" th:each="commonCode:${session.commonCode.get('CTH'+num)}">
|
||||||
th:selected="${commonCode.itemCd eq internationalCrimeArrest.violationType}"></option>
|
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${internationalCrimeArrest.violationType eq commonCode.itemCd}"></option>
|
||||||
|
</th:block>
|
||||||
</th:block>
|
</th:block>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue