|
|
@@ -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>
|