Parcourir la source

쿠폰 수정

bin2107 il y a 5 ans
Parent
commit
d93b790c00

+ 1 - 1
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -378,7 +378,7 @@ public class TsaCustomerController extends TsaBaseController {
 		mav.addObject("orderDtlStatList", rendererService.getCommonCodeList("G013"));
 
 		// 쿠폰유형
-		mav.addObject("cpnType", rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnType", rendererService.getCommonCodeList("G230", "Y"));
 
 		// 쿠폰할인방식
 		//mav.addObject("dcWayList", rendererService.getCommonCodeList("G240"));

+ 5 - 1
src/main/java/com/style24/admin/biz/web/TsaMarketingController.java

@@ -335,7 +335,7 @@ public class TsaMarketingController extends TsaBaseController {
 		ModelAndView mav = new ModelAndView();
 
 		// 쿠폰 유형 조회
-		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230"));
+		mav.addObject("cpnTypeList", rendererService.getCommonCodeList("G230", "Y"));
 		// 할인 유형 조회
 		mav.addObject("dcWayList", rendererService.getCommonCodeList("G240"));
 		// 사이트 조회
@@ -459,6 +459,8 @@ public class TsaMarketingController extends TsaBaseController {
 		mav.addObject("upperAfLinkCdList", rendererService.getCommonCodeList("G053"));
 		// 선착순쿠폰 조회
 		mav.addObject("limitedTimeCpnList", new Coupon());
+		// 제휴채널 조회
+		mav.addObject("channelList", rendererService.getCommonCodeList("G053","Y"));
 		// 이미 쿠폰 아이디가 있으면 적용대상 조회
 		if (cpnId != 0) {
 			mode = "U";
@@ -487,6 +489,8 @@ public class TsaMarketingController extends TsaBaseController {
 			mav.addObject("cpnPayTypeList", coreCouponService.getCouponPayTypeList(cpnId));
 			// 선착순쿠폰 조회
 			mav.addObject("limitedTimeCpnList", coreCouponService.getLimitedTimeCouponList(cpnId));
+			// 등록했던 제휴채널
+			mav.addObject("afChannelList", coreCouponService.getCouponAfChannelList(cpnId));
 		}
 
 		//issueCnt = 3;

+ 1 - 0
src/main/java/com/style24/persistence/domain/Coupon.java

@@ -104,6 +104,7 @@ public class Coupon extends TscBaseDomain {
     private String[] payTypeArr;
 
     List<CouponLimitedTime> limitedTimeCpnList; //선착순 쿠폰 리스트
+    List<CouponAfChannel> afChannelList; //쿠폰 제휴채널 리스트
 
     // Pagination
     private TscPageRequest pageable;

+ 21 - 0
src/main/java/com/style24/persistence/domain/CouponAfChannel.java

@@ -0,0 +1,21 @@
+package com.style24.persistence.domain;
+
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 쿠폰 제휴채널 도메인
+ * @author bin2107
+ * @since 2021-04-22
+ */
+@SuppressWarnings("serial")
+@Data
+public class CouponAfChannel extends TscBaseDomain {
+    private int  cpnId;					// 쿠폰ID
+    private String afLinkCd;
+
+    private String afLinkNm;
+    private int freeRate;
+    private int dispOrd;
+    private String afChannel;
+}

+ 20 - 20
src/main/webapp/WEB-INF/views/marketing/CouponListForm.html

@@ -20,7 +20,7 @@
 	</div>
 	<!-- //메인타이틀 영역 -->
 
-	<form id="searchForm" name="searchForm" action="#" th:action="@{'/marketing/coupon/list'}">
+	<form id="cpnSearchForm" name="cpnSearchForm" action="#" th:action="@{'/marketing/coupon/list'}">
 		<!-- 패널 영역1 -->
 		<div class="panelStyle" >
 			<!-- 검색조건 영역 -->
@@ -230,17 +230,17 @@
 
 		// 초기화 클릭시
 		$('#btnInit').on('click', function() {
-			$('#searchForm')[0].reset();
-			//$("#searchForm input[type=radio]").removeClass("checked");
-			$("#searchForm input[type=checkbox]").removeClass("checked");
-			//$("#searchForm input[type=radio]").parent("label").removeClass("checked");
-			$("#searchForm input[type=checkbox]").parent("label").removeClass("checked");
-			$("#searchForm input[type=radio][checked]").parent("label").addClass("checked");
+			$('#cpnSearchForm')[0].reset();
+			//$("#cpnSearchForm input[type=radio]").removeClass("checked");
+			$("#cpnSearchForm input[type=checkbox]").removeClass("checked");
+			//$("#cpnSearchForm input[type=radio]").parent("label").removeClass("checked");
+			$("#cpnSearchForm input[type=checkbox]").parent("label").removeClass("checked");
+			$("#cpnSearchForm input[type=radio][checked]").parent("label").addClass("checked");
 		});
 
 		// 조회클릭시
 		$('#btnSearch').on('click', function() {
-			$("#searchForm input[name=pageNo]").val('1');
+			$("#cpnSearchForm input[name=pageNo]").val('1');
 			fnCouponListSearch();
 		});
 
@@ -248,14 +248,14 @@
 		var fnCouponListSearch = function() {
 			if(!fnConditionCheck()) return;
 
-			gagaPaging.init('searchForm', fnSearchCallBack, 'couponListPagination', $('#searchForm').find('#pageSize').val());
-			gagaPaging.load($("#searchForm input[name=pageNo]").val());
+			gagaPaging.init('cpnSearchForm', fnSearchCallBack, 'couponListPagination', $('#cpnSearchForm').find('#pageSize').val());
+			gagaPaging.load($("#cpnSearchForm input[name=pageNo]").val());
 		}
 
 		//검색 조건 확인
 		var fnConditionCheck = function(){
-			var fromDate = $('#searchForm input[name=availStdt]').val();
-			var toDate = $('#searchForm input[name=availEddt]').val();
+			var fromDate = $('#cpnSearchForm input[name=availStdt]').val();
+			var toDate = $('#cpnSearchForm input[name=availEddt]').val();
 
 			if (!gagajf.isNull(fromDate) || !gagajf.isNull(toDate)) {
 
@@ -263,7 +263,7 @@
 					mcxDialog.alertC("기간 조회시 시작일자와 종료일자를 입력하세요.", {
 						sureBtnText: "확인",
 						sureBtnClick: function() {
-							$('#searchForm input[name=availStdt]').focus();
+							$('#cpnSearchForm input[name=availStdt]').focus();
 						}
 					});
 					return false;
@@ -273,7 +273,7 @@
 					mcxDialog.alertC("등록 시작일자는 종료일자 보다 클 수 없습니다.", {
 						sureBtnText: "확인",
 						sureBtnClick: function() {
-							$('#searchForm input[name=availEddt]').focus();
+							$('#cpnSearchForm input[name=availEddt]').focus();
 						}
 					});
 					return false;
@@ -285,18 +285,18 @@
 
 		var fnSearchCallBack = function(result){
 
-			$('#searchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
-			$('#searchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
-			$('#searchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
-			$('#searchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
+			$('#cpnSearchForm').find('#gridRowTotalCount').html(result.pageing.pageable.totalCount.addComma());
+			$('#cpnSearchForm').find('#pageNo').val(result.pageing.pageable.pageNo.addComma());
+			$('#cpnSearchForm').find('#pgNo').html(result.pageing.pageable.pageNo.addComma());
+			$('#cpnSearchForm').find('#endPgNo').html(result.pageing.pageable.totalPage.addComma());
 			gridOptions.api.setRowData(result.cpnList);
 			gagaPaging.createPagination(result.pageing.pageable);
 
 		}
 
 		//페이징
-		$('#searchForm select[name=pageSize]').on('change', function() {
-			$("#searchForm input[name=pageNo]").val('1');
+		$('#cpnSearchForm select[name=pageSize]').on('change', function() {
+			$("#cpnSearchForm input[name=pageNo]").val('1');
 			fnCouponListSearch();
 		});
 

+ 140 - 39
src/main/webapp/WEB-INF/views/marketing/CouponPopupForm.html

@@ -346,6 +346,22 @@
 												</label>
 											</td>
 										</tr>
+										<tr>
+											<th>제휴채널</th>
+											<td colspan="1">
+												<!-- 수정시 프로모션명 입력 : before -->
+												<div class="padding10"	style="display: inline-block; width: 100%;">
+													<!--<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="afChannelList" style="width: 100%; height: 200px;" class="ag-theme-balham"></div>
+													</div>
+												</div>
+											</td>
+										</tr>
 										<tr>
 											<th>쿠폰상태<em class="required" title="필수"></em></th>
 											<td>
@@ -354,14 +370,14 @@
 												</label>
 												<input type="hidden" id="cpnStat" name="cpnStat"/>
 											</td>
-											<th>제휴링크코드<em class="required" title="필수"></em></th>
+											<!--<th>제휴링크코드<em class="required" title="필수"></em></th>
 											<td>
 												<select name="afChannel" id="afChannel" onchange="fnChangeAfLinkCdList()" data-valid-name="제휴링크코드" required="required">
 													<option th:if="${upperAfLinkCdList}" th:each="oneData , status : ${upperAfLinkCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 												</select>
 												<select name="afLinkCd" id="afLinkCd">
 												</select>
-											</td>
+											</td>-->
 										</tr>
 									</tbody>
 								</table>
@@ -531,6 +547,7 @@
 	var cpnCustGradeList = [[${cpnCustGradeList}]];
 	var cpnPayTypeList = [[${cpnPayTypeList}]];
 	var limitedTimeCpnList = [[${limitedTimeCpnList}]];
+	var afChannelList = [[${afChannelList}]];
 
 	// 공통코드 리스트
 	var ibSupplyComList = gagajf.convertToArray([[${ibSupplyCompList}]]);
@@ -539,6 +556,7 @@
 	var delYnList = { "Y":"Yes", "N":"No" };
 	var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
 	var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
+	let channelName = gagajf.convertToArray([[${channelList}]]);
 
 	// ag-grid 입점업체분담율 컬럼
 	var columnDefs = [
@@ -650,16 +668,50 @@
 		{ headerName: "선착순쿠폰명" , field: "limitCpnNm" , width: 200, cellClass: 'text-center'
 			,cellEditorParams: { maxlength: 20}
 		} ,
-		{ headerName: "시작일시" , field: "downStdt" , width: 200, cellClass: 'text-center'
-			,cellRenderer: function (params) { return gagaAgGrid.toDateTimeFormat(params.value); }
+		{ headerName: "시작일" , field: "downStDate" , width: 200, cellClass: 'text-center'
+			,cellEditor: 'datePicker'
+			,cellEditorParams: { maxlength: 10, required: true }
 		},
-		{ headerName: "종료일시"  , field: "downEddt" , width: 200 , cellClass: 'text-center'
-			,cellRenderer: function (params) { return gagaAgGrid.toDateTimeFormat(params.value); }
+		{ headerName: "시작시간" , field: "downStTime" , width: 200, cellClass: 'text-center'
+			,cellEditor: 'dateTimer'
+			,cellEditorParams: { maxlength: 8, required: true }
+		},
+		{ headerName: "종료일"  , field: "downEdDate" , width: 200 , cellClass: 'text-center'
+			,cellEditor: 'datePicker'
+			,cellEditorParams: { maxlength: 10, required: true }
+		} ,
+		{ headerName: "종료시간"  , field: "downEdTime" , width: 200 , cellClass: 'text-center'
+			,cellEditor: 'dateTimer'
+			,cellEditorParams: { maxlength: 8, required: true }
+			,valueFormatter: function (params) {
+				params.value = params.value.replace(/[^0-9]/g, '');
+				params.value = params.value.substr(0,2)+':'+params.value.substr(2,2)+':59';
+				return params.value;
+			}
 		} ,
 		{ headerName: "다운로드가능수량"  , field: "downLimitQty" , width: 150 , cellClass: 'text-center'
 			,cellEditorParams: { maxlength: 4, validType: 'numeric'}
 		},
 		{ headerName: "선착순시퀀스", field: "limitCpnId", width: 150, cellClass: 'text-center'} 	//, hide: true
+		,{headerName: "시작일시", field: "downStDt", width: 150, cellClass: 'text-center',hide: true}
+		,{headerName: "종료일시", field: "downEdDt", width: 150, cellClass: 'text-center',hide: true}
+	];
+
+	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 inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
@@ -670,6 +722,10 @@
 	var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
 	var randomCouponGridOptions = gagaAgGrid.getGridOptions(randomCouponDefs);
 	var limitedTimeCpnGridOptions = gagaAgGrid.getGridOptions(limitedTimeCpnDefs);
+	// 제휴채널 그리드 설정
+	var afLinkOptions = gagaAgGrid.getGridOptions(columnAfDefs);
+	afLinkOptions.rowSelection = "multiple";
+	afLinkOptions.suppressRowClickSelection = true;
 
 	inComGridOptions.defaultColDef.editable = true;
 	inComGridOptions.rowSelection = "multiple";
@@ -712,9 +768,14 @@
 		limitedTimeCpnGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(limitedTimeCpnGridOptions)});
 	});
 
+	// 제휴채널 선택삭제 버튼 클릭시
+	$('#btnDeleteAf').on('click', function() {
+		afLinkOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(afLinkOptions)});
+	});
+
 	// 선착순 쿠폰 행추가
 	$('#btnAddLimitedTimeCpnRow').on('click', function() {
-		var data = { cpnId: 1 ,limitCpnNm: null, downStdt: null, downEddt: null, downLimitQty: null, limitCpnId: null  };
+		var data = { cpnId: 1 ,limitCpnNm: null, downStDate: _today, downStTime: '00:00:00', downEdDate: _today, downEdTime: '23:59:59', downLimitQty: null, limitCpnId: null  };
 		gagaAgGrid.addRowData(limitedTimeCpnGridOptions, data, "limitCpnNm");
 	});
 
@@ -754,16 +815,6 @@
 		var chkBox= document.getElementById('limitedTimeCpnYn').checked;
 
 		if(chkBox){	//true 체크가 되어있었는데 해제됐어 -> 탭을 숨겨
-			$("#CouponForm .limitedTimeCpnTab").hide();
-			$("#limitedTimeCpnYn").val("N");
-			$("#CouponForm #totPubLimitQty").val(0);
-			$("#CouponForm input[id=chkBoxTotPubQty]").prop("disabled", false);
-			$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
-			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").removeClass("checked");
-			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', false);
-			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', false);
-			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', false);
-		}else{	//false 체크가 안되어있었는데 체크됐어 -> 탭을 보여줘
 			$("#CouponForm .limitedTimeCpnTab").show();
 			$("#limitedTimeCpnYn").val("Y");
 			$("#CouponForm #totPubLimitQty").val(0);
@@ -773,6 +824,16 @@
 			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', true);
 			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', true);
 			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', true);
+		}else{	//false 체크가 안되어있었는데 체크됐어 -> 탭을 보여줘
+			$("#CouponForm .limitedTimeCpnTab").hide();
+			$("#limitedTimeCpnYn").val("N");
+			$("#CouponForm #totPubLimitQty").val(0);
+			$("#CouponForm input[id=chkBoxTotPubQty]").prop("disabled", false);
+			$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
+			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").removeClass("checked");
+			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', false);
+			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', false);
+			$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', false);
 		}
 	});
 
@@ -885,7 +946,7 @@
 						,cpnNm : $('#CouponForm input[name=cpnNm]').val()
 						,cpnDesc : $('#CouponForm input[name=cpnDesc]').val()
 						,siteCd : $('#CouponForm select[name=siteCd]').val()
-						,afLinkCd : $('#CouponForm select[name=afLinkCd]').val()
+						// ,afLinkCd : $('#CouponForm select[name=afLinkCd]').val()
 						,cpnType : $('input:radio[name="rdoCpnType"]:checked').val()
 						,applyScope : $('input:radio[name="rdoApplyScope"]:checked').val()
 						,dcWay : $('input:radio[name="rdoDcWay"]:checked').val()
@@ -912,7 +973,7 @@
 						,buyStdt : $('#CouponForm input[name=buyStdt]').val()
 						,buyEddt : $('#CouponForm input[name=buyEddt]').val()
 						,newCustYn : $('#CouponForm select[name=newCustYn]').val()
-						,afChannel : $('#CouponForm select[name=afChannel]').val()
+						// ,afChannel : $('#CouponForm select[name=afChannel]').val()
 						,dcCdGb : $('input:radio[name="dcCdGb"]:checked').val()
 						,rdCpnNm : $('input[name="serialCpnNm"]').val()
 						,supplyCompList : gagaAgGrid.getAllRowData(supplyGridOptions)
@@ -925,10 +986,11 @@
 						,usableCustGradeArr : usableCustGradeArr
 						,payTypeArr : payTypeArr
 						,limitedTimeCpnList : gagaAgGrid.getAllRowData(limitedTimeCpnGridOptions)
+						,afChannelList : gagaAgGrid.getAllRowData(afLinkOptions)
 				};
 
 				var jsonData = JSON.stringify(data);
-
+console.log('jsonData::'+jsonData);
 				gagajf.ajaxJsonSubmit($('#CouponForm').prop('action'), jsonData, fnCouponSaveCollback);
 
 			}
@@ -1215,6 +1277,18 @@
 			$("#CouponForm input:radio[name='dcCdGb']:radio[value='G233_00']").prop('checked', true);		// 주문서 쿠폰이 아닐 경우 일반 쿠폰으로 설정
 		}
 
+		// 선착순 쿠폰 비노출
+		$("#CouponForm .limitedTimeCpnTab").hide();
+		$('#CouponForm input:checkbox[name=limitedTimeCpnYn]').prop('checked', false);
+		$("#limitedTimeCpnYn").val("N");
+		$("#CouponForm #totPubLimitQty").val(0);
+		$("#CouponForm input[id=chkBoxTotPubQty]").prop("disabled", false);
+		$("#CouponForm input[id=totPubLimitQty]").prop("disabled", false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent("label").removeClass("checked");
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").attr('readonly', false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").prop('disabled', false);
+		$("#CouponForm input[id=chkNoLimitTotPubLimitQty]").parent().prop('disabled', false);
+
 		$('#CouponForm #cpnType').val(radioValue);
 	});
 
@@ -1625,24 +1699,24 @@
 	});*/
 
 	// 제휴링크채널 수정 (제휴링크가 꼭필요한지 확인필요)
-	function fnChangeAfLinkCdList(){
-		var actionUrl = "/business/aflink/list" + '?' + $('#afChannel').serialize();
-		var tag = "";
-
-		$("#CouponForm #afLinkCd").children('option').remove();
-
-		gagajf.ajaxJsonSubmit(actionUrl, '', function(data) {
-			for (let i = 0; i < data.length; i++) {
-				if (data[i].useYn == 'Y') {
-					tag += '<option value="' + data[i].afLinkCd + '">[' + data[i].afLinkCd + '] ' + data[i].afLinkNm + '</option>';
-				}
-			}
-
-			$("#CouponForm #afLinkCd").append(tag);
-			$("#CouponForm #afLinkCd option:first").attr("selected" , "selected");
-
-		});
-	}
+	// function fnChangeAfLinkCdList(){
+	// 	var actionUrl = "/business/aflink/list" + '?' + $('#afChannel').serialize();
+	// 	var tag = "";
+	//
+	// 	$("#CouponForm #afLinkCd").children('option').remove();
+	//
+	// 	gagajf.ajaxJsonSubmit(actionUrl, '', function(data) {
+	// 		for (let i = 0; i < data.length; i++) {
+	// 			if (data[i].useYn == 'Y') {
+	// 				tag += '<option value="' + data[i].afLinkCd + '">[' + data[i].afLinkCd + '] ' + data[i].afLinkNm + '</option>';
+	// 			}
+	// 		}
+	//
+	// 		$("#CouponForm #afLinkCd").append(tag);
+	// 		$("#CouponForm #afLinkCd option:first").attr("selected" , "selected");
+	//
+	// 	});
+	// }
 
 	// 발급받은회원 팝업
 	var fnPubCustListPopUp = function (){
@@ -1782,6 +1856,7 @@
 		gagaAgGrid.createGrid('excepGoodsGridList', excepGoodsGridOptions);
 		gagaAgGrid.createGrid('randomCpnList', randomCouponGridOptions);
 		gagaAgGrid.createGrid('limitedTimeCpnList', limitedTimeCpnGridOptions);
+		gagaAgGrid.createGrid('afChannelList', afLinkOptions );
 
 		// 일단 버튼 숨김
 		$(".couponButton").hide();
@@ -1818,6 +1893,7 @@
 			}
 			$("#btnCouponSave").show();	// 저장버튼
 			$("#CouponForm .buttonSpan").show();
+
 		} else {
 			if(cpnDetail.cpnStat == "G232_10"){
 				$("#btnCouponSave").show();		// 저장버튼
@@ -1884,6 +1960,7 @@
 			cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
 			randomCouponGridOptions.api.setRowData(randomCpnList);
 			limitedTimeCpnGridOptions.api.setRowData(limitedTimeCpnList);
+			afLinkOptions.api.setRowData(afChannelList);
 			// 기본정보 세팅
 			$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
 			$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
@@ -2149,7 +2226,7 @@
 		pdGbChange();
 		firstOrdYnChange();
 		newCustYnChange();
-		fnChangeAfLinkCdList();
+		// fnChangeAfLinkCdList();
 
 		// 제휴채널2뎁스 기본세팅
 		if(cpnDetail != null ) {
@@ -2263,6 +2340,30 @@
 		});
 	});
 
+	// 제휴채널 추가
+	$('#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(afLinkOptions);		// 받아온 모든 데이터
+
+			// 받아온 data for
+			for(let j = 0 ; j < gridListValue.length ; j++) {
+				// 동일한 data는 추가하지 않음
+				if(gridListValue[j].afLinkCd == result[i].afLinkCd) {	addChk = false;	}		// 중복체크
+			}
+
+			// 중복되지 않은 데이터 리스트에 추가
+			if(addChk) {
+				gagaAgGrid.addRowData(afLinkOptions, {"afLinkCd":result[i].afLinkCd , "afLinkNm":result[i].afLinkNm, "afChannel":result[i].afChannel});
+			}
+		}
+	}
+
 	/*]]>*/
 </script>
 </html>