fix : 관리자 구독서비스 등록(복사)
This commit is contained in:
877
src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcC.jsp
Normal file
877
src/main/webapp/WEB-INF/views/mngr/goods/subsvc/SubsvcC.jsp
Normal file
@@ -0,0 +1,877 @@
|
||||
<%@ 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);
|
||||
|
||||
//재고변경 시 가용재고 계산
|
||||
$('#invntryQy').on('change', fn_cal_availQt);
|
||||
//구독서비스명 변경 시 중복체크 초기화
|
||||
$('#subsvcNm').on('change', fn_initDupCheck);
|
||||
});
|
||||
|
||||
//숫자 인풋 포커스시 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회 배송비
|
||||
selpric.val(((Number(dlvyCnt.val().replace(/,/g, '')) * Number(tmeDlvyAmt.val().replace(/,/g, ''))) + Number(subsvcCt.val().replace(/,/g, ''))).toLocaleString());
|
||||
}
|
||||
|
||||
/*가용재고 자동계산*/
|
||||
const fn_cal_availQt = function(){
|
||||
var invntryQy = $('#invntryQy');
|
||||
var usefulInvntryQy = $('#usefulInvntryQy');
|
||||
var availQt = $('#availQt');
|
||||
availQt.val(Number(invntryQy.val().replace(/,/g, '')) - Number(usefulInvntryQy.val().replace(/,/g, '')));
|
||||
}
|
||||
|
||||
/** 중복체크 초기화*/
|
||||
const fn_initDupCheck = function (){
|
||||
$('#dupCheck').val('false');
|
||||
}
|
||||
|
||||
/** 제약조건 체크 */
|
||||
const validate = function(){
|
||||
var retVal = true;
|
||||
//에디터내용을 textarea로 복사
|
||||
var subsvcDc = $('#subsvcDc');
|
||||
subsvcDc.val(fn_get_editor_data('#subsvcDc'));
|
||||
|
||||
//구독서비스명 중복확인
|
||||
var dupCheck = $('#dupCheck');
|
||||
if(typeof dupCheck.val() != 'undefined' && dupCheck.val() == 'false'){
|
||||
alert('구독서비스명 중복확인이 필요합니다.');
|
||||
return false;
|
||||
}
|
||||
// 텍스트 입력 내용중 필수 항목 체크
|
||||
$(':text[required]').each(function () {
|
||||
if($(this).hasClass('number')){
|
||||
if ($(this).val().trim() == '' || $(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(imgDropzone.files.length != 1){
|
||||
if(imgDropzone.files.length == 0){
|
||||
alert("대표이미지(섬네일)은(는) 필수입니다");
|
||||
}else{
|
||||
alert("대표이미지(섬네일)은(는) 1개만 등록가능합니다");
|
||||
}
|
||||
$('#img-dropzone')[0].scrollIntoView();
|
||||
// $('#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/insertSubsvc"/>';
|
||||
var formData = new FormData($('#subsvcForm')[0]);
|
||||
|
||||
imgDropzone.files.forEach(function(file, index){
|
||||
console.log("file",file);
|
||||
//1개만 등록 되도록
|
||||
if(index == 0){
|
||||
formData.append('files',file);
|
||||
}
|
||||
});
|
||||
|
||||
console.log("formData",formData);
|
||||
|
||||
if (confirm(`구독서비스를 <spring:message code="confirm.common.insert"/>`)) {
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
enctype: 'multipart/form-data',
|
||||
url: url,
|
||||
data: formData,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function (data) {
|
||||
try{
|
||||
const message = JSON.parse(data.resBody.result).message;
|
||||
if(message == "success"){
|
||||
alert('<spring:message code="success.common.insert"/>');
|
||||
//등록 후 목록화면으로 이동
|
||||
fn_select_list();
|
||||
} else {
|
||||
alert('<spring:message code="fail.common.insert"/>');
|
||||
}
|
||||
}catch (e) {
|
||||
alert('<spring:message code="fail.common.insert"/>');
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
alert('<spring:message code="fail.common.insert"/>');
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** 구독서비스 명칭 중복확인 */
|
||||
fn_subsvcNmDupCheck = function (subsvcNm){
|
||||
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcNmDupCheck"/>';
|
||||
|
||||
if(subsvcNm.val().trim() == ''){
|
||||
alert('구독서비스명을 입력해주세요.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: url,
|
||||
data: {
|
||||
'subsvcNm': subsvcNm.val()
|
||||
},
|
||||
success: function (data) {
|
||||
try{
|
||||
const message = JSON.parse(data.resBody.result).message;
|
||||
if(message == "success"){
|
||||
alert('사용가능한 구독서비스입니다.');
|
||||
$('#dupCheck').val('true');
|
||||
//check 컬럼에 true 등록
|
||||
} else {
|
||||
alert('동일한 구독서비스가 있습니다.');
|
||||
$('#dupCheck').val('false');
|
||||
//check 컬럼에 false 등록
|
||||
}
|
||||
}catch (e) {
|
||||
alert('<spring:message code="fail.common.select"/>');
|
||||
//check 컬럼에 false 등록
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
error: function (request, status, error) {
|
||||
alert('<spring:message code="fail.common.select"/>');
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</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">
|
||||
구독서비스 등록
|
||||
</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.insert"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<form id="subsvcForm" method="post" action="" enctype="multipart/form-data">
|
||||
<input type="hidden" id="subsvcInnb" name="subsvcInnb" value="">
|
||||
<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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.expsrBgnDt}</c:if>">
|
||||
<input type="hidden" id="expsrEndDt" name="expsrEndDt" value="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.expsrBgnDt}</c:if>">
|
||||
<input type="hidden" id="usefulInvntryQy" name="usefulInvntryQy" value="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.usefulInvntryQy}</c:if>">
|
||||
<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 lg" type="text" title="구독서비스명" id="subsvcNm" name="subsvcNm" maxlength="100" value="${resultMap.subsvcDtl.subsvcNm}" <c:if test='${resultMap.subsvcDtl != null}'>readonly</c:if> required>
|
||||
<c:if test='${resultMap.subsvcDtl == null}'>
|
||||
<button type="button" id="dupCheckButton" onclick="fn_subsvcNmDupCheck($('#subsvcNm'));return false;" class="btn xsm gray ml-5">중복확인</button>
|
||||
<input type="hidden" id="dupCheck" name="dupCheck" value="false">
|
||||
</c:if>
|
||||
</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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.subPd}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.subsvcNextGnr}</c:if><c:if test='${resultMap.subsvcDtl == null}'>1</c:if>" readonly> 기
|
||||
</div>
|
||||
</td>
|
||||
<th>기수명<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text lg" type="text" title="기수명" id="subsvcGnrNm" name="subsvcGnrNm" maxlength="80" value="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.subsvcGnrNm}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.dlvyCnt}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.dlvyCycle}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.subsvcCt}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.tmeDlvyAmt}</c:if>" 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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.cnsmrpric}</c:if>"> 円(엔)
|
||||
</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="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.selpric}</c:if>" 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>재고<span class="red-7">*</span></th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="재고" id="invntryQy" name="invntryQy" maxlength="11" value="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.invntryQy}</c:if>" required>
|
||||
</div>
|
||||
</td>
|
||||
<th>가용재고</th>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input class="input-text sm number text-right" type="text" title="가용재고" id="availQt" maxlength="11" value="<c:if test='${resultMap.subsvcDtl != null}'>${resultMap.subsvcDtl.availQt}</c:if>" readonly>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<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,' ')[0]}" disabled>
|
||||
<div class="timepicker-container">
|
||||
<input type="text" class="bs-timepicker" id="expsrBgnDt_time" title="시작 시간 설정" value="${fn:split(fn:split(resultMap.subsvcDtl.expsrBgnDt,' ')[1], ':')[0]}:${fn:split(fn:split(resultMap.subsvcDtl.expsrBgnDt,' ')[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,' ')[0]}" disabled>
|
||||
<div class="timepicker-container">
|
||||
<input type="text" class="bs-timepicker" id="expsrEndDt_time" title="종료 시간 설정" value="${fn:split(fn:split(resultMap.subsvcDtl.expsrEndDt,' ')[1], ':')[0]}:${fn:split(fn:split(resultMap.subsvcDtl.expsrEndDt,' ')[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>상품 설명<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>
|
||||
@@ -98,7 +98,7 @@
|
||||
* 구독서비스 복사 조회
|
||||
*********************************************************/
|
||||
const fn_move_subsvc_copy = (subsvcInnb) => {
|
||||
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcCopyForm"/>';
|
||||
const url = '<c:url value="/mngr/goods/subsvc/selectSubsvcRegistForm"/>';
|
||||
$('#subsvcInnb').val(subsvcInnb);
|
||||
|
||||
$('#listForm').attr('action', url);
|
||||
|
||||
@@ -357,6 +357,9 @@
|
||||
|
||||
$('#expsrBgnDt').val(expsrBgnDt);
|
||||
$('#expsrEndDt').val(expsrEndDt);
|
||||
}else if($('input[name="expsrDvCd"]:checked').val() != '03'){
|
||||
$('#expsrBgnDt').val('');
|
||||
$('#expsrEndDt').val('');
|
||||
}
|
||||
|
||||
//재고가 있으면 판매인 경우 개수 품절처리 필수
|
||||
@@ -434,12 +437,17 @@
|
||||
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 {
|
||||
try{
|
||||
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"/>');
|
||||
}
|
||||
}catch (e) {
|
||||
console.log(e);
|
||||
alert('<spring:message code="fail.common.update"/>');
|
||||
}
|
||||
}
|
||||
@@ -480,7 +488,7 @@
|
||||
<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}">
|
||||
<input type="hidden" id="expsrEndDt" name="expsrEndDt" value="${resultMap.subsvcDtl.expsrEndDt}">
|
||||
<input type="hidden" id="usefulInvntryQy" name="usefulInvntryQy" value="${resultMap.subsvcDtl.usefulInvntryQy}">
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user