|
|
@@ -106,7 +106,7 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
}
|
|
|
- html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this,this,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 += '</tr>';
|
|
|
if(contentsLoc=='SMM009' || contentsLoc=='SMM012'){
|
|
|
@@ -174,8 +174,9 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(!gagajf.isNull(result[i].goodsCdList)){
|
|
|
- html += fnAddGoodsRow(result[i].goodsCdList,result[i].goodsNmList,result[i].goodsImgList);
|
|
|
+ if(!gagajf.isNull(result[i].contentsGoodsList)){
|
|
|
+ console.log(fnAddGoodsRow(result[i].contentsGoodsList));
|
|
|
+ html += fnAddGoodsRow(result[i].contentsGoodsList);
|
|
|
}
|
|
|
html += '</tbody></table>';
|
|
|
}
|
|
|
@@ -268,7 +269,7 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddTitlePopRow(this);">타이틀추가</button>';
|
|
|
html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddSubTextPopRow(this);">서브텍스트추가</button>';
|
|
|
}
|
|
|
- html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddGoodsRow(this,this,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 += '</tr>';
|
|
|
if(contentsLoc=='SMM009' || contentsLoc=='SMM012'){
|
|
|
@@ -495,8 +496,14 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
|
|
|
// 컨텐츠 행삭제
|
|
|
var fnDeleteBrandRow = function (obj){
|
|
|
- $(obj).closest("table").remove();
|
|
|
- fnReloadIdx();
|
|
|
+ mcxDialog.confirm('삭제시 전시순서가 초기화됩니다. 삭제하시겠습니까?', {
|
|
|
+ cancelBtnText: "취소",
|
|
|
+ sureBtnText: "확인",
|
|
|
+ sureBtnClick: function(){
|
|
|
+ $(obj).closest("table").remove();
|
|
|
+ fnReloadIdx();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
// 행삭제
|
|
|
@@ -537,6 +544,28 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
uifnPopupClose('popupMainMultiContents');
|
|
|
}
|
|
|
|
|
|
+ // 전시 일시 체크
|
|
|
+ function dateValidation(){
|
|
|
+ var dateBool = true;
|
|
|
+ $(".tableTest").each(function(i){
|
|
|
+ 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";
|
|
|
+
|
|
|
+ let fromDate = dispStdt.replace(/[^0-9]/g, '');
|
|
|
+ let toDate = dispEddt.replace(/[^0-9]/g, '');
|
|
|
+ if(fromDate > toDate){
|
|
|
+ mcxDialog.alert("시작일자는 종료일자 보다 클 수 없습니다.");
|
|
|
+ $(this).find('input[name=dispStdt]').focus();
|
|
|
+ dateBool = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(!dateBool){
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 임시저장
|
|
|
*/
|
|
|
@@ -546,6 +575,11 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ // 전시일시 체크
|
|
|
+ if(!dateValidation()){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
dataArr = [];
|
|
|
$("#multiPopSortable .tableTest").each(function(){ //$("#multiPopSortable table").each(function(){
|
|
|
var newImgFileArr = [];
|
|
|
@@ -625,11 +659,11 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
|
|
|
var dispOrd = $(this).find("[name=dispOrd]").val();
|
|
|
|
|
|
- var brandGroupNo = '';
|
|
|
+ var brandGroupNo;
|
|
|
if(contentsLoc=='SBM007'||contentsLoc=='SBM008'||contentsLoc=='SBM009'||contentsLoc=='SBM017'||contentsLoc=='SBM018'||contentsLoc=='SBM019'||contentsLoc=='SOM003'||contentsLoc=='SCM002'||contentsLoc=='SCM003'){
|
|
|
brandGroupNo = [[${brandGroupNo}]];
|
|
|
}else{
|
|
|
- $(this).find("[name=brandGroupNo]").val();
|
|
|
+ brandGroupNo = $(this).find("[name=brandGroupNo]").val();
|
|
|
}
|
|
|
var brandGroupImg = $(this).find("[name=brandNewImgFile]").val();
|
|
|
var mdTitle = $(this).find("[name=mdTitle]").val();
|
|
|
@@ -745,60 +779,39 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
* 상품추가
|
|
|
*/
|
|
|
var goodsIdx = 0;
|
|
|
- var fnAddGoodsRow = function (param, param2, param3){
|
|
|
+ var fnAddGoodsRow = function (param){
|
|
|
var addRow = "goodsListTd"+goodsIdx;
|
|
|
- //console.log('addRow::'+addRow);
|
|
|
|
|
|
var html = '<tr name="goodsRow">';
|
|
|
html += '<th>상품추가<br><button type="button" class="btn btn-base btn-lg" onclick="fnSearchGoods(\''+addRow+'\');">상품조회</button>';
|
|
|
html += '<br></br><button type="button" class="btn btn-danger btn-lg" onclick="fnDeleteTrRow(this);">삭제</button>';
|
|
|
html += '</th>';
|
|
|
html += '<td colspan="3">';
|
|
|
- //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+'">';
|
|
|
if(typeof param!='object'){
|
|
|
- var goodsCdList = [];
|
|
|
- var goodsNmList = [];
|
|
|
- var goodsImgList = [];
|
|
|
- goodsCdList = param;
|
|
|
- goodsNmList = param2;
|
|
|
- goodsImgList = param3;
|
|
|
- // 여기서 부터 시작! 상품불러오는거 똑같이 html 추가해서 체크
|
|
|
- // +) 저장할때 TB_CONTENTS_GOODS 에 상품코드, 상품명, 상품이미지경로 추가해서 3개다 불러와서 데이터 뿌릴수 있게
|
|
|
- $.each(goodsCdList.split(','),function (i){
|
|
|
+ var imgPath = _goodsUrl;
|
|
|
+ for(let i=0; i<param.length; i++){
|
|
|
html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:140px;"> ';
|
|
|
- goodsImg = goodsImgList.split(',')[i];
|
|
|
- goodsCd = goodsCdList.split(',')[i];
|
|
|
- goodsNm = goodsNmList.split(',')[i];
|
|
|
html += '<li class="img">';
|
|
|
- var imgPath = _goodsUrl;
|
|
|
- html += '<img src="'+imgPath+ "/" +goodsImg+'" onerror="this.src=\'/image/no.png\';"/>';
|
|
|
+ html += '<img src="'+imgPath+ "/" +param[i].sysImgNm+'" onerror="this.src=\'/image/no.png\';"/>';
|
|
|
html += '</li>';
|
|
|
html += '<li class="cont">';
|
|
|
html += '<ul>';
|
|
|
- html += '<li class="no" name="goodsCdLi"><span>'+goodsCd+'</span>';
|
|
|
- html += '<input type="hidden" name="goodsImgPath" value="'+goodsImg+'">';
|
|
|
- html += '<input type="hidden" name="goodsCd" value="'+goodsCd+'">';
|
|
|
- html += '<input type="hidden" name="goodsNm" value="'+goodsNm+'">';
|
|
|
+ html += '<li class="no" name="goodsCdLi"><span>'+param[i].goodsCd+'</span>';
|
|
|
+ html += '<input type="hidden" name="goodsImgPath" value="'+param[i].sysImgNm+'">';
|
|
|
+ html += '<input type="hidden" name="goodsCd" value="'+param[i].goodsCd+'">';
|
|
|
+ html += '<input type="hidden" name="goodsNm" value="'+param[i].goodsNm+'">';
|
|
|
html += '<span style="margin-left:5px;"><a href="javascript:void(0);" id="delId" onclick="fnRemoveGoods(this,'+i+');">X</a></span>';
|
|
|
html += '</li>';
|
|
|
html += '</li>';
|
|
|
- html += '<li class="title">'+goodsNm+'</li>';
|
|
|
+ html += '<li class="title">'+param[i].goodsNm+'</li>';
|
|
|
html += '</ul>';
|
|
|
html += '</ul>';
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
html += '</div>';
|
|
|
html += '</div>';
|
|
|
- //html += '</thead>';
|
|
|
- //html += '</table>';
|
|
|
html += '</td>';
|
|
|
html += '</tr>';
|
|
|
if(typeof param == 'object'){
|
|
|
@@ -808,7 +821,7 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
}
|
|
|
goodsIdx++;
|
|
|
$(param).closest("table").find("tbody").append(html);
|
|
|
-
|
|
|
+ return html;
|
|
|
}else{
|
|
|
goodsIdx++;
|
|
|
return html;
|