|
|
@@ -789,6 +789,46 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
});
|
|
|
});
|
|
|
|
|
|
+ var fnUpBtn = function (obj, idx){
|
|
|
+ var ind = $(obj).closest('.item').index();
|
|
|
+ if(ind>0){
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind-1).before($('#goodsListTd'+idx).find(".item").eq(ind));
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=setDispOrd]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=setDispOrd]").val())+1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind-1).find("input[name=setDispOrd]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind-1).find("input[name=setDispOrd]").val())-1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=dispOrdEdit]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=dispOrdEdit]").val())+1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind-1).find("input[name=dispOrdEdit]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind-1).find("input[name=dispOrdEdit]").val())-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnDownBtn = function (obj, idx){
|
|
|
+ var ind = $(obj).closest('.item').index();
|
|
|
+ if(ind<$("#goodsListTd"+idx).find('.goodsClass').length){
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind+1).after($('#goodsListTd'+idx).find(".item").eq(ind));
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=setDispOrd]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=setDispOrd]").val())-1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind+1).find("input[name=setDispOrd]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind+1).find("input[name=setDispOrd]").val())+1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=dispOrdEdit]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind).find("input[name=dispOrdEdit]").val())-1);
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(ind+1).find("input[name=dispOrdEdit]").val(Number($('#goodsListTd'+idx).find(".item").eq(ind+1).find("input[name=dispOrdEdit]").val())+1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var fnUpdownBtn = function (obj, gubun, idx){
|
|
|
+ if(gubun=='up'){
|
|
|
+ var ind = $(obj).closest('.item').index();
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(0).before($('#goodsListTd'+idx).find(".item").eq(ind));
|
|
|
+ $('#goodsListTd'+idx).find('.goodsClass').each(function (j){
|
|
|
+ $(this).find('input[name=dispOrdEdit]').val(j+1);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ var ind = $(obj).closest('.item').index();
|
|
|
+ let lastNum = $("#goodsListTd"+idx).find('.goodsClass').length;
|
|
|
+ $('#goodsListTd'+idx).find(".item").eq(lastNum-1).after($('#goodsListTd'+idx).find(".item").eq(ind));
|
|
|
+ $('#goodsListTd'+idx).find('.goodsClass').each(function (j){
|
|
|
+ $(this).find('input[name=dispOrdEdit]').val(j+1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 상품추가
|
|
|
*/
|
|
|
@@ -809,12 +849,12 @@ console.log('brandGroupNo:'+brandGroupNo);
|
|
|
html += '<ul id="goodsUl'+i+'" class="item ui-state-default goodsClass" style="min-height:200px;"> ';
|
|
|
html += '<li class="img">';
|
|
|
html += '<img src="'+imgPath+ "/" +param[i].sysImgNm+'" onerror="this.src=\'/image/no.png\';"/>';
|
|
|
- // html += '<div class="btnArea">';
|
|
|
- // html += '<button type="button" class="icnSm" title="맨위로" onclick="fnUpdownBtn(\''+param[i].goodsCd+'\', \''+param[i].dispOrd+'\', \'up\');"><i class="fa fa-play-circle fa-rotate-270" aria-hidden="true"></i></button>';
|
|
|
- // html += '<button type="button" class="icnSm" title="위로"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>';
|
|
|
- // html += '<button type="button" class="icnSm" title="맨아래로" onclick="fnUpdownBtn(\''+param[i].goodsCd+'\', \''+param[i].dispOrd+'\', \'down\');"><i class="fa fa-play-circle fa-rotate-90" aria-hidden="true"></i></button>';
|
|
|
- // html += '<button type="button" class="icnSm" title="아래로"><i class="fa fa-arrow-down" aria-hidden="true"></i></button>';
|
|
|
- // html += '</div>';
|
|
|
+ html += '<div class="btnArea">';
|
|
|
+ html += '<button type="button" class="icnSm" title="맨위로" onclick="fnUpdownBtn(this, \'up\', \''+goodsIdx+'\');"><i class="fa fa-play-circle fa-rotate-270" aria-hidden="true"></i></button>';
|
|
|
+ html += '<button type="button" class="icnSm" title="위로" onclick="fnUpBtn(this, \''+goodsIdx+'\');"><i class="fa fa-arrow-up" aria-hidden="true"></i></button>';
|
|
|
+ html += '<button type="button" class="icnSm" title="맨아래로" onclick="fnUpdownBtn(this, \'down\', \''+goodsIdx+'\');"><i class="fa fa-play-circle fa-rotate-90" aria-hidden="true"></i></button>';
|
|
|
+ html += '<button type="button" class="icnSm" title="아래로" onclick="fnDownBtn(this, \''+goodsIdx+'\');"><i class="fa fa-arrow-down" aria-hidden="true"></i></button>';
|
|
|
+ html += '</div>';
|
|
|
html += '</li>';
|
|
|
html += '<li class="cont">';
|
|
|
html += '<ul>';
|