|
|
@@ -35,6 +35,7 @@
|
|
|
<input type="hidden" id="mainColorCd" name="mainColorCd" />
|
|
|
<input type="hidden" id="goodsType" name="goodsType" />
|
|
|
<input type="hidden" id="goodsComposeList" name="goodsComposeList" />
|
|
|
+ <input type="hidden" id="repGoodsCd" name="repGoodsCd" /> <!-- 대표상품(딜 가격) -->
|
|
|
<table class="frmStyle">
|
|
|
<colgroup>
|
|
|
<col width="11%"/>
|
|
|
@@ -468,7 +469,7 @@
|
|
|
<button type="button" class="btn btn-base btn-lg" onclick="fnOpenGoodsDetailPopup()">상품조회</button>
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <div id="gridGoodsComposeList" style="height: 500px;" class="ag-theme-balham lh60"></div>
|
|
|
+ <div id="gridGoodsComposeList" style="height: 600px;" class="ag-theme-balham lh60"></div>
|
|
|
<!-- 내용 삽입 -->
|
|
|
</div>
|
|
|
<!-- //TAB6 CONTENTS AREA -->
|
|
|
@@ -478,7 +479,7 @@
|
|
|
<!-- TAB8 CONTENTS AREA -->
|
|
|
<div class="panelStyle">
|
|
|
<!-- 내용 삽입 -->
|
|
|
- <div id="gridGoodsHstoryList" style="height: 500px;" class="ag-theme-balham"></div>
|
|
|
+ <div id="gridGoodsHstoryList" style="height: 600px;" class="ag-theme-balham"></div>
|
|
|
<!-- 내용 삽입 -->
|
|
|
</div>
|
|
|
<!-- //TAB5 CONTENTS AREA -->
|
|
|
@@ -596,7 +597,15 @@
|
|
|
cellEditorParams: { maxlength: 14, validType: 'numeric'}
|
|
|
},
|
|
|
{headerName: "상품판매가ORG", field: "compsCurrPriceOrg" , width: 100, cellClass: 'text-right', hide: true},
|
|
|
- {headerName: "기준여부(품목-카테고리)", field: "baseYn", width: 160, cellClass: 'text-center'},
|
|
|
+ {headerName: "기준여부(품목-카테고리)", field: "baseYn", width: 160, cellClass: 'text-center'
|
|
|
+ },
|
|
|
+ {headerName: "대표여부(가격)", field: "repYn", width: 160, cellClass: 'text-center',editable: true,
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(useYnList), required: true },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(useYnList, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(useYnList, params.newValue); }
|
|
|
+ },
|
|
|
+ {headerName: "대표상품", field: "repGoodsCd" , width: 100, cellClass: 'text-right', hide: true},
|
|
|
{headerName: "전시여부", field: "useYn", width: 100, cellClass: 'text-center',editable: true,
|
|
|
cellEditor: 'agRichSelectCellEditor',
|
|
|
cellEditorParams: { values: gagaAgGrid.extractValues(useYnList), required: true },
|
|
|
@@ -643,6 +652,58 @@
|
|
|
gridGoodsComposeOptions.getRowStyle = function(params) {
|
|
|
if ("Y" == params.data.baseYn) {
|
|
|
return { background: '#1ab394' };
|
|
|
+ }else{
|
|
|
+ return { background: '#ffffff' };
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Row
|
|
|
+ gridGoodsComposeOptions.onCellValueChanged = function(event) {
|
|
|
+ var rowIdx = null;
|
|
|
+ var isChangColor = true;
|
|
|
+ if (event.colDef.field == "baseYn"){
|
|
|
+ if (event.data.baseYn == "Y"){
|
|
|
+ rowIdx = event.rowIndex;
|
|
|
+
|
|
|
+ //다른 기준여부 'Y'가 존재하는지 확인
|
|
|
+ gridGoodsComposeOptions.api.forEachNode(function(rowNode, index) {
|
|
|
+ if (rowNode.data.baseYn == "Y" && index != rowIdx){
|
|
|
+ event.data.baseYn = event.oldValue;
|
|
|
+ gridGoodsComposeOptions.api.updateRowData({update: [event.data]});
|
|
|
+ isChangColor = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!isChangColor){
|
|
|
+ mcxDialog.alert('다른 구성상품에 기준여부가 선택되어 있습니다.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($("#goodsDetailForm input[name=goodsType]").val() == "G056_D"){
|
|
|
+ isChangColor = true;
|
|
|
+ if (event.colDef.field == "repYn"){
|
|
|
+ if (event.data.repYn == "Y"){
|
|
|
+ rowIdx = event.rowIndex;
|
|
|
+
|
|
|
+ //다른 대표여부 'Y'가 존재하는지 확인
|
|
|
+ gridGoodsComposeOptions.api.forEachNode(function(rowNode, index) {
|
|
|
+ if (rowNode.data.repYn == "Y" && index != rowIdx){
|
|
|
+ event.data.repYn = event.oldValue;
|
|
|
+ gridGoodsComposeOptions.api.updateRowData({update: [event.data]});
|
|
|
+ isChangColor = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!isChangColor){
|
|
|
+ mcxDialog.alert('다른 구성상품에 대표여부가 선택되어 있습니다.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -833,7 +894,7 @@
|
|
|
$('#goodsDetailForm input[name=certNumOrg]').val(result.certNum);
|
|
|
|
|
|
//상품상세
|
|
|
- // 공지내용. Summernote에 값 세팅
|
|
|
+ // Summernote에 값 세팅
|
|
|
gagaSn.setContents('#goodsPcTopDesc', result.goodsPcTopDesc);
|
|
|
gagaSn.setContents('#goodsMobileTopDesc', result.goodsMobileTopDesc);
|
|
|
gagaSn.setContents('#goodsPcDownDesc', result.goodsPcDownDesc);
|
|
|
@@ -939,7 +1000,7 @@
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'currPrice', false);
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'useYn', false);
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsGoodsOptNm', false);
|
|
|
-
|
|
|
+ gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'repYn', false);
|
|
|
$('#GoodsComposeBtnArea').addClass("off");
|
|
|
}else{ //딜
|
|
|
gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'qty', false);
|
|
|
@@ -1303,15 +1364,18 @@
|
|
|
} */
|
|
|
|
|
|
//정상가와 판매가 비교
|
|
|
- if(Number($("#goodsDetailForm input[name=listPrice]").val().removeComma()) < Number($("#goodsDetailForm input[name=currPrice]").val().removeComma())) {
|
|
|
- mcxDialog.alertC("판매가를 올바르게 입력해주세요.", {
|
|
|
- sureBtnText: "확인",
|
|
|
- sureBtnClick: function() {
|
|
|
- $("#goodsDetailForm input[name=currPrice]").focus();
|
|
|
- }
|
|
|
- });
|
|
|
- return false;
|
|
|
+ if ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D"){
|
|
|
+ if(Number($("#goodsDetailForm input[name=listPrice]").val().removeComma()) < Number($("#goodsDetailForm input[name=currPrice]").val().removeComma())) {
|
|
|
+ mcxDialog.alertC("판매가를 올바르게 입력해주세요.", {
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function() {
|
|
|
+ $("#goodsDetailForm input[name=currPrice]").focus();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
//판매 수수료율
|
|
|
if ( gagajf.isNull($("#goodsDetailForm input[name=sellFeeRate]").val())) {
|
|
|
mcxDialog.alertC("판매수수료를 입력해 주세요.", {
|
|
|
@@ -1563,7 +1627,7 @@
|
|
|
var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
|
|
|
dcRate = 100 - Math.floor(Number(currPrice) / Number(listPrice) * 100); //절사
|
|
|
|
|
|
- if (dcRate < 0){
|
|
|
+ if (dcRate < 0 && ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D")){
|
|
|
mcxDialog.alertC('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', {
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
@@ -1571,7 +1635,7 @@
|
|
|
}
|
|
|
});
|
|
|
return false;
|
|
|
- }else if (dcRate >= 90){
|
|
|
+ }else if (dcRate >= 90 && ($("#goodsDetailForm input[name=goodsType]").val() != "G056_D")){
|
|
|
mcxDialog.confirmC("할인율이 90%이상입니다. 계속하시겠습니까?", {
|
|
|
btn: ["아니요","예"],
|
|
|
btnClick: function(index){
|
|
|
@@ -1622,18 +1686,26 @@
|
|
|
var allData = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
|
|
|
var comSupplyCompCd = '';
|
|
|
var comSelfGoodsYn = '';
|
|
|
+ var index = 0;
|
|
|
//기준여부 Y 존재하는지 확인
|
|
|
var checkBaseYn = false;
|
|
|
+ //대표여부 Y 존재하는지 확인
|
|
|
+ var checkRepYn = false;
|
|
|
optCheck = false;
|
|
|
- $.each(allData, function(index, item) {
|
|
|
+ $.each(allData, function(index, item) { debugger;
|
|
|
if (index == 0){
|
|
|
comSelfGoodsYn = item.selfGoodsYn;
|
|
|
comSupplyCompCd = item.supplyCompCd;
|
|
|
+ $("#goodsDetailForm input[name=repGoodsCd]").val(item.repGoodsCd); // 대표상품
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (item.baseYn == "Y"){
|
|
|
checkBaseYn = true;
|
|
|
}
|
|
|
+ if (item.repYn == "Y"){
|
|
|
+ checkRepYn = true;
|
|
|
+ }
|
|
|
|
|
|
if (comSelfGoodsYn != item.selfGoodsYn){
|
|
|
optCheck = true;
|
|
|
@@ -1674,7 +1746,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ index++;
|
|
|
});
|
|
|
|
|
|
if(optCheck) {
|
|
|
@@ -1686,6 +1758,11 @@
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ if (!checkRepYn){
|
|
|
+ mcxDialog.alert('구성상품중 대표여부를 선택해 주세요.');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|