diff --git a/src/main/java/com/wb/domainserver/domain/gcone/goods/subsvc/vo/BOSubsvcVO.java b/src/main/java/com/wb/domainserver/domain/gcone/goods/subsvc/vo/BOSubsvcVO.java
index 3f78b530..7f11389e 100644
--- a/src/main/java/com/wb/domainserver/domain/gcone/goods/subsvc/vo/BOSubsvcVO.java
+++ b/src/main/java/com/wb/domainserver/domain/gcone/goods/subsvc/vo/BOSubsvcVO.java
@@ -42,6 +42,8 @@ private static final long serialVersionUID = 1L;
private String invntryQy;
/** 판매재고수량 */
private String usefulInvntryQy;
+ /** 판매수량 초기화여부*/
+ private String usefulInvntryQyInit;
/** 재고정책 */
private String invntryPolicyCd;
/** 가용재고제한수량 */
diff --git a/src/main/resources/mybatis/xml/mapper/gcone/goods/subsvc/BOSubsvcMapper.xml b/src/main/resources/mybatis/xml/mapper/gcone/goods/subsvc/BOSubsvcMapper.xml
index 5e71e859..fa14083c 100644
--- a/src/main/resources/mybatis/xml/mapper/gcone/goods/subsvc/BOSubsvcMapper.xml
+++ b/src/main/resources/mybatis/xml/mapper/gcone/goods/subsvc/BOSubsvcMapper.xml
@@ -201,17 +201,20 @@
, CNSMRPRIC = REPLACE(#{cnsmrpric},',','')
, INVNTRY_QY = REPLACE(#{invntryQy},',','')
, INVNTRY_POLICY_CD = #{invntryPolicyCd}
+
+ , USEFUL_INVNTRY_QY = 0
+
, AVLINV_LMTT_QY = #{avlinvLmttQy}
, SUBSVC_STTUS_CD = #{subsvcSttusCd}
, EXPSR_DV_CD = #{expsrDvCd}
-
+
, EXPSR_BGN_DT = #{expsrBgnDt}
, EXPSR_BGN_DT = null
-
+
, EXPSR_END_DT = #{expsrEndDt}
@@ -223,9 +226,9 @@
, SUBSVC_DC = #{subsvcDc}
, MBL_SUBSVC_DC = #{mblSubsvcDc}
, MBL_SUBSVC_DC_PC_SAME_AT = #{mblSubsvcDcPcSameAt}
-
+
, IMG = #{img}
-
+
, UPDUSR = #{updusr}
, UPDT_DT = NOW()
WHERE SUBSVC_INNB = #{subsvcInnb}
diff --git a/src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp b/src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp
index f6fb8ad4..c14e16aa 100644
--- a/src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp
+++ b/src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp
@@ -194,6 +194,10 @@
tgtForm.appendChild(input);
}
+ const fn_remove_input = function (name, tftForm) {
+ $(tftForm).find('input[name="' + name + '"]').remove();
+ }
+
/* ********************************************************
* 리스트 바로가기
@@ -309,15 +313,16 @@
// 텍스트 입력 내용중 필수 항목 체크
$(':text[required]').each(function () {
+ const inputVal = $(this).val().trim();
if($(this).hasClass('number')){
- if ($(this).val().trim() == '' || $(this).val().trim() == '0') {
+ if (inputVal == '' || inputVal == '0' && !$(this).hasClass('allow-zero')) {
alert($(this).prop('title')+"은(는) 필수입니다");
$(this).focus();
retVal = false;
return false;
}
}else{
- if ($(this).val().trim() == '') {
+ if (inputVal == '') {
alert($(this).prop('title')+"은(는) 필수입니다");
$(this).focus();
retVal = false;
@@ -362,8 +367,12 @@
$('#expsrEndDt').val('');
}
+ //선택한 재고정책
+ const choiceInvntryPolicyCd = $('input[name="invntryPolicyCd"]:checked').val()
+ const prevInvntryPolicyCd = $('#invntryPolicyCdAsIs').val()
+
//재고가 있으면 판매인 경우 개수 품절처리 필수
- if($('input[name="invntryPolicyCd"]:checked').val() == '01'){
+ if(choiceInvntryPolicyCd == '01'){
if($('#avlinvLmttQy').val() == ''){
alert($('#avlinvLmttQy').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
$('#avlinvLmttQy').focus();
@@ -371,6 +380,13 @@
}
}
+ //재고에 따른 판매(재고정책)가 수정되었을 경우
+ fn_remove_input('usefulInvntryQyInit', $("#subsvcForm")[0]);
+ if(choiceInvntryPolicyCd !== prevInvntryPolicyCd){
+ alert('재고정책 변경에 따라 판매가능재고수량을 초기화합니다.');
+ fn_create_input('hidden', 'usefulInvntryQyInit','Y', $("#subsvcForm")[0]);
+ }
+
//이미지 필수 체크
if((($('#delImg').val() != '' || $('#img').val() == '') && imgDropzone.files.length != 1)){
if(imgDropzone.files.length == 0){
@@ -487,6 +503,7 @@
+
@@ -519,7 +536,7 @@
| 구독기간* |
- 개월
+ 개월
|
@@ -541,7 +558,7 @@
배송횟수* |
- 회
+ 회
|
배송주기* |
@@ -576,13 +593,13 @@
구독료* |
- 円(엔)
+ 円(엔)
|
1회 배송비* |
- 円(엔)
+ 円(엔)
|
@@ -596,7 +613,7 @@
실판매가* |
- 円(엔)
+ 円(엔)
|
@@ -631,7 +648,7 @@
가용재고 |
-
+
|
diff --git a/src/main/webapp/WEB-INF/views/sopmal/main/SubscribeR.jsp b/src/main/webapp/WEB-INF/views/sopmal/main/SubscribeR.jsp
index 8c1120b7..ed4ec2c7 100644
--- a/src/main/webapp/WEB-INF/views/sopmal/main/SubscribeR.jsp
+++ b/src/main/webapp/WEB-INF/views/sopmal/main/SubscribeR.jsp
@@ -57,6 +57,7 @@
$('#selpric').text(fn_format_number(data.selpric) + curUnit);
$('#dscntRaito').text(data.dscntRaito + '%');
$('#subsvcDc').html(data.subsvcDc);
+ fn_hide_subsvcDetail(data.subPd, data.dlvyCnt, data.selpric);
$("#fixedImg").attr("src", cdnurl + data.img);
$('#fixedTitle').text(data.subsvcConcatNm);
@@ -83,6 +84,25 @@
});
}
+ /******************************************************
+ * 구독서비스 상세 숨기기
+ * ****************************************************/
+ const fn_hide_subsvcDetail = function(subPd, dlvyCnt, selpric) {
+ function isEmpty(val) {
+ return !val || val === 0;
+ }
+ function hideIf(condition, find, base) {
+ let target = base ? $(base).closest(find) : $(find);
+ $(target).toggle(!condition);
+ }
+
+ hideIf(isEmpty(subPd), 'li', '#subPd');
+ hideIf(isEmpty(dlvyCnt), 'li', '#dlvyCnt');
+ hideIf(isEmpty(subPd) && isEmpty(dlvyCnt), '.box', '#subPd');
+ hideIf(isEmpty(selpric), '.box', '#selpric');
+ hideIf(isEmpty(selpric), '#fixedButton');
+ }
+
/*************************************************************
구매하기 버튼
**************************************************************/
diff --git a/src/main/webapp/WEB-INF/views/sopmal_m/main/SubscribeR.jsp b/src/main/webapp/WEB-INF/views/sopmal_m/main/SubscribeR.jsp
index 47438b18..a9da20b7 100644
--- a/src/main/webapp/WEB-INF/views/sopmal_m/main/SubscribeR.jsp
+++ b/src/main/webapp/WEB-INF/views/sopmal_m/main/SubscribeR.jsp
@@ -51,6 +51,7 @@
$('#subsvcDc').html(
data.mblSubsvcDcPcSameAt === "N" ? data.mblSubsvcDc : data.subsvcDc
);
+ fn_hide_subsvcDetail(data.subPd, data.dlvyCnt, data.selpric);
switch (data.subsvcSttusCd) {
case '01':
@@ -72,6 +73,25 @@
});
}
+ /******************************************************
+ * 구독서비스 상세 숨기기
+ * ****************************************************/
+ const fn_hide_subsvcDetail = function(subPd, dlvyCnt, selpric) {
+ function isEmpty(val) {
+ return !val || val === 0;
+ }
+ function hideIf(condition, find, base) {
+ let target = base ? $(base).closest(find) : $(find);
+ $(target).toggle(!condition);
+ }
+
+ hideIf(isEmpty(subPd), 'dl', '#subPd');
+ hideIf(isEmpty(dlvyCnt), 'dl', '#dlvyCnt');
+ hideIf(isEmpty(subPd) && isEmpty(dlvyCnt), '.productDetailInfo__info');
+ hideIf(isEmpty(selpric), '.productDetailInfo__price');
+ hideIf(isEmpty(selpric), '#subscribeBtn');
+ }
+
/*************************************************************
구매하기 버튼
**************************************************************/
@@ -105,6 +125,11 @@
padding: 16px;
}
+ .productDetailInfo__info > dl > dt,
+ .productDetailInfo__info > dl > dd {
+ font-size: 14px;
+ }
+
#subsvcDc {
padding: clamp(12px, 3%, 18px);
border-radius: 8px;
@@ -147,9 +172,6 @@
%
-
- 구독 서비스 상품 설명
-
+
+ 구독 서비스 상품 설명
+