|
@@ -82,8 +82,8 @@
|
|
|
var dispStdt = result[i].dispStdt.split(" ");
|
|
var dispStdt = result[i].dispStdt.split(" ");
|
|
|
var dispEddt = result[i].dispEddt.split(" ");
|
|
var dispEddt = result[i].dispEddt.split(" ");
|
|
|
var brandGroupImg = result[i].brandGroupImg;
|
|
var brandGroupImg = result[i].brandGroupImg;
|
|
|
- var linkUrl = '#';
|
|
|
|
|
- html += '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
|
|
|
|
+
|
|
|
|
|
+ html += '<table class="frmStyle tableTest" style="margin-bottom:30px" id="tabTable'+i+'" tableIdx="'+i+'">';
|
|
|
html += '<colgroup>';
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
html += '<col style="width:55%;"/>';
|
|
@@ -110,7 +110,7 @@
|
|
|
if(contentsLoc=='SMM007') {
|
|
if(contentsLoc=='SMM007') {
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddPlanRow(\'#\',this);">기획전/배너추가</button>';
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddPlanRow(\'#\',this);">기획전/배너추가</button>';
|
|
|
}
|
|
}
|
|
|
- //html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this);">상품추가</button>';
|
|
|
|
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this);">상품추가</button>';
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
|
html += '</tr>';
|
|
html += '</tr>';
|
|
|
if(contentsLoc=='SMM010'){
|
|
if(contentsLoc=='SMM010'){
|
|
@@ -195,8 +195,8 @@
|
|
|
src = $("#uploadDefaultBrandUrlPop").val().replace('/contents/brand', '') + param;
|
|
src = $("#uploadDefaultBrandUrlPop").val().replace('/contents/brand', '') + param;
|
|
|
imgPath = param;
|
|
imgPath = param;
|
|
|
}
|
|
}
|
|
|
- var linkUrl = '#';
|
|
|
|
|
- var html = '<table class="frmStyle" style="margin-bottom:30px">';
|
|
|
|
|
|
|
+
|
|
|
|
|
+ var html = '<table class="frmStyle tableTest" style="margin-bottom:30px" id="tabTable'+brandIdx+'" tableIdx="'+brandIdx+'">';
|
|
|
html += '<colgroup>';
|
|
html += '<colgroup>';
|
|
|
html += '<col style="width:10%;"/>';
|
|
html += '<col style="width:10%;"/>';
|
|
|
html += '<col style="width:55%;"/>';
|
|
html += '<col style="width:55%;"/>';
|
|
@@ -223,7 +223,7 @@
|
|
|
if(contentsLoc=='SMM007') {
|
|
if(contentsLoc=='SMM007') {
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddPlanRow(\'#\',this);">기획전/배너추가</button>';
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddPlanRow(\'#\',this);">기획전/배너추가</button>';
|
|
|
}
|
|
}
|
|
|
- //html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this);">상품추가</button>';
|
|
|
|
|
|
|
+ html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this);">상품추가</button>';
|
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
html += '<button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
|
html += '</tr>';
|
|
html += '</tr>';
|
|
|
if(contentsLoc=='SMM010'){
|
|
if(contentsLoc=='SMM010'){
|
|
@@ -262,14 +262,37 @@
|
|
|
html += '</thead><tbody></tbody></table>';
|
|
html += '</thead><tbody></tbody></table>';
|
|
|
|
|
|
|
|
brandIdx++;
|
|
brandIdx++;
|
|
|
|
|
+
|
|
|
$("#multiPopSortable").prepend(html);
|
|
$("#multiPopSortable").prepend(html);
|
|
|
$("#multiPopSortable").sortable();
|
|
$("#multiPopSortable").sortable();
|
|
|
|
|
+ /*$("#multiPopSortable").sortable({
|
|
|
|
|
+ stop : function (event, table){
|
|
|
|
|
+ $(".tableTest").each(function(i){
|
|
|
|
|
+ $(this).attr('id','tabTable'+i);
|
|
|
|
|
+ console.log($(this).attr('id'));
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });*/
|
|
|
$('.schDate').datepicker("destroy");
|
|
$('.schDate').datepicker("destroy");
|
|
|
$('.schDate').datepicker({
|
|
$('.schDate').datepicker({
|
|
|
changeMonth: true,
|
|
changeMonth: true,
|
|
|
changeYear: true,
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
});
|
|
|
|
|
+ //fnReloadIdx();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var test = "";
|
|
|
|
|
+ var fnReloadIdx = function (){
|
|
|
|
|
+ $(".tableTest").each(function(i){
|
|
|
|
|
+ $(this).attr('id','tabTable'+i);
|
|
|
|
|
+ console.log($(this).attr('id'));
|
|
|
|
|
+
|
|
|
|
|
+ $(".gridClass").each(function(j){
|
|
|
|
|
+ $(this).attr('id','gridGoodsList'+j);
|
|
|
|
|
+ console.log("gridClass:::"+$(this).attr('id'));
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -371,6 +394,7 @@
|
|
|
// 컨텐츠 행삭제
|
|
// 컨텐츠 행삭제
|
|
|
var fnDeleteBrandRow = function (obj){
|
|
var fnDeleteBrandRow = function (obj){
|
|
|
$(obj).closest("table").remove();
|
|
$(obj).closest("table").remove();
|
|
|
|
|
+ //fnReloadIdx();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 행삭제
|
|
// 행삭제
|
|
@@ -587,6 +611,117 @@
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ var columnList = [
|
|
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
|
|
+ {headerName: "우선순위", field: "dispOrd", width: 100, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "상품코드", field: "goodsCd", width: 120, cellClass: 'text-center'},
|
|
|
|
|
+ {headerName: "상품명", field: "goodsNm", width: 300, cellClass: 'text-center'},
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ var gridGoodsList = gagaAgGrid.getGridOptions(columnList);
|
|
|
|
|
+ gridGoodsList.rowSelection = "multiple";
|
|
|
|
|
+ gridGoodsList.defaultColDef.editable = true;
|
|
|
|
|
+
|
|
|
|
|
+ // 선택삭제 버튼 클릭시
|
|
|
|
|
+ var fndelMultiContentsGoods = function (){
|
|
|
|
|
+ gridGoodsList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridGoodsList)});
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 상품추가
|
|
|
|
|
+ */
|
|
|
|
|
+ var fnAddGoodsRow = function(param){
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var inputGridId = '';
|
|
|
|
|
+ var goodsIdx = 0;
|
|
|
|
|
+ var fnAddGoodsRowGrid = function (param){
|
|
|
|
|
+ var gridId = "gridGoodsList"+goodsIdx;
|
|
|
|
|
+ var html = '<tr name="goodsRow">';
|
|
|
|
|
+ html += '<th>상품추가<br><button type="button" class="btn btn-base btn-lg" onclick="fnDeleteTrRow(this);">삭제</button></th>';
|
|
|
|
|
+ html += '<td colspan="3">';
|
|
|
|
|
+ html +='<div class="padding10">';
|
|
|
|
|
+ html +='<span class="buttonSpan">';
|
|
|
|
|
+ html +='<button type="button" class="btn btnRight btn-success btn-lg" onclick="fnAddMultiContentsGoods(\''+gridId+'\');">상품추가</button>';
|
|
|
|
|
+ html +='<button type="button" class="btn btnRight btn-success btn-lg" onclick="fndelMultiContentsGoods();">행삭제</button>';
|
|
|
|
|
+ html +='</span>';
|
|
|
|
|
+ html +='<br/>';
|
|
|
|
|
+ html +='<div id="gridGoodsList'+goodsIdx+'" style="width:100%; height:200px;" class="gridClass ag-theme-balham"></div>';
|
|
|
|
|
+ html +='</div>';
|
|
|
|
|
+ html += '</td>';
|
|
|
|
|
+ html += '</tr>';
|
|
|
|
|
+
|
|
|
|
|
+ if(typeof param == 'object'){
|
|
|
|
|
+ if($(param).closest("table").find("tbody").find("tr[name=goodsRow]").length>0){
|
|
|
|
|
+ mcxDialog.alert("상품추가 ROW는 1개 등록 가능합니다");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ goodsIdx++;
|
|
|
|
|
+ $(param).closest("table").find("tbody").append(html);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ goodsIdx++;
|
|
|
|
|
+ return html;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ fnSetGrid(gridId,goodsIdx);
|
|
|
|
|
+ //gagaAgGrid.createGrid(gridId, gridGoodsList);
|
|
|
|
|
+ //fnReloadIdx();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var fnSetGrid = function (id,idx){
|
|
|
|
|
+ console.log('id??'+id);
|
|
|
|
|
+ console.log('idx??'+idx);
|
|
|
|
|
+ var idxx = idx-1;
|
|
|
|
|
+ window['gridGoodsList'+idxx] = gagaAgGrid.getGridOptions(columnList);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ gagaAgGrid.createGrid(id, gridGoodsList+idxx);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 상품조회
|
|
|
|
|
+ */
|
|
|
|
|
+ var fnAddMultiContentsGoods = function (obj){
|
|
|
|
|
+ inputGridId = obj;
|
|
|
|
|
+ console.log('objobj>>>'+obj);
|
|
|
|
|
+ cfnOpenGoodsPopup("fnSetGoodsInfo");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var fnSetGoodsInfo = function(result){
|
|
|
|
|
+ console.log('a1>>>'+inputGridId);
|
|
|
|
|
+ gridAddGoodsList(gridGoodsList, result , "apply");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // ag-grid 상품관련 list 콜백함수
|
|
|
|
|
+ function gridAddGoodsList(OriginGridListOption, result, gubun) {
|
|
|
|
|
+ console.log('OriginGridListOption??'+OriginGridListOption);
|
|
|
|
|
+ let addCnt = 0;
|
|
|
|
|
+ let failCnt = 0;
|
|
|
|
|
+ let dupliCnt = 0;
|
|
|
|
|
+ for(let i=0; i<result.length; i++){
|
|
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(OriginGridListOption); // 받아온 모든 데이터
|
|
|
|
|
+
|
|
|
|
|
+ // 받아온 data for
|
|
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
|
|
+ if(gridListValue[j].goodsCd == result[i].goodsCd) { // 중복체크
|
|
|
|
|
+ addChk = false;
|
|
|
|
|
+ dupliCnt++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
|
|
+ if(addChk) {
|
|
|
|
|
+ gagaAgGrid.addRowData(OriginGridListOption, {"goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
|
|
|
|
|
+ addCnt++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ uifnPopupClose('popupGoods');
|
|
|
|
|
+ failCnt = result.length - addCnt - dupliCnt;
|
|
|
|
|
+ mcxDialog.alert("데이터가 적용되었습니다.<br/>" + addCnt + "건 성공, "+ dupliCnt + "건 중복, " + failCnt + "건 실패");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
|
$("#multiPopTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
|
|
$("#multiPopTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
|
|
|
|
|
|
|
@@ -595,7 +730,11 @@
|
|
|
}else{
|
|
}else{
|
|
|
$("#multiContentsTitleForm").hide();
|
|
$("#multiContentsTitleForm").hide();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ $("#multiPopSortable").sortable({
|
|
|
|
|
+ stop: function(event, ui) {
|
|
|
|
|
+ //fnReloadIdx();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
$("#multiPopSortable").disableSelection();
|
|
$("#multiPopSortable").disableSelection();
|
|
|
fnGetMultiContentsPreviewList();
|
|
fnGetMultiContentsPreviewList();
|
|
|
});
|
|
});
|