상품관리 > 상품조회 > 상품 등록/복사재등록/수정 - 상품명(영문), HS Code, 실무게(KG) 추가

This commit is contained in:
이대환
2026-05-19 11:16:34 +09:00
parent 7e54dd22f9
commit 5da6ad42d0
6 changed files with 1537 additions and 1461 deletions

View File

@@ -587,6 +587,18 @@
alert('상품명을 입력해 주세요')
return false;
}
const goodsNmEn = $('#goodsNmEn')
if(fn_is_empty(goodsNmEn.val())){
goodsNmEn.focus()
alert('상품명(영문)을 입력해 주세요')
return false;
}
const goodsNmEnAlphabet = goodsNmEn.val().replace(/[0-9]/g, '');
if (goodsNmEnAlphabet.length < 10) {
goodsNmEn.focus();
alert('상품명(영문)은 숫자를 제외한 영문 기준 10자 이상 입력해 주세요');
return false;
}
//재고에 따른 판매여부
const goodsinvntryPolicy = $('#goodsDftinfoInvntryPolicy1')
@@ -2522,10 +2534,10 @@
<input type="hidden" id="sopmalCd" name="sopmalCd" value="${resultMap.BOGoodsVO.sopmalCd}"/>
</div>
</td>
<th>간략설명</th>
<th>상품명(영문)<span class="red-7">*</span></th>
<td>
<div class="td-inner">
<input class="input-text full" type="text" title="간략설명" id="srtDc" name="srtDc" placeholder="간략한 상품 설명을 입력해 주세요.">
<input class="input-text full" type="text" title="상품명(영문)" id="goodsNmEn" name="goodsNmEn" maxlength="35" placeholder="상품명을 입력해 주세요.">
</div>
</td>
</tr>
@@ -2536,6 +2548,20 @@
<input class="input-text full" type="text" title="대표설명" id="reprsntDc" name="reprsntDc" placeholder="상품 대표설명을 입력해 주세요.">
</div>
</td>
<th>간략설명</th>
<td>
<div class="td-inner">
<input class="input-text full" type="text" title="간략설명" id="srtDc" name="srtDc" placeholder="간략한 상품 설명을 입력해 주세요.">
</div>
</td>
</tr>
<tr>
<th>검색어</th>
<td>
<div class="td-inner">
<input class="input-text full" type="text" title="검색어" id="kwrd" name="kwrd" placeholder="검색어는 ,(콤마)로 구분됩니다.">
</div>
</td>
<th>브랜드</th>
<td>
<div class="td-inner">
@@ -2552,20 +2578,6 @@
</div>
</td>
</tr>
<tr>
<th>검색어</th>
<td>
<div class="td-inner">
<input class="input-text full" type="text" title="검색어" id="kwrd" name="kwrd" placeholder="검색어는 ,(콤마)로 구분됩니다.">
</div>
</td>
<th>대표 상품 코드(네이버)</th>
<td>
<div class="td-inner">
<input class="input-text full" type="text" title="대표 상품 코드(네이버)" id="reprsntGoodsCd" name="reprsntGoodsCd">
</div>
</td>
</tr>
<tr>
<th>리뷰 연동</th>
<td>
@@ -3005,190 +3017,202 @@
</div>
</div>
<div class="radio-tab-content" id="radio-tab-01">
<div>
<div class="table-wrapper">
<div style="overflow-x: auto; overflow-y: hidden;">
<div class="table-wrapper" style="width: 100%;">
<table class="table vertical tight draggable" id="normal_option">
<caption>일반옵션</caption>
<colgroup>
<col style="width: 13%;">
<col style="width: 12%;">
<col style="width: 60px;">
<col style="width: 60px;">
<col style="width: auto;">
<col style="width: 8%;">
<col style="width: 7%;">
<col style="width: 4%;">
<col style="width: 4%;">
<col style="width: 4%;">
<%-- <col style="width: 4%;">--%>
<col style="width: 5%;">
<col style="width: 6%;">
<col style="width: 6%;">
<col style="width: 13%;">
<col style="width: 5%;">
<col style="width: 12%;">
<col style="width: 100px;">
<col style="width: 6%;">
<col style="width: 5%;">
<col style="width: 60px;">
<col style="width: 60px;">
<col style="width: 80px;">
</colgroup>
<thead>
<tr>
<%-- <th>순서</th>--%>
<th>옵션명
<%-- <button id="fn_add_normal_option_row" type="button" class="btn xxsm outline">추가</button>--%>
</th>
<th>노출</th>
<th>기준</th>
<th>옵션값
</th>
<th>상품코드</th>
<th>재고</th>
<th>소비자가</th>
<th>판매가</th>
<th>마일리지</th>
<th>재고품절시
<div class="select-box d-inline-block">
<select class="short" title="재고품절시 노출 상태" id="invntrySldoutExpsrAt_normal" name="invntrySldoutExpsrAt_normal">
<option value="N">미노출</option>
<option value="Y">노출</option>
</select>
</div>
</th>
<th>설명</th>
<th>복수<br/>할인<br/>적용</th>
<th>구간<br/>할인<br/>적용</th>
<th>관리</th>
</tr>
<tr>
<th>옵션명</th>
<th>노출</th>
<th>기준</th>
<th>옵션값</th>
<th>상품코드</th>
<th>HS Code</th>
<th>실무게(KG)</th>
<th>재고</th>
<th>소비자가</th>
<th>판매가</th>
<th>마일리지</th>
<th>재고품절시
<div class="select-box d-inline-block">
<select class="short" title="재고품절시 노출 상태" id="invntrySldoutExpsrAt_normal" name="invntrySldoutExpsrAt_normal">
<option value="N">미노출</option>
<option value="Y">노출</option>
</select>
</div>
</th>
<th>설명</th>
<th>복수<br/>할인<br/>적용</th>
<th>구간<br/>할인<br/>적용</th>
<th>관리</th>
</tr>
</thead>
<tbody id="normal_option_tbody">
<tr>
<%-- <td>--%>
<%-- <div class="draggable-icon-container">--%>
<%-- <i class="icon icon_draggable"></i>--%>
<%-- <span class="visually-hidden">순서 바꾸기</span>--%>
<%-- </div>--%>
<%-- </td>--%>
<td>
<div class="optionApply__inputList">
<div class="optionApply__inputContainer">
<input class="input-text full" type="text" name="optnNm1_normal" title="옵션명" id="optnNm1_normal0">
<%-- <button type="button" class="btn outline xsm optionDel01">삭제</button>--%>
<button type="button" class="btn outline xsm optionVal98" >옵션값 추가</button>
<tr>
<%--<td>
<div class="draggable-icon-container">
<i class="icon icon_draggable"></i>
<span class="visually-hidden">순서 바꾸기</span>
</div>
</div>
</td>
<td>
<div class="optnExpsrAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="optnExpsrAt_normal">
<label class="b-checkbox checkbox is-medium" for="optnExpsrAt01-0">
<input type="checkbox" id="optnExpsrAt01-0" value="Y" name="optnExpsrAt_normal" checked>
<span class="check"></span>
</label>
</div>
</div>
</td>
<td id="td_stdrDvAt_normal">
<div class="stdrDvAt_normalList" style=" height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="custom-radio" style="display: flex;align-items: center;justify-content: center;height: 24px;">
<input type="radio" id="stdrDvAt01-0" name="stdrDvAt_normal" value="Y" class="checked" checked>
<label for="stdrDvAt01-0"></label>
</div>
</div>
</td>
<td><div class="optionApply__inputList">
<div class="optionApply__inputContainer">
<div class="optionApply__moveBtnContainer">
<button type="button" class="optionApply__moveBtn optionMove01 up"><span class="visually-hidden">위로</span></button>
<button type="button" class="optionApply__moveBtn optionMove01 down"><span class="visually-hidden">아래로</span></button>
</div>
<input class="input-text full" type="text" id="optnVal1" name="optnVal1_normal" title="옵션값">
</div>
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" title="상품코드" name="optnCd1_normal">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="invntryQy0" name="invntryQy_normal" title="재고">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="cnsmrpric0" name="cnsmrpric_normal" title="소비자가">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="slepric0" name="slepric_normal" title="판매자가">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<div class="input-container gap-4">
<div class="select-box">
<select class="short" title="일반옵션 마일리지정책코드" style="display: none;" name="mlgPolicyCd_normal">
<option value="01">통합</option>
<option value="02">개별</option>
</select>
<div class="nice-select short" tabindex="0"><span class="current">통합</span>
<ul class="list">
<li data-value="01" class="option selected">통합</li>
<li data-value="02" class="option">개별</li>
</ul>
</td>--%>
<td>
<div class="optionApply__inputList">
<div class="optionApply__inputContainer">
<input class="input-text full" type="text" name="optnNm1_normal" title="옵션명" id="optnNm1_normal0">
<%-- <button type="button" class="btn outline xsm optionDel01">삭제</button>--%>
<button type="button" class="btn outline xsm optionVal98" >옵션값 추가</button>
</div>
</div>
<input class="input-text sm number right" value="" type="text" id="mlgAccmlAmt" name="mlgAccmlAmt_normal" title="마일리지" disabled>
<div class="select-box">
<select class="short" title="일반옵션 마일리지구분코드" style="display: none;" name="mlgAccmlCd_normal" disabled>
<option value="02">${curUnit}</option>
<option value="01">%</option>
</select>
<div class="nice-select short disabled"
tabindex="0"><span class="current">${curUnit}</span>
<ul class="list">
<li data-value="02" class="option selected">${curUnit}</li>
<li data-value="01" class="option">%</li>
</ul>
</td>
<td>
<div class="optnExpsrAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="optnExpsrAt_normal">
<label class="b-checkbox checkbox is-medium" for="optnExpsrAt01-0">
<input type="checkbox" id="optnExpsrAt01-0" value="Y" name="optnExpsrAt_normal" checked>
<span class="check"></span>
</label>
</div>
</div>
</div>
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<div class="optionApply__miscText invntrySldoutExpsrAt_normal">미노출</div>
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" id="optnInfo0" name="optnInfo_normal" title="설명">
</div>
</td>
<td>
<div class="compnbDscntAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="compnbDscntAt_normal">
<label class="b-checkbox checkbox" for="compnbDscntAt01_0">
<input type="checkbox" value="Y" id="compnbDscntAt01_0" name="compnbDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</td>
<td id="td_stdrDvAt_normal">
<div class="stdrDvAt_normalList" style=" height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="custom-radio" style="display: flex;align-items: center;justify-content: center;height: 24px;">
<input type="radio" id="stdrDvAt01-0" name="stdrDvAt_normal" value="Y" class="checked" checked>
<label for="stdrDvAt01-0"></label>
</div>
</div>
</div>
</td>
<td>
<div class="sctnDscntAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="sctnDscntAt_normal">
<label class="b-checkbox checkbox" for="sctnDscntAt01_0">
<input type="checkbox" value="Y" id="sctnDscntAt01_0" name="sctnDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</td>
<td>
<div class="optionApply__inputList">
<div class="optionApply__inputContainer">
<div class="optionApply__moveBtnContainer">
<button type="button" class="optionApply__moveBtn optionMove01 up"><span class="visually-hidden">위로</span></button>
<button type="button" class="optionApply__moveBtn optionMove01 down"><span class="visually-hidden">아래로</span></button>
</div>
<input class="input-text full" type="text" id="optnVal1" name="optnVal1_normal" title="옵션값">
</div>
</div>
</div>
</td>
<td>
<div class="optionApply__inputList">
<div class="manage-btn-container">
<button class="btn xsm dark optionDel02">삭제</button>
</div>
</div>
</td>
</tr>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" title="상품코드" name="optnCd1_normal">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" value="220600" title="HS Code" name="hscode_normal" maxlength="10">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" value="0.0" title="실무게(KG)" name="realWt_normal">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="invntryQy0" name="invntryQy_normal" title="재고">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="cnsmrpric0" name="cnsmrpric_normal" title="소비자가">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full number right" value="0" type="text" id="slepric0" name="slepric_normal" title="판매자가">
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<div class="input-container gap-4">
<div class="select-box">
<select class="short" title="일반옵션 마일리지정책코드" style="display: none;" name="mlgPolicyCd_normal">
<option value="01">통합</option>
<option value="02">개별</option>
</select>
<div class="nice-select short" tabindex="0"><span class="current">통합</span>
<ul class="list">
<li data-value="01" class="option selected">통합</li>
<li data-value="02" class="option">개별</li>
</ul>
</div>
</div>
<input class="input-text sm number right" value="" type="text" id="mlgAccmlAmt" name="mlgAccmlAmt_normal" title="마일리지" disabled>
<div class="select-box">
<select class="short" title="일반옵션 마일리지구분코드" style="display: none;" name="mlgAccmlCd_normal" disabled>
<option value="02">${curUnit}</option>
<option value="01">%</option>
</select>
<div class="nice-select short disabled"
tabindex="0"><span class="current">${curUnit}</span>
<ul class="list">
<li data-value="02" class="option selected">${curUnit}</li>
<li data-value="01" class="option">%</li>
</ul>
</div>
</div>
</div>
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<div class="optionApply__miscText invntrySldoutExpsrAt_normal">미노출</div>
</div>
</td>
<td>
<div class="optionApply__priceContainer">
<input class="input-text full" type="text" id="optnInfo0" name="optnInfo_normal" title="설명">
</div>
</td>
<td>
<div class="compnbDscntAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="compnbDscntAt_normal">
<label class="b-checkbox checkbox" for="compnbDscntAt01_0">
<input type="checkbox" value="Y" id="compnbDscntAt01_0" name="compnbDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</div>
</div>
</td>
<td>
<div class="sctnDscntAt_normalList" style="height: 100%; display: flex; flex-direction: column; justify-content: space-around;">
<div class="sctnDscntAt_normal">
<label class="b-checkbox checkbox" for="sctnDscntAt01_0">
<input type="checkbox" value="Y" id="sctnDscntAt01_0" name="sctnDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</div>
</div>
</td>
<td>
<div class="optionApply__inputList">
<div class="manage-btn-container">
<button class="btn xsm dark optionDel02">삭제</button>
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
@@ -3982,16 +4006,17 @@
let sctnDscntAt_normal_num = removeTrailingNumber(chkboxExpsrAt) + sctnDscntAt_normal_length
let tdCount = 0;
const $closestTr = $(this).closest('tr');
//옵션명
$closestTr.find('td:eq(0) .optionApply__inputList').append(
`<div class="optionApply__inputContainer">
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__inputList').append(`
<div class="optionApply__inputContainer" style="margin: 0">
<input class="input-text full `+optnNm.attr('id')+`" type="hidden" value="`+optnNmVal+`" title="일반옵션명" name="optnNm1_normal">
</div>`
);
</div>
`);
//노출여부
$closestTr.find('td:eq(1) .optnExpsrAt_normalList').append(`
$closestTr.find('td:eq(' + tdCount++ + ') .optnExpsrAt_normalList').append(`
<div class="optnExpsrAt_normal">
<label class="b-checkbox checkbox is-medium" for="`+optnExpsrAt_normal_num+`">
<input type="checkbox" id="`+optnExpsrAt_normal_num+`" value="Y" name="optnExpsrAt_normal" checked>
@@ -3999,141 +4024,136 @@
</label>
</div>
`);
$closestTr.find('td:eq(2) .stdrDvAt_normalList').append(`
$closestTr.find('td:eq(' + tdCount++ + ') .stdrDvAt_normalList').append(`
<div class="custom-radio">
<input type="radio" value="Y" title="일반옵션 기준여부" id="`+stdrDvAt_normal_num+`" name="stdrDvAt_normal" style="display: flex;align-items: center;justify-content: center;height: 24px;">
<label for="`+stdrDvAt_normal_num+`"></label>
</div>
`);
$closestTr.find('td:eq(3) .optionApply__inputList').append(
`<div class="optionApply__inputContainer">
<div class="optionApply__moveBtnContainer">
<button type="button" class="optionApply__moveBtn optionMove01 up"><span class="visually-hidden">위로</span></button>
<button type="button" class="optionApply__moveBtn optionMove01 down"><span class="visually-hidden">아래로</span></button>
</div>
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__inputList').append(`
<div class="optionApply__inputContainer">
<div class="optionApply__moveBtnContainer">
<button type="button" class="optionApply__moveBtn optionMove01 up"><span class="visually-hidden">위로</span></button>
<button type="button" class="optionApply__moveBtn optionMove01 down"><span class="visually-hidden">아래로</span></button>
</div>
<input class="input-text full" value="" type="text" title="일반옵션값" name="optnVal1_normal">
</div>`
);
$closestTr.find('td:eq(4) .optionApply__priceContainer').append(
`
<input class="input-text full" type="text" title="일반옵션코드" name="optnCd1_normal">
`
);
</div>
`);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full" type="text" title="일반옵션코드" name="optnCd1_normal">
`);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full" value="220600" type="text" title="HS Code" name="hscode_normal" maxlength="10">
`);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full" value="0.0" type="text" title="실무게(KG)" name="realWt_normal">
`);
//재고와 상관없이 판매일 경우 옵션재고 disabled
if($('input[name="invntryPolicyCd"]:checked').val() ==='02'){
$closestTr.find('td:eq(5) .optionApply__priceContainer').append(
`
<input class="input-text full number right" value="0" type="text" title="일반옵션 재고" name="invntryQy_normal" disabled>
`
);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full number right" value="0" type="text" title="일반옵션 재고" name="invntryQy_normal" disabled>
`);
}else{
$closestTr.find('td:eq(5) .optionApply__priceContainer').append(
`
<input class="input-text full number right" value="0" type="text" title="일반옵션 재고" name="invntryQy_normal">
`
);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full number right" value="0" type="text" title="일반옵션 재고" name="invntryQy_normal">
`);
}
$closestTr.find('td:eq(6) .optionApply__priceContainer').append(
`
<input class="input-text full number right" value="0" type="text" title="일반옵션 소비자가" name="cnsmrpric_normal">
`
);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full number right" value="0" type="text" title="일반옵션 소비자가" name="cnsmrpric_normal">
`);
$closestTr.find('td:eq(7) .optionApply__priceContainer').append(
`
<input class="input-text full number right" value="0" type="text" title="일반옵션 판매가" name="slepric_normal">
`
);
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full number right" value="0" type="text" title="일반옵션 판매가" name="slepric_normal">
`);
$closestTr.find('td:eq(8) .optionApply__priceContainer').append(
`
<div class="input-container gap-4">
<div class="select-box">
<select class="short"
title="일반옵션 마일리지정책코드"
style="display: none;" name="mlgPolicyCd_normal">
<option value="01">통합</option>
<option value="02">개별</option>
</select>
<div class="nice-select short"
tabindex="0"><span class="current">통합</span>
<ul class="list">
<li data-value="01"
class="option selected">통합
</li>
<li data-value="02"
class="option">개별
</li>
</ul>
</div>
</div>
<input class="input-text sm number right"
value="" type="text" id="mlgAccmlAmt" name="mlgAccmlAmt_normal" disabled
title="일반옵션 마일리지구분코드">
<div class="select-box">
<select class="short"
title="일반옵션 마일리지구분코드"
style="display: none;" name="mlgAccmlCd_normal" disabled>
<option value="02">` + curUnit + `</option>
<option value="01">%</option>
</select>
<div class="nice-select short disabled"
tabindex="0"><span class="current">` + curUnit + `</span>
<ul class="list">
<li data-value=""
class="option selected">` + curUnit + `
</li>
<li data-value=""
class="option">%
</li>
</ul>
</div>
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<div class="input-container gap-4">
<div class="select-box">
<select class="short"
title="일반옵션 마일리지정책코드"
style="display: none;" name="mlgPolicyCd_normal">
<option value="01">통합</option>
<option value="02">개별</option>
</select>
<div class="nice-select short"
tabindex="0"><span class="current">통합</span>
<ul class="list">
<li data-value="01"
class="option selected">통합
</li>
<li data-value="02"
class="option">개별
</li>
</ul>
</div>
</div>
`
);
<input class="input-text sm number right"
value="" type="text" id="mlgAccmlAmt" name="mlgAccmlAmt_normal" disabled
title="일반옵션 마일리지구분코드">
<div class="select-box">
<select class="short"
title="일반옵션 마일리지구분코드"
style="display: none;" name="mlgAccmlCd_normal" disabled>
<option value="02">` + curUnit + `</option>
<option value="01">%</option>
</select>
<div class="nice-select short disabled"
tabindex="0"><span class="current">` + curUnit + `</span>
<ul class="list">
<li data-value=""
class="option selected">` + curUnit + `
</li>
<li data-value=""
class="option">%
</li>
</ul>
</div>
</div>
</div>
`);
$closestTr.find('td:eq(9) .optionApply__priceContainer').append(
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(
dynamicInvntrySldoutExpsrAt
);
$closestTr.find('td:eq(10) .optionApply__priceContainer').append(
`
<input class="input-text full" type="text" title="일반옵션 정보" name="optnInfo_normal">
`
);
$closestTr.find('td:eq(11) .compnbDscntAt_normalList').append(
`
<div class="compnbDscntAt_normal">
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer').append(`
<input class="input-text full" type="text" title="일반옵션 정보" name="optnInfo_normal">
`);
$closestTr.find('td:eq(' + tdCount++ + ') .compnbDscntAt_normalList').append(`
<div class="compnbDscntAt_normal">
<label class="b-checkbox checkbox" for="compnbDscntAt01_`+compnbDscntAt_normal_length+`">
<input type="checkbox" value="Y" id="compnbDscntAt01_`+compnbDscntAt_normal_length+`" name="compnbDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</div>
`
);
$closestTr.find('td:eq(12) .sctnDscntAt_normalList').append(
`
`);
$closestTr.find('td:eq(' + tdCount++ + ') .sctnDscntAt_normalList').append(`
<div class="sctnDscntAt_normal">
<label class="b-checkbox checkbox" for="sctnDscntAt01_`+sctnDscntAt_normal_length+`">
<input type="checkbox" value="Y" id="sctnDscntAt01_`+sctnDscntAt_normal_length+`" name="sctnDscntAt_normal" checked>
<span class="check"></span><span class="control-label"></span>
</label>
</div>
`
);
$closestTr.find('td:eq(13) .manage-btn-container').append(
`
<button class="btn xsm dark optionDel02">삭제</button>
`
);
`);
$closestTr.find('td:eq(' + tdCount++ + ') .manage-btn-container').append(`
<button class="btn xsm dark optionDel02">삭제</button>
`);
});
// 옵션타입-옵션명, 옵션값 입력값 제한(영문+숫자만)
$(document).on('input', 'input[name=optnNm1_normal], input[name=optnVal1_normal]', function () {
this.value = this.value.replace(/[^a-zA-Z0-9]/g, '');
});
// 실무게 자릿수 제한
$(document).on('input', 'input[name="realWt_normal"]', function () {
this.value = this.value.replace(/(\.\d).*/,'$1');
});
// 하이픈 뒤에 숫자한자리만 남기기
function removeTrailingNumber(id) {
@@ -4423,21 +4443,23 @@
return false;
}
$closestTr.find('td:eq(0) .optionApply__inputList .optionApply__inputContainer').eq(optionIndex).remove();
$closestTr.find('td:eq(1) .optnExpsrAt_normalList .optnExpsrAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(2) .stdrDvAt_normalList .custom-radio').eq(optionIndex).remove();
$closestTr.find('td:eq(3) .optionApply__inputContainer').eq(optionIndex).remove();
$closestTr.find('td:eq(4) .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(5) .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(6) .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(7) .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(8) .optionApply__priceContainer .input-container').eq(optionIndex).remove();
$closestTr.find('td:eq(9) .optionApply__priceContainer .optionApply__miscText').eq(optionIndex).remove();
$closestTr.find('td:eq(10) .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(11) .compnbDscntAt_normalList .compnbDscntAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(12) .sctnDscntAt_normalList .sctnDscntAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(13) .manage-btn-container .btn').eq(optionIndex).remove();
let tdCount = 0;
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__inputList .optionApply__inputContainer').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optnExpsrAt_normalList .optnExpsrAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .stdrDvAt_normalList .custom-radio').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__inputContainer').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-container').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .optionApply__miscText').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .optionApply__priceContainer .input-text').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .compnbDscntAt_normalList .compnbDscntAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .sctnDscntAt_normalList .sctnDscntAt_normal').eq(optionIndex).remove();
$closestTr.find('td:eq(' + tdCount++ + ') .manage-btn-container .btn').eq(optionIndex).remove();
});
// 추가구성옵션-옵션값삭제
@@ -4468,54 +4490,42 @@
$(document).on('click', '.optionMove01', function () {
var $closestTr = $(this).closest('tr');
var optionIndex = $(this).closest('.optionApply__inputContainer').index();
var optnExpsrAt_normalList = $closestTr.find('td:eq(1) .optnExpsrAt_normalList');
var stdrDvAt_normalList = $closestTr.find('td:eq(2) .stdrDvAt_normalList');
var $optionApplyInputList3 = $closestTr.find('td:eq(3) .optionApply__inputList');
var $optionApplyPriceList0 = $closestTr.find('td:eq(4) .optionApply__priceContainer');
var $optionApplyPriceList1 = $closestTr.find('td:eq(5) .optionApply__priceContainer');
var $optionApplyPriceList2 = $closestTr.find('td:eq(6) .optionApply__priceContainer');
var $optionApplyPriceList3 = $closestTr.find('td:eq(7) .optionApply__priceContainer');
var $optionApplyPriceList4 = $closestTr.find('td:eq(8) .optionApply__priceContainer');
var $optionApplyInputList2 = $closestTr.find('td:eq(9) .optionApply__priceContainer');
var $optionApplymiscTextList = $closestTr.find('td:eq(10) .optionApply__priceContainer');
var $compnbDscntAt_normalList = $closestTr.find('td:eq(11) .compnbDscntAt_normalList');
var $sctnDscntAt_normalList = $closestTr.find('td:eq(12) .sctnDscntAt_normalList');
var $optionApplyBtnList = $closestTr.find('td:eq(13) .manage-btn-container');
if ($(this).hasClass('up')) {
if (optionIndex > 0) {
optnExpsrAt_normalList.children().eq(optionIndex).insertBefore(optnExpsrAt_normalList.children().eq(optionIndex - 1));
stdrDvAt_normalList.children().eq(optionIndex).insertBefore(stdrDvAt_normalList.children().eq(optionIndex - 1));
$optionApplyInputList3.children().eq(optionIndex).insertBefore($optionApplyInputList3.children().eq(optionIndex - 1));
$optionApplyPriceList0.children().eq(optionIndex).insertBefore($optionApplyPriceList0.children().eq(optionIndex - 1));
$optionApplyPriceList1.children().eq(optionIndex).insertBefore($optionApplyPriceList1.children().eq(optionIndex - 1));
$optionApplyPriceList2.children().eq(optionIndex).insertBefore($optionApplyPriceList2.children().eq(optionIndex - 1));
$optionApplyPriceList3.children().eq(optionIndex).insertBefore($optionApplyPriceList3.children().eq(optionIndex - 1));
$optionApplyPriceList4.children().eq(optionIndex).insertBefore($optionApplyPriceList4.children().eq(optionIndex - 1));
$optionApplyInputList2.eq(optionIndex).insertBefore($optionApplyInputList2.eq(optionIndex - 1));
$optionApplymiscTextList.children().eq(optionIndex).insertBefore($optionApplymiscTextList.children().eq(optionIndex - 1));
$compnbDscntAt_normalList.children().eq(optionIndex).insertBefore($compnbDscntAt_normalList.children().eq(optionIndex - 1));
$sctnDscntAt_normalList.children().eq(optionIndex).insertBefore($sctnDscntAt_normalList.children().eq(optionIndex - 1));
$optionApplyBtnList.children().eq(optionIndex).insertBefore($optionApplyBtnList.children().eq(optionIndex - 1));
const selectors = [
'.optionApply__inputList',
'.optnExpsrAt_normalList',
'.stdrDvAt_normalList',
'.optionApply__inputList',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.optionApply__priceContainer',
'.compnbDscntAt_normalList',
'.sctnDscntAt_normalList',
'.manage-btn-container'
];
const targets = selectors.map((sclass, tdCount) => {
return $closestTr.find('td:eq(' + tdCount + ') ' + sclass);
});
const isUp = $(this).hasClass('up');
const maxLength = targets[0].children().length;
targets.forEach(function (target) {
const current = target.children().eq(optionIndex);
if (isUp) {
if (optionIndex > 0)
current.insertBefore(target.children().eq(optionIndex - 1));
} else {
if (optionIndex < maxLength - 1)
current.insertAfter(target.children().eq(optionIndex + 1));
}
} else {
if (optionIndex < optnExpsrAt_normalList.children().length - 1) {
optnExpsrAt_normalList.children().eq(optionIndex).insertAfter(optnExpsrAt_normalList.children().eq(optionIndex + 1));
stdrDvAt_normalList.children().eq(optionIndex).insertAfter(stdrDvAt_normalList.children().eq(optionIndex + 1));
$optionApplyInputList3.children().eq(optionIndex).insertAfter($optionApplyInputList3.children().eq(optionIndex + 1));
$optionApplyPriceList0.children().eq(optionIndex).insertAfter($optionApplyPriceList0.children().eq(optionIndex + 1));
$optionApplyPriceList1.children().eq(optionIndex).insertAfter($optionApplyPriceList1.children().eq(optionIndex + 1));
$optionApplyPriceList2.children().eq(optionIndex).insertAfter($optionApplyPriceList2.children().eq(optionIndex + 1));
$optionApplyPriceList3.children().eq(optionIndex).insertAfter($optionApplyPriceList3.children().eq(optionIndex + 1));
$optionApplyPriceList4.children().eq(optionIndex).insertAfter($optionApplyPriceList4.children().eq(optionIndex + 1));
$optionApplyInputList2.eq(optionIndex).insertAfter($optionApplyInputList2.eq(optionIndex + 1));
$optionApplymiscTextList.children().eq(optionIndex).insertAfter($optionApplymiscTextList.children().eq(optionIndex + 1));
$compnbDscntAt_normalList.children().eq(optionIndex).insertAfter($compnbDscntAt_normalList.children().eq(optionIndex + 1));
$sctnDscntAt_normalList.children().eq(optionIndex).insertAfter($sctnDscntAt_normalList.children().eq(optionIndex + 1));
// $optionApplyInputTextList.eq(optionIndex).insertAfter($optionApplyInputTextList.eq(optionIndex + 1));
$optionApplyBtnList.children().eq(optionIndex).insertAfter($optionApplyBtnList.children().eq(optionIndex + 1));
}
}
});
});
// 추가구성옵션-옵션값 순서변경