|
|
@@ -197,13 +197,13 @@
|
|
|
<option th:if="${socialTypeList}" th:each="oneData, status : ${socialTypeList}" th:value="${oneData.cd}" th:text="|${oneData.cdNm}|"></option>
|
|
|
</select>
|
|
|
|
|
|
- <button type="button" class="btn btn-base btn-lg" id="btnSearchPlan">기획전 조회</button>
|
|
|
+ <!-- <button type="button" class="btn btn-base btn-lg" id="btnSearchPlan">기획전 조회</button>
|
|
|
/ 기획전
|
|
|
<span id="planSpan">
|
|
|
<select name="planSq" id="planSq">
|
|
|
<option th:if="${planList}" th:each="oneData, status : ${planList}" th:value="${oneData.planSq}" th:text="|[${oneData.planSq}] ${oneData.planNm}|"></option>
|
|
|
</select>
|
|
|
- </span>
|
|
|
+ </span> -->
|
|
|
</td>
|
|
|
|
|
|
<th>진행기간</th>
|
|
|
@@ -252,10 +252,9 @@
|
|
|
<option value="">선택</option>
|
|
|
<option value="currAprice">판매가</option>
|
|
|
<option value="dcArate">할인율</option>
|
|
|
- <option value="pntAprate">PC 포인트</option>
|
|
|
- <option value="pntAmrate">MOBILE 포인트</option>
|
|
|
- </select>
|
|
|
-
|
|
|
+ <!-- <option value="pntAprate">PC 포인트</option> -->
|
|
|
+ <!-- <option value="pntAmrate">MOBILE 포인트</option> -->
|
|
|
+ </select>
|
|
|
<input type="text" class="w100 aR" id="price" name="price" data-valid-type="numeric"/>
|
|
|
|
|
|
<button type="button" class="btn btn-default btn-lg" onclick="fnPriceApply();">일괄적용</button>
|
|
|
@@ -361,7 +360,7 @@
|
|
|
$(formId + ' select[name=socialType]').trigger('change');
|
|
|
|
|
|
$(formId + ' select[name=planSq]').attr("disabled",true);
|
|
|
- $(formId + ' select[name=socialType]').attr("disabled",true);
|
|
|
+ //$(formId + ' select[name=socialType]').attr("disabled",true);
|
|
|
$(formId + ' button[id=btnSearchPlan]').css("display","none");
|
|
|
// 진행 기간 설정
|
|
|
var stDate = data.socialStdt.split(" ")[0];
|
|
|
@@ -510,20 +509,36 @@
|
|
|
|
|
|
var columnDefsGoods = [
|
|
|
{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
- {headerName: "상품코드" , field:'goodsCd' , width:300 , cellClass: 'text-center',
|
|
|
+ {headerName: '상품이미지' , field:'goodsImg' , width: 100, height: 60, cellClass: 'text-center',
|
|
|
+ cellRenderer: function(params) {
|
|
|
+ return '<img width="60" src="' + _goodsUrl + '/' + params.value + '" alt="" onclick="cfnOpenImagePreViewPopup(\'goodsImgView\', \'' + _goodsUrl + '/' + params.value + '\')" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: '상품코드' , field:'goodsCd' , width:250 , cellClass: 'text-center',
|
|
|
cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
|
|
|
},
|
|
|
- {headerName: '적용 판매가' , field:'currAprice', width:200 , cellClass: 'text-right', cellEditor: 'numericCellEditor'
|
|
|
+ {headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'},
|
|
|
+ {headerName: '정상가' , field:'listPrice', width:200 , cellClass: 'text-center', cellEditor: 'numericCellEditor'
|
|
|
+ , cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : params.value.addComma(); }
|
|
|
+ },
|
|
|
+ {headerName: '기존 판매가' , field:'currBprice', width:200 , cellClass: 'text-center', cellEditor: 'numericCellEditor'
|
|
|
+ , cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : params.value.addComma(); }
|
|
|
+ },
|
|
|
+ {headerName: '적용 판매가' , field:'currAprice', width:200 , cellClass: 'text-center', cellEditor: 'numericCellEditor'
|
|
|
, editable: function(params) { return gagajf.isNull(params.data.dcArate) ? true : false; }
|
|
|
, cellRenderer: function(params) { return gagajf.isNull(params.value) ? '' : params.value.addComma(); }
|
|
|
}, // 변경 후 현재판매가
|
|
|
- {headerName: '적용 할인율' , field:'dcArate' , width:200 , cellClass: 'text-right', cellEditor: 'numericCellEditor'
|
|
|
+ {headerName: '변경전 할인율(%)' , field:'dcBrate' , width:100 , cellClass: 'text-center'},
|
|
|
+ {headerName: '적용 할인율(%)' , field:'dcArate' , width:200 , cellClass: 'text-center', cellEditor: 'numericCellEditor'
|
|
|
, editable: function(params) { return gagajf.isNull(params.data.currAprice) ? true : false; }
|
|
|
}, // 변경 후 할인율
|
|
|
- {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: '적용 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:'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},
|
|
|
+ {headerName: '기존 판매가' , field:'cur' , width:100 , cellClass: 'text-center', hide: true},
|
|
|
];
|
|
|
|
|
|
var gridOptionsGoods = gagaAgGrid.getGridOptions(columnDefsGoods);
|
|
|
@@ -630,19 +645,25 @@
|
|
|
return;
|
|
|
|
|
|
} else {
|
|
|
- if (gagajf.isNull(socialSq)) {
|
|
|
+ /* if (gagajf.isNull(socialSq)) {
|
|
|
mcxDialog.alert('소셜을 선택 해주세요.');
|
|
|
return;
|
|
|
- }
|
|
|
+ } */
|
|
|
|
|
|
for (var disp = 0; disp < result.length; disp++) {
|
|
|
var goods = { socialSq : Number(socialSq) ,
|
|
|
scgoodsSq : Number(0) ,
|
|
|
- goodsCd : result[disp].goodsCd };
|
|
|
+ goodsCd : result[disp].goodsCd,
|
|
|
+ goodsNm : result[disp].goodsNm,
|
|
|
+ currBprice: result[disp].currPrice,
|
|
|
+ dcBrate: result[disp].dcRate,
|
|
|
+ listPrice : result[disp].listPrice,
|
|
|
+ };
|
|
|
oldGoodsList.unshift(goods);
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ mcxDialog.alert('상품이 적용되었습니다.');
|
|
|
gridOptionsGoods.api.setRowData(oldGoodsList);
|
|
|
}
|
|
|
|
|
|
@@ -687,6 +708,9 @@
|
|
|
|
|
|
// 소셜 상품 저장
|
|
|
var fnSocialGoodsSave = function() {
|
|
|
+
|
|
|
+ var dcRate;
|
|
|
+ var currAprice;
|
|
|
var goodsList = gagaAgGrid.getAllRowData(gridOptionsGoods);
|
|
|
|
|
|
if (goodsList.length < 1) {
|
|
|
@@ -698,7 +722,7 @@
|
|
|
var msg = '';
|
|
|
$(goodsList).each(function(idx, goods) {
|
|
|
if (goods.dcArate > 100) {
|
|
|
- msg = '할인율은 100을 넘을 수 없습니다.';
|
|
|
+ msg = '할인율은 100%를 넘을 수 없습니다.';
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@@ -706,6 +730,22 @@
|
|
|
msg = '상품코드 : ' + goods.goodsCd + '<br/>판매가와 할인율 모두 값이 존재하지않습니다.';
|
|
|
return false;
|
|
|
}
|
|
|
+ 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); //절사
|
|
|
+ goods.dcArate = dcRate;
|
|
|
+ //var good = {dcArate : dcRate};
|
|
|
+ //goodsList.unshift(good);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ currAprice = Number(goods.listPrice) - ( Number(goods.listPrice) * (Number(goods.dcArate)/100) );
|
|
|
+ console.log("여기들어왓어"+currAprice);
|
|
|
+ goods.currAprice = currAprice;
|
|
|
+ }
|
|
|
|
|
|
});
|
|
|
|
|
|
@@ -724,6 +764,13 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // Row Click
|
|
|
+ gridOptionsGoods.onCellClicked = function(event) {
|
|
|
+ var goodsCd = event.data.goodsCd;
|
|
|
+ if (event.colDef.field == "goodsCd"){
|
|
|
+ cfnOpenGoodsDetailPopup('U',goodsCd);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$('#btnSearchPlan').on('click', function() {
|
|
|
cfnOpenPlanPopup('popupPlan');
|