|
|
@@ -268,8 +268,8 @@
|
|
|
<li class="right">
|
|
|
<button type="button" class="btn btn-default btn-lg" onclick="fnOpenGoodsPopup();">상품추가</button>
|
|
|
<button type="button" class="btn btn-default btn-lg" onclick="fnDeleteGoods();">상품삭제</button>
|
|
|
- <!-- <button type="button" class="btn btn-default btn-lg" onclick="fnSocialGoodsExcelUpload();">엑셀상품추가</button>
|
|
|
- <button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF011');">엑셀상품추가 양식 다운로드</button> -->
|
|
|
+ <button type="button" class="btn btn-default btn-lg" onclick="fnSocialGoodsExcelUpload();">엑셀상품추가</button>
|
|
|
+ <button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF011');">엑셀상품추가 양식 다운로드</button>
|
|
|
<button type="button" class="btn btn-success btn-lg" onclick="fnSocialGoodsSave();">저장</button>
|
|
|
</li>
|
|
|
</ul>
|
|
|
@@ -342,10 +342,12 @@
|
|
|
|
|
|
// 바인딩
|
|
|
var fnBindDetail = function(data) {
|
|
|
- fnSearchSocialGoodsList(data.socialSq);
|
|
|
+ fnFirstSearchSocialGoodsList(data.socialSq);
|
|
|
fnSetDate(data);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// 데이터 설정
|
|
|
var fnSetDate = function(data) {
|
|
|
var formId = '#detailForm';
|
|
|
@@ -539,7 +541,8 @@
|
|
|
}, // 변경 후 할인율
|
|
|
/* {headerName: '적용 PC 포인트율' , field:'pntAprate' , width:200 , cellClass: 'text-right', editable : true, cellEditor: 'numericCellEditor'}, // 변경 후 포인트적립율(PC) */
|
|
|
/* {headerName: '적용 MOBILE 포인트율' , field:'pntAmrate' , width:200 , cellClass: 'text-right', editable : true, cellEditor: 'numericCellEditor' }, // 변경 후 포인트적립율(모바일) */
|
|
|
- {headerName: '표시순서' , field:'dispOrd' , width:100 , cellClass: 'text-center', editable : true, cellEditor: 'numericCellEditor'},
|
|
|
+ /* {headerName: '표시순서' , field:'dispOrd' , width:100 , cellClass: 'text-center', editable : true, cellEditor: 'numericCellEditor', valueGetter: 'node.rowIndex+1'
|
|
|
+ }, */
|
|
|
{headerName: '삭제여부' , field:'delYn' , width:100 , cellClass: 'text-center', hide: true},
|
|
|
{headerName: '변경전 할인율' , field:'dcBrate' , width:100 , cellClass: 'text-center', hide: true},
|
|
|
{headerName: '기존 판매가' , field:'currBprice' , width:100 , cellClass: 'text-center', hide: true},
|
|
|
@@ -557,14 +560,26 @@
|
|
|
params.socialSq = typeof socialSq == 'object' ? $('#detailForm input[name=socialSq]').val() : socialSq;
|
|
|
|
|
|
var jsonData = JSON.stringify(params);
|
|
|
- gagajf.ajaxJsonSubmit(actionUrl, jsonData, function(result) {
|
|
|
+ gagajf.ajaxJsonSubmit(actionUrl, jsonData, function(result) {
|
|
|
+ //gridOptionsGoods.api.setRowData(result);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 소셜 상품 목록 검색
|
|
|
+ var fnFirstSearchSocialGoodsList = function(socialSq) {
|
|
|
+ var actionUrl = 'marketing/social/goods/list';
|
|
|
+ var params = new Object();
|
|
|
+ params.socialSq = typeof socialSq == 'object' ? $('#detailForm input[name=socialSq]').val() : socialSq;
|
|
|
+
|
|
|
+ var jsonData = JSON.stringify(params);
|
|
|
+ gagajf.ajaxJsonSubmit(actionUrl, jsonData, function(result) {
|
|
|
gridOptionsGoods.api.setRowData(result);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 적용가격 일괄적용
|
|
|
var fnPriceApply = function() {
|
|
|
- var priceGb = $('#priceGb').val();
|
|
|
+ var priceGb = $('select[name=priceGb]').val();
|
|
|
var price = $('#price').val();
|
|
|
var msg = '';
|
|
|
|
|
|
@@ -664,7 +679,9 @@
|
|
|
currBprice: result[disp].currPrice,
|
|
|
dcBrate: result[disp].dcRate,
|
|
|
listPrice : result[disp].listPrice,
|
|
|
+ dispOrd : disp+1
|
|
|
};
|
|
|
+
|
|
|
oldGoodsList.unshift(goods);
|
|
|
|
|
|
}
|
|
|
@@ -687,6 +704,7 @@
|
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
+ gridOptionsGoods.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsGoods)});
|
|
|
$(selectedGoodsList).each(function(idx, goods) {
|
|
|
goods.delYn = 'Y';
|
|
|
});
|
|
|
@@ -697,7 +715,7 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- /* var fnSocialGoodsExcelUpload = function() {
|
|
|
+ var fnSocialGoodsExcelUpload = function() {
|
|
|
cfnExcelUploadPopup('socialGoodsExcelUpload', 'socialGoodsExcelUpload');
|
|
|
}
|
|
|
|
|
|
@@ -710,7 +728,7 @@
|
|
|
|
|
|
var jsonData = JSON.stringify(data);
|
|
|
gagajf.ajaxJsonSubmit('/marketing/social/goods/excelupload', jsonData, fnSearchSocialGoodsList);
|
|
|
- } */
|
|
|
+ }
|
|
|
|
|
|
// 소셜 상품 저장
|
|
|
var fnSocialGoodsSave = function() {
|
|
|
@@ -736,10 +754,10 @@
|
|
|
msg = '상품코드 : ' + goods.goodsCd + '<br/>판매가와 할인율 모두 값이 존재하지않습니다.';
|
|
|
return false;
|
|
|
}
|
|
|
- if (gagajf.isNull(goods.dispOrd)) {
|
|
|
+ /* if (gagajf.isNull(goods.dispOrd)) {
|
|
|
msg = '상품코드 : ' + goods.goodsCd + '<br/>전시순서를 입력해주세요.';
|
|
|
return false;
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
if(!gagajf.isNull(goods.currAprice)){
|
|
|
dcRate = 100 - Math.floor(Number(goods.currAprice) / Number(goods.listPrice) * 100); //절사
|
|
|
@@ -749,7 +767,6 @@
|
|
|
}
|
|
|
else{
|
|
|
currAprice = Number(goods.listPrice) - ( Number(goods.listPrice) * (Number(goods.dcArate)/100) );
|
|
|
- console.log("여기들어왓어"+currAprice);
|
|
|
goods.currAprice = currAprice;
|
|
|
}
|
|
|
|