|
|
@@ -27,7 +27,7 @@
|
|
|
</li>
|
|
|
<li class="aR">
|
|
|
<button type="button" class="btn btn btn-base btn-sm" th:if="${contentsLoc == 'SMM007'}" onclick="fnAddBrand(this);">브랜드 추가</button> <!--id="btnBrandAddRow"-->
|
|
|
- <button type="button" class="btn btn btn-base btn-sm" th:if="${contentsLoc == 'SMM010'}" onclick="fnAddBrand(this);">MD 탭 추가</button>
|
|
|
+ <button type="button" class="btn btn btn-base btn-sm" th:if="${contentsLoc == 'SMM009'}" onclick="fnAddBrand(this);">MD 탭 추가</button>
|
|
|
<button type="button" class="btn btn btn-dark btn-sm" id="btnMultiPopSave">임시저장</button>
|
|
|
<input type="hidden" name="uploadDefaultUrlMultiPop" id="uploadDefaultUrlMultiPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/'}"/>
|
|
|
<input type="hidden" name="uploadDefaultBrandUrlPop" id="uploadDefaultBrandUrlPop" th:value="${@environment.getProperty('upload.image.view') + '/display/contents/brand/'}"/>
|
|
|
@@ -110,10 +110,10 @@
|
|
|
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="fnAddGoodsRow(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-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
|
html += '</tr>';
|
|
|
- if(contentsLoc=='SMM010'){
|
|
|
+ if(contentsLoc=='SMM009'){
|
|
|
html += '<tr>';
|
|
|
html += '<th>MD탭문구</th>';
|
|
|
html += '<td colspan="3"><input type="text" name="mdTitle" id="mdTitle" style="width:30%;" value="' + result[i].mdTitle + '"></td>';
|
|
|
@@ -138,8 +138,8 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(!gagajf.isNull(result[i].goodsArr)){
|
|
|
- html += fnAddGoodsRow(result[i].goodsArr);
|
|
|
+ if(!gagajf.isNull(result[i].goodsCdList)){
|
|
|
+ html += fnAddGoodsRow(result[i].goodsCdList,result[i].goodsNmList,result[i].goodsImgList);
|
|
|
}
|
|
|
html += '</tbody></table>';
|
|
|
}
|
|
|
@@ -226,10 +226,10 @@
|
|
|
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="fnAddGoodsRow(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-danger btn-lg" onclick="fnDeleteBrandRow(this);">삭제</button></td>';
|
|
|
html += '</tr>';
|
|
|
- if(contentsLoc=='SMM010'){
|
|
|
+ if(contentsLoc=='SMM009'){
|
|
|
html += '<tr>';
|
|
|
html += '<th>MD탭문구</th>';
|
|
|
html += '<td colspan="3"><input type="text" name="mdTitle" id="mdTitle" style="width:30%;"></td>';
|
|
|
@@ -482,7 +482,9 @@
|
|
|
var subText2 = '';
|
|
|
var subText3 = '';
|
|
|
var subText4 = '';
|
|
|
+ var goodsImgArr = [];
|
|
|
var goodsCdArr = [];
|
|
|
+ var goodsNmArr = [];
|
|
|
var i = 1;
|
|
|
$(this).find('input[name=planImgPath]').each(function(){
|
|
|
eval("imgPath" + i + "='"+$(this).val()+"'");
|
|
|
@@ -503,10 +505,17 @@
|
|
|
i++;
|
|
|
});
|
|
|
|
|
|
+ $(this).find('input[name=goodsImgPath]').each(function(){
|
|
|
+ goodsImgArr.push($(this).val());
|
|
|
+ });
|
|
|
+
|
|
|
$(this).find('input[name=goodsCd]').each(function(){
|
|
|
goodsCdArr.push($(this).val());
|
|
|
});
|
|
|
- console.log(goodsCdArr);
|
|
|
+
|
|
|
+ $(this).find('input[name=goodsNm]').each(function(){
|
|
|
+ goodsNmArr.push($(this).val());
|
|
|
+ });
|
|
|
|
|
|
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";
|
|
|
@@ -554,6 +563,8 @@
|
|
|
, multiContentsYn : 'Y'
|
|
|
, contentsTitle : $("#multiContentsTitleForm input[name=contentsTitle]").val()
|
|
|
, goodsCdArr : goodsCdArr
|
|
|
+ , goodsNmArr : goodsNmArr
|
|
|
+ , goodsImgArr : goodsImgArr
|
|
|
};
|
|
|
|
|
|
dataArr.push(data);
|
|
|
@@ -614,14 +625,13 @@
|
|
|
* 상품추가
|
|
|
*/
|
|
|
var goodsIdx = 0;
|
|
|
- var fnAddGoodsRow = function (param){
|
|
|
+ var fnAddGoodsRow = function (param, param2, param3){
|
|
|
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="fnDeleteTrRow(this);">삭제</button>';
|
|
|
- html += '<br><button type="button" class="btn btn-base btn-lg" onclick="fnSearchGoods(\''+addRow+'\');">상품조회</button>';
|
|
|
- html += '<input type="hidden" name="goodsArrTest" id="goodsArrTest" value="'+goodsArr+'">';
|
|
|
+ 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;">';
|
|
|
@@ -634,16 +644,34 @@
|
|
|
html += '<div class="sortableWrap" data-unit="7" style="overflow-y:scroll;">';
|
|
|
html += '<div class="itemWrap" id="goodsListTd'+goodsIdx+'">';
|
|
|
if(typeof param!='object'){
|
|
|
- var goodsArr = [];
|
|
|
- goodsArr = param;
|
|
|
+ var goodsCdList = [];
|
|
|
+ var goodsNmList = [];
|
|
|
+ var goodsImgList = [];
|
|
|
+ goodsCdList = param;
|
|
|
+ goodsNmList = param2;
|
|
|
+ goodsImgList = param3;
|
|
|
// 여기서 부터 시작! 상품불러오는거 똑같이 html 추가해서 체크
|
|
|
// +) 저장할때 TMP_CONTENTS_GOODS 에 상품코드, 상품명, 상품이미지경로 추가해서 3개다 불러와서 데이터 뿌릴수 있게
|
|
|
- $.each(goodsArr.split(','), function(i){
|
|
|
- console.log(i+':::>>>>>>>>>>>>>'+goodsArr.split(',')[i]);
|
|
|
- goodsCd = goodsArr.split(',')[i];
|
|
|
- html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:130px;" ';
|
|
|
- html += '">';
|
|
|
- html += '<li class="no" name="goodsCdLi"><span>'+goodsCd+'</span></li>';
|
|
|
+ $.each(goodsCdList.split(','),function (i){
|
|
|
+ html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:130px;"> ';
|
|
|
+ imgPath1 = goodsImgList.split(',')[i];
|
|
|
+ goodsCd = goodsCdList.split(',')[i];
|
|
|
+ goodsNm = goodsNmList.split(',')[i];
|
|
|
+ html += '<li class="img">';
|
|
|
+ var imgPath = uploadGoodsUrl;
|
|
|
+ html += '<img src="'+imgPath+ "/" +imgPath1+'" onerror="this.src=\'/image/no.gif\';"/>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '<li class="cont">';
|
|
|
+ html += '<ul>';
|
|
|
+ html += '<li class="no" name="goodsCdLi"><span>'+goodsCd+'</span>';
|
|
|
+ html += '<input type="hidden" name="goodsImgPath" value="'+imgPath1+'">';
|
|
|
+ html += '<input type="hidden" name="goodsCd" value="'+goodsCd+'">';
|
|
|
+ html += '<input type="hidden" name="goodsNm" value="'+goodsNm+'">';
|
|
|
+ html += '<span style="margin-left:5px;"><a href="javascript:void(0);" onclick="fnRemoveGoods(this,'+i+');">X</a></span>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '</li>';
|
|
|
+ html += '<li class="title">'+goodsNm+'</li>';
|
|
|
+ html += '</ul>';
|
|
|
html += '</ul>';
|
|
|
});
|
|
|
}
|
|
|
@@ -669,42 +697,6 @@
|
|
|
fnReloadIdx();
|
|
|
}
|
|
|
|
|
|
- var fnShowGoodsList = function (obj){
|
|
|
- console.log('18181818');
|
|
|
- var tableNm = obj;
|
|
|
- var goodsCd1 = $("#"+tableNm).find("input[name=goodsArrTest]").val();
|
|
|
- console.log('goodsCd1>>>'+goodsCd1);
|
|
|
- //$("#"+tableNm);
|
|
|
- var goodsCd = '';
|
|
|
- $.each(goodsCd1.split(','), function(i){
|
|
|
- console.log(i+':::>>>>>>>>>>>>>'+goodsCd1.split(',')[i]);
|
|
|
- goodsCd = goodsCd1.split(',')[i];
|
|
|
- html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:130px;" ';
|
|
|
- html += '">';
|
|
|
- html += '<li class="no" name="goodsCdLi"><span>'+goodsCd+'</span></li>>';
|
|
|
- html += '</ul>';
|
|
|
- $("#goodsListTd0").append(html);
|
|
|
- i++;
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- var fnShowGoodsList2 = function (param){
|
|
|
- console.log('goodsArr>>>'+param);
|
|
|
- var html = '';
|
|
|
- var goodsCd = '';
|
|
|
- $.each(param.split(','), function(i){
|
|
|
- console.log(i+':::>>>>>>>>>>>>>'+param.split(',')[i]);
|
|
|
- goodsCd = param.split(',')[i];
|
|
|
- html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:130px;" ';
|
|
|
- html += '">';
|
|
|
- html += '<li class="no" name="goodsCdLi"><span>'+goodsCd+'</span></li>>';
|
|
|
- html += '</ul>';
|
|
|
- $("#goodsListTd0").append(html);
|
|
|
- i++;
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 상품조회
|
|
|
*/
|
|
|
@@ -738,7 +730,9 @@
|
|
|
html += '<li class="cont">';
|
|
|
html += '<ul>';
|
|
|
html += '<li class="no" name="goodsCdLi"><span>'+result[i].goodsCd+'</span>';
|
|
|
+ html += '<input type="hidden" name="goodsImgPath" value="'+result[i].imgPath1+'">';
|
|
|
html += '<input type="hidden" name="goodsCd" value="'+result[i].goodsCd+'">';
|
|
|
+ html += '<input type="hidden" name="goodsNm" value="'+result[i].goodsNm+'">';
|
|
|
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>';
|
|
|
@@ -786,7 +780,7 @@
|
|
|
$(document).ready(function() {
|
|
|
$("#multiPopTitle").text("["+contentsLoc+"] "+gagaAgGrid.lookupValue(contentsLocArr, contentsLoc));
|
|
|
|
|
|
- if(contentsLoc=='SMM007'||contentsLoc=='SMM010'){
|
|
|
+ if(contentsLoc=='SMM007'||contentsLoc=='SMM009'){
|
|
|
$("#multiContentsTitleForm").show();
|
|
|
}else{
|
|
|
$("#multiContentsTitleForm").hide();
|