|
@@ -34,9 +34,15 @@
|
|
|
<div class="form-group {{ $formA['FormVars']['Display']['Area'] }} flex-column mb-2">
|
|
|
<label class="m-0">{{ $formA['FormVars']['Title']['Area'] }}</label>
|
|
|
<select class="w-100 rounded" id="area-select">
|
|
|
+ <!-- <option value="1">수도권</option>
|
|
|
+ <option value="2">강원</option>
|
|
|
+ <option value="3">충청</option>
|
|
|
+ <option value="4">영남</option>
|
|
|
+ <option value="5">제주</option>
|
|
|
+ <option value="6">호남</option> -->
|
|
|
<option value="100">수도권/강원/충청권</option>
|
|
|
<option value="200">영남/제주권</option>
|
|
|
- <option value="300">호남권</option>
|
|
|
+ <option value="300">호남</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
<div class="form-group {{ $formA['FormVars']['Display']['MembershipName'] }} flex-column mb-2">
|
|
@@ -45,6 +51,12 @@
|
|
|
maxlength="{{ $formA['FormVars']['MaxLength']['MembershipName'] }}"
|
|
|
{{ $formA['FormVars']['Required']['MembershipName'] }}>
|
|
|
</div>
|
|
|
+ <div class="form-group {{ $formA['FormVars']['Display']['MembershipCode'] }} flex-column mb-2">
|
|
|
+ <label class="m-0">{{ $formA['FormVars']['Title']['MembershipCode'] }}</label>
|
|
|
+ <input type="text" id="membership-code-txt" class="rounded w-100" autocomplete="off"
|
|
|
+ maxlength="{{ $formA['FormVars']['MaxLength']['MembershipCode'] }}"
|
|
|
+ {{ $formA['FormVars']['Required']['MembershipCode'] }}>
|
|
|
+ </div>
|
|
|
<div class="form-group {{ $formA['FormVars']['Display']['TodayPrice'] }} flex-column mb-2">
|
|
|
<label class="m-0">{{ $formA['FormVars']['Title']['TodayPrice'] }}</label>
|
|
|
<input type="text" id="today-price-txt" class="rounded w-100" autocomplete="off"
|
|
@@ -87,50 +99,12 @@
|
|
|
});
|
|
|
|
|
|
// sisetype 라디오 버튼 클릭 시 이벤트 핸들러
|
|
|
- $('input[name="sisetype"]').on('change', function() {
|
|
|
+ $('#sise-form').on('change', 'input[name="sisetype"]', function() {
|
|
|
var selectedType = $(this).val();
|
|
|
- var areaSelect = $('#area-select');
|
|
|
- areaSelect.empty();
|
|
|
-
|
|
|
- if (selectedType === 'golf') {
|
|
|
- areaSelect.append('<option value="100">수도권/강원/충청권</option>');
|
|
|
- areaSelect.append('<option value="200">영남권</option>');
|
|
|
- areaSelect.append('<option value="300">호남권</option>');
|
|
|
- } else if (selectedType === 'condo') {
|
|
|
- areaSelect.append('<option value="400">체인형콘도</option>');
|
|
|
- areaSelect.append('<option value="500">스키장콘도</option>');
|
|
|
- } else if (selectedType === 'fitness') {
|
|
|
- areaSelect.append('<option value="600">강남권</option>');
|
|
|
- areaSelect.append('<option value="700">강북권</option>');
|
|
|
- }
|
|
|
-
|
|
|
- areaSelect.val(areaSelect.children('option:first').val()); // 첫 번째 option을 선택하거나 초기화
|
|
|
+ PopupPopupForm1FormAPostSiseForm.change_option(selectedType);
|
|
|
});
|
|
|
|
|
|
- // 페이지 로드 시 초기 sisetype에 따른 option 설정
|
|
|
- var initialType = $('input[name="sisetype"]:checked').val();
|
|
|
- if (initialType) {
|
|
|
- // 초기에 선택된 sisetype 값에 따라 option 설정
|
|
|
- if (initialType === 'golf') {
|
|
|
- $('#area-select').html(`
|
|
|
- <option value="100">수도권/강원/충청권</option>
|
|
|
- <option value="101">다른 지역1</option>
|
|
|
- <option value="102">다른 지역2</option>
|
|
|
- `);
|
|
|
- } else if (initialType === 'condo') {
|
|
|
- $('#area-select').html(`
|
|
|
- <option value="200">영남/제주권</option>
|
|
|
- <option value="201">다른 지역3</option>
|
|
|
- <option value="202">다른 지역4</option>
|
|
|
- `);
|
|
|
- } else if (initialType === 'fitness') {
|
|
|
- $('#area-select').html(`
|
|
|
- <option value="300">호남권</option>
|
|
|
- <option value="301">다른 지역5</option>
|
|
|
- <option value="302">다른 지역6</option>
|
|
|
- `);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
});
|
|
|
|
|
@@ -180,6 +154,7 @@
|
|
|
Pc2: $(sise_form).find('#area-select').val(),
|
|
|
Pc3: $(sise_form).find('#today-price-txt').val(),
|
|
|
Pc4: $(sise_form).find('#yesterday-price-txt').val(),
|
|
|
+ Pc5: $(sise_form).find('#membership-code-txt').val(),
|
|
|
}
|
|
|
if (id < 0) {
|
|
|
parameter = { Id: id }
|
|
@@ -189,16 +164,40 @@
|
|
|
}
|
|
|
|
|
|
PopupPopupForm1FormAPostSiseForm.fetch_sise = async function (id) {
|
|
|
-
|
|
|
+ console.log('fetch_sise_id : ', id);
|
|
|
const response = await get_api_data(PopupPopupForm1FormAPostSiseForm.formA['General']['PickApi'], {
|
|
|
Page: [ { Id: id } ]
|
|
|
})
|
|
|
|
|
|
- console.log('response : ', response)
|
|
|
-
|
|
|
PopupPopupForm1FormAPostSiseForm.set_sise_ui(response)
|
|
|
}
|
|
|
|
|
|
+ PopupPopupForm1FormAPostSiseForm.change_option = function (type, area){
|
|
|
+ const sise_form = $('#sise-form')
|
|
|
+ var areaSelect = $('#area-select');
|
|
|
+ areaSelect.empty();
|
|
|
+ if (type === 'golf') {
|
|
|
+ // areaSelect.append('<option value="1">수도권</option>');
|
|
|
+ // areaSelect.append('<option value="2">강원</option>');
|
|
|
+ // areaSelect.append('<option value="3">충청</option>');
|
|
|
+ // areaSelect.append('<option value="4">영남</option>');
|
|
|
+ // areaSelect.append('<option value="5">제주</option>');
|
|
|
+ // areaSelect.append('<option value="6">호남</option>');
|
|
|
+ areaSelect.append('<option value="100">수도권/강원/충청</option>');
|
|
|
+ areaSelect.append('<option value="200">영남/제주권</option>');
|
|
|
+ areaSelect.append('<option value="300">호남권</option>');
|
|
|
+ } else if (type === 'condo') {
|
|
|
+ areaSelect.append('<option value="400">체인형콘도</option>');
|
|
|
+ areaSelect.append('<option value="500">스키장콘도</option>');
|
|
|
+ } else if (type === 'fitness') {
|
|
|
+ areaSelect.append('<option value="600">강남</option>');
|
|
|
+ areaSelect.append('<option value="700">강북</option>');
|
|
|
+ }
|
|
|
+ if(area){
|
|
|
+ areaSelect.val(area);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
PopupPopupForm1FormAPostSiseForm.set_sise_ui = async function (response) {
|
|
|
if (isEmpty(response.data) || response.data.apiStatus) {
|
|
|
return;
|
|
@@ -206,13 +205,15 @@
|
|
|
|
|
|
const sise = response.data.Page[0];
|
|
|
const sise_form = $('#sise-form')
|
|
|
-
|
|
|
$(sise_form).find('#Id').val(sise.Id)
|
|
|
$(sise_form).find('#membership-name-txt').val(sise.PostTitle)
|
|
|
$(sise_form).find(`input[name='sisetype'][value='${sise.Pc1}']`).prop('checked', true)
|
|
|
$(sise_form).find('#area-select').val(sise.Pc2)
|
|
|
$(sise_form).find('#today-price-txt').val(sise.Pc3)
|
|
|
$(sise_form).find('#yesterday-price-txt').val(sise.Pc4)
|
|
|
+ $(sise_form).find('#membership-code-txt').val(sise.Pc5)
|
|
|
+
|
|
|
+ PopupPopupForm1FormAPostSiseForm.change_option(sise.Pc1, sise.Pc2);
|
|
|
}
|
|
|
|
|
|
}( window.PopupPopupForm1FormAPostSiseForm = window.PopupPopupForm1FormAPostSiseForm || {}, jQuery ));
|