|
@@ -344,7 +344,7 @@
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
<div class="mdPopBtnB aR">
|
|
<div class="mdPopBtnB aR">
|
|
|
- <button type="button" class="btn btn-info btn-lg" onclick="fnCustomerIssuePopUp();" th:if="${mode == 'U'}">쿠폰발행</button>
|
|
|
|
|
|
|
+ <button type="button" class="btn btn-info btn-lg" onclick="fnCustomerIssuePopUp();" th:if="${mode == 'U' && cpnDetail.dcCdGb == 'G233_00'}">쿠폰발행</button> <!-- 난수유형과 시리얼 유형에서는 쿠폰발행기능 X -->
|
|
|
<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();" th:if="${mode == 'N'}">등록</button>
|
|
<button type="button" class="btn btn-info btn-lg" onclick="fnCouponCreate();" th:if="${mode == 'N'}">등록</button>
|
|
|
<button type="button" class="btn btn-info btn-lg" onclick="fnCouponUpdate();" th:if="${mode == 'U'}">수정</button>
|
|
<button type="button" class="btn btn-info btn-lg" onclick="fnCouponUpdate();" th:if="${mode == 'U'}">수정</button>
|
|
|
</div>
|
|
</div>
|
|
@@ -480,6 +480,7 @@
|
|
|
var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
|
|
var cpnDtlRefvalBrandList = [[${cpnDtlRefvalBrandList}]];
|
|
|
var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
|
|
var cpnDtlRefvalExceptGoodsList = [[${cpnDtlRefvalExceptGoodsList}]];
|
|
|
var cpnDtlBurdenList = [[${cpnDtlBurdenList}]];
|
|
var cpnDtlBurdenList = [[${cpnDtlBurdenList}]];
|
|
|
|
|
+ var randomCpnList = [[${randomCpnList}]];
|
|
|
var issueCnt = [[${issueCnt}]];
|
|
var issueCnt = [[${issueCnt}]];
|
|
|
|
|
|
|
|
// 공통코드 리스트
|
|
// 공통코드 리스트
|
|
@@ -577,11 +578,14 @@
|
|
|
{ headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
{ headerName: "쿠폰대상일련번호" , field: "cpnRefvalSq" , width: 120 , cellClass: 'text-center' , hide:true}
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
- // ag-grid 공급처 컬럼
|
|
|
|
|
|
|
+ // ag-grid 시리얼 및 난수 리스트
|
|
|
var randomCouponDefs = [
|
|
var randomCouponDefs = [
|
|
|
- { headerName : "생성쿠폰명" , field: "supplyCompCd" , width:150, cellClass: 'text-center'} ,
|
|
|
|
|
- { headerName: "고객아이디" , field: "supplyCompNm" , width:150, cellClass: 'text-center'},
|
|
|
|
|
- { headerName: "고객명" , field: "supplyCompNm" , width:150, cellClass: 'text-center'}
|
|
|
|
|
|
|
+ { headerName : "생성쿠폰키워드" , field: "rdCpnNm" , width:150, cellClass: 'text-center'} ,
|
|
|
|
|
+ { headerName: "지급고객번호" , field: "custNm" , width:150, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "고객아이디" , field: "custId" , width:150, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "고객명" , field: "custNm" , width:150, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "지급일" , field: "regDt" , width:150, cellClass: 'text-center'},
|
|
|
|
|
+ { headerName: "쿠폰사용일" , field: "usedDt" , width:150, cellClass: 'text-center'}
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
var inComGridOptions = gagaAgGrid.getGridOptions(columnDefs);
|
|
@@ -1219,9 +1223,13 @@
|
|
|
// 할인쿠폰 유형에 따른 총 발행수량 수정 (주문서 쿠폰이고 난수쿠폰일 경우)
|
|
// 할인쿠폰 유형에 따른 총 발행수량 수정 (주문서 쿠폰이고 난수쿠폰일 경우)
|
|
|
if($('#CouponForm #cpnType').val() == "G230_20" && $('#CouponForm input:radio[name="dcCdGb"]:checked').val() == "G233_20") {
|
|
if($('#CouponForm #cpnType').val() == "G230_20" && $('#CouponForm input:radio[name="dcCdGb"]:checked').val() == "G233_20") {
|
|
|
$('#CouponForm input[name="totPubLimitQty"]').val($('#CouponForm input[name="randomCpnQty"]').val()); // 총 발행수량 난수 생성수량으로 변경
|
|
$('#CouponForm input[name="totPubLimitQty"]').val($('#CouponForm input[name="randomCpnQty"]').val()); // 총 발행수량 난수 생성수량으로 변경
|
|
|
|
|
+ $('#CouponForm input[name="custPubLimitQty"]').val(1); // 1인당 발행제한수량 1개 고정
|
|
|
|
|
+ $('#CouponForm input[name="onePubQty"]').val(1); // 1회발행수량 1개 고정
|
|
|
} else if ($('#CouponForm #cpnType').val() == "G230_20" && $('#CouponForm input:radio[name="dcCdGb"]:checked').val() == "G233_10") { // 주문서 쿠폰이고 시리얼 유형일 경우
|
|
} else if ($('#CouponForm #cpnType').val() == "G230_20" && $('#CouponForm input:radio[name="dcCdGb"]:checked').val() == "G233_10") { // 주문서 쿠폰이고 시리얼 유형일 경우
|
|
|
$('#CouponForm input[name="rdCpnNm"]').val($('#CouponForm input[name="serialCpnNm"]').val()); // 시리얼유형쿠폰명 저장
|
|
$('#CouponForm input[name="rdCpnNm"]').val($('#CouponForm input[name="serialCpnNm"]').val()); // 시리얼유형쿠폰명 저장
|
|
|
$('#CouponForm input[name="totPubLimitQty"]').val($('#CouponForm input[name="serialCpnQty"]').val()); // 총 발행수량 랜덤쿠폰발급수량으로 변경
|
|
$('#CouponForm input[name="totPubLimitQty"]').val($('#CouponForm input[name="serialCpnQty"]').val()); // 총 발행수량 랜덤쿠폰발급수량으로 변경
|
|
|
|
|
+ $('#CouponForm input[name="custPubLimitQty"]').val(1); // 1인당 발행제한수량 1개 고정
|
|
|
|
|
+ $('#CouponForm input[name="onePubQty"]').val(1); // 1회발행수량 1개 고정
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 적용대상 - 공급처 그리드 전체값 세팅
|
|
// 적용대상 - 공급처 그리드 전체값 세팅
|
|
@@ -1285,6 +1293,7 @@
|
|
|
excepGoodsGridOptions.api.setRowData(cpnDtlRefvalExceptGoodsList);
|
|
excepGoodsGridOptions.api.setRowData(cpnDtlRefvalExceptGoodsList);
|
|
|
brandGridOptions.api.setRowData(cpnDtlRefvalBrandList);
|
|
brandGridOptions.api.setRowData(cpnDtlRefvalBrandList);
|
|
|
cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
|
|
cateGridOptions.api.setRowData(cpnDtlRefvalCateList);
|
|
|
|
|
+ randomCouponGridOptions.api.setRowData(randomCpnList);
|
|
|
// 기본정보 세팅
|
|
// 기본정보 세팅
|
|
|
$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
|
|
$("#CouponForm input:radio[name='rdoDcWay']:radio[value=" + cpnDetail.dcWay + "]").prop('checked', true);
|
|
|
$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
|
|
$("#CouponForm input:radio[name='rdoCpnType']:radio[value=" + cpnDetail.cpnType + "]").prop('checked', true);
|
|
@@ -1314,24 +1323,35 @@
|
|
|
|
|
|
|
|
// 한번 저장되면 쿠폰유형, 할인쿠폰유형, 난수 생성수량, 시리얼명, 시리얼쿠폰발급수량 수정 불가 처리
|
|
// 한번 저장되면 쿠폰유형, 할인쿠폰유형, 난수 생성수량, 시리얼명, 시리얼쿠폰발급수량 수정 불가 처리
|
|
|
$("#CouponForm input:radio[name='rdoCpnType']").attr('readonly', true);
|
|
$("#CouponForm input:radio[name='rdoCpnType']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='rdoCpnType']").prop('disabled', true);
|
|
|
$("#CouponForm input:radio[name='rdoCpnType']").parent().prop('disabled', true);
|
|
$("#CouponForm input:radio[name='rdoCpnType']").parent().prop('disabled', true);
|
|
|
$("#CouponForm input:radio[name='dcCdGb']").attr('readonly', true);
|
|
$("#CouponForm input:radio[name='dcCdGb']").attr('readonly', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='dcCdGb']").prop('disabled', true);
|
|
|
$("#CouponForm input:radio[name='dcCdGb']").parent().prop('disabled', true);
|
|
$("#CouponForm input:radio[name='dcCdGb']").parent().prop('disabled', true);
|
|
|
|
|
+ $("#CouponForm input:radio[name='dcCdGb']:radio[value=" + cpnDetail.dcCdGb + "]").prop('checked', true);
|
|
|
$("#CouponForm input[name='serialCpnNm']").prop("disabled", true);
|
|
$("#CouponForm input[name='serialCpnNm']").prop("disabled", true);
|
|
|
$("#CouponForm input[name='serialCpnQty']").prop("disabled", true);
|
|
$("#CouponForm input[name='serialCpnQty']").prop("disabled", true);
|
|
|
$("#CouponForm input[name='randomCpnQty']").prop("disabled", true);
|
|
$("#CouponForm input[name='randomCpnQty']").prop("disabled", true);
|
|
|
|
|
|
|
|
- // 할인코드유형이 일반유형이 아니면 시리얼 및 난수 생성 및 지급 내역 탭 노출
|
|
|
|
|
|
|
+ // 주문서 쿠폰이면 할인쿠폰유형 노출
|
|
|
|
|
+ if(cpnDetail.cpnType == "G230_20") {
|
|
|
|
|
+ $("#CouponForm .dcCdGb").show();
|
|
|
|
|
+ }
|
|
|
|
|
+ // 할인코드유형이 일반유형이 아니면
|
|
|
if(cpnDetail.dcCdGb != "G233_00" ) {
|
|
if(cpnDetail.dcCdGb != "G233_00" ) {
|
|
|
- $("#CouponForm .randomCpnTab").show();
|
|
|
|
|
|
|
+ $("#CouponForm .randomCpnTab").show(); // 시리얼 및 난수 TAB 노출
|
|
|
|
|
+ $("#CouponForm .dcCdCheck").hide(); // 총발행제한수량, 1회발행수량, 1인당발행제한수량 숨김
|
|
|
if(cpnDetail.dcCdGb == "G233_10") { // 시리얼 유형
|
|
if(cpnDetail.dcCdGb == "G233_10") { // 시리얼 유형
|
|
|
$("#CouponForm input[name='serialCpnQty']").val(cpnDetail.totPubLimitQty);
|
|
$("#CouponForm input[name='serialCpnQty']").val(cpnDetail.totPubLimitQty);
|
|
|
$("#CouponForm input[name='serialCpnNm']").val(cpnDetail.rdCpnNm);
|
|
$("#CouponForm input[name='serialCpnNm']").val(cpnDetail.rdCpnNm);
|
|
|
|
|
+ $("#CouponForm .normalCol").attr("colspan", "5");
|
|
|
$("#CouponForm .serialCpnArea").show();
|
|
$("#CouponForm .serialCpnArea").show();
|
|
|
|
|
+ $("#CouponForm .randomCpnArea").hide();
|
|
|
} else if (cpnDetail.dcCdGb == "G233_20") {
|
|
} else if (cpnDetail.dcCdGb == "G233_20") {
|
|
|
$("#CouponForm input[name='randomCpnQty']").val(cpnDetail.totPubLimitQty);
|
|
$("#CouponForm input[name='randomCpnQty']").val(cpnDetail.totPubLimitQty);
|
|
|
- $("#CouponForm .randomCpnArea").show();
|
|
|
|
|
$("#CouponForm .normalCol").attr("colspan", "");
|
|
$("#CouponForm .normalCol").attr("colspan", "");
|
|
|
|
|
+ $("#CouponForm .randomCpnArea").show();
|
|
|
|
|
+ $("#CouponForm .serialCpnArea").hide();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|