|
|
@@ -104,7 +104,7 @@
|
|
|
html += '<select name="edTimeMin" required="required" data-valid-name="노출기간 종료시간">';
|
|
|
html += fnCreateTimeOption(60, dispEddt[1].split(":")[1]);
|
|
|
html += '</select>';
|
|
|
- html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center"/>';
|
|
|
+ html += '<input name="dispOrd" type="text" class="w80"placeholder="전시순서" style="margin-left:5px; text-align:center" value="'+result[i].dispOrd+'"/>';
|
|
|
html += '</td>';
|
|
|
html += '<td class="aL">';
|
|
|
if(contentsLoc=='SMM007') {
|
|
|
@@ -279,19 +279,13 @@
|
|
|
changeYear: true,
|
|
|
defaultDate: $('.schDate').val()
|
|
|
});
|
|
|
- //fnReloadIdx();
|
|
|
+ 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'));
|
|
|
- });
|
|
|
+ //console.log($(this).attr('id'));
|
|
|
});
|
|
|
}
|
|
|
|
|
|
@@ -390,11 +384,10 @@
|
|
|
);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// 컨텐츠 행삭제
|
|
|
var fnDeleteBrandRow = function (obj){
|
|
|
$(obj).closest("table").remove();
|
|
|
- //fnReloadIdx();
|
|
|
+ fnReloadIdx();
|
|
|
}
|
|
|
|
|
|
// 행삭제
|
|
|
@@ -459,7 +452,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
dataArr = [];
|
|
|
- $("#multiPopSortable table").each(function(){
|
|
|
+ $("#multiPopSortable .tableTest").each(function(){ //$("#multiPopSortable table").each(function(){
|
|
|
var newImgFileArr = [];
|
|
|
var imgPath1 = '';
|
|
|
var imgPath2 = '';
|
|
|
@@ -485,11 +478,13 @@
|
|
|
var subText2 = '';
|
|
|
var subText3 = '';
|
|
|
var subText4 = '';
|
|
|
+ var goodsCdArr = [];
|
|
|
var i = 1;
|
|
|
$(this).find('input[name=planImgPath]').each(function(){
|
|
|
eval("imgPath" + i + "='"+$(this).val()+"'");
|
|
|
i++;
|
|
|
});
|
|
|
+
|
|
|
$(this).find('input[name=planNewImgFile]').each(function(){
|
|
|
newImgFileArr.push($(this).val());
|
|
|
});
|
|
|
@@ -504,6 +499,11 @@
|
|
|
i++;
|
|
|
});
|
|
|
|
|
|
+ $(this).find('input[name=goodsCd]').each(function(){
|
|
|
+ goodsCdArr.push($(this).val());
|
|
|
+ });
|
|
|
+ console.log(goodsCdArr);
|
|
|
+
|
|
|
var dispStdt = $(this).find("[name=dispStdt]").val().replace(/[^0-9]/g, '') + "" +$(this).find("[name=stTimeHour]").val().replace('시', '') + "" +$(this).find("[name=stTimeMin]").val().replace('분', '') + "00";
|
|
|
var dispEddt = $(this).find("[name=dispEddt]").val().replace(/[^0-9]/g, '') + "" +$(this).find("[name=edTimeHour]").val().replace('시', '') + "" +$(this).find("[name=edTimeMin]").val().replace('분', '') + "59";
|
|
|
|
|
|
@@ -548,6 +548,8 @@
|
|
|
, useYn : 'Y'
|
|
|
, dispOrd : dispOrd
|
|
|
, multiContentsYn : 'Y'
|
|
|
+ , contentsTitle : $("#multiContentsTitleForm input[name=contentsTitle]").val()
|
|
|
+ , goodsCdArr : goodsCdArr
|
|
|
};
|
|
|
|
|
|
dataArr.push(data);
|
|
|
@@ -594,13 +596,6 @@
|
|
|
dataArr = dataArrSort;
|
|
|
}
|
|
|
|
|
|
- var data = {
|
|
|
- cateNo : cateNo
|
|
|
- , contentsLoc : contentsLoc
|
|
|
- , contentsTitle : $("#multiContentsTitleForm input[name=contentsTitle]").val()
|
|
|
- }
|
|
|
- dataArr.push(data);
|
|
|
-
|
|
|
var jsonData = JSON.stringify(dataArr);
|
|
|
mcxDialog.confirm('컨텐츠를 저장 하시겠습니까?', {
|
|
|
cancelBtnText: "취소",
|
|
|
@@ -611,47 +606,34 @@
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- 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 fnAddGoodsRow = function (param){
|
|
|
+ var addRow = "goodsListTd"+goodsIdx;
|
|
|
+ //console.log('addRowTd::'+addRowTd);
|
|
|
+ console.log('addRow::'+addRow);
|
|
|
var html = '<tr name="goodsRow">';
|
|
|
- html += '<th>상품추가<br><button type="button" class="btn btn-base btn-lg" onclick="fnDeleteTrRow(this);">삭제</button></th>';
|
|
|
+ html += '<th>상품추가<br><button type="button" class="btn btn-base btn-lg" onclick="fnDeleteTrRow(this);">삭제</button>';
|
|
|
+ html += '<br><button type="button" class="btn btn-base btn-lg" onclick="fnSearchGoods(\''+addRow+'\');">상품조회</button>';
|
|
|
+ html += '</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 += '<table style="border-style: solid;border-color: #ac2925; width:100%; height:20px;">';
|
|
|
+ //html += '<colgroup>';
|
|
|
+ //html += '<col style="width:90%;"/>';
|
|
|
+ //html += '<col style="width:10%;"/>';
|
|
|
+ //html += '<col/>';
|
|
|
+ //html += '</colgroup>';
|
|
|
+ //html += '<thead>';
|
|
|
+ html += '<div class="sortableWrap" data-unit="7" style="overflow-y:scroll;">';
|
|
|
+ html += '<div class="itemWrap" id="goodsListTd'+goodsIdx+'">';
|
|
|
+ html += '</div>';
|
|
|
+ html += '</div>';
|
|
|
+ //html += '</thead>';
|
|
|
+ //html += '</table>';
|
|
|
html += '</td>';
|
|
|
html += '</tr>';
|
|
|
-
|
|
|
if(typeof param == 'object'){
|
|
|
if($(param).closest("table").find("tbody").find("tr[name=goodsRow]").length>0){
|
|
|
mcxDialog.alert("상품추가 ROW는 1개 등록 가능합니다");
|
|
|
@@ -663,64 +645,86 @@
|
|
|
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);
|
|
|
+ fnReloadIdx();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 상품조회
|
|
|
*/
|
|
|
- var fnAddMultiContentsGoods = function (obj){
|
|
|
- inputGridId = obj;
|
|
|
- console.log('objobj>>>'+obj);
|
|
|
- cfnOpenGoodsPopup("fnSetGoodsInfo");
|
|
|
+ var addRowTd;
|
|
|
+ var fnSearchGoods = function (obj){
|
|
|
+ addRowTd = obj;
|
|
|
+ cfnOpenGoodsPopup('fnAddMultiContentsGoods');
|
|
|
}
|
|
|
|
|
|
- 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++;
|
|
|
- }
|
|
|
+ var firstOrd = '';
|
|
|
+ var uploadGoodsUrl = "image.istyle24.com/Upload/ProductImage";//[[${@environment.getProperty('upload.goods.view')}]];
|
|
|
+ var fnAddMultiContentsGoods = function(result){
|
|
|
+ console.log('goodsRowIdx>>>>'+addRowTd);
|
|
|
+ var html='';
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
+ if(i==0){
|
|
|
+ firstOrd = result[i].dispOrd;
|
|
|
}
|
|
|
-
|
|
|
- // 중복되지 않은 데이터 리스트에 추가
|
|
|
- if(addChk) {
|
|
|
- gagaAgGrid.addRowData(OriginGridListOption, {"goodsCd" : result[i].goodsCd, "goodsNm" : result[i].goodsNm});
|
|
|
- addCnt++;
|
|
|
+ html+='<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:130px;" ';
|
|
|
+ if(result[i].goodsStat!="G008_90" || result[i].currStockQty<1){
|
|
|
+ html += 'background:#f5f5f5;';
|
|
|
+ }
|
|
|
+ html += '">';
|
|
|
+ html += '<li class="img">';
|
|
|
+ var imgPath = '';
|
|
|
+ if(result[i].imgType=='A'){
|
|
|
+ imgPath = uploadGoodsUrl;
|
|
|
}
|
|
|
+ html += '<img src="'+imgPath+ "/" +result[i].imgPath1+'" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '<li class="cont">';
|
|
|
+ html += '<ul>';
|
|
|
+ html += '<li class="no" name="goodsCdLi"><span>'+result[i].goodsCd+'</span>';
|
|
|
+ html += '<input type="hidden" name="goodsCd" value="'+result[i].goodsCd+'">';
|
|
|
+ html += '<span style="margin-left:5px;"><a href="javascript:void(0);" onclick="fnRemoveGoods(this,'+i+');">X</a></span>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '<li class="title">'+result[i].goodsNm+'</li>';
|
|
|
+ /*html += '<li>';
|
|
|
+ html += '<span>전시순서 :</span>';
|
|
|
+ html += '<input type="text" name="dispOrdEdit" value="" />';
|
|
|
+ html += '<input type="text" name="setDispOrd" value="'+result[i].dispOrd+'"/>';
|
|
|
+ html += '</li>';*/
|
|
|
+ html += '</ul>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '</ul>';
|
|
|
}
|
|
|
+ $("#"+addRowTd).append(html);
|
|
|
+ $("#"+addRowTd).sortable();
|
|
|
+ /*$("#"+addRowTd).sortable({
|
|
|
+ stop: function(event, ui) {
|
|
|
+ if(gagajf.isNull(firstOrd)){
|
|
|
+ firstOrd = 1;
|
|
|
+ }else{
|
|
|
+ firstOrd = Number(firstOrd);
|
|
|
+ }
|
|
|
+ $("#"+addRowTd+" .item").each(function(i){
|
|
|
+ $(this).find("input[name=setDispOrd]").val(i+firstOrd);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });*/
|
|
|
+ $("#"+addRowTd).disableSelection();
|
|
|
uifnPopupClose('popupGoods');
|
|
|
- failCnt = result.length - addCnt - dupliCnt;
|
|
|
- mcxDialog.alert("데이터가 적용되었습니다.<br/>" + addCnt + "건 성공, "+ dupliCnt + "건 중복, " + failCnt + "건 실패");
|
|
|
+ fnReloadGoodsListIdx(addRowTd);
|
|
|
}
|
|
|
|
|
|
+ var fnReloadGoodsListIdx = function (obj){
|
|
|
+ var tableId = obj
|
|
|
+ $("#"+tableId +" .goodsClass").each(function (i){
|
|
|
+ $(this).attr('id','goodsUl'+i);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnRemoveGoods = function (obj , idx){
|
|
|
+ var divId = $(obj).closest('div').attr('id');
|
|
|
+ $("#"+divId+" #goodsUl"+idx).remove();
|
|
|
+ fnReloadGoodsListIdx(divId);
|
|
|
+ }
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
$("#multiPopTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
|
|
|
@@ -737,6 +741,7 @@
|
|
|
});
|
|
|
$("#multiPopSortable").disableSelection();
|
|
|
fnGetMultiContentsPreviewList();
|
|
|
+ fnReloadIdx();
|
|
|
});
|
|
|
/*]]>*/
|
|
|
</script>
|