|
|
@@ -57,7 +57,7 @@
|
|
|
<i class="fa fa-info-circle" aria-hidden="true"></i>옵션정보는 자동 등록 됩니다.</h3>
|
|
|
</li>
|
|
|
<li class="right">
|
|
|
- <th:block th:if="${sessionInfo.roleCd == 'G001_E000'}">
|
|
|
+ <th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001'}">
|
|
|
<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDetailSave">저장</button>
|
|
|
</th:block>
|
|
|
</li>
|
|
|
@@ -71,6 +71,7 @@
|
|
|
<li class="on"><a href="#goodstab1">기본정보</a></li>
|
|
|
<li><a href="#goodstab3">상품상세정보</a></li>
|
|
|
<li><a href="#goodstab4">고시정보</a></li>
|
|
|
+ <li id="goodsSafeTab"><a href="#goodstab5">안전인증</a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<!-- //TABS NAVI -->
|
|
|
@@ -195,10 +196,24 @@
|
|
|
</select>
|
|
|
</td>
|
|
|
<th>선물 주문가능여부<em class="required" title="필수"></em></th>
|
|
|
- <td colspan="3">
|
|
|
+ <td>
|
|
|
<label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnY" value="Y" />Y</label>
|
|
|
<label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnN" value="N" checked="checked"/>N</label>
|
|
|
</td>
|
|
|
+ <th>원가</th>
|
|
|
+ <td><input type="text" class="w100 aR" id="costPrice" name="costPrice" value="0" maxlength="10" data-valid-type="numeric" required="required" data-valid-name="원가"/> 원
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>정상가<em class="required" title="필수"></em></th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w100 aR" id="listPrice" name="listPrice" maxlength="10" data-valid-type="numeric" required="required" data-valid-name="정상가"/> 원
|
|
|
+ </td>
|
|
|
+ <th>판매가<em class="required" title="필수"></em></th>
|
|
|
+ <td><input type="text" class="w100 aR" id="currPrice" name="currPrice" maxlength="10" data-valid-type="numeric" required="required" data-valid-name="판매가"/> 원
|
|
|
+ </td>
|
|
|
+ <th>할인율</th>
|
|
|
+ <td class="aR" ><span id="dcRateTxt"></span> %</td>
|
|
|
</tr>
|
|
|
<tr id="selfGoodsNSellFeeRate">
|
|
|
<th>판매수수료율<em class="required" title="필수"></em></th>
|
|
|
@@ -422,6 +437,69 @@
|
|
|
<!-- //TAB4 CONTENTS AREA -->
|
|
|
</li>
|
|
|
<!-- //TAB4 : 고시정보 -->
|
|
|
+ <!-- TAB6 : 안전인증 -->
|
|
|
+ <li class="tab" id="goodstab5">
|
|
|
+ <div class="panelStyle">
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col width="11%"/>
|
|
|
+ <col width="22%"/>
|
|
|
+ <col width="11%"/>
|
|
|
+ <col width="22%"/>
|
|
|
+ <col width="11%"/>
|
|
|
+ <col/>
|
|
|
+ </colgroup>
|
|
|
+ <tr>
|
|
|
+ <th>인증대상</th>
|
|
|
+ <td colspan="5">
|
|
|
+ <label class="rdoBtn" th:if="${certTargetGbList}" th:each="oneData, status : ${certTargetGbList}">
|
|
|
+ <input type="radio" name="selCertTargetGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
|
|
|
+ </label>
|
|
|
+ <input type="hidden" name="certTargetGb"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>인증형태</th>
|
|
|
+ <td>
|
|
|
+ <select name="certFormGb" id="certFormGb" >
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${certFormGbList}" th:each="oneData, status : ${certFormGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>인증타입</th>
|
|
|
+ <td>
|
|
|
+ <select name="certType" id="certType" >
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${certTypeList}" th:each="oneData, status : ${certTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>인증번호</th>
|
|
|
+ <td>
|
|
|
+ <input type="text" class="w200" id="certNum" name="certNum" maxlength="20"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <!-- <tr>
|
|
|
+ <th>인증상태</th>
|
|
|
+ <td><span id="certStateTxt"></span></td>
|
|
|
+ <th>인증기관</th>
|
|
|
+ <td><span id="certOrganNameTxt"></span></td>
|
|
|
+ <th>인증일</th>
|
|
|
+ <td><span id="certDtTxt"></span></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>인증구분</th>
|
|
|
+ <td colspan="5"><span id="certDivTxt"></span></td>
|
|
|
+ </tr> -->
|
|
|
+ </table>
|
|
|
+ <!-- <ul class="panelBar marT10">
|
|
|
+ <li class="right">
|
|
|
+ <button type="button" class="btn btn-success btn-lg" id="btnGoodsSafetyCertNum">안전인증</button>
|
|
|
+ </li>
|
|
|
+ </ul> -->
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ <!-- //TABS CONTENTS -->
|
|
|
</ul>
|
|
|
<!-- //TABS CONTENTS -->
|
|
|
|
|
|
@@ -452,6 +530,29 @@
|
|
|
fnDataLengthCheck('goodsSnm1',200);
|
|
|
});
|
|
|
|
|
|
+ //판매가 변경시 할인율 계산
|
|
|
+ $("#goodsDetailForm input[name=currPrice]").bind('focusout paste', function () {
|
|
|
+ fnCurrPriceCheck();
|
|
|
+ });
|
|
|
+
|
|
|
+ //정상가 변경시 할인율 계산
|
|
|
+ $("#goodsDetailForm input[name=listPrice]").bind('focusout paste', function () {
|
|
|
+ fnCurrPriceCheck();
|
|
|
+ });
|
|
|
+
|
|
|
+ //판매가의 할인율 확인
|
|
|
+ var fnCurrPriceCheck = function(){
|
|
|
+ var dcRate = 0;
|
|
|
+
|
|
|
+ var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
|
|
|
+ var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
|
|
|
+ dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
|
|
|
+
|
|
|
+ $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
|
|
|
+ $("#goodsDetailForm input[name=dcRate]").val(dcRate);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
//데이터 길이 확인
|
|
|
var fnDataLengthCheck = function(id , maxByte){
|
|
|
var maximumByte = maxByte;
|
|
|
@@ -524,7 +625,7 @@
|
|
|
|
|
|
//출고처
|
|
|
$("#goodsDetailForm select[name=delvLocCd] option:gt(0)").remove();
|
|
|
- cfnCreateCombo("/renderer/delvLoc/list/" + supplyCompCd, $('#goodsDetailForm select[name=delvLocCd]'), "[선택]", '');
|
|
|
+ cfnCreateCombo("/renderer/delvloc/list/" + supplyCompCd, $('#goodsDetailForm select[name=delvLocCd]'), "[선택]", '');
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -532,20 +633,16 @@
|
|
|
$('#goodsDetailForm select[name=brandCd]').on('change', function() {
|
|
|
var brandCd = $(this).val();
|
|
|
//판매수수료율
|
|
|
- //포인트 적용
|
|
|
- var params = new Object();
|
|
|
- params.brandCd = brandCd;
|
|
|
- cfnAjaxSubmit("/business/brand/list", "json", fnBrandCallback, params);
|
|
|
+ var data = {brandCd : brandCd};
|
|
|
+ var jsonData = JSON.stringify(data);
|
|
|
+ gagajf.ajaxJsonSubmit('/business/brand/list', jsonData, function(result) {
|
|
|
+ if (result != null){
|
|
|
+ $("#goodsDetailForm select[name=distributionGb]").val(result[0].distributionGb);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
});
|
|
|
|
|
|
- // 브랜드
|
|
|
- var fnBrandCallback = function(result){
|
|
|
- if (result != null){
|
|
|
- $("#goodsDetailForm select[name=distributionGb]").val(result[0].distributionGb);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//배송비정책변경시
|
|
|
$('#goodsDetailForm select[name=delvFeeCd]').on('change', function() {
|
|
|
var delvFeeCd = $("#goodsDetailForm select[name=delvFeeCd]").val();
|
|
|
@@ -615,6 +712,93 @@
|
|
|
|
|
|
$('#goodsDetailForm').find('#notiArea').append(notiHtml);
|
|
|
}
|
|
|
+
|
|
|
+ //안전인증관련 체크
|
|
|
+ var fnGoodsSafetyCertNumCheck = function(){
|
|
|
+
|
|
|
+ $("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
|
|
|
+
|
|
|
+ // 유아용품 확인
|
|
|
+ if ("G004_23" == $("#goodsDetailForm input[name=safeNiClsfCd]").val()){
|
|
|
+ if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
|
|
|
+ mcxDialog.alert("안전인증대상을 선택해 주세요.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" == $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
|
|
|
+ mcxDialog.alert("인즌대상이 아닌 상품은 인증대상아님을 선택해주세요");
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
|
|
|
+
|
|
|
+ if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
|
|
|
+ mcxDialog.alert("안전인증대상을 선택해 주세요.");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 인증대상이 아니면 스킵
|
|
|
+ if ("G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val()){
|
|
|
+
|
|
|
+ if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
|
|
|
+ !gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
|
|
|
+ mcxDialog.alert("인즌대상이 아닐경우 정보를 입력하지 마세요.");
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val())){
|
|
|
+ mcxDialog.alertC("안전인증형태를 선택해 주세요.", {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $("#goodsDetailForm select[name=certFormGb]").focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gagajf.isNull($("#goodsDetailForm select[name=certType]").val())){
|
|
|
+ mcxDialog.alertC("안전인증타입를 선택해 주세요.", {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $("#goodsDetailForm select[name=certType]").focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //인증타입이 공급자적합성일 경우 인증번호 미입력
|
|
|
+ if( "G081_1" == $("#goodsDetailForm select[name=certType]").val() || "G081_2" == $("#goodsDetailForm select[name=certType]").val()){
|
|
|
+ if(gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
|
|
|
+ mcxDialog.alertC("안전인증번호를 입력해 주세요.", {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $("#goodsDetailForm input[name=certNum]").focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
//상품저장 버튼 클릭 시
|
|
|
$('#btnGoodsDetailSave').click(function() {
|
|
|
@@ -720,7 +904,41 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- fnGoodsSave();
|
|
|
+ if (!fnGoodsSafetyCertNumCheck()) return false;
|
|
|
+
|
|
|
+ var dcRate = 0;
|
|
|
+ var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
|
|
|
+ var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
|
|
|
+ dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
|
|
|
+
|
|
|
+ if (dcRate < 0){
|
|
|
+ mcxDialog.alertC('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $("#goodsDetailForm input[name=currPrice]").focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ /* }else if (dcRate >= 90){
|
|
|
+ mcxDialog.confirmC("할인율이 90%이상입니다. 계속하시겠습니까?", {
|
|
|
+ btn: ["아니요","예"],
|
|
|
+ btnClick: function(index){
|
|
|
+ if (index == 1){
|
|
|
+ optCheck = true;
|
|
|
+ } else {
|
|
|
+ fnGoodsSave();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ */
|
|
|
+ }else{
|
|
|
+ $("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
|
|
|
+ $("#goodsDetailForm input[name=dcRate]").val(dcRate);
|
|
|
+ fnGoodsSave();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (optCheck) return false;
|
|
|
+
|
|
|
|
|
|
});
|
|
|
|