|
|
@@ -6,7 +6,7 @@
|
|
|
* @source : GoodsDetailForm.html
|
|
|
* @desc : 상품 상세 팝업
|
|
|
*============================================================================
|
|
|
- * SISUN
|
|
|
+ * SISUNChDataYn
|
|
|
* Copyright(C) 2020 TSIT, All rights reserved.
|
|
|
*============================================================================
|
|
|
* VER DATE AUTHOR DESCRIPTION
|
|
|
@@ -158,7 +158,7 @@
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
- <td rowspan="10"> </td>
|
|
|
+ <td rowspan="11"> </td>
|
|
|
<th>시즌<em class="required" title="필수"></em></th>
|
|
|
<td >
|
|
|
<select name="seasonCd" id="seasonCd">
|
|
|
@@ -190,6 +190,23 @@
|
|
|
</select>
|
|
|
<input type="hidden" id="goodsGbOrg" name="goodsGbOrg"/>
|
|
|
</td>
|
|
|
+ <th>유통구분<em class="required" title="필수"></em></th>
|
|
|
+ <td><select name="distributionGb" id="distributionGb">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${distributionGbList}" th:each="oneData, status : ${distributionGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ <input type="hidden" id="distributionGbOrg" name="distributionGbOrg"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr id="erplinkarea">
|
|
|
+ <th>상품연령대</th>
|
|
|
+ <td>
|
|
|
+ <select name="ageGrpCd" id="ageGrpCd">
|
|
|
+ <option value="">[선택]</option>
|
|
|
+ <option th:if="${ageGrpCdList}" th:each="oneData, status : ${ageGrpCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
|
|
|
+ </select>
|
|
|
+ <input type="hidden" id="ageGrpCdOrg" name="ageGrpCdOrg"/>
|
|
|
+ </td>
|
|
|
<th>가격변경일</th>
|
|
|
<td colspan="3"><span id="priceUpdDtTxt"></span></td>
|
|
|
</tr>
|
|
|
@@ -518,19 +535,19 @@
|
|
|
//{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
{headerName: "이미지", field: "imgPath1", width: 100, height: 60, cellClass: 'text-center'
|
|
|
,cellRenderer: function(params) {
|
|
|
- if (params.data.imgType == "A"){
|
|
|
+ if (params.data.imgType == "G030_A"){
|
|
|
if(!gagajf.isNull(params.data.imgPath6)){
|
|
|
- return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ params.data.imgPath1 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}else{
|
|
|
- return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}
|
|
|
+
|
|
|
}else{
|
|
|
if(!gagajf.isNull(params.data.imgPath6)){
|
|
|
- return '<img width="60" src="'+ params.data.imgPath1 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}else{
|
|
|
- return '<img width="60" src="'+ params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -539,8 +556,8 @@
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsTypeList, params.value); },
|
|
|
valueParser: function (params) { return gagaAgGrid.lookupKey(goodsTypeList, params.newValue); }
|
|
|
},
|
|
|
- {headerName: "구성상품코드", field: "extendGoodsCd" , width: 130, cellClass: 'text-center'},
|
|
|
- {headerName: "구성상품코드명", field: "extendGoodsCdNm" , width: 200, cellClass: 'text-left'},
|
|
|
+ {headerName: "구성상품코드", field: "compsGoodsCd" , width: 130, cellClass: 'text-center'},
|
|
|
+ {headerName: "구성상품코드명", field: "compsGoodsCdNm" , width: 200, cellClass: 'text-left'},
|
|
|
//{headerName: "순서", field: "dispOrd" , width: 80, cellClass: 'text-right',editable: true, required: true},
|
|
|
{headerName: "수량", field: "qty" , width: 100, cellClass: 'text-right'
|
|
|
,valueFormatter: function(params) { return Number(params.value).addComma();}
|
|
|
@@ -558,7 +575,7 @@
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
|
|
|
valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
|
|
|
},
|
|
|
- {headerName: "옵션명(딜상품용)", field: "extendGoodsOptNm" , width: 200, cellClass: 'text-left',editable: true, required: true},
|
|
|
+ {headerName: "옵션명(딜상품용)", field: "compsGoodsOptNm" , width: 200, cellClass: 'text-left',editable: true, required: true},
|
|
|
{headerName: "상품상태", field: "goodsStat" , width: 100, cellClass: 'text-center',
|
|
|
cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
|
|
|
valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
|
|
|
@@ -586,19 +603,19 @@
|
|
|
//{headerName: 'No', width: 60, cellClass: 'text-center', valueGetter: function(params) { return params.node.rowIndex + 1 }},
|
|
|
{headerName: "이미지", field: "imgPath1", width: 100, height: 60, cellClass: 'text-center'
|
|
|
,cellRenderer: function(params) {
|
|
|
- if (params.data.imgType == "A"){
|
|
|
+ if (params.data.imgType == "G030_A"){
|
|
|
if(!gagajf.isNull(params.data.imgPath6)){
|
|
|
- return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ params.data.imgPath6 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}else{
|
|
|
- return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
- }
|
|
|
+ return '<img width="60" src="'+ params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ }
|
|
|
+
|
|
|
}else{
|
|
|
if(!gagajf.isNull(params.data.imgPath6)){
|
|
|
- return '<img width="60" src="'+ params.data.imgPath1 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ uploadGoodsUrl+params.data.imgPath6 + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}else{
|
|
|
- return '<img width="60" src="'+ params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ return '<img width="60" src="'+ uploadGoodsUrl+params.value + '" alt="" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -650,7 +667,7 @@
|
|
|
// 상품상세 조회
|
|
|
var fnGoodsDeailSearch = function() {
|
|
|
|
|
|
- $('#goodsDetailForm').find('.tabs .tabsNav li a').attr("style", "color:#888;");
|
|
|
+ $('#goodsDetailForm').find('.tabs .tabsNav li a').attr("style", "color:#888;"); //탭색 초기화
|
|
|
|
|
|
var params = new Object();
|
|
|
params.mode = $('#goodsDetailForm input[name=mode]').val();
|
|
|
@@ -720,6 +737,11 @@
|
|
|
$('#goodsDetailForm').find('#priceUpdDtTxt').html(!gagajf.isNull(result.priceUpdDt) ? result.priceUpdDt.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD") : '');
|
|
|
$('#goodsDetailForm').find('#frstCfrmDtTxt').html(!gagajf.isNull(result.frstCfrmDt) ? result.frstCfrmDt.toDate("YYYYMMDDHHmmss").format("YYYY-MM-DD") : '');
|
|
|
|
|
|
+ $('#goodsDetailForm select[name=distributionGb]').val(result.distributionGb);
|
|
|
+ $("#goodsDetailForm input[name=distributionGbOrg]").val(result.distributionGb);
|
|
|
+ $('#goodsDetailForm select[name=ageGrpCd]').val(result.ageGrpCd);
|
|
|
+ $("#goodsDetailForm input[name=ageGrpCdOrg]").val(result.ageGrpCd);
|
|
|
+
|
|
|
$("#goodsDetailForm input[type=radio]").parent().removeClass("checked");
|
|
|
$("#goodsDetailForm input[type=radio]").removeAttr('checked');
|
|
|
|
|
|
@@ -762,6 +784,7 @@
|
|
|
$("#goodsDetailForm input[name=prePpntUsableYnOrg]").val(result.prePpntUsableYn);
|
|
|
$("#goodsDetailForm input[name=preMpntUsableYnOrg]").val(result.preMpntUsableYn);
|
|
|
$("#goodsDetailForm input[name=changeableYnOrg]").val(result.changeableYn);
|
|
|
+
|
|
|
|
|
|
$("#goodsDetailForm input[type=radio][checked]").addClass("checked");
|
|
|
//$("#goodsDetailForm input[type=radio][checked]").parent("label").addClass("checked");
|
|
|
@@ -886,6 +909,11 @@
|
|
|
fnGoodsDetailHstSearch();
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ //기본정보탭 변경여부
|
|
|
+ $('#goodsDetailForm').find('#goodstab1').find("input, select, textarea").on('change', function() {
|
|
|
+ $('#goodsDetailForm').find('.tabs .tabsNav li:eq(0) a').attr("style", "color:red;");
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//옵셥 재고
|
|
|
@@ -903,12 +931,12 @@
|
|
|
if ("G056_S" == params.goodsType){ //세트
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'currPrice', false);
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'useYn', false);
|
|
|
- gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'extendGoodsOptNm', false);
|
|
|
+ gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsGoodsOptNm', false);
|
|
|
|
|
|
$('#GoodsComposeBtnArea').addClass("off");
|
|
|
}else{ //딜
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'qty', false);
|
|
|
- gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'extendcompsCurrPrice', false);
|
|
|
+ gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsCurrPrice', false);
|
|
|
}
|
|
|
gagaAgGrid.fetch("/goods/detail/compose/list?goodsCd=" + params.goodsCd , gridGoodsComposeOptions);
|
|
|
}
|
|
|
@@ -977,8 +1005,7 @@
|
|
|
|
|
|
var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
|
|
|
var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
|
|
|
- //dcRate = Math.round(100 - Math.floor((Number(currPrice) / Number(listPrice) * 100)*100)/100);
|
|
|
- dcRate = 100 - (Number((Number(currPrice) / Number(listPrice)).toFixed(2)) *100)
|
|
|
+ dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
|
|
|
|
|
|
$("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
|
|
|
$("#goodsDetailForm input[name=dcRate]").val(dcRate);
|
|
|
@@ -992,7 +1019,8 @@
|
|
|
var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
|
|
|
var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
|
|
|
//dcRate = Math.round(100 - Math.floor((Number(currPrice) / Number(listPrice) * 100)*100)/100);
|
|
|
- dcRate = 100 - (Number((Number(currPrice) / Number(listPrice)).toFixed(2)) *100)
|
|
|
+ //dcRate = 100 - (Number((Number(currPrice) / Number(listPrice)).toFixed(2)) *100);
|
|
|
+ dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100);
|
|
|
|
|
|
if (dcRate < 0){
|
|
|
mcxDialog.alert('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', function(){
|
|
|
@@ -1081,7 +1109,7 @@
|
|
|
}
|
|
|
|
|
|
//상품저장 버튼 클릭 시
|
|
|
- $('#btnGoodsDetailSave').click(function() {
|
|
|
+ $('#btnGoodsDetailSave').click(function() {debugger;
|
|
|
|
|
|
var optCheck = false;
|
|
|
var idx = 0;
|
|
|
@@ -1487,14 +1515,15 @@
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
- }else if (dcRate >= 90){
|
|
|
+ }else if (dcRate >= 90){debugger;
|
|
|
mcxDialog.confirmC("할인율이 90%이상입니다. 계속하시겠습니까?", {
|
|
|
btn: ["아니요","예"],
|
|
|
btnClick: function(index){
|
|
|
if (index == 1){
|
|
|
optCheck = true;
|
|
|
} else {
|
|
|
- fnNoticheck();
|
|
|
+ if (!fnGoodsComposeCheck()) return false;
|
|
|
+ fnSaveCheck();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
@@ -1502,16 +1531,15 @@
|
|
|
}else{
|
|
|
$("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
|
|
|
$("#goodsDetailForm input[name=dcRate]").val(dcRate);
|
|
|
-
|
|
|
+ fnSaveCheck();
|
|
|
}
|
|
|
-
|
|
|
|
|
|
if (optCheck) return false;
|
|
|
|
|
|
- if (!fnGoodsComposeCheck()) return false;
|
|
|
-
|
|
|
- //fnNoticheck();
|
|
|
-
|
|
|
+ });
|
|
|
+
|
|
|
+ //저장 관련 체크
|
|
|
+ var fnSaveCheck = function(idx){
|
|
|
if($("#goodsDetailForm input:checkbox[name=chkDescKeep]").is(':checked')){
|
|
|
mcxDialog.confirmC("'정보유지' 체크박스가 선택되어 있어 '상품상세설명' 항목이 저장되지 않습니다.<br/>저장을 원하시면 체크를 해제하세요. 계속하시겠습니까?", {
|
|
|
btn: ["아니요","예"],
|
|
|
@@ -1526,11 +1554,7 @@
|
|
|
}else{
|
|
|
fnGoodsSave();
|
|
|
}
|
|
|
-
|
|
|
- if (optCheck) return false;
|
|
|
-
|
|
|
-
|
|
|
- });
|
|
|
+ }
|
|
|
|
|
|
// 구성 정보 관련 체크
|
|
|
var fnGoodsComposeCheck = function(){
|
|
|
@@ -1694,7 +1718,7 @@
|
|
|
return true;
|
|
|
}
|
|
|
//상품구분
|
|
|
- if ($("#goodsDetailForm input[name=goodsGbOrg]").val() != $("input:radio[name=goodsGb]:checked").val()){
|
|
|
+ if ($("#goodsDetailForm input[name=goodsGbOrg]").val() != $("#goodsDetailForm select[name=goodsGb]").val()){
|
|
|
return true;
|
|
|
}
|
|
|
//상품상태
|
|
|
@@ -1757,6 +1781,14 @@
|
|
|
if ($("#goodsDetailForm input[name=minOrdAmtOrg]").val() != $("#goodsDetailForm input[name=minOrdAmt]").val().removeComma()){
|
|
|
return true;
|
|
|
}
|
|
|
+ //유통구분
|
|
|
+ if ($("#goodsDetailForm input[name=distributionGbOrg]").val() != $("#goodsDetailForm select[name=distributionGb]").val()){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ //상품연령대
|
|
|
+ if ($("#goodsDetailForm input[name=ageGrpCdOrg]").val() != $("#goodsDetailForm select[name=ageGrpCd]").val()){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
@@ -1866,7 +1898,7 @@
|
|
|
gridGoodsComposeOptions.api.updateRowData({add: [data], addIndex: idx});
|
|
|
|
|
|
idx++;
|
|
|
-
|
|
|
+ $('#goodsDetailForm').find('.tabs .tabsNav li:eq(5) a').attr("style", "color:red;");
|
|
|
}
|
|
|
});
|
|
|
gridGoodsComposeOptions.api.refreshCells();
|
|
|
@@ -1918,6 +1950,7 @@
|
|
|
gridCodiGoodsOptions.api.updateRowData({add: [data], addIndex: idx});
|
|
|
|
|
|
idx++;
|
|
|
+ $('#goodsDetailForm').find('.tabs .tabsNav li:eq(4) a').attr("style", "color:red;");
|
|
|
|
|
|
}
|
|
|
});
|
|
|
@@ -1933,8 +1966,6 @@
|
|
|
}
|
|
|
|
|
|
//화면에서 삭제
|
|
|
- //var removedData_1 = gagaAgGrid.removeRowData(gridCodiGoodsOptions, false);
|
|
|
-
|
|
|
var removedData = gagaAgGrid.removeRowData(gridCodiGoodsOptions, false);
|
|
|
|
|
|
if (removedData.length > 0) {
|
|
|
@@ -1983,7 +2014,6 @@
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
- /* gagaSe.createSmartEditor(seOptions, 'goodsDesc'); */
|
|
|
gagaSe.createSmartEditor(seOptions, 'goodsPcTopDesc');
|
|
|
gagaSe.createSmartEditor(seOptions, 'goodsMobileTopDesc');
|
|
|
gagaSe.createSmartEditor(seOptions, 'goodsPcDownDesc');
|
|
|
@@ -1995,11 +2025,6 @@
|
|
|
|
|
|
fnGoodsDeailSearch();
|
|
|
|
|
|
- //기본정보탭 변경여부
|
|
|
- $('#goodsDetailForm').find('#goodstab1').find("input, select, textarea").on('change', function() {
|
|
|
- $('#goodsDetailForm').find('.tabs .tabsNav li:eq(0) a').attr("style", "color:red;");
|
|
|
- });
|
|
|
-
|
|
|
});
|
|
|
|
|
|
/*]]>*/
|