fix : 관리자 구독서비스 삭제 및 상세
This commit is contained in:
@@ -13,7 +13,7 @@ public interface BOSubsvcMapper {
|
||||
|
||||
/** 구독서비스 목록 조회*/
|
||||
List<DataMap> selectBOSubsvcList(BOSubsvcVO vo);
|
||||
/** 구독서비스 상세 조회*/
|
||||
/** 구독서비스 상세 조회 (관리자에서 사용함)*/
|
||||
DataMap selectBOSubsvcDetail(BOSubsvcVO vo);
|
||||
|
||||
/** 관리자 구독서비스 목록 조회*/
|
||||
@@ -24,4 +24,5 @@ public interface BOSubsvcMapper {
|
||||
List<DataMap> selectBOMngrSrchSubsvcGnrList(BOSubsvcVO vo);
|
||||
/** 관리자 구독서비스 선택 삭제*/
|
||||
int deleteBOMngrSubsvc(BOSubsvcVO vo);
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class BOSubsvcVO extends AbstractVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 구독서비스고유번호 */
|
||||
@
|
||||
private String subsvcInnb;
|
||||
/** 쇼핑몰코드 */
|
||||
private String sopmalCd;
|
||||
@@ -76,6 +77,8 @@ private static final long serialVersionUID = 1L;
|
||||
private String dftGoodsOptnInnb;
|
||||
/** 최종처리차수 */
|
||||
private String lastProcsOdr;
|
||||
/** 삭제섬네일이미지경로 */
|
||||
private String delImg;
|
||||
|
||||
|
||||
/** 검색조건 */
|
||||
|
||||
@@ -114,6 +114,47 @@ public class SubsvcController {
|
||||
return "mngr/goods/subsvc/SubsvcListForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 수정화면
|
||||
* @param vo
|
||||
* @return SubsvcDtlU.jsp
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectSubsvcDtlForm")
|
||||
public String selectSubsvcDtlForm(BOSubsvcVO vo, ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
AnonymousUser user = MemberJwtContextHolder.getMemberInfo();
|
||||
if ("01".equals(user.getSysDvCd())) {
|
||||
vo.setSopmalCd(user.getSopmalCd());
|
||||
}
|
||||
|
||||
Map<String, Object> content = new HashMap<>();
|
||||
content.put("paramVO", vo);
|
||||
|
||||
// 구독서비스 상세조회
|
||||
DataMap subsvcDtl = service.selectBOSubsvcDetail(vo);
|
||||
content.put("subsvcDtl", subsvcDtl);
|
||||
|
||||
//판매상태
|
||||
BOMaComncdVO param = new BOMaComncdVO();
|
||||
param.setGroupCd("GOODS_STTUS");
|
||||
List<?> subsvcSttusList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("subsvcSttusList", subsvcSttusList);
|
||||
|
||||
//노출구분
|
||||
param.setGroupCd("EXPSR_DV");
|
||||
List<?> expsrDvList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("expsrDvList", expsrDvList);
|
||||
|
||||
//가용재고정책
|
||||
param.setGroupCd("INVNTRY_POLICY");
|
||||
List<?> invntryPolicyList = boMaComncdService.selectBOCommcdDetailList(param);
|
||||
content.put("invntryPolicyList", invntryPolicyList);
|
||||
|
||||
model.addAttribute("resultMap", content);
|
||||
return "mngr/goods/subsvc/SubsvcU";
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 목록 조회 리스트
|
||||
* @param vo
|
||||
@@ -157,6 +198,7 @@ public class SubsvcController {
|
||||
|
||||
return "mngr/goods/subsvc/SubsvcList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 구독서비스 선택삭제
|
||||
* @param vo
|
||||
|
||||
@@ -31,26 +31,34 @@
|
||||
SELECT GS.SUBSVC_INNB
|
||||
, GS.SOPMAL_CD
|
||||
, GS.SUBSVC_NM
|
||||
, GS.SUBSVC_GNR
|
||||
, GS.SUBSVC_GNR_NM
|
||||
, GS.SUB_PD /*구독기간*/
|
||||
, GS.SUBSVC_GNR /*기수*/
|
||||
, GS.SUBSVC_GNR_NM /*기수명*/
|
||||
, CONCAT(GS.SUBSVC_NM, ' (', GS.SUBSVC_GNR_NM, ')') AS SUBSVC_CONCAT_NM
|
||||
, GS.DLVY_CNT
|
||||
, GS.DLVY_CYCLE
|
||||
, GS.INVNTRY_QY
|
||||
, GS.INVNTRY_QY - GS.USEFUL_INVNTRY_QY AS AVAIL_QT /*가용재고*/
|
||||
, GS.SUBSVC_STTUS_CD
|
||||
, FN_GET_COMMCODE_NAME('GOODS_STTUS', GS.SUBSVC_STTUS_CD) AS SUBSVC_STTUS
|
||||
, FN_GET_COMMCODE_NAME('EXPSR_DV', GS.EXPSR_DV_CD) AS EXPSR_DV
|
||||
, GS.DLVY_CNT /*배송횟수*/
|
||||
, GS.DLVY_CYCLE /*배송주기*/
|
||||
, GS.SUBSVC_CT /*구독료*/
|
||||
, GS.TME_DLVY_AMT /*1회배송비*/
|
||||
, GS.CNSMRPRIC /*소비자가*/
|
||||
, GS.SUBSVC_CT + (TME_DLVY_AMT * DLVY_CNT) AS SELPRIC /*실판매가=구독료+(1회배송비X배송횟수)*/
|
||||
, GS.SUBSVC_CT + (TME_DLVY_AMT * DLVY_CNT) as SELPRIC /*실판매가=구독료+(1회배송비X배송횟수)*/
|
||||
, ROUND((GS.CNSMRPRIC - (GS.SUBSVC_CT + (TME_DLVY_AMT * DLVY_CNT))) / NULLIF(GS.CNSMRPRIC, 0) * 100, 0) AS DSCNT_RAITO
|
||||
, GS.IMG
|
||||
, GS.SUBSVC_DC
|
||||
, GS.MBL_SUBSVC_DC
|
||||
, GS.MBL_SUBSVC_DC_PC_SAME_AT
|
||||
, GS.SUB_PD
|
||||
, GS.INVNTRY_QY /*재고수량*/
|
||||
, GS.USEFUL_INVNTRY_QY /*판매재고수량*/
|
||||
, GS.INVNTRY_QY - GS.USEFUL_INVNTRY_QY AS AVAIL_QT /*가용제고*/
|
||||
, GS.SUBSVC_STTUS_CD /*상태코드*/
|
||||
, FN_GET_COMMCODE_NAME('GOODS_STTUS', GS.SUBSVC_STTUS_CD) AS SUBSVC_STTUS
|
||||
, FN_GET_COMMCODE_NAME('EXPSR_DV', GS.EXPSR_DV_CD) AS EXPSR_DV
|
||||
, GS.EXPSR_DV_CD /*노출구분코드*/
|
||||
, GS.EXPSR_BGN_DT /*노출시작일시*/
|
||||
, GS.EXPSR_END_DT /*노출종료일시*/
|
||||
, GS.INVNTRY_POLICY_CD /*재고정책코드*/
|
||||
, GS.AVLINV_LMTT_QY /*가용재고제한수량*/
|
||||
, GS.SUBSVC_DC /*구독서비스 설명*/
|
||||
, GS.IMG /*섬네일 이미지*/
|
||||
, GS.MBL_SUBSVC_DC /*모바일 구독서비스 설명*/
|
||||
, GS.MBL_SUBSVC_DC_PC_SAME_AT /*모바일 구독서비스 설명 PC동일여부*/
|
||||
, GS.LAST_PROCS_ODR /*최종차수*/
|
||||
, GS.DFT_GOODS_OPTN_INNB /*기본상품옵션고유번호*/
|
||||
FROM GC_SUBSVC GS
|
||||
WHERE GS.SOPMAL_CD = #{sopmalCd}
|
||||
AND GS.SUBSVC_INNB = #{subsvcInnb}
|
||||
@@ -79,7 +87,7 @@
|
||||
, GC.SUBSVC_CT /*구독료*/
|
||||
, GC.TME_DLVY_AMT /*1회배송비*/
|
||||
, GC.CNSMRPRIC /*소비자가*/
|
||||
, GC.SUBSVC_CT + (TME_DLVY_AMT * DLVY_CNT) as RL_SLEPRIC /*실판매가=구독료+(1회배송비X배송횟수)*/
|
||||
, GC.SUBSVC_CT + (TME_DLVY_AMT * DLVY_CNT) as SELPRIC /*실판매가=구독료+(1회배송비X배송횟수)*/
|
||||
, GC.IMG /*섬네일 이미지*/
|
||||
, GC.LAST_PROCS_ODR /*최종차수*/
|
||||
FROM GC_SUBSVC GC
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<td><fmt:formatNumber value="${subsvc.subsvcCt}" pattern="#,###"/></td>
|
||||
<td><fmt:formatNumber value="${subsvc.tmeDlvyAmt}" pattern="#,###"/></td>
|
||||
<td><fmt:formatNumber value="${subsvc.cnsmrpric}" pattern="#,###"/></td>
|
||||
<td><fmt:formatNumber value="${subsvc.rlSlepric}" pattern="#,###"/></td>
|
||||
<td><fmt:formatNumber value="${subsvc.selpric}" pattern="#,###"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
|
||||
@@ -26,11 +26,20 @@
|
||||
|
||||
</head>
|
||||
<script>
|
||||
var initFlag = true;
|
||||
$(document).ready(function () {
|
||||
let pageIndex = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
|
||||
let pageUnit = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
|
||||
let pageIndex = $("#pageIndex").val();
|
||||
let pageUnit = $("#pageUnit").val();
|
||||
let srchSelSubsvcNm = $('#srchSelSubsvcNm').val();
|
||||
// event 제어
|
||||
fn_event();
|
||||
|
||||
if(srchSelSubsvcNm != ''){
|
||||
fn_getsubsvcGnr(srchSelSubsvcNm);
|
||||
}else{
|
||||
// 목록 조회
|
||||
fn_select_list(pageIndex, pageUnit);
|
||||
}
|
||||
|
||||
// 엔터키 검색
|
||||
$('#listForm').on('keydown', function (event) {
|
||||
@@ -39,8 +48,6 @@
|
||||
fn_select_list(1);
|
||||
}
|
||||
});
|
||||
// event 제어
|
||||
fn_event();
|
||||
});
|
||||
|
||||
/*********************************************************
|
||||
@@ -54,13 +61,12 @@
|
||||
} else {
|
||||
$('#pageIndex').val(pageIndex);
|
||||
}
|
||||
|
||||
//정렬기준 셋팅
|
||||
if(typeof $('#sortDvView') !== 'undefined'){
|
||||
if(typeof $('#sortDvView') !== undefined && $('#sortDvView').val() !== undefined){
|
||||
$('#sortDv').val($('#sortDvView').val());
|
||||
}
|
||||
//한페이지 목록개수 셋팅
|
||||
if(typeof $('#pageUnitView') !== 'undefined'){
|
||||
if(typeof $('#pageUnitView') !== undefined && $('#pageUnitView').val() !== undefined){
|
||||
$('#pageUnit').val($('#pageUnitView').val());
|
||||
}
|
||||
|
||||
@@ -142,6 +148,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
/* 목록 > 전체선택 체인지 이벤트 */
|
||||
$(document).on('change', '#checkAll', function () {
|
||||
let checkbox = $(this).closest('table').find('input[name="arrSubsvcInnb"]');
|
||||
|
||||
$(checkbox).prop('checked', false);
|
||||
$(checkbox).prop('checked', $(this).is(':checked'));
|
||||
});
|
||||
}
|
||||
|
||||
/* ****************************
|
||||
* 해당구독서비스 기수조회 AJAX
|
||||
******************************/
|
||||
@@ -163,7 +178,19 @@
|
||||
|
||||
for (let i = 0; i < srchSubsvcGnrList.length; i++) {
|
||||
const srchSubsvcGnr = srchSubsvcGnrList[i];
|
||||
var check = "";
|
||||
if(srchSubsvcGnr.subsvcGnr == '${resultMap.paramVO.srchSelSubsvcGnr}'){
|
||||
check ="selected"
|
||||
}
|
||||
console.log("check:",check," resultMap.paramVO.srchSelSubsvcGnr", '${resultMap.paramVO.srchSelSubsvcGnr}');
|
||||
if(initFlag == true){
|
||||
$('#srchSelSubsvcGnr').append('<option value="' + srchSubsvcGnr.subsvcGnr + '" '+ check+'>' + srchSubsvcGnr.subsvcGnrNm + '</option>');
|
||||
fn_select_list();
|
||||
initFlag = false;
|
||||
}else{
|
||||
$('#srchSelSubsvcGnr').append('<option value="' + srchSubsvcGnr.subsvcGnr + '">' + srchSubsvcGnr.subsvcGnrNm + '</option>');
|
||||
|
||||
}
|
||||
}
|
||||
$('#srchSelSubsvcGnr').niceSelect('update');
|
||||
}
|
||||
@@ -175,15 +202,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* 목록 > 전체선택 체인지 이벤트 */
|
||||
$(document).on('change', '#checkAll', function () {
|
||||
let checkbox = $(this).closest('table').find('input[name="arrSubsvcInnb"]');
|
||||
|
||||
$(checkbox).prop('checked', false);
|
||||
$(checkbox).prop('checked', $(this).is(':checked'));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 체크박스 전체 처리
|
||||
* */
|
||||
@@ -289,9 +307,6 @@
|
||||
//1차 카테고리 일경우 카테고리 번호 비우기
|
||||
$('#ctgryId').val('')
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
@@ -322,8 +337,8 @@
|
||||
</div>
|
||||
<form id='listForm' name="listForm" method="post" action="<c:url value="/mngr/goods/subsvc/selectSubsvcList"/>">
|
||||
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex }"/>
|
||||
<input type="hidden" id="sortDv" name="sortDv" value="">
|
||||
<input type="hidden" id="pageUnit" name="pageUnit" value="">
|
||||
<input type="hidden" id="sortDv" name="sortDv" value="${ resultMap.paramVO.sortDv }">
|
||||
<input type="hidden" id="pageUnit" name="pageUnit" value="${ resultMap.paramVO.pageUnit }">
|
||||
<input type="hidden" id="subsvcInnb" name="subsvcInnb" value="">
|
||||
<section class="content-section" id="search-section">
|
||||
<div class="table-wrapper">
|
||||
@@ -342,7 +357,7 @@
|
||||
<select title="구독서비스" id="srchSelSubsvcNm" name="srchSelSubsvcNm">
|
||||
<option value="" <c:if test="${ resultMap.paramVO.srchSelSubsvcNm eq ''}">selected="selected"</c:if>>전체</option>
|
||||
<c:forEach items="${resultMap.srchSubsvcList}" var="srchSubsvc" varStatus="status">
|
||||
<option value="${srchSubsvc.subsvcNm}" <c:if test="${ resultMap.paramVO.srchSelSubsvcNm eq srchSubsvc}">selected="selected"</c:if>>${srchSubsvc.subsvcNm}</option>
|
||||
<option value="${srchSubsvc.subsvcNm}" <c:if test="${ resultMap.paramVO.srchSelSubsvcNm eq srchSubsvc.subsvcNm}">selected="selected"</c:if>>${srchSubsvc.subsvcNm}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
@@ -358,13 +373,13 @@
|
||||
<th>구독서비스명</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcNm" name="srchSubsvcNm" value="<c:out value="${ resultMap.BOGoodsVO.srchSubsvcNm }" />">
|
||||
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcNm" name="srchSubsvcNm" value="<c:out value="${ resultMap.paramVO.srchSubsvcNm }" />">
|
||||
</div>
|
||||
</td>
|
||||
<th>기수명</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcGnrNm" name="srchSubsvcGnrNm" value="<c:out value="${ resultMap.BOGoodsVO.srchSubsvcGnrNm }" />">
|
||||
<input class="input-text xl" type="text" title="구독서비스명" id="srchSubsvcGnrNm" name="srchSubsvcGnrNm" value="<c:out value="${ resultMap.paramVO.srchSubsvcGnrNm }" />">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -374,13 +389,13 @@
|
||||
<div class="td-inner">
|
||||
<div class="b-checkbox-container">
|
||||
<label class="b-checkbox checkbox check-all">
|
||||
<input id="srchArrSubsvcSttusCd-all" type="checkbox" name="srchArrSubsvcSttusCd-all" value="" checked onclick="fn_change_event('srchArrSubsvcSttusCd', 'all');">
|
||||
<input id="srchArrSubsvcSttusCd-all" type="checkbox" name="srchArrSubsvcSttusCd-all" <c:if test="${resultMap.paramVO.srchArrSubsvcSttusCd == null || fn:length(resultMap.paramVO.srchArrSubsvcSttusCd) == 3}" >checked</c:if> value="" onclick="fn_change_event('srchArrSubsvcSttusCd', 'all');">
|
||||
<span class="check"></span>
|
||||
<span class="subsvcSttus-all">전체</span>
|
||||
</label>
|
||||
<c:forEach items="${resultMap.srchSubsvcSttusList}" var="srchSubsvcSttus" varStatus="status">
|
||||
<label class="b-checkbox checkbox">
|
||||
<input type="checkbox" name="srchArrSubsvcSttusCd" value="${srchSubsvcSttus.cd}" onclick="fn_change_event('srchArrSubsvcSttusCd', 'other');" checked>
|
||||
<input type="checkbox" name="srchArrSubsvcSttusCd" value="${srchSubsvcSttus.cd}" onclick="fn_change_event('srchArrSubsvcSttusCd', 'other');" <c:if test="${resultMap.paramVO.srchArrSubsvcSttusCd == null || fn:contains(resultMap.paramVO.srchArrSubsvcSttusCd, srchSubsvcSttus.cd) }">checked</c:if>>
|
||||
<span class="check"></span>
|
||||
<span class="control-label">${srchSubsvcSttus.cdNm}</span>
|
||||
</label>
|
||||
@@ -393,12 +408,12 @@
|
||||
<div class="td-inner">
|
||||
<div class="custom-radio-container">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="srchExpsrDvCd" name="srchExpsrDvCd" value="" checked>
|
||||
<input type="radio" id="srchExpsrDvCd" name="srchExpsrDvCd" value="" <c:if test="${resultMap.paramVO.srchExpsrDvCd eq '' || resultMap.paramVO.srchExpsrDvCd == null}">checked</c:if>>
|
||||
<label for="srchExpsrDvCd">전체</label>
|
||||
</div>
|
||||
<c:forEach items="${resultMap.srchExpsrDvList}" var="srchExpsrDvCd" varStatus="status">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="srchExpsrDvCd${status.count}" name="srchExpsrDvCd" value="${srchExpsrDvCd.cd}">
|
||||
<input type="radio" id="srchExpsrDvCd${status.count}" name="srchExpsrDvCd" value="${srchExpsrDvCd.cd}"<c:if test="${srchExpsrDvCd.cd eq resultMap.paramVO.srchExpsrDvCd}">checked</c:if>>
|
||||
<label for="srchExpsrDvCd${status.count}">${srchExpsrDvCd.cdNm}</label>
|
||||
</div>
|
||||
</c:forEach>
|
||||
|
||||
811
src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp
Normal file
811
src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcU.jsp
Normal file
@@ -0,0 +1,811 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui" %>
|
||||
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld" %>
|
||||
|
||||
<%--
|
||||
Class Name : SubsvcU.jsp
|
||||
Description : 구독서비스 상세
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
------- -------- ---------------------------
|
||||
2026-01-27 jazz 최초생성
|
||||
--%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>일반 관리자</title>
|
||||
<%-- 공통 include --%>
|
||||
<%@ include file="/WEB-INF/views/comm/mngr/Include.jsp"%>
|
||||
</head>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
//페이지 로드 시 숫자 인풋 정규화( 3자리 컴마)
|
||||
$('.input-text.number').each(function () {
|
||||
var input = $(this).val();
|
||||
$(this).val(input.replace(/[^0-9]/g, "").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"));
|
||||
});
|
||||
|
||||
const expsrSetTable = document.getElementById('expsrSet');
|
||||
//노출예약 체크되어있을 경우 enable 처리
|
||||
if($("input[name='expsrDvCd']:checked").val() ==='03'){
|
||||
enableTableInputs(expsrSetTable)
|
||||
}
|
||||
|
||||
const sopmalCd = $('#sopmalCd').val()
|
||||
fn_create_ckeditor('#subsvcDc', sopmalCd); //상세 설명 > 상품 설명 ck에디터 적용
|
||||
fn_create_ckeditor('#mblSubsvcDc', sopmalCd); // 모바일용 상세 설명 > 모바일용 상품 설명 ck에디터 적용
|
||||
/* 모바일용 상세 설명 설정 이벤트 */
|
||||
fn_handleMblSubsvcDcPcSameAt();
|
||||
|
||||
//모바일용 상세 설명 설정 이벤트 설정
|
||||
$('[name="mblSubsvcDcPcSameAt"]').on('change', fn_handleMblSubsvcDcPcSameAt);
|
||||
|
||||
//실판매가 자동계산 이벤트 등록
|
||||
$('[name="dlvyCnt"]').on('change', fn_cal_selpric);
|
||||
$('[name="subsvcCt"]').on('change', fn_cal_selpric);
|
||||
$('[name="tmeDlvyAmt"]').on('change', fn_cal_selpric);
|
||||
|
||||
});
|
||||
|
||||
//숫자 인풋 포커스시 0 제거
|
||||
$(document).on("focus", '.input-text.number',function () {
|
||||
if(fn_nvl($(this).val(), '0') === '0'){
|
||||
$(this).val('');
|
||||
}
|
||||
});
|
||||
|
||||
//재고와 상관없이 판매일 경우 옵션재고 disabled
|
||||
$(document).on('change', 'input[name="invntryPolicyCd"]',function () {
|
||||
|
||||
let normalQy = $('input[name="invntryQy_normal"]');
|
||||
let invntryQy = $('input[name="invntryQy_invntry"]');
|
||||
let addeddQy = $('input[name="invntryQy_added"]');
|
||||
|
||||
if($(this).val() === '02'){
|
||||
normalQy.prop('disabled', true)
|
||||
invntryQy.prop('disabled', true)
|
||||
addeddQy.prop('disabled', true)
|
||||
}else{
|
||||
normalQy.prop('disabled', false)
|
||||
invntryQy.prop('disabled', false)
|
||||
addeddQy.prop('disabled', false)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
//예약 판매설정 체크 해제시 예약상품 배송일자, 안내문구 빈값 처리
|
||||
$(document).on('click', '#goodsExpsrTy02', function () {
|
||||
if(!$(this).prop('checked')){
|
||||
$('#resveGoods input').val('')
|
||||
}
|
||||
})
|
||||
|
||||
//노출여부 노출예약이 아닐경우 노출 정보 빈값 처리
|
||||
$(document).on('click', 'input[name="expsrDvCd"]', function () {
|
||||
const target = $('#expsrDvCd3')
|
||||
if($(this).attr('id') !== target.attr('id')){
|
||||
$('#expsrSet input').val('')
|
||||
}
|
||||
})
|
||||
|
||||
//재고와 상관없이 판매일 경우 가용재고제한수량 빈값처리
|
||||
$(document).on('click', '#invntryPolicyCd2', function () {
|
||||
$('#avlinvLmttQy').val('')
|
||||
})
|
||||
|
||||
/* ********************************************************
|
||||
* 모바일용 상세설명 설정 enable-disable
|
||||
******************************************************** */
|
||||
function fn_handleMblSubsvcDcPcSameAt() {
|
||||
if($('[name="mblSubsvcDcPcSameAt"]:checked').val() === 'Y'){
|
||||
$('.mobileSubsvcCn').hide();
|
||||
}else{
|
||||
$('.mobileSubsvcCn').show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ********************************************************
|
||||
* 노출여부 enable-disable
|
||||
******************************************************** */
|
||||
function handleRadioClick2(radio) {
|
||||
//노출쳬약 객체
|
||||
const lastRadio = document.querySelector('#expsrDvCd3');
|
||||
const table = document.getElementById('expsrSet');
|
||||
|
||||
if (radio === lastRadio) {
|
||||
enableTableInputs(table);
|
||||
} else {
|
||||
disableTableInputs(table);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 재고에 따른 판매 enable-disable
|
||||
******************************************************** */
|
||||
function handleRadioClickDisable(radio) {
|
||||
const firstRadio = document.querySelector('input[name="invntryPolicyCd"]:first-of-type');
|
||||
const inputText = document.getElementById('avlinvLmttQy');
|
||||
|
||||
if (radio === firstRadio) {
|
||||
inputText.disabled = false;
|
||||
} else {
|
||||
inputText.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* enable-disable
|
||||
******************************************************** */
|
||||
function enableTableInputs(table) {
|
||||
const inputs = table.querySelectorAll('input');
|
||||
inputs.forEach(input => input.disabled = false);
|
||||
}
|
||||
|
||||
function disableTableInputs(table) {
|
||||
const inputs = table.querySelectorAll('input');
|
||||
inputs.forEach(input => input.disabled = true);
|
||||
}
|
||||
|
||||
function convertToDate(dateStr) {
|
||||
// 입력된 문자열을 Date 객체로 변환
|
||||
const date = new Date(dateStr);
|
||||
// 유효하지 않은 날짜인 경우 null 반환
|
||||
if (isNaN(date.getTime())) {
|
||||
return null;
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
//시간을 분으로 변경하는 함수
|
||||
function timeToMinutes(timeStr) {
|
||||
// 시간과 분을 ':'를 기준으로 분리
|
||||
const [hours, minutes] = timeStr.split(':').map(Number);
|
||||
// 시간을 분으로 변환
|
||||
return hours * 60 + minutes;
|
||||
}
|
||||
|
||||
//마지막 컴마 지우기
|
||||
const remove_Last_Comma = function removeLastComma(str) {
|
||||
const lastCommaIndex = str.lastIndexOf(',');
|
||||
if (lastCommaIndex !== -1) {
|
||||
return str.substring(0, lastCommaIndex);
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
const fn_create_input = function (type, name, value, tgtForm) {
|
||||
const input = document.createElement('input');
|
||||
input.setAttribute("type", type);
|
||||
input.setAttribute("name", name);
|
||||
input.setAttribute("value", value);
|
||||
tgtForm.appendChild(input);
|
||||
}
|
||||
|
||||
|
||||
/* ********************************************************
|
||||
* 리스트 바로가기
|
||||
******************************************************** */
|
||||
const fn_select_list = function () {
|
||||
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcListForm"/>';
|
||||
|
||||
$('#subsvcForm').attr('action', url);
|
||||
$('#subsvcForm').attr('method', 'post');
|
||||
$('#subsvcForm').submit();
|
||||
};
|
||||
|
||||
//모든 컴마 삭제 및 문자를 숫자로 변환
|
||||
const fn_comma_del_str_to_number = function (str) {
|
||||
|
||||
// null이나 undefined인 경우 0을 반환
|
||||
if (str === null || str === undefined || str.trim() === '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 쉼표를 제거하고 숫자로 변환
|
||||
const numberWithoutCommas = str.replace(/,/g, '');
|
||||
const number = parseFloat(numberWithoutCommas);
|
||||
|
||||
// 변환된 값이 NaN인 경우 0을 반환
|
||||
if (isNaN(number)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return number;
|
||||
|
||||
}
|
||||
|
||||
/* 에러메세지 처리 */
|
||||
const fn_proc_error_message = function(data) {
|
||||
$('#overlay').fadeOut();
|
||||
|
||||
if (!data.responseJSON.resBody.message) {
|
||||
alert('<spring:message code="error.internal-server"/>');
|
||||
} else {
|
||||
if (fn_check_json(data.responseJSON.resBody.message)) {
|
||||
const errorObject = JSON.parse(data.responseJSON.resBody.message);
|
||||
|
||||
if (!errorObject) {
|
||||
alert('<spring:message code="error.internal-server"/>');
|
||||
} else {
|
||||
if (!errorObject.errorMsg) {
|
||||
alert('<spring:message code="error.internal-server"/>');
|
||||
} else {
|
||||
alert(errorObject.errorMsg);
|
||||
|
||||
let isMtched = false;
|
||||
|
||||
$('.main').eq(0).find('input, select, textarea').each(function () {
|
||||
for (let idx = 0; idx < errorObject.errorFields.length; idx++) {
|
||||
const name = $(this).prop('name');
|
||||
|
||||
if (!fn_is_empty(name)) {
|
||||
if (errorObject.errorFields[idx].indexOf(name) >= 0) {
|
||||
isMtched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isMtched) {
|
||||
$(this).focus();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (data.responseJSON.resBody.message) {
|
||||
alert(data.responseJSON.resBody.message);
|
||||
} else {
|
||||
alert('<spring:message code="error.internal-server"/>');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//상품이미지 삭제
|
||||
const deleteFileImg = function (obj) {
|
||||
$("#delImg").val($("#img").val());
|
||||
|
||||
$(obj).parent('div.file-preview').parent('div.file-preview__container').remove()
|
||||
}
|
||||
|
||||
/*자동계산*/
|
||||
const fn_cal_selpric = function(){
|
||||
var dlvyCnt = $('#dlvyCnt'); //배송횟수
|
||||
var subsvcCt = $('#subsvcCt'); //구독료
|
||||
var tmeDlvyAmt = $('#tmeDlvyAmt'); //1회 배송비
|
||||
var selpric = $('#selpric'); //1회 배송비
|
||||
console.log("dlvyCnt.val()",Number(dlvyCnt.val())," tmeDlvyAmt.val()",Number(tmeDlvyAmt.val().replace(/,/g, '')),"subsvcCt.val()",subsvcCt.val().replace(/,/g, ''));
|
||||
selpric.val(((Number(dlvyCnt.val().replace(/,/g, '')) * Number(tmeDlvyAmt.val().replace(/,/g, ''))) + Number(subsvcCt.val().replace(/,/g, ''))).toLocaleString());
|
||||
}
|
||||
|
||||
/** 제약조건 체크 */
|
||||
const validate = function(){
|
||||
var retVal = true;
|
||||
//에디터내용을 textarea로 복사
|
||||
var subsvcDc = $('#subsvcDc');
|
||||
subsvcDc.val(fn_get_editor_data('#subsvcDc'));
|
||||
|
||||
// 텍스트 입력 내용중 필수 항목 체크
|
||||
$(':text[required]').each(function () {
|
||||
if($(this).hasClass('number')){
|
||||
if ($(this).val().trim() == '0') {
|
||||
alert($(this).prop('title')+"은(는) 필수입니다");
|
||||
$(this).focus();
|
||||
retVal = false;
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
if ($(this).val().trim() == '') {
|
||||
alert($(this).prop('title')+"은(는) 필수입니다");
|
||||
$(this).focus();
|
||||
retVal = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(!retVal){
|
||||
return retVal;
|
||||
}
|
||||
|
||||
//노출예약 인 경우 노출기간 필수
|
||||
if($('input[name="expsrDvCd"]:checked').val() == '03'){
|
||||
if($('#expsrBgnDt_dt').val().trim() == ''){
|
||||
alert($('#expsrBgnDt_dt').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
|
||||
$('#expsrBgnDt_dt').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#expsrBgnDt_time').val().trim().replaceAll(':','') == ''){
|
||||
alert($('#expsrBgnDt_time').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
|
||||
$('#expsrBgnDt_time').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#expsrEndDt_dt').val().trim() == ''){
|
||||
alert($('#expsrEndDt_dt').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
|
||||
$('#expsrEndDt_dt').focus();
|
||||
return false;
|
||||
}
|
||||
if($('#expsrEndDt_time').val().trim().replaceAll(':','') == ''){
|
||||
alert($('#expsrEndDt_time').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
|
||||
$('#expsrEndDt_time').focus();
|
||||
return false;
|
||||
}
|
||||
// 노출기간 셋팅
|
||||
const expsrBgnDt = $('#expsrBgnDt_dt').val() + ' ' +$('#expsrBgnDt_time').val() +':00'
|
||||
const expsrEndDt = $('#expsrEndDt_dt').val() + ' ' +$('#expsrEndDt_time').val() +':00'
|
||||
|
||||
$('#expsrBgnDt').val(expsrBgnDt);
|
||||
$('#expsrEndDt').val(expsrEndDt);
|
||||
}
|
||||
|
||||
//재고가 있으면 판매인 경우 개수 품절처리 필수
|
||||
if($('input[name="invntryPolicyCd"]:checked').val() == '01'){
|
||||
if($('#avlinvLmttQy').val() == ''){
|
||||
alert($('#avlinvLmttQy').prop('title')+"은(는) 노출여부가 노출예약인 경우 필수입니다");
|
||||
$('#avlinvLmttQy').focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//이미지 필수 체크
|
||||
if((($('#delImg').val() != '' || $('#img').val() == '') && imgDropzone.files.length != 1)){
|
||||
if(imgDropzone.files.length == 0){
|
||||
alert("대표이미지(섬네일)은(는) 필수입니다");
|
||||
}else{
|
||||
alert("대표이미지(섬네일)은(는) 1개만 등록가능합니다");
|
||||
}
|
||||
$('#img-dropzone')[0].scrollIntoView();
|
||||
// $('#img-dropzone').focus();
|
||||
return false;
|
||||
|
||||
}else if(imgDropzone.files.length > 1){
|
||||
alert("대표이미지(섬네일)은(는) 1개만 등록가능합니다");
|
||||
$('#img-dropzone').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
//상품설명 필수체크
|
||||
if(subsvcDc.val() == ''){
|
||||
alert(subsvcDc.prop('title')+"은(는) 필수입니다");
|
||||
CKEditorArray['#subsvcDc'].editing.view.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
//PC와 모바일 다르게 설정인 경우 모바일 상품설명 필수
|
||||
if($('input[name="mblSubsvcDcPcSameAt"]:checked').val() == 'N'){
|
||||
var mblSubsvcDc = $('#mblSubsvcDc');
|
||||
mblSubsvcDc.val(fn_get_editor_data('#mblSubsvcDc'));
|
||||
if(mblSubsvcDc.val().trim() == ''){
|
||||
alert(mblSubsvcDc.prop('title')+"은(는) 필수입니다");
|
||||
CKEditorArray['#mblSubsvcDc'].editing.view.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const fn_updateSubsvc = function (){
|
||||
if(!validate()){
|
||||
return false;
|
||||
}
|
||||
|
||||
const url = '<c:url value="/mngr/goods/subsvc/updateSubsvc"/>';
|
||||
var formData = new FormData($('#subsvcForm')[0]);
|
||||
|
||||
imgDropzone.files.forEach(function(file, index){
|
||||
console.log("file",file);
|
||||
//1개만 등록 되도록
|
||||
if(index == 0){
|
||||
alert();
|
||||
formData.append('files',file);
|
||||
}
|
||||
});
|
||||
|
||||
console.log("formData",formData);
|
||||
|
||||
if (confirm(`구독서비스를 <spring:message code="confirm.common.update"/>`)) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
enctype: 'multipart/form-data',
|
||||
url: url,
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
const message = JSON.parse(data.resBody.result).message;
|
||||
if(message == "success"){
|
||||
alert('<spring:message code="success.common.update"/>');
|
||||
//등록 후 수정화면으로 이동
|
||||
window.location.reload();
|
||||
} else {
|
||||
alert('<spring:message code="fail.common.update"/>');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<body>
|
||||
<%@ include file="/WEB-INF/views/comm/mngr/Header.jsp"%>
|
||||
<main class="main">
|
||||
<%@ include file="/WEB-INF/views/comm/mngr/Left.jsp"%>
|
||||
<div class="content">
|
||||
<div class="content__inner">
|
||||
<button class="side-nav__fold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
|
||||
<div class="page-title">
|
||||
<h2 class="page-title__title">
|
||||
<a href="javascript:void(0);" onclick="fn_move_goods_dtl_common(<c:out value="${resultMap.subsvcDtl.subsvcInnb}"/>, 'sopmal')">구독서비스 수정 (상품번호 : ${resultMap.subsvcDtl.subsvcInnb})</a>
|
||||
</h2>
|
||||
<div class="page-title__btn-container">
|
||||
<button onclick="fn_select_list()" class="btn outline"><spring:message code="button.list"/></button>
|
||||
<button onclick="fn_updateSubsvc();return false;" class="btn primary"><spring:message code="button.save"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<form id="subsvcForm" method="post" action="" enctype="multipart/form-data">
|
||||
<input type="hidden" id="sopmalCd" name="sopmalCd" value="${resultMap.paramVO.sopmalCd}">
|
||||
<input type="hidden" id="srchSelSubsvcNm" name="srchSelSubsvcNm" value="${resultMap.paramVO.srchSelSubsvcNm}">
|
||||
<input type="hidden" id="srchSubsvcNm" name="srchSubsvcNm" value="${resultMap.paramVO.srchSubsvcNm}">
|
||||
<input type="hidden" id="srchSelSubsvcGnr" name="srchSelSubsvcGnr" value="${resultMap.paramVO.srchSelSubsvcGnr}">
|
||||
<input type="hidden" id="srchSubsvcGnrNm" name="srchSubsvcGnrNm" value="${resultMap.paramVO.srchSubsvcGnrNm}">
|
||||
<c:forEach items="${resultMap.paramVO.srchArrSubsvcSttusCd}" var="srchSubsvcSttusCd" varStatus="status">
|
||||
<input type="hidden" id="srchArrSubsvcSttusCd${status.count}" name="srchArrSubsvcSttusCd" value="${srchSubsvcSttusCd}">
|
||||
</c:forEach>
|
||||
<input type="hidden" id="srchExpsrDvCd" name="srchExpsrDvCd" value="${resultMap.paramVO.srchExpsrDvCd}">
|
||||
<input type="hidden" id="sortDv" name="sortDv" value="${resultMap.paramVO.sortDv}">
|
||||
<input type="hidden" id="pageIndex" name="pageIndex" value="${ resultMap.paramVO.pageIndex }"/>
|
||||
<input type="hidden" id="pageUnit" name="pageUnit" value="${ resultMap.paramVO.pageUnit }">
|
||||
<input type="hidden" id="delImg" name="delImg" value="">
|
||||
<input type="hidden" id="expsrBgnDt" name="expsrBgnDt" value="${resultMap.subsvcDtl.expsrBgnDt}">
|
||||
<input type="hidden" id="expsrEndDt" name="expsrEndDt" value="${resultMap.subsvcDtl.expsrBgnDt}">
|
||||
<spring:eval expression="@environment.getProperty('spring.servlet.multipart.max-file-size')" var="maxFileSize"/>
|
||||
<spring:eval expression="@environment.getProperty('mngrfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
|
||||
<spring:eval expression="@environment.getProperty('mngrfo.common.fileupload.cdnurl')" var="cdnurl"/>
|
||||
<input type="hidden" id="cdnurl" value="${cdnurl}"/>
|
||||
|
||||
<section id="section01" class="content-section content-scroll-detect content-fold">
|
||||
<div class="content-fold__header">
|
||||
<h3 class="content-section__title">기본정보</h3>
|
||||
<button class="content-fold__btn"><span class="visually-hidden">접기</span></button>
|
||||
</div>
|
||||
<div class="content-fold__content">
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<caption>기본정보</caption>
|
||||
<colgroup>
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 38%">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 38%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>구독서비스명<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xl" type="text" title="구독서비스명" id="subsvcNm" name="subsvcNm" maxlength="100" value="${resultMap.subsvcDtl.subsvcNm}" required>
|
||||
</div>
|
||||
</td>
|
||||
<th>구독기간<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xsm number text-right" type="text" title="구독기간" id="subPd" name="subPd" maxlength="3" value="${resultMap.subsvcDtl.subPd}" required> 개월
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>기수</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xsm number text-right" type="text" title="기수" id="subsvcGnr" name="subsvcGnr" value="${resultMap.subsvcDtl.subsvcGnr}" readonly> 기
|
||||
</div>
|
||||
</td>
|
||||
<th>기수명<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xl" type="text" title="기수명" id="subsvcGnrNm" name="subsvcGnrNm" maxlength="80" value="${resultMap.subsvcDtl.subsvcGnrNm}" required>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>배송횟수<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text xsm number text-right" type="text" title="배송횟수" id="dlvyCnt" name="dlvyCnt" maxlength="3" value="${resultMap.subsvcDtl.dlvyCnt}" required> 회
|
||||
</div>
|
||||
</td>
|
||||
<th>배송주기<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm" type="text" title="배송주기" id="dlvyCycle" name="dlvyCycle" maxlength="30" value="${resultMap.subsvcDtl.dlvyCycle}" required>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="section02" class="content-section content-scroll-detect content-fold">
|
||||
<div class="content-fold__header">
|
||||
<h3 class="content-section__title">판매정보</h3>
|
||||
<button class="content-fold__btn"><span class="visually-hidden">접기</span></button>
|
||||
</div>
|
||||
<div class="content-fold__content">
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<caption>판매정보</caption>
|
||||
<colgroup>
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 38%">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 38%">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>구독료<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="구독료" id="subsvcCt" name="subsvcCt" maxlength="11" value="${resultMap.subsvcDtl.subsvcCt}" required> 円(엔)
|
||||
</div>
|
||||
</td>
|
||||
<th>1회 배송비<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="1회 배송비" id="tmeDlvyAmt" name="tmeDlvyAmt" maxlength="11" value="${resultMap.subsvcDtl.tmeDlvyAmt}" required> 円(엔)
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>소비자가</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="소비자가" id="cnsmrpric" name="cnsmrpric" maxlength="11" value="${resultMap.subsvcDtl.cnsmrpric}"> 円(엔)
|
||||
</div>
|
||||
</td>
|
||||
<th>실판매가<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="실판매가" id="selpric" name="selpric" maxlength="11" value="${resultMap.subsvcDtl.selpric}" readonly> 円(엔)
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="section03" class="content-section content-scroll-detect content-fold">
|
||||
<div class="content-fold__header">
|
||||
<h3 class="content-section__title">구독설정</h3>
|
||||
<button type="button" class="content-fold__btn"><span class="visually-hidden">접기</span></button>
|
||||
</div>
|
||||
<div class="content-fold__content">
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<caption>구독설정</caption>
|
||||
<colgroup>
|
||||
<col style="width: 12%;">
|
||||
<col>
|
||||
<col style="width: 12%;">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>판매 상태</th>
|
||||
<td colspan="2">
|
||||
<div class="td-inner">
|
||||
<div class="custom-radio-container">
|
||||
<c:forEach items="${resultMap.subsvcSttusList}" var="subsvcSttus" varStatus="status">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="subsvcSttusCd${status.count}" name="subsvcSttusCd" title="판매 상태" value="${subsvcSttus.cd}" <c:if test="${resultMap.subsvcDtl.subsvcSttusCd eq subsvcSttus.cd}">checked</c:if>/>
|
||||
<label for="subsvcSttusCd${status.count}">${subsvcSttus.cdNm}</label>
|
||||
<input type="hidden" value="${resultMap.subsvcDtl.subsvcSttusCd}" id="subsvcSttusCdChk"/>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>노출 여부</th>
|
||||
<td colspan="3">
|
||||
<div class="td-inner vertical">
|
||||
<div class="custom-radio-container mt-10">
|
||||
<c:forEach items="${resultMap.expsrDvList}" var="expsrDv" varStatus="status">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="expsrDvCd${status.count}" name="expsrDvCd" title="노출 여부" value="${expsrDv.cd}" onclick="handleRadioClick2(this);" <c:if test="${resultMap.subsvcDtl.expsrDvCd eq expsrDv.cd}">checked</c:if>/>
|
||||
<label for="expsrDvCd${status.count}">${expsrDv.cdNm}</label>
|
||||
<input type="hidden" value="${resultMap.subsvcDtl.expsrDvCd}" id="expsrDvCdChk"/>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div class="table-wrapper mt-10">
|
||||
<table class="table">
|
||||
<caption>노출 기간</caption>
|
||||
<colgroup>
|
||||
<col style="width: 16%;">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody id="expsrSet">
|
||||
<tr>
|
||||
<th>노출 기간</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" id="expsrBgnDt_dt" class="datepicker" title="시작 날짜 선택" autocomplete="off" value="${fn:split(resultMap.subsvcDtl.expsrBgnDt,'T')[0]}" disabled>
|
||||
<div class="timepicker-container">
|
||||
<input type="text" class="bs-timepicker" id="expsrBgnDt_time" title="시작 시간 설정" value="${fn:split(fn:split(resultMap.subsvcDtl.expsrBgnDt,'T')[1], ':')[0]}:${fn:split(fn:split(resultMap.subsvcDtl.expsrBgnDt,'T')[1], ':')[1]}" disabled>
|
||||
</div>
|
||||
<span class="tilde">~</span>
|
||||
<input type="text" id="expsrEndDt_dt" class="datepicker" title="종료 날짜 선택" autocomplete="off" value="${fn:split(resultMap.subsvcDtl.expsrEndDt,'T')[0]}" disabled>
|
||||
<div class="timepicker-container">
|
||||
<input type="text" class="bs-timepicker" id="expsrEndDt_time" title="종료 시간 설정" value="${fn:split(fn:split(resultMap.subsvcDtl.expsrEndDt,'T')[1], ':')[0]}:${fn:split(fn:split(resultMap.subsvcDtl.expsrEndDt,'T')[1], ':')[1]}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>재고에 따른 판매</th>
|
||||
<td colspan="3">
|
||||
<div class="td-inner">
|
||||
<div class="custom-radio-container">
|
||||
<c:forEach items="${resultMap.invntryPolicyList}" var="invntryPolicy" varStatus="status">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="invntryPolicyCd${status.count}" name="invntryPolicyCd" value="${invntryPolicy.cd}" onclick="handleRadioClickDisable(this);"<c:if test="${resultMap.subsvcDtl.invntryPolicyCd eq invntryPolicy.cd}">checked</c:if>/>
|
||||
<label for="invntryPolicyCd${status.count}">${invntryPolicy.cdNm}</label>
|
||||
</div>
|
||||
<c:if test="${status.first}">
|
||||
<div>
|
||||
<span class="ml-4">(</span>
|
||||
<input class="input-text number xsm ml-5 right" id="avlinvLmttQy" name="avlinvLmttQy" value="${resultMap.subsvcDtl.avlinvLmttQy}" type="text" title="해당 인풋에 대한 설명" <c:if test="${resultMap.subsvcDtl.invntryPolicyCd eq '02'}"> disabled</c:if> />
|
||||
개 이하 일 때 품절 처리
|
||||
<span class="ml-4">)</span>
|
||||
</div>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section id="section07" class="content-section content-scroll-detect content-fold">
|
||||
<div class="content-fold__header">
|
||||
<h3 class="content-section__title">구독서비스 설명</h3>
|
||||
<button class="content-fold__btn"><span class="visually-hidden">접기</span></button>
|
||||
</div>
|
||||
<div class="content-fold__content">
|
||||
<div class="table-wrapper">
|
||||
<table class="table">
|
||||
<caption>구독서비스 설명</caption>
|
||||
<colgroup>
|
||||
<col style="width: 12%;">
|
||||
<col>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>대표이미지(썸네일) 등록<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner vertical">
|
||||
<div class="dropzone-wrapper">
|
||||
<spring:eval expression="@environment.getProperty('mngrfo.common.fileupload.extensions.images')" var="acceptFileExtensions"/>
|
||||
<div class="dropzone" id="img-dropzone">
|
||||
</div><p class="fyi gray-7 mt-15">1개의 이미지만 등록가능합니다.</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>등록한 대표이미지(썸네일)</th>
|
||||
<td>
|
||||
<div class="td-inner" id="sortable">
|
||||
<c:if test="${not empty resultMap.subsvcDtl.img}">
|
||||
<div class="file-preview__container">
|
||||
<div class="file-preview">
|
||||
<span class="file-preview__number"></span>
|
||||
<button class="file-preview__delete" id="file-preview__delete" onclick="deleteFileImg(this)">
|
||||
<span class="visually-hidden">삭제</span></button>
|
||||
<div class="file-preview__image">
|
||||
<img src="<c:out value="${cdnurl}${resultMap.subsvcDtl.img}"/>" alt="구독서비스 이미지" onerror="this.src='/mngr/images/image_placeholder.png'" >
|
||||
<input type="hidden" id="img" name="img" value="<c:out value="${resultMap.subsvcDtl.img}"/>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>상품 설명<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner"><textarea class="textarea" title="상품 설명" cols="30" rows="10" id="subsvcDc" name="subsvcDc">${resultMap.subsvcDtl.subsvcDc}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>모바일용 상세 설명 설정</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<div class="custom-radio-container mr-5">
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="mblSubsvcDcPcSameAt1" name="mblSubsvcDcPcSameAt" value="Y" <c:if test="${ resultMap.subsvcDtl.mblSubsvcDcPcSameAt eq 'Y'}">checked</c:if>>
|
||||
<label for="mblSubsvcDcPcSameAt1">PC와 동일</label>
|
||||
</div>
|
||||
<div class="custom-radio">
|
||||
<input type="radio" id="mblSubsvcDcPcSameAt2" name="mblSubsvcDcPcSameAt" value="N" <c:if test="${ resultMap.subsvcDtl.mblSubsvcDcPcSameAt eq 'N'}">checked</c:if>>
|
||||
<label for="mblSubsvcDcPcSameAt2">PC와 모바일 다르게 설정</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="mobileSubsvcCn">
|
||||
<th>모바일용 상세 설명<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner"><textarea class="textarea" title="모바일용 상품 설명" cols="30" rows="10" id="mblSubsvcDc" name="mblSubsvcDc">${resultMap.subsvcDtl.mblSubsvcDc}</textarea>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modalDiv">
|
||||
|
||||
</div>
|
||||
<%--관리자 수정이력 내역보기 모달 --%>
|
||||
<div id="logDiv"></div>
|
||||
</main>
|
||||
<script>
|
||||
// Dropzone 파일업로드
|
||||
if ($("#img-dropzone").length > 0) {
|
||||
Dropzone.autoDiscover = false;
|
||||
var imgDropzone = new Dropzone("#img-dropzone", {
|
||||
url: "/file-upload",
|
||||
maxFiles: 1,
|
||||
maxFilesize: 20,
|
||||
autoProcessQueue: false,
|
||||
addRemoveLinks: true,
|
||||
dictDefaultMessage: "클릭하거나 파일을 여기로 드래그하세요",
|
||||
dictRemoveFile: "삭제",
|
||||
acceptedFiles: "${acceptFileExtensions}",
|
||||
dictCancelUpload: "취소",
|
||||
dictCancelUploadConfirmation: "업로드를 취소하시겠습니까?",
|
||||
dictInvalidFileType: "이 파일은 업로드할 수 없습니다.",
|
||||
dictFileTooBig: "파일이 너무 큽니다. ({{filesize}}MB). 최대 파일 크기: {{maxFilesize}}MB.",
|
||||
dictMaxFilesExceeded: "파일을 더 이상 추가할 수 없습니다.",
|
||||
dictResponseError: "서버에서 응답을 받지 못했습니다.",
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user