|
|
@@ -140,9 +140,17 @@
|
|
|
<tr>
|
|
|
<th>제휴채널<em class="required" title="필수"></em></th>
|
|
|
<td colspan="3">
|
|
|
- <label class="chkBox" th:if="${upperAfLinkCdList}" th:each="oneData, status : ${upperAfLinkCdList}">
|
|
|
- <input type="checkbox" name="upperAfLinkCdArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
|
|
|
- </label>
|
|
|
+ <!-- 수정시 프로모션명 입력 : before -->
|
|
|
+ <div class="padding10" style="display: inline-block; width: 49%;">
|
|
|
+ <!--<span>공급업체 설정</span>-->
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
+ <span class="buttonSpan">
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddAf">제휴채널 추가</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg"id="btnDeleteAf">선택삭제</button>
|
|
|
+ </span> <br />
|
|
|
+ <div id="gridAfPlanList" style="width: 100%; height: 200px;" class="ag-theme-balham"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
@@ -472,9 +480,17 @@
|
|
|
<tr>
|
|
|
<th>제휴채널<em class="required" title="필수"></em></th>
|
|
|
<td colspan="3">
|
|
|
- <label class="chkBox" th:if="${upperAfLinkCdList}" th:each="oneData, status : ${upperAfLinkCdList}">
|
|
|
- <input type="checkbox" name="upperAfLinkCdArr" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
|
|
|
- </label>
|
|
|
+ <!-- 수정시 프로모션명 입력 : before -->
|
|
|
+ <div class="padding10" style="display: inline-block; width: 49%;">
|
|
|
+ <!--<span>공급업체 설정</span>-->
|
|
|
+ <div class="padding10 inner-tb-solid">
|
|
|
+ <span class="buttonSpan">
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg" id="btnAddAf">제휴채널 추가</button>
|
|
|
+ <button type="button" class="btn btnRight btn-success btn-lg"id="btnDeleteAf">선택삭제</button>
|
|
|
+ </span> <br />
|
|
|
+ <div id="gridAfPlanList" style="width: 100%; height: 200px;" class="ag-theme-balham"></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
@@ -629,8 +645,38 @@
|
|
|
var planCateList = [[${planCateList}]];
|
|
|
var custGbList = [[${gbList}]];
|
|
|
var custGradeList = [[${gradeList}]];
|
|
|
+ var afChannelList = [[${afChannelList}]];
|
|
|
var snOptions;
|
|
|
|
|
|
+ let useYnList = { "Y":"Yes", "N":"No" };
|
|
|
+ let channelName = {"G053_01":"직접","G053_02":"네이버","G053_03":"다음","G053_04":"크리데오","G053_05":"카카오","G053_06":"인스타그램","G053_07":"페이스북","G053_08":"구글"
|
|
|
+ ,"G053_09":"바이럴","G053_10":"모비온","G053_11":"YES24","G053_12":"한세드림"}
|
|
|
+
|
|
|
+ let columnAfDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-right', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ {headerName: "제휴채널코드", field: "afLinkCd", width: 100, cellClass: 'text-center'},
|
|
|
+ {
|
|
|
+ headerName: "제휴채널명", field: "afLinkNm", width: 180,
|
|
|
+ cellRenderer: function(params) {
|
|
|
+ return '<a href="javascript:void(0);">' + params.value + '</a>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: "상위제휴채널", field: "afChannel", width: 120, cellClass: 'text-center',
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(channelName) },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(channelName, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(channelName, params.newValue); }
|
|
|
+ }
|
|
|
+
|
|
|
+ ];
|
|
|
+
|
|
|
+ // 제휴채널 그리드 설정
|
|
|
+ var gridOptionsAfList = gagaAgGrid.getGridOptions(columnAfDefs);
|
|
|
+ gridOptionsAfList.rowSelection = "multiple";
|
|
|
+ gridOptionsAfList.suppressRowClickSelection = true;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 카테고리 전시 여부
|
|
|
var fnCataCheck = function(is, formId) {
|
|
|
if (is.checked) {
|
|
|
@@ -724,7 +770,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else if($('#planUpdateForm select[name=replyYn]').val()=='N'){
|
|
|
$("#append1").css('display','none');
|
|
|
$("#append2").css('display','none');
|
|
|
$("#append3").css('display','none');
|
|
|
@@ -762,6 +808,10 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else{
|
|
|
+ $("#append1").css('display','none');
|
|
|
+ $("#append2").css('display','none');
|
|
|
+ $("#append3").css('display','none');
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -905,17 +955,13 @@
|
|
|
multiCate.push(item.cateNo);
|
|
|
});
|
|
|
|
|
|
- var usableCustGradeArr = [];
|
|
|
- var chkCustGrade = $('#planRegisterForm input:checkbox[name=usableCustGradeArr]:checked');
|
|
|
- for(let i=0; i< chkCustGrade.length; i++){
|
|
|
- usableCustGradeArr.push(chkCustGrade.eq(i).val());
|
|
|
- }
|
|
|
+ let allChannelData = gagaAgGrid.getAllRowData(gridOptionsAfList);
|
|
|
+ var multiChannel = [];
|
|
|
+ $.each(allChannelData, function(idx, item) {
|
|
|
+ multiChannel.push(item.afLinkCd);
|
|
|
+ });
|
|
|
|
|
|
- var usableCustGbArr = [];
|
|
|
- var chkCustGb = $('#planRegisterForm input:checkbox[name=usableCustGbArr]:checked');
|
|
|
- for(let i=0; i< chkCustGb.length; i++){
|
|
|
- usableCustGbArr.push(chkCustGb.eq(i).val());
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
// 기획전 등록
|
|
|
if (formId == '#planRegisterForm') {
|
|
|
@@ -923,6 +969,17 @@
|
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
+ var usableCustGradeArr = [];
|
|
|
+ var chkCustGrade = $('#planRegisterForm input:checkbox[name=usableCustGradeArr]:checked');
|
|
|
+ for(let i=0; i< chkCustGrade.length; i++){
|
|
|
+ usableCustGradeArr.push(chkCustGrade.eq(i).val());
|
|
|
+ }
|
|
|
+
|
|
|
+ var usableCustGbArr = [];
|
|
|
+ var chkCustGb = $('#planRegisterForm input:checkbox[name=usableCustGbArr]:checked');
|
|
|
+ for(let i=0; i< chkCustGb.length; i++){
|
|
|
+ usableCustGbArr.push(chkCustGb.eq(i).val());
|
|
|
+ }
|
|
|
|
|
|
let data = {
|
|
|
multiBrand : multiBrand
|
|
|
@@ -931,6 +988,7 @@
|
|
|
,CateList : allCateData
|
|
|
,usableCustGradeArr : usableCustGradeArr
|
|
|
,usableCustGbArr : usableCustGbArr
|
|
|
+ ,multiChannel : multiChannel
|
|
|
,mode : $('#planRegisterForm input[name=mode]').val()
|
|
|
,planSq : $('#planRegisterForm input[name=planSq]').val()
|
|
|
,planGb : $('#planRegisterForm select[name=planGb]').val()
|
|
|
@@ -974,12 +1032,25 @@
|
|
|
cancelBtnText: "취소",
|
|
|
sureBtnText: "확인",
|
|
|
sureBtnClick: function() {
|
|
|
+ var usableCustGradeArr = [];
|
|
|
+ var chkCustGrade = $('#planUpdateForm input:checkbox[name=usableCustGradeArr]:checked');
|
|
|
+ for(let i=0; i< chkCustGrade.length; i++){
|
|
|
+ usableCustGradeArr.push(chkCustGrade.eq(i).val());
|
|
|
+ }
|
|
|
|
|
|
+ var usableCustGbArr = [];
|
|
|
+ var chkCustGb = $('#planUpdateForm input:checkbox[name=usableCustGbArr]:checked');
|
|
|
+ for(let i=0; i< chkCustGb.length; i++){
|
|
|
+ usableCustGbArr.push(chkCustGb.eq(i).val());
|
|
|
+ }
|
|
|
let data = {
|
|
|
multiBrand : multiBrand
|
|
|
,brandList : allBrandData
|
|
|
,multiCate : multiCate
|
|
|
+ ,multiChannel : multiChannel
|
|
|
,CateList : allCateData
|
|
|
+ ,usableCustGradeArr : usableCustGradeArr
|
|
|
+ ,usableCustGbArr : usableCustGbArr
|
|
|
,mode : $('#planUpdateForm input[name=mode]').val()
|
|
|
,planSq : $('#planUpdateForm input[name=planSq]').val()
|
|
|
,planGb : $('#planUpdateForm select[name=planGb]').val()
|
|
|
@@ -1105,9 +1176,6 @@
|
|
|
{headerName: "브랜드그룹명", field: "brandGroupKnm", width: 120, cellClass: 'text-center'},
|
|
|
{headerName: "브랜드영문명", field: "brandGroupEnm", width: 150, cellClass: 'text-center'},
|
|
|
{headerName: "", field: "brandKnm", width: 150, cellClass: 'text-center'},
|
|
|
- /* {headerName: "적용대상", field: "targetGb", width: 150, cellClass: 'text-center', hide: true},
|
|
|
- {headerName: "시퀀스", field: "tmtbGoodsSq", width: 150, cellClass: 'text-center', hide: true},
|
|
|
- {headerName: "삭제여부", field: "delYn", width: 150, cellClass: 'text-center', hide: true} */
|
|
|
];
|
|
|
|
|
|
// 브랜드 그리드 설정
|
|
|
@@ -1163,7 +1231,7 @@
|
|
|
gridOptionsFGCateList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsFGCateList)});
|
|
|
});
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
// 카테고리 추가
|
|
|
$('#btnAddCate').on('click' , function () {
|
|
|
@@ -1194,7 +1262,34 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 제휴채널 추가
|
|
|
+ $('#btnAddAf').on('click' , function () {
|
|
|
+ cfnOpenAfChannelPopup("callBackAf");
|
|
|
+ });
|
|
|
|
|
|
+ // 제휴채널 콜백
|
|
|
+ var callBackAf = function(result) {
|
|
|
+ // 기존 리스트 데이터 for
|
|
|
+ for(let i = 0 ; i < result.length ; i++) {
|
|
|
+ let addChk = true, gridListValue = gagaAgGrid.getAllRowData(gridOptionsAfList); // 받아온 모든 데이터
|
|
|
+
|
|
|
+ // 받아온 data for
|
|
|
+ for(let j = 0 ; j < gridListValue.length ; j++) {
|
|
|
+ // 동일한 data는 추가하지 않음
|
|
|
+ if(gridListValue[j].afLinkCd == result[i].afLinkCd) { addChk = false; } // 중복체크
|
|
|
+ }
|
|
|
+
|
|
|
+ // 중복되지 않은 데이터 리스트에 추가
|
|
|
+ if(addChk) {
|
|
|
+ gagaAgGrid.addRowData(gridOptionsAfList, {"afLinkCd":result[i].afLinkCd , "afLinkNm":result[i].afLinkNm, "afChannel":result[i].afChannel});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 제츄채널 선택삭제 버튼 클릭시
|
|
|
+ $('#btnDeleteAf').on('click', function() {
|
|
|
+ gridOptionsAfList.api.updateRowData({remove:gagaAgGrid.selectedRowData(gridOptionsAfList)});
|
|
|
+ });
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
|
|
@@ -1207,22 +1302,12 @@
|
|
|
// 그리드 그리기
|
|
|
gagaAgGrid.createGrid("gridFGBrandList", gridOptionsFGBrandList);
|
|
|
gagaAgGrid.createGrid("gridFGCateList", gridOptionsFGCateList);
|
|
|
+ gagaAgGrid.createGrid("gridAfPlanList", gridOptionsAfList);
|
|
|
|
|
|
if (mode =='U') {
|
|
|
- /* $('#planDetailForm input[name=badgeFcolor]').spectrum({
|
|
|
- preferredFormat: "hex",
|
|
|
- showInput: true,
|
|
|
- allowEmpty: true
|
|
|
- });
|
|
|
-
|
|
|
- $('#planDetailForm input[name=badgeBcolor]').spectrum({
|
|
|
- preferredFormat: "hex",
|
|
|
- showInput: true,
|
|
|
- allowEmpty: true
|
|
|
- }); */
|
|
|
-
|
|
|
gridOptionsFGBrandList.api.setRowData(planBrandList);
|
|
|
gridOptionsFGCateList.api.setRowData(planCateList);
|
|
|
+ gridOptionsAfList.api.setRowData(afChannelList);
|
|
|
|
|
|
if (planInfo.goodsLimitYn == 'N') {
|
|
|
$('#planDetailForm input[name=goodsLimitQty]').hide();
|
|
|
@@ -1238,17 +1323,6 @@
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- /* $('#planRegisterForm input[name=badgeFcolor]').spectrum({
|
|
|
- preferredFormat: "hex",
|
|
|
- showInput: true,
|
|
|
- allowEmpty: true
|
|
|
- });
|
|
|
-
|
|
|
- $('#planRegisterForm input[name=badgeBcolor]').spectrum({
|
|
|
- preferredFormat: "hex",
|
|
|
- showInput: true,
|
|
|
- allowEmpty: true
|
|
|
- }); */
|
|
|
|
|
|
$("#viewStartDtNew").val(_today);
|
|
|
$("#viewEndDtNew").val(_today);
|