초기소스
This commit is contained in:
400
src/main/webapp/WEB-INF/views/crm/coupon/HoldCouponDtlsRForm.jsp
Normal file
400
src/main/webapp/WEB-INF/views/crm/coupon/HoldCouponDtlsRForm.jsp
Normal file
@@ -0,0 +1,400 @@
|
||||
<%@ page import="java.util.Date" %>
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
|
||||
|
||||
|
||||
<%--
|
||||
Class Name : HoldCouponDtlsForm.jsp
|
||||
Description : CRM 쿠폰 내역 jsp
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
------- -------- ---------------------------
|
||||
2024-02-19 추지훈 최초 생성
|
||||
--%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<%@ include file="/WEB-INF/views/comm/crm/Include.jsp"%>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//crm 정보 조회
|
||||
if ($("#mbrTyCd").val() === '01') {
|
||||
fn_get_crm_info($("#leftMbrInnb").val(), $("#leftMbrDvCd").val());
|
||||
} else {
|
||||
fn_get_crm_info_nmbr($("#leftMbtlnb").val());
|
||||
$("#nmbrMbtlnb").text(fn_format_mbtlnb($("#nmbrMbtlnb").text()));
|
||||
}
|
||||
let pageIndexHold = '<c:out value="${ resultMap.paramVO.pageIndex }"/>';
|
||||
let pageUnitHold = '<c:out value="${ resultMap.paramVO.pageUnit }"/>';
|
||||
|
||||
let pageIndexDwld = '<c:out value="${ resultMapDwld.paramVO.pageIndex }"/>';
|
||||
let pageUnitDwld = '<c:out value="${ resultMapDwld.paramVO.pageUnit }"/>';
|
||||
|
||||
|
||||
|
||||
fn_select_hold_coupon_list(pageIndexHold, pageUnitHold);
|
||||
|
||||
//fn_select_dwld_coupon_list(pageIndexDwld, pageUnitDwld);
|
||||
|
||||
|
||||
fn_start_display();
|
||||
|
||||
fn_add_crm_menu_class("leftCoupon");
|
||||
|
||||
});
|
||||
|
||||
/************************************************
|
||||
* 보유 쿠폰 목록 조회
|
||||
*************************************************/
|
||||
const fn_select_hold_coupon_list = function(pageIndex, pageUnit) {
|
||||
|
||||
|
||||
let dataStr;
|
||||
if(!pageIndex) {
|
||||
$('#pageIndex').val(1);
|
||||
} else {
|
||||
$('#pageIndex').val(pageIndex);
|
||||
}
|
||||
|
||||
if(!pageUnit) {
|
||||
|
||||
dataStr = $('#holdListForm').serialize();
|
||||
} else {
|
||||
if($('#pageUnit').length){
|
||||
$('#pageUnit').val(pageUnit);
|
||||
dataStr = $('#holdListForm').serialize();
|
||||
} else {
|
||||
dataStr = $('#holdListForm').serialize()+'&pageUnit='+pageUnit;
|
||||
}
|
||||
}
|
||||
|
||||
let listFormData = $('#leftForm').serialize();
|
||||
dataStr = dataStr + '&' + listFormData;
|
||||
|
||||
$('#pageIndex').val(pageIndex);
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url : "<c:url value="/crm/coupon/selectHoldCouponDtlsInqire"/>",
|
||||
data : dataStr,
|
||||
success:function(resultHtml) {
|
||||
|
||||
|
||||
$('#holdCouponListDiv').html(resultHtml);
|
||||
$('#pageUnit').niceSelect();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* 다운로드 가능 쿠폰 목록 조회
|
||||
*************************************************/
|
||||
const fn_select_dwld_coupon_list = function(pageIndexDwld, pageUnitDwld) {
|
||||
|
||||
let dataStr;
|
||||
if(!pageIndexDwld) {
|
||||
$('#pageIndexDwld').val(1);
|
||||
} else {
|
||||
$('#pageIndexDwld').val(pageIndexDwld);
|
||||
}
|
||||
|
||||
if(!pageUnitDwld) {
|
||||
|
||||
dataStr = $('#dwldListForm').serialize();
|
||||
} else {
|
||||
if($('#pageUnitDwld').length){
|
||||
$('#pageUnitDwld').val(pageUnitDwld);
|
||||
dataStr = $('#dwldListForm').serialize();
|
||||
} else {
|
||||
dataStr = $('#dwldListForm').serialize()+'&pageUnitDwld='+pageUnitDwld;
|
||||
}
|
||||
}
|
||||
|
||||
let listFormData = $('#leftForm').serialize();
|
||||
dataStr = dataStr + '&' + listFormData;
|
||||
|
||||
$('#pageIndexDwld').val(pageIndexDwld);
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url : "<c:url value="/crm/coupon/selectDwldPosblCouponDtlsInqire"/>",
|
||||
data : dataStr,
|
||||
success:function(resultHtml) {
|
||||
$('#holdCouponListDiv').html(resultHtml);
|
||||
$('#pageUnitDwld').niceSelect();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 시작 화면 제어 함수
|
||||
******************************************************** */
|
||||
const fn_start_display = function() {
|
||||
|
||||
|
||||
|
||||
// 시작, 종료 날짜 제어
|
||||
fn_set_date('validpdBgnDt','validpdEndDt','validpdEndDt');
|
||||
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* 쿠폰 상세 정보 조회 팝업 : 이미 다운로드 된 쿠폰
|
||||
*************************************************/
|
||||
const fn_open_modal_dwldcoupon_dtl = function(modalDivSltr, modalSlrt, url, param, callback){
|
||||
var dwldCouponInnb = param
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: url,
|
||||
data: {
|
||||
dwldCouponInnb : dwldCouponInnb
|
||||
},
|
||||
success: function (data) {
|
||||
//callback함수가 없을 경우 default로 지정된 영역에 모달팝업 화면을 교체하고 화면 로딩
|
||||
if(!callback) {
|
||||
$(modalSlrt).remove();
|
||||
$(modalDivSltr).html(data);
|
||||
$(modalSlrt).modal();
|
||||
} else {
|
||||
callback(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/************************************************
|
||||
* 쿠폰 상세 정보 조회 팝업 : 다운로드 가능 쿠폰
|
||||
*************************************************/
|
||||
const fn_open_modal_coupon_dtl = function(modalDivSltr, modalSlrt, url, param, sopmalCd, callback){
|
||||
var couponInnb = param
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: url,
|
||||
data: {
|
||||
couponInnb : couponInnb,
|
||||
sopmalCd : sopmalCd
|
||||
},
|
||||
success: function (data) {
|
||||
//callback함수가 없을 경우 default로 지정된 영역에 모달팝업 화면을 교체하고 화면 로딩
|
||||
if(!callback) {
|
||||
$(modalSlrt).remove();
|
||||
$(modalDivSltr).html(data);
|
||||
$(modalSlrt).modal();
|
||||
} else {
|
||||
callback(data);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
/************************************************
|
||||
* 쿠폰 유효기간 수정
|
||||
*************************************************/
|
||||
const fn_updt_coupon_validpd = function() {
|
||||
const data = $('#validpdDtUpdtForm').serialize();
|
||||
|
||||
if (confirm('쿠폰 유효기간을 <spring:message code="confirm.common.update"/>')) {
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '<c:out value="/crm/coupon/updateCouponPdUpdt"/>',
|
||||
data: data,
|
||||
success: function (result) {
|
||||
|
||||
fn_close_modal('coupon-info-pop');
|
||||
fn_select_hold_coupon_list(1);
|
||||
alert('<spring:message code="success.common.update"/>');
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
let alldwldCnt = '${ not empty resultMap.dwldPosblCouponCnt ? resultMap.dwldPosblCouponCnt : '0' }';
|
||||
|
||||
/************************************************
|
||||
* 쿠폰 다운로드 단건
|
||||
*************************************************/
|
||||
const fn_regist_dwld_coupon = function(couponInnb, sopmalCd, couponSndngInnb, cupnpkInnb, cupnpkNm, cupnpkDc) {
|
||||
let mbrInnb = $('input[name="mbrInnb"]').val();
|
||||
let mbrDvCd = $('input[name="mbrDvCd"]').val();
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '<c:url value="/crm/coupon/insertCrmDwldCouponAllRegist"/>',
|
||||
data: {
|
||||
couponInnb: couponInnb,
|
||||
sopmalCd: sopmalCd,
|
||||
couponSndngInnb : couponSndngInnb,
|
||||
cupnpkInnb : cupnpkInnb,
|
||||
cupnpkNm : cupnpkNm,
|
||||
cupnpkDc : cupnpkDc,
|
||||
mbrInnb : mbrInnb,
|
||||
mbrDvCd : mbrDvCd
|
||||
},
|
||||
success: function (result) {
|
||||
console.log("단건 다운로드 result 확인 : ", result);
|
||||
|
||||
let parseData = JSON.parse(result.resBody.result);
|
||||
console.log("parseData : ", parseData);
|
||||
|
||||
if (parseData.result === 'success') {
|
||||
alert('<spring:message code="success.common.save"/>');
|
||||
location.reload();
|
||||
} else {
|
||||
alert('쿠폰 다운로드 미완료');
|
||||
}
|
||||
|
||||
// alert('<spring:message code="success.common.save"/>');
|
||||
// $('#useCouponListBtn').click();
|
||||
}, error(e) {
|
||||
console.lgo("error : ", e);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/************************************************
|
||||
* (모든) 쿠폰 다운로드 다건
|
||||
*************************************************/
|
||||
const fn_regist_dwld_coupon_all = function() {
|
||||
|
||||
let data = $('#dwldListForm').serializeArray();
|
||||
|
||||
console.log("data", data);
|
||||
|
||||
let mbrInnb = $('input[name="mbrInnb"]').val();
|
||||
let mbrDvCd = $('input[name="mbrDvCd"]').val();
|
||||
|
||||
|
||||
// data.push({ name: "mbrInnb", value: mbrInnb });
|
||||
// data.push({ name: "mbrDvCd", value: mbrDvCd });
|
||||
// data = data + '&mbrInnb='+ mbrInnb;
|
||||
// data = data + '&mbrDvCd='+ mbrDvCd;
|
||||
|
||||
|
||||
if (alldwldCnt > 0) {
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: '<c:url value="/crm/coupon/insertCrmDwldCouponAllRegist"/>',
|
||||
data: {
|
||||
couponArray : '1',
|
||||
mbrInnb : mbrInnb,
|
||||
mbrDvCd : mbrDvCd
|
||||
},
|
||||
success: function (result) {
|
||||
|
||||
console.log("단건 다운로드 result 확인 : ", result);
|
||||
|
||||
let parseData = JSON.parse(result.resBody.result);
|
||||
console.log("parseData : ", parseData);
|
||||
|
||||
if (parseData.result === 'success') {
|
||||
alert('<spring:message code="success.common.save"/>');
|
||||
location.reload();
|
||||
} else {
|
||||
alert('쿠폰 다운로드 미완료');
|
||||
}
|
||||
|
||||
<%--alert('<spring:message code="success.common.save"/>');--%>
|
||||
// $('#useCouponListBtn').click();
|
||||
}, error(e) {
|
||||
conosle.log("error : ", e);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('다운로드 받을 쿠폰이 없습니다.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* 주문상세 화면 전환 */
|
||||
const fn_chng_ordr_dtl = function(ordrInnb) {
|
||||
|
||||
if($('#ordrDtlForm').length > 0) {
|
||||
$('#ordrDtlForm').remove()
|
||||
}
|
||||
|
||||
const form = document.createElement('form');
|
||||
form.id = 'ordrDtlForm';
|
||||
document.body.append(form);
|
||||
|
||||
$(form).find('input[name="ordrInnb"]').remove();
|
||||
$(form).append($('<input/>', {type:'hidden', name:'ordrInnb', id:'ordrInnb', value:ordrInnb}));
|
||||
|
||||
$(form).attr('method', 'post');
|
||||
$(form).attr('target', '_blank');
|
||||
$(form).attr('action', '<c:url value="/mngr/ordr/ordrmngr/selectOrdrDtlInqire"/>');
|
||||
|
||||
$(form).submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%@ include file="/WEB-INF/views/comm/crm/Header.jsp"%>
|
||||
<main class="main">
|
||||
<%-- CRM left 공통 --%>
|
||||
<%@ include file="/WEB-INF/views/comm/crm/Left.jsp"%>
|
||||
<div class="content">
|
||||
<div class="content__inner">
|
||||
<button class="side-nav__fold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
|
||||
<div class="page-title">
|
||||
<h2 class="page-title__title">쿠폰</h2>
|
||||
<div class="page-title__btn-container">
|
||||
<input type="hidden" name="mbrInnb" value="<c:out value="${cnsltVO.mbrInnb}"/>" />
|
||||
<input type="hidden" name="mbrDvCd" value="<c:out value="${cnsltVO.mbrDvCd}"/>" />
|
||||
<input type="hidden" name="mbtlnb" value="${ cnsltVO.mbtlnb}" />
|
||||
</div>
|
||||
</div>
|
||||
<section class="content-section">
|
||||
<div class="tab-box">
|
||||
<button class="tab-box__btn current" onclick="fn_select_hold_coupon_list(); return false;">보유한 쿠폰(<c:out value="${ not empty resultMap.usePosblCouponCnt ? resultMap.usePosblCouponCnt : '0' }"/>/<c:out value="${ not empty resultMap.usePosblCouponUseAtIsYCnt ? resultMap.usePosblCouponUseAtIsYCnt : '0' }"/>)</button>
|
||||
<button class="tab-box__btn" onclick="fn_select_dwld_coupon_list(); return false;">다운로드 가능쿠폰(<c:out value="${ not empty resultMap.dwldPosblCouponCnt ? resultMap.dwldPosblCouponCnt : '0' }"/>)</button>
|
||||
</div>
|
||||
|
||||
<%-- 보유한 쿠폰 내역 --%>
|
||||
<div id="holdCouponListDiv">
|
||||
|
||||
</div>
|
||||
|
||||
<%-- 다운로드 가능쿠폰 내역 --%>
|
||||
<div id="dwldCouponListDiv">
|
||||
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
|
||||
</div>
|
||||
<%-- CRM right 공통 --%>
|
||||
<%@ include file="/WEB-INF/views/comm/crm/Right.jsp"%>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- 쿠폰정보 모달 보유한 쿠폰 -->
|
||||
<div id="modalDiv">
|
||||
</div>
|
||||
<!-- 쿠폰정보 모달 다운로드 가능 쿠폰 -->
|
||||
<div id="modalDivCouponInfo">
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user