|
|
@@ -183,8 +183,8 @@
|
|
|
<th class="downAblArea">다운로드가능여부<em class="required" title="필수"></em></th>
|
|
|
<td class="downAblArea">
|
|
|
<select name="downAblYn" id="downAblYn" required="required" data-valid-name="다운로드가능여부">
|
|
|
- <option value="Y">Y</option>
|
|
|
- <option value="N" selected="selected">N</option>
|
|
|
+ <option value="Y" selected="selected">Y</option>
|
|
|
+<!-- <option value="N" >N</option>-->
|
|
|
</select>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -324,9 +324,117 @@
|
|
|
var issueCnt = [[${issueCnt}]];
|
|
|
|
|
|
// 공통코드 리스트
|
|
|
- //var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
|
|
|
+ var formalGbList = gagajf.convertToArray([[${formalGbList}]]);
|
|
|
+ var cateGbList = gagajf.convertToArray([[${cateGbList}]]);
|
|
|
var delYnList = { "Y":"Yes", "N":"No" };
|
|
|
- //var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
|
|
|
+ var selfBrandList = gagajf.convertToArray([[${selfBrandList}]]);
|
|
|
+ var siteCdList = gagajf.convertToArray([[${siteCdList}]]);
|
|
|
+
|
|
|
+ // ag-grid 공급처 컬럼
|
|
|
+ var supplyColumnDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ { headerName : "공급업체코드" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
|
|
|
+ { headerName: "공급업체명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'},
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true},
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
+ ];
|
|
|
+
|
|
|
+ // ag-grid 브랜드 컬럼
|
|
|
+ var brandSelColumnDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ { headerName : "브랜드ID" , field: "brandCd" , width: 120, cellClass : 'text-center'} ,
|
|
|
+ { headerName : "브랜드명" , field: "brandEnm" , width: 120, cellClass: 'text-center'} ,
|
|
|
+ //{ headerName : "공급업체명", field: "supplyCompNm" , width: 150, cellClass: 'text-center' } ,
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true},
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
+ ];
|
|
|
+
|
|
|
+ // ag-grid 적용상품 컬럼
|
|
|
+ var goodsSelColumnDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ { headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
|
|
|
+ { headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
|
|
|
+ { headerName: "상품명" , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true},
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
+ ];
|
|
|
+
|
|
|
+ // ag-grid 카테고리 컬럼
|
|
|
+ var cateSelColumnDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ { headerName: "사이트" , field: "siteCd" , width: 100 , cellClass: 'text-center' ,
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(siteCdList) },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(siteCdList, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(siteCdList, params.newValue); }
|
|
|
+ },
|
|
|
+ { headerName: "카테고리구분" , field: "cateGb" , width: 100 , cellClass: 'text-center' ,
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(cateGbList) },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(cateGbList, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(cateGbList, params.newValue); }
|
|
|
+ },
|
|
|
+ { headerName: "카테고리코드" , field: "cateNo" , width: 100 , cellClass: 'text-center'} ,
|
|
|
+ { headerName: "카테고리명" , field: "cateNm" , width: 120 , cellClass: 'text-center'},
|
|
|
+ { headerName: "이월/정상구분" , field: "formalGb" , width: 120 , cellClass: 'text-center',
|
|
|
+ cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(formalGbList) },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(formalGbList, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(formalGbList, params.newValue); }
|
|
|
+ },
|
|
|
+ { headerName: "브랜드명" , field:"brandCd" , width:150, cellClass: "text-center", required: true ,
|
|
|
+ editable: true, cellEditor: 'agRichSelectCellEditor',
|
|
|
+ cellEditorParams: { values: gagaAgGrid.extractValues(selfBrandList) },
|
|
|
+ valueFormatter: function (params) { return gagaAgGrid.lookupValue(selfBrandList, params.value); },
|
|
|
+ valueParser: function (params) { return gagaAgGrid.lookupKey(selfBrandList, params.newValue); }
|
|
|
+ },
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true},
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
+ ];
|
|
|
+
|
|
|
+ // ag-grid 제외상품 컬럼
|
|
|
+ var excepGoodsColumnDefs = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
|
|
|
+ { headerName: "상품구분" , field: "goodsGb" , width: 100, cellClass: 'text-center'} ,
|
|
|
+ { headerName: "Product ID" , field: "goodsCd" , width: 120, cellClass: 'text-center'},
|
|
|
+ { headerName: "상품명" , field: "goodsNm" , width: 250 , cellClass: 'text-center'} ,
|
|
|
+ { headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true},
|
|
|
+ { headerName: "삭제여부" , field: "delYn" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
+ ];
|
|
|
+
|
|
|
+ var cateGridOptions = gagaAgGrid.getGridOptions(cateSelColumnDefs);
|
|
|
+ var goodsGridOptions = gagaAgGrid.getGridOptions(goodsSelColumnDefs);
|
|
|
+ var brandGridOptions = gagaAgGrid.getGridOptions(brandSelColumnDefs);
|
|
|
+ var supplyGridOptions = gagaAgGrid.getGridOptions(supplyColumnDefs);
|
|
|
+ var excepGoodsGridOptions = gagaAgGrid.getGridOptions(excepGoodsColumnDefs);
|
|
|
+
|
|
|
+ goodsGridOptions.rowSelection = "multiple";
|
|
|
+ supplyGridOptions.rowSelection = "multiple";
|
|
|
+ excepGoodsGridOptions.rowSelection = "multiple";
|
|
|
+ cateGridOptions.rowSelection = "multiple";
|
|
|
+ brandGridOptions.rowSelection = "multiple";
|
|
|
+
|
|
|
+ // 삭제버튼 클릭시
|
|
|
+ // 1.공급업체
|
|
|
+ $('#btnSupplyDel').on('click', function() {
|
|
|
+ supplyGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(supplyGridOptions)});
|
|
|
+ });
|
|
|
+ // 2.브랜드
|
|
|
+ $('#btnBrandDel').on('click', function() {
|
|
|
+ brandGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(brandGridOptions)});
|
|
|
+ });
|
|
|
+ // 3.카테고리
|
|
|
+ $('#btnCateDel').on('click', function() {
|
|
|
+ cateGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(cateGridOptions)});
|
|
|
+ });
|
|
|
+ // 4.적용상품
|
|
|
+ $('#btnGoodsDel').on('click', function() {
|
|
|
+ goodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(goodsGridOptions)});
|
|
|
+ });
|
|
|
+ // 5.제외상품
|
|
|
+ $('#btnExcepGoodsDel').on('click', function() {
|
|
|
+ excepGoodsGridOptions.api.updateRowData({remove:gagaAgGrid.selectedRowData(excepGoodsGridOptions)});
|
|
|
+ });
|
|
|
|
|
|
// 종료시간 클릭시
|
|
|
var fnChangeEdHH = function (obj){
|
|
|
@@ -716,23 +824,14 @@
|
|
|
|
|
|
// 즉시할인 쿠폰일때
|
|
|
if(radioValue == 'G230_10'){
|
|
|
- $('#CouponForm .custJoinTr').hide();
|
|
|
- $('#CouponForm .custJoinDateTr').hide();
|
|
|
- $('#CouponForm .firstBuyTr').hide();
|
|
|
- $('#CouponForm .buyDateTr').hide();
|
|
|
$('#CouponForm .dcCdCheck1').hide();
|
|
|
- $('#CouponForm .limitedTimeCpnArea').hide();
|
|
|
- $('#CouponForm .pdGbArea').hide();
|
|
|
$('#CouponForm .availDaysArea').hide();
|
|
|
// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
|
|
|
$('#CouponForm .downStdtArea').hide();
|
|
|
$('#CouponForm .downEddtArea').hide();
|
|
|
$('#CouponForm .pdGbArea').hide();
|
|
|
$('#CouponForm .buyLimitAmtArea').hide();
|
|
|
- $('#CouponForm .usableCustGbArea').hide();
|
|
|
- $('#CouponForm .usableCustGradeArea').hide();
|
|
|
$('#CouponForm .downAblArea').hide();
|
|
|
- $('#CouponForm .linkAfArea').hide();
|
|
|
$('#CouponForm .dcCdCheck2').hide();
|
|
|
$('#CouponForm .maxDcAmtArea').hide();
|
|
|
$('#CouponForm .availDateTr').show();
|
|
|
@@ -744,47 +843,24 @@
|
|
|
$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('disabled', false);
|
|
|
$("#CouponForm").find("input:radio[name='rdoApplyScope']").attr('readonly', false);
|
|
|
|
|
|
- if(radioValue == 'G230_11'){ // 상품쿠폰일때 선착순쿠폰 등록 가능
|
|
|
- $('#CouponForm .limitedTimeCpnArea').show();
|
|
|
- }else{
|
|
|
- $('#CouponForm .limitedTimeCpnArea').hide();
|
|
|
- }
|
|
|
|
|
|
- if(radioValue == 'G230_30'){ // 배송비쿠폰일때 할인금액만 적용
|
|
|
- $("#CouponForm input:radio[name='rdoDcWay']:radio[value=G240_10]").prop('checked', true);
|
|
|
- $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', true);
|
|
|
- $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', true);
|
|
|
- $('#CouponForm .maxDcAmtArea').hide();
|
|
|
- // 적용대상 탭
|
|
|
- $("#CouponForm .supplyTrArea").show();
|
|
|
- $("#CouponForm .brandTrArea").hide();
|
|
|
- $("#CouponForm .categoryTrArea").hide();
|
|
|
- $("#CouponForm .goodsTrArea").hide();
|
|
|
- $("#CouponForm .exceptArea").hide();
|
|
|
- }else{
|
|
|
- $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', false);
|
|
|
- $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', false);
|
|
|
- $('#CouponForm .maxDcAmtArea').show();
|
|
|
- // 적용대상 탭
|
|
|
- $("#CouponForm .supplyTrArea").show();
|
|
|
- $("#CouponForm .brandTrArea").show();
|
|
|
- $("#CouponForm .categoryTrArea").show();
|
|
|
- $("#CouponForm .goodsTrArea").show();
|
|
|
- $("#CouponForm .exceptArea").show();
|
|
|
- }
|
|
|
+ $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('disabled', false);
|
|
|
+ $("#CouponForm").find("input:radio[name='rdoDcWay']").attr('readonly', false);
|
|
|
+ $('#CouponForm .maxDcAmtArea').show();
|
|
|
+ // 적용대상 탭
|
|
|
+ $("#CouponForm .supplyTrArea").show();
|
|
|
+ $("#CouponForm .brandTrArea").show();
|
|
|
+ $("#CouponForm .categoryTrArea").show();
|
|
|
+ $("#CouponForm .goodsTrArea").show();
|
|
|
+ $("#CouponForm .exceptArea").show();
|
|
|
|
|
|
- $('#CouponForm .custJoinTr').show();
|
|
|
- $('#CouponForm .firstBuyTr').show();
|
|
|
$('#CouponForm .dcCdCheck1').show();
|
|
|
$('#CouponForm .pdGbArea').show();
|
|
|
// 다운로드 시작,종료 , 기간/일수 , 제휴채널, 고객 등급, 구매제한 , 할인율일때 구매제한한도, 1회발행수량, 다운로드 가능여부 숨기기
|
|
|
$('#CouponForm .downStdtArea').show();
|
|
|
$('#CouponForm .downEddtArea').show();
|
|
|
$('#CouponForm .buyLimitAmtArea').show();
|
|
|
- $('#CouponForm .usableCustGbArea').show();
|
|
|
- $('#CouponForm .usableCustGradeArea').show();
|
|
|
$('#CouponForm .downAblArea').show();
|
|
|
- $('#CouponForm .linkAfArea').show();
|
|
|
$('#CouponForm .dcCdCheck2').show();
|
|
|
|
|
|
// 즉시할인아닌 쿠폰들 할인금액체크시 최대할인금액 숨김
|
|
|
@@ -802,67 +878,9 @@
|
|
|
$("input:radio[name='rdoApplyScope']:radio[value='A']").prop('checked', true);
|
|
|
}
|
|
|
|
|
|
- // 주문서 쿠폰 선택시 결제수단 노출
|
|
|
- if(radioValue == 'G230_20') {
|
|
|
- $('#CouponForm .payTypeTr').show();
|
|
|
- $('#CouponForm #payType').attr('required' , true);
|
|
|
- $("#CouponForm .dcCdGb").show(); // 할인쿠폰유형 노출
|
|
|
- } else {
|
|
|
- $('#CouponForm .payTypeTr').hide();
|
|
|
- $('#CouponForm #payType').attr('required' , false );
|
|
|
- $("#CouponForm .dcCdGb").hide(); // 할인쿠폰유형 숨김
|
|
|
- $("#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);
|
|
|
});
|
|
|
|
|
|
- // 할인 쿠폰 유형 변경
|
|
|
- $("#CouponForm input[name=dcCdGb]").bind('click change', function () {
|
|
|
- if(this.value == "G233_00") { // 일반 유형
|
|
|
- $("#CouponForm .dcCdCheck1").show();
|
|
|
- $("#CouponForm .dcCdCheck2").show();
|
|
|
- $("#CouponForm .serialCpnArea").hide();
|
|
|
- $("#CouponForm .randomCpnArea").hide();
|
|
|
- $("#CouponForm #newCustYn").parent().attr("colspan", "");
|
|
|
- $("#CouponForm .normalCol").attr("colspan", "5");
|
|
|
- $('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
|
|
|
- $('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
|
|
|
- $('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
|
|
|
- } else {
|
|
|
- if(this.value == "G233_10") { // 시리얼 유형
|
|
|
- $("#CouponForm .serialCpnArea").show();
|
|
|
- $("#CouponForm .randomCpnArea").hide();
|
|
|
- $("#CouponForm .normalCol").attr("colspan", "5");
|
|
|
- $('#CouponForm input[name="serialCpnNm"]').attr('required' , true);
|
|
|
- $('#CouponForm input[name="serialCpnQty"]').attr('required' , true);
|
|
|
- $('#CouponForm input[name="randomCpnQty"]').attr('required' , false);
|
|
|
- } else { // 난수 유형
|
|
|
- $("#CouponForm .serialCpnArea").hide();
|
|
|
- $("#CouponForm .randomCpnArea").show();
|
|
|
- $("#CouponForm .normalCol").attr("colspan", "");
|
|
|
- $('#CouponForm input[name="serialCpnNm"]').attr('required' , false);
|
|
|
- $('#CouponForm input[name="serialCpnQty"]').attr('required' , false);
|
|
|
- $('#CouponForm input[name="randomCpnQty"]').attr('required' , true);
|
|
|
- }
|
|
|
- $("#CouponForm .dcCdCheck1").hide(); // 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
|
|
|
- $("#CouponForm .dcCdCheck2").hide(); // 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
|
|
|
- $("#CouponForm #newCustYn").parent().attr("colspan", "5"); // 총발행제한 수량을 없애면서 신규회원여부 colspan 수정
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
// 적용대상 - 브랜드 추가 버튼시
|
|
|
$('#btnBrandAdd').on('click' , function(){
|
|
|
cfnOpenBrandListPopup("fnSetPopupBrandInfo", "M");
|
|
|
@@ -888,7 +906,7 @@
|
|
|
|
|
|
// 적용대상 - 공급처 추가 버튼시
|
|
|
$('#btnSupplyAdd').on('click' , function (){
|
|
|
- cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M");
|
|
|
+ cfnOpenCompanyListPopup("fnSetPopupComapnyInfo" , "M" ,"","","N");
|
|
|
});
|
|
|
|
|
|
// 공급업체 설정 / 업체 추가 콜백함수
|
|
|
@@ -1022,11 +1040,6 @@
|
|
|
cfnOpenModalPopup(actionUrl, 'CpnPubCustListPopup');
|
|
|
};
|
|
|
|
|
|
- // 쿠폰발행팝업
|
|
|
- function fnCustomerIssuePopUp(){
|
|
|
- cfnCpnPubForCustPopup();
|
|
|
- };
|
|
|
-
|
|
|
// 전송시 값 세팅
|
|
|
function setReqValue(){
|
|
|
// 쿠폰유형값 세팅
|
|
|
@@ -1073,6 +1086,12 @@
|
|
|
}
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
+ gagaAgGrid.createGrid('brandGridList', brandGridOptions);
|
|
|
+ gagaAgGrid.createGrid('cateGridList', cateGridOptions);
|
|
|
+ gagaAgGrid.createGrid('supplyGridList', supplyGridOptions);
|
|
|
+ gagaAgGrid.createGrid('goodsGridList', goodsGridOptions);
|
|
|
+ gagaAgGrid.createGrid('excepGoodsGridList', excepGoodsGridOptions);
|
|
|
+
|
|
|
// 일단 버튼 숨김
|
|
|
$(".couponButton").hide();
|
|
|
|
|
|
@@ -1107,6 +1126,13 @@
|
|
|
$("#CouponForm .buttonSpan").show();
|
|
|
|
|
|
} else {
|
|
|
+ // 수정모드시 그리드 세팅
|
|
|
+ supplyGridOptions.api.setRowData(cpnDtlRefvalSupplyCompList);
|
|
|
+ goodsGridOptions.api.setRowData(cpnDtlRefvalApplyGoodsList);
|
|
|
+ excepGoodsGridOptions.api.setRowData(cpnDtlRefvalExceptGoodsList);
|
|
|
+ brandGridOptions.api.setRowData(cpnDtlRefvalBrandList);
|
|
|
+ cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
|
|
|
+
|
|
|
if(cpnDetail.cpnStat == "G232_10"){
|
|
|
$("#btnCouponSave").show(); // 저장버튼
|
|
|
$("#btnChangeStatIng").show(); // 진행버튼
|