|
|
@@ -0,0 +1,1180 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="ko" xmlns:th="http://www.thymeleaf.org">
|
|
|
+<!--
|
|
|
+ *******************************************************************************
|
|
|
+ * @source : ExchangeRequestForm.html
|
|
|
+ * @desc : 교환요청 화면
|
|
|
+ *============================================================================
|
|
|
+ * STYLE24
|
|
|
+ * Copyright(C) 2021 TSIT, All rights reserved.
|
|
|
+ *============================================================================
|
|
|
+ * VER DATE AUTHOR DESCRIPTION
|
|
|
+ * === =========== ========== =============================================
|
|
|
+ * 1.0 2021.01.15 card007 최초 작성
|
|
|
+ *******************************************************************************
|
|
|
+ -->
|
|
|
+<div class="modalPopup" data-width="1400" data-height="600">
|
|
|
+ <div class="panelStyle">
|
|
|
+ <div class="panelTitle">
|
|
|
+ <h2>교환요청</h2>
|
|
|
+ <button type="button" class="close" onclick="uifnPopupClose('popupExchangeRequestForm');"><i class="fa fa-times"></i></button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="panelContent" style="height:90%; overflow-y:auto; padding:0px 20px !important; ">
|
|
|
+ <form id="exchangeRequestFrm" name="exchangeRequestFrm" action="/orderChange/exchange" method="post" target="hdFrameForOrderExchange">
|
|
|
+ <input type="hidden" name="ordNo" th:value="${ordNo}"/>
|
|
|
+ <input type="hidden" name="chgReason" value=""/>
|
|
|
+ <input type="hidden" name="chgReasonDesc" value=""/>
|
|
|
+
|
|
|
+ <h4>주문정보</h4>
|
|
|
+ <div id="gridOrderCancelRequestList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
|
|
|
+
|
|
|
+ <h4>교환정보</h4>
|
|
|
+ <div id="gridOrderCancelRequestToBeList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
|
|
|
+
|
|
|
+ <h4>배송비정보</h4>
|
|
|
+ <div id="gridDelvCdList" style="width:100%; height: 140px;" class="ag-theme-balham"></div>
|
|
|
+
|
|
|
+ <div style="text-align:right; padding-bottom:5px; padding-top:5px;">
|
|
|
+ <button type="button" class="btn btn-success" id="fnExchangeRequest" onclick="fnExchangeRequest();">요청</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col style="width:320px;" />
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col />
|
|
|
+ </colgroup>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>교환사유 <i class="star"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
|
|
|
+ <option value="">[선택하세요]</option>
|
|
|
+ <option th:if="${chgReasonList}" th:each="oneData, status : ${chgReasonList}" th:value="|${oneData.cd}:${oneData.cdNm}|" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
|
|
|
+ </select>
|
|
|
+ </td>
|
|
|
+ <th>귀책사유</th>
|
|
|
+ <td><span id="imputeReason"></span></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>요청메모</th>
|
|
|
+ <td colspan="3">
|
|
|
+ <textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="교환사유를 300자내외로 작성해 주세요"></textarea>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <h4>회수지 정보</h4>
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col style="width:320px;" />
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col />
|
|
|
+ </colgroup>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>보내는사람 <i class="star"></i></th>
|
|
|
+ <td colspan="3"><input type="text" name ="chgerNm" class=""/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>회수지주소 <i class="star"></i></th>
|
|
|
+ <td colspan="3">
|
|
|
+ <input type="text" name ="chgerZipNo" class="w100" readonly="readonly"/>
|
|
|
+ <button type="button" class="btn btn-info" onclick="fnOpenDaumAddr('delvLoc');">우편번호찾기</button>
|
|
|
+ <input type="text" name ="chgerBaseAddr" class="w300"/>
|
|
|
+ <input type="text" name ="chgerDtlAddr" class="w300"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>일반전화</th>
|
|
|
+ <td>
|
|
|
+ <select name="chgerTelno1" class="w100">
|
|
|
+ <option value="">[선택하세요]</option>
|
|
|
+ <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
|
|
|
+ </select>
|
|
|
+ - <input type="text" name ="chgerTelno2" class="w60" value="0000" />
|
|
|
+ - <input type="text" name ="chgerTelno3" class="w60" value="0000" />
|
|
|
+ </td>
|
|
|
+ <th>휴대전화 <i class="star"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="chgerPhnno1" class="w100">
|
|
|
+ <option value="">[선택하세요]</option>
|
|
|
+ <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
|
|
|
+ </select>
|
|
|
+ - <input type="text" name ="chgerPhnno2" class="w60" value="0000" />
|
|
|
+ - <input type="text" name ="chgerPhnno3" class="w60" value="0000" />
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ <h4>교환지 정보</h4>
|
|
|
+ <table class="frmStyle">
|
|
|
+ <colgroup>
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col style="width:320px;" />
|
|
|
+ <col style="width:160px;" />
|
|
|
+ <col />
|
|
|
+ </colgroup>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th>받는사람 <i class="star"></i></th>
|
|
|
+ <td colspan="3"><input type="text" name ="recipNm" class=""/></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>교환지주소 <i class="star"></i></th>
|
|
|
+ <td colspan="3">
|
|
|
+ <input type="text" name ="recipZipNo" class="w100" readonly="readonly"/>
|
|
|
+ <button type="button" class="btn btn-info" onclick="fnOpenDaumAddr('delvLoc');">우편번호찾기</button>
|
|
|
+ <input type="text" name ="recipBaseAddr" class="w300"/>
|
|
|
+ <input type="text" name ="recipDtlAddr" class="w300"/>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>일반전화</th>
|
|
|
+ <td>
|
|
|
+ <select name="recipTelno1" class="w100">
|
|
|
+ <option value="">[선택하세요]</option>
|
|
|
+ <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
|
|
|
+ </select>
|
|
|
+ - <input type="text" name ="recipTelno2" class="w60" value="0000" />
|
|
|
+ - <input type="text" name ="recipTelno3" class="w60" value="0000" />
|
|
|
+ </td>
|
|
|
+ <th>휴대전화 <i class="star"></i></th>
|
|
|
+ <td>
|
|
|
+ <select name="recipPhnno1" class="w100">
|
|
|
+ <option value="">[선택하세요]</option>
|
|
|
+ <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
|
|
|
+ </select>
|
|
|
+ - <input type="text" name ="recipPhnno2" class="w60" value="0000" />
|
|
|
+ - <input type="text" name ="recipPhnno3" class="w60" value="0000" />
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<!-- data -->
|
|
|
+<script th:inline="javascript">
|
|
|
+/*<![CDATA[*/
|
|
|
+var cancelRequestTargetList = [[${cancelRequestTargetList}]]; // 교환대상목록
|
|
|
+var ordNo = [[${ordNo}]]; // 주문번호
|
|
|
+var orderInfoList = [[${orderInfoList}]]; // 주문기본정보
|
|
|
+var payMeans = orderInfoList[0].payMeans; // 결제수단
|
|
|
+var orderDelvAddrInfo = [[${orderDelvAddrInfo}]]; // 회수지정보
|
|
|
+
|
|
|
+var temp1 = true;
|
|
|
+var temp2 = false;
|
|
|
+
|
|
|
+// 1. 주문정보(교환대상)
|
|
|
+var columnExchangeReqList = [
|
|
|
+ {
|
|
|
+ headerName : "주문상세정보",
|
|
|
+ children : [
|
|
|
+ {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
|
|
|
+ {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품명" , field: "goodsNm" , width: 200 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문상세단품정보",
|
|
|
+ children : [
|
|
|
+ {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "단품명" , field: "itemNm" , width: 200 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "옵션1" , field: "optCd1" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "옵션2" , field: "optCd2" , width: 80 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "단품수량"
|
|
|
+ , field : "itemQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "단품금액"
|
|
|
+ , field : "itemPrice"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "단품옵션금액"
|
|
|
+ , field : "optAddPrice"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문상세수량",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "주문"
|
|
|
+ , field : "ordQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소/요청"
|
|
|
+ , field : "cnclRtnQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
|
|
|
+ return cnclRtnReqQty;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: "교환가능옵션" , field: "optCd2s" , width: 200 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "교환옵션"
|
|
|
+ , field : "ordChgOpt"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : "text-center"
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ var optArr = params.data.optCd2s.split(',');
|
|
|
+
|
|
|
+ var strVal = '';
|
|
|
+ strVal += '<select class="ordChgOpt" name="ordChgOpt">';
|
|
|
+ strVal += '<option value="" selected>선택</option>'
|
|
|
+
|
|
|
+ for (var opt in optArr) {
|
|
|
+ console.log(opt);
|
|
|
+ strVal += '<option value="' + opt + '">' + opt + '</option>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {headerName: "재고수량" , field: "currStockQty" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "교환신청수량"
|
|
|
+ , field : "ordCanChgQty"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ var ordQty = parseInt(params.data.ordQty);
|
|
|
+ var cnclRtnQty = parseInt(params.data.cnclRtnQty);
|
|
|
+ var ordReqChgQty = parseInt(params.data.ordReqChgQty);
|
|
|
+ var ordCanChgQty = ordQty - (cnclRtnQty + ordReqChgQty);
|
|
|
+
|
|
|
+ var strVal = "";
|
|
|
+ strVal += "<select class='ordCanChgQty' name='ordCanChgQty'>";
|
|
|
+
|
|
|
+ for (i=0 ; i<=ordCanChgQty ; i++) {
|
|
|
+ if (i == params.data.ordCanChgQty) {
|
|
|
+ strVal += " <option value='"+i+"' selected>"+i+"</option>";
|
|
|
+ } else {
|
|
|
+ strVal += " <option value='"+i+"'>"+i+"</option>";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ strVal += "</select>";
|
|
|
+ return strVal;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문단품금액",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "주문"
|
|
|
+ , field : "ordAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소"
|
|
|
+ , field : "cnclRtnAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "즉시할인"
|
|
|
+ , field : "cpn1DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "다다익선1"
|
|
|
+ , field : "tmtb1DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "다다익선2"
|
|
|
+ , field : "tmtb2DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "상품쿠폰"
|
|
|
+ , field : "goodsCpnDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "장바구니쿠폰"
|
|
|
+ , field : "cartCpnDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "포인트"
|
|
|
+ , field : "pntDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "선포인트"
|
|
|
+ , field : "prePntDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "상품권"
|
|
|
+ , field : "gfcdUseAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "실결제금액"
|
|
|
+ , field : "realOrdAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문배송비정보",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "배송비"
|
|
|
+ , field : "delvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "무료배송비"
|
|
|
+ , field : "minOrdAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "기본배송비"
|
|
|
+ , field : "orgDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "반품배송비"
|
|
|
+ , field : "rtnDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "교환배송비"
|
|
|
+ , field : "excDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+];
|
|
|
+var gridOptionsExchangeReqList = gagaAgGrid.getGridOptions(columnExchangeReqList);
|
|
|
+
|
|
|
+// Add on options
|
|
|
+gridOptionsExchangeReqList.suppressRowClickSelection = true;
|
|
|
+gridOptionsExchangeReqList.rowSelection = 'multiple';
|
|
|
+
|
|
|
+gridOptionsExchangeReqList.onCellValueChanged = function(params) {
|
|
|
+ var colId = params.column.getId();
|
|
|
+ if (colId === 'ordChgOpt') {
|
|
|
+ var optCd2 = params.data.optCd2;
|
|
|
+ var stockQtyArr = params.data.currStockQtys.split(',');
|
|
|
+ var optCdArr = params.data.optCd2s.split(',');
|
|
|
+ var stockIdx = optCdArr.indexOf(optCd2);
|
|
|
+ var stockQty = stockQtyArr[stockIdx];
|
|
|
+ params.node.setDataValue('stockQty', stockQty);
|
|
|
+ } else if (colId === 'ordCanChgQty') {
|
|
|
+ console.log(params);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 2. 교환정보(환불정보)
|
|
|
+var columnExchangeReqToBeList = [
|
|
|
+ {
|
|
|
+ headerName : "주문상세정보",
|
|
|
+ children : [
|
|
|
+ {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
|
|
|
+ {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품명" , field: "goodsNm" , width: 200 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문상세단품정보",
|
|
|
+ children : [
|
|
|
+ {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "단품명" , field: "itemNm" , width: 200 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "칼라코드" , field: "optCd1" , width: 80 , cellClass: 'text-center', hide: temp1},
|
|
|
+ {headerName: "사이즈코드" , field: "optCd2" , width: 80 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "단품수량"
|
|
|
+ , field : "itemQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "단품금액"
|
|
|
+ , field : "itemPrice"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "단품옵션금액"
|
|
|
+ , field : "optAddPrice"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문상세수량",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "주문"
|
|
|
+ , field : "ordQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소/요청"
|
|
|
+ , field : "cnclRtnQty"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
|
|
|
+ return cnclRtnReqQty;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소"
|
|
|
+ , field : "ordCanChgQty"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-center'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문단품금액",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "주문"
|
|
|
+ , field : "ordAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소/반품"
|
|
|
+ , field : "cnclRtnAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "즉시할인"
|
|
|
+ , field : "cpn1DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "다다익선1"
|
|
|
+ , field : "tmtb1DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "다다익선2"
|
|
|
+ , field : "tmtb2DcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "상품쿠폰"
|
|
|
+ , field : "goodsCpnDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "장바구니쿠폰"
|
|
|
+ , field : "cartCpnDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "포인트"
|
|
|
+ , field : "pntDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "선포인트"
|
|
|
+ , field : "prePntDcAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "상품권"
|
|
|
+ , field : "gfcdUseAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "환불금액"
|
|
|
+ , field : "realOrdAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "주문배송비정보",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "배송비"
|
|
|
+ , field : "delvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "무료배송비"
|
|
|
+ , field : "minOrdAmt"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "기본배송비"
|
|
|
+ , field : "orgDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "반품배송비"
|
|
|
+ , field : "rtnDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "교환배송비"
|
|
|
+ , field : "excDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+];
|
|
|
+var gridOptionsExchangeReqToBeList = gagaAgGrid.getGridOptions(columnExchangeReqToBeList);
|
|
|
+
|
|
|
+// 3. 배송비정보(환불정보)
|
|
|
+var columnDelvCdList = [
|
|
|
+ {
|
|
|
+ headerName : "배송코드기준금액",
|
|
|
+ children : [
|
|
|
+ {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "주문"
|
|
|
+ , field : "ordAmt"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "취소"
|
|
|
+ , field : "cnclRtnAmt"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "환불"
|
|
|
+ , field : "realOrdAmt"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "배송비정보",
|
|
|
+ children : [
|
|
|
+ {
|
|
|
+ headerName : "배송비"
|
|
|
+ , field : "delvFee"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "무료배송비"
|
|
|
+ , field : "minOrdAmt"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "기본배송비"
|
|
|
+ , field : "orgDelvFee"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "반품배송비"
|
|
|
+ , field : "rtnDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ headerName : "교환배송비"
|
|
|
+ , field : "excDelvFee"
|
|
|
+ , width : 80
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "추가배송비여부" , field: "addDelvFeeYn" , width: 140 , cellClass: 'text-center', hide: temp2},
|
|
|
+ {
|
|
|
+ headerName : "추가배송비"
|
|
|
+ , field : "addDelvFee"
|
|
|
+ , width : 100
|
|
|
+ , cellClass : 'text-right'
|
|
|
+ , cellRenderer : function (params) {
|
|
|
+ return params.value.addComma();
|
|
|
+ }
|
|
|
+ , hide : temp2
|
|
|
+ },
|
|
|
+ {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
|
|
|
+ ]
|
|
|
+ }
|
|
|
+];
|
|
|
+var gridOptionsDelvCdList = gagaAgGrid.getGridOptions(columnDelvCdList);
|
|
|
+
|
|
|
+// 4. 무통장 계좌정보
|
|
|
+var columnDefsRefundAccountInfo = [
|
|
|
+ {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: false, checkboxSelection: true, filter: false},
|
|
|
+ {headerName: "은행명" , field: "bankNm" , width: 140 , cellClass: 'text-center'},
|
|
|
+ {headerName: "은행코드" , field: "bankCd" , width: 120 , cellClass: 'text-center', hidden:true},
|
|
|
+ {headerName: "계좌번호" , field: "accountNo" , width: 150 , cellClass: 'text-center'},
|
|
|
+ {headerName: "예금주" , field: "accountNm" , width: 120 , cellClass: 'text-center'},
|
|
|
+ {headerName: "기본" , field: "defaultYn" , width: 100 , cellClass: 'text-center'}
|
|
|
+];
|
|
|
+
|
|
|
+var gridOptionsRefundAccountInfo = gagaAgGrid.getGridOptions(columnDefsRefundAccountInfo);
|
|
|
+</script>
|
|
|
+
|
|
|
+<script>
|
|
|
+//현재 사유는 고객 입니다.
|
|
|
+var isCustomer = true;
|
|
|
+
|
|
|
+// 취소정보계산
|
|
|
+var fnCalculateRefundAmt = function (obj) {
|
|
|
+ // 취소정보담은목록
|
|
|
+ var cancelRequestTargetToBeList = [];
|
|
|
+
|
|
|
+ if (obj != null) {
|
|
|
+ for (i=0 ; i<cancelRequestTargetList.length ; i++) {
|
|
|
+ var orDtlNo = $(obj).attr("ordDtlNo");
|
|
|
+ var ordCanChgQty = $(obj).val();
|
|
|
+
|
|
|
+ if (cancelRequestTargetList[i].ordDtlNo == orDtlNo) {
|
|
|
+ cancelRequestTargetList[i].ordCanChgQty = ordCanChgQty;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 주문정보 다시 셋팅 (체크해봐야할문제)
|
|
|
+ gridOptionsCancelReqList.api.setRowData(cancelRequestTargetList);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (cancelRequestTargetList.length == 0) {
|
|
|
+ alert("요청 대상정보가 존재 하지 않습니다.");
|
|
|
+ uifnPopupClose('popupReturnRequestForm');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 환불금액계산호출
|
|
|
+ var jsonData = JSON.stringify(cancelRequestTargetList);
|
|
|
+ gagajf.ajaxJsonSubmit(
|
|
|
+ '/orderChange/cancel/refundAmt'
|
|
|
+ , jsonData
|
|
|
+ , function(result) {
|
|
|
+ gridOptionsCancelReqToBeList.api.setRowData(result.cancelOrderRefundList);
|
|
|
+ gridOptionsDelvCdList.api.setRowData(result.cancelDelvRefundList);
|
|
|
+
|
|
|
+ $("#spanPayAmt").text(result.spanPayAmt.addComma()); //총 결제 금액
|
|
|
+ $("#spanSumRealOrdAmt").text(result.spanSumRealOrdAmt.addComma()); //상품 실결제 금액
|
|
|
+ $("#spanSumDeliveryFee").text(result.spanSumDeliveryFee.addComma()); //배송금액
|
|
|
+
|
|
|
+ $("#spanOrdAmt").text(result.spanOrdAmt.addComma()); //주문 상품 금액
|
|
|
+ $("#spanCnclRtnAmt").text(result.spanCnclRtnAmt.addComma()); //취소 상품 금액
|
|
|
+
|
|
|
+ $("#spanTotPntDcAmt").text(result.spanTotPntDcAmt.addComma()); //취소 사용 포인트
|
|
|
+ $("#spanPntDcAmt").text(result.spanPntDcAmt.addComma()); //고객 포인트
|
|
|
+ $("#spanPrePntDcAmt").text(result.spanPrePntDcAmt.addComma()); //상품 선포인트
|
|
|
+
|
|
|
+ $("#spanCpnDcAmt").text(result.spanCpnDcAmt.addComma()); //취소 사용 쿠폰금액
|
|
|
+ $("#spanCpn1DcAmt").text(result.spanCpn1DcAmt.addComma()); //즉시할인쿠폰
|
|
|
+ $("#spanGoodsCpnDcAmt").text(result.spanGoodsCpnDcAmt.addComma()); //상품쿠폰
|
|
|
+ $("#spanCartCpnDcAmt").text(result.spanCartCpnDcAmt.addComma()); //장바구니쿠폰
|
|
|
+
|
|
|
+ $("#spanTmtbDcAmt").text(result.spanTmtbDcAmt.addComma()); //취소 다다익선 금액
|
|
|
+ $("#spanTmtb1DcAmt").text(result.spanTmtb1DcAmt.addComma()); //수량할인
|
|
|
+ $("#spanTmtb2DcAmt").text(result.spanTmtb2DcAmt.addComma()); //금액할인
|
|
|
+
|
|
|
+ $("#spanGfcdUseAmt").text(result.spanGfcdUseAmt.addComma()); //취소 고객 상품권 금액
|
|
|
+
|
|
|
+ $("#spanRealCnclRtnAmt").text(result.spanRealCnclRtnAmt.addComma()); //취소 상품 실결제 금액
|
|
|
+ $("#spanTotDeliveryFee").text(result.spanTotDeliveryFee.addComma()); //취소 환불 배송 금액
|
|
|
+
|
|
|
+ $("#spanTotRtnDelvFee").text(result.spanTotRtnDelvFee.addComma()); //반품 환불 배송 금액
|
|
|
+ $("#spanTotExcDelvFee").text(result.spanTotExcDelvFee.addComma()); //교환 환불 배송 금액
|
|
|
+
|
|
|
+ if (result.spanRealCnclRtnAmt > 0) {
|
|
|
+ // 고객사유 : 환불금액게산 = (취소금액 + 배송비) - 추가배송비 - 반품배송비
|
|
|
+ if (isCustomer) {
|
|
|
+ result.spanRefundAmt = (result.spanRealCnclRtnAmt + result.sumDeliveryFee) - result.spanTotDeliveryFee - result.spanTotRtnDelvFee;
|
|
|
+ }
|
|
|
+ // 회사사유 : 환불금액게산 = (취소금액 + 배송비)
|
|
|
+ else {
|
|
|
+ result.spanRefundAmt = (result.spanRealCnclRtnAmt + result.sumDeliveryFee);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $("#spanRefundAmt").text(result.spanRefundAmt.addComma()); //환불 금액 합계
|
|
|
+ }
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+// 사유
|
|
|
+var fnChangeChgReason = function(reasonCd){
|
|
|
+ var arrReasonCd = reasonCd.split(":");
|
|
|
+ var customerReasonArr = ['G688_10', 'G688_11', 'G688_12', 'G688_13', 'G688_15' , 'G688_21', 'G688_30'];
|
|
|
+
|
|
|
+ isCustomer = false;
|
|
|
+
|
|
|
+ // 취소, 반품, 교환 사유 판단
|
|
|
+ for (i=0 ; i<customerReasonArr.length ; i++) {
|
|
|
+ if (customerReasonArr[i] == arrReasonCd[0]) {
|
|
|
+ isCustomer = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 귀책사유설정 회사, 고객
|
|
|
+ if (isCustomer) {
|
|
|
+ $("#imputeReason").text("고객");
|
|
|
+ } else {
|
|
|
+ $("#imputeReason").text("회사");
|
|
|
+ }
|
|
|
+
|
|
|
+ $('#cancelRequestFrm input[name=chgReason]').val(arrReasonCd[0]);
|
|
|
+ $('#cancelRequestFrm input[name=chgReasonDesc]').val(arrReasonCd[1]);
|
|
|
+
|
|
|
+ //환불예정금액 계산.
|
|
|
+ fnCalculateRefundAmt();
|
|
|
+}
|
|
|
+
|
|
|
+// 반품요청
|
|
|
+var fnExchangeRequest = function () {
|
|
|
+ var temp = false;
|
|
|
+ var ordDtlStat = cancelRequestTargetList[0].ordDtlStat;
|
|
|
+ var allCanYn = "N";
|
|
|
+
|
|
|
+ // 1. 취소수량 체크
|
|
|
+ for (i=0 ; i<cancelRequestTargetList.length ; i++) {
|
|
|
+ if (cancelRequestTargetList[i].ordCanChgQty > 0) {
|
|
|
+ temp = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp == false) {
|
|
|
+ mcxDialog.alert('취소 할 수량을 입력하세요.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2. 입금대기건 && 전체취소 체크
|
|
|
+ if (ordDtlStat == "G013_10" && $("#spanPayAmt").text() != $("#spanRefundAmt").text()) {
|
|
|
+ alert("입금대기건은 전체 취소만 가능합니다.");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 2.1 전체취소 여부 적용
|
|
|
+ if (ordDtlStat == "G013_10" && $("#spanPayAmt").text() == $("#spanRefundAmt").text()) {
|
|
|
+ allCanYn = "Y";
|
|
|
+ }
|
|
|
+
|
|
|
+ // 3. 취소사유 체크
|
|
|
+ var chgReason = $("#cancelRequestFrm select[name=selectChgReason]").val();
|
|
|
+
|
|
|
+ if (gagajf.isNull(chgReason)) {
|
|
|
+ mcxDialog.alert("취소사유를 입력하세요.");
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 4. 환불계좌 체크
|
|
|
+ var accountNo = "";
|
|
|
+ var accountNm = "";
|
|
|
+ var bankCd = "";
|
|
|
+
|
|
|
+ // 결제타입이 무통장 입금일때 사용
|
|
|
+ if (payMeans == 'G014_20') {
|
|
|
+ var refundAccount = gridOptionsRefundAccountInfo.api.getSelectedRows();
|
|
|
+
|
|
|
+ if (refundAccount.length == 0) {
|
|
|
+ mcxDialog.alert('선택된 행이 없습니다.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ accountNo = refundAccount[0].accountNo;
|
|
|
+ accountNm = refundAccount[0].accountNm;
|
|
|
+ bankCd = refundAccount[0].bankCd;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 5. 회수지정보설정
|
|
|
+ var chgerNm = $("#cancelRequestFrm input[name=chgerNm]").val();
|
|
|
+ var chgerZipNo = $("#cancelRequestFrm input[name=chgerZipNo]").val();
|
|
|
+ var chgerBaseAddr = $("#cancelRequestFrm input[name=chgerBaseAddr]").val();
|
|
|
+ var chgerDtlAddr = $("#cancelRequestFrm input[name=chgerDtlAddr]").val();
|
|
|
+
|
|
|
+ var chgerPhnno1 = $("#cancelRequestFrm select[name=chgerPhnno1]").val();
|
|
|
+ var chgerPhnno2 = $("#cancelRequestFrm input[name=chgerPhnno2]").val();
|
|
|
+ var chgerPhnno3 = $("#cancelRequestFrm input[name=chgerPhnno3]").val();
|
|
|
+
|
|
|
+ var chgerTelno1 = $("#cancelRequestFrm select[name=chgerTelno1]").val();
|
|
|
+ var chgerTelno2 = $("#cancelRequestFrm input[name=chgerTelno2]").val();
|
|
|
+ var chgerTelno3 = $("#cancelRequestFrm input[name=chgerTelno3]").val();
|
|
|
+
|
|
|
+ if (gagajf.isNull(chgerZipNo)) {
|
|
|
+ mcxDialog.alert("회수지주소를 입력하세요."); return;
|
|
|
+ }
|
|
|
+ if (gagajf.isNull(chgerBaseAddr)) {
|
|
|
+ mcxDialog.alert("회수지주소를 입력하세요."); return;
|
|
|
+ }
|
|
|
+ if (gagajf.isNull(chgerDtlAddr)) {
|
|
|
+ mcxDialog.alert("회수지주소를 입력하세요."); return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gagajf.isNull(chgerPhnno1)) {
|
|
|
+ mcxDialog.alert("휴대전화를 입력하세요."); return;
|
|
|
+ }
|
|
|
+ if (gagajf.isNull(chgerPhnno2)) {
|
|
|
+ mcxDialog.alert("휴대전화를 입력하세요."); return;
|
|
|
+ }
|
|
|
+ if (gagajf.isNull(chgerPhnno3)) {
|
|
|
+ mcxDialog.alert("휴대전화를 입력하세요."); return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var chgerPhnno = chgerPhnno1 + chgerPhnno2 + chgerPhnno3;
|
|
|
+ var chgerTelno = chgerTelno1 + chgerTelno2 + chgerTelno3;
|
|
|
+ var chgerEmail = orderInfoList[0].ordEmail;
|
|
|
+
|
|
|
+ var jsonObj = {
|
|
|
+ "ordNo" : $('#cancelRequestFrm input[name=ordNo]').val()
|
|
|
+ ,"chgReason" : $('#cancelRequestFrm input[name=chgReason]').val()
|
|
|
+ ,"chgMemo" : $('#chgMemo').val()
|
|
|
+ ,"cancelReqList" : cancelRequestTargetList
|
|
|
+ ,"accountNo" : accountNo
|
|
|
+ ,"accountNm" : accountNm
|
|
|
+ ,"bankCd" : bankCd
|
|
|
+ ,"allCanYn" : allCanYn
|
|
|
+ ,"isCustomer" : isCustomer
|
|
|
+ ,"chgerNm" : chgerNm
|
|
|
+ ,"chgerEmail" : chgerEmail
|
|
|
+ ,"chgerZipNo" : chgerZipNo
|
|
|
+ ,"chgerBaseAddr" : chgerBaseAddr
|
|
|
+ ,"chgerDtlAddr" : chgerDtlAddr
|
|
|
+ ,"chgerPhnno" : chgerPhnno
|
|
|
+ ,"chgerTelno" : chgerTelno
|
|
|
+ }
|
|
|
+
|
|
|
+ // 주문번호, 취소사유, 취소메모, (취소, 반품, 교환 신청 정보 목록), 환불계좌
|
|
|
+ var jsonData = JSON.stringify(jsonObj);
|
|
|
+
|
|
|
+ mcxDialog.confirm('반품요청하시겠습니까?', {
|
|
|
+ cancelBtnText : "반품",
|
|
|
+ sureBtnClick : function(){
|
|
|
+ // 취소 실행
|
|
|
+ gagajf.ajaxJsonSubmit(
|
|
|
+ '/orderChange/returnRequest/'
|
|
|
+ , jsonData
|
|
|
+ , function() {
|
|
|
+ uifnPopupClose('popupOrderDetail');
|
|
|
+ fnReOpenOrderDetailPopup();
|
|
|
+ uifnPopupClose('popupReturnRequestForm');
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 환불계좌 등록
|
|
|
+var fnCreateOrderRfAccount = function () {
|
|
|
+ var actionUrl = "/orderChange/refund/account/create/form?ordNo=" + ordNo ;
|
|
|
+ cfnOpenModalPopup(actionUrl, 'popupCreateRefundAccount');
|
|
|
+};
|
|
|
+
|
|
|
+// 환불계좌 정보
|
|
|
+var fnBindOrderRfAccountInfo = function () {
|
|
|
+ gagaAgGrid.fetch(
|
|
|
+ "/orderChange/refund/account/info/list?ordNo=" + ordNo
|
|
|
+ , gridOptionsRefundAccountInfo
|
|
|
+ , null
|
|
|
+ , function (result) {
|
|
|
+ }
|
|
|
+ )
|
|
|
+};
|
|
|
+
|
|
|
+// 우편번호 DAUM을 이용한 우편번호 팝업 레이어
|
|
|
+var fnOpenDaumAddr = function() {
|
|
|
+ let daumZip = new daum.Postcode({
|
|
|
+ oncomplete: function(data) {
|
|
|
+ // 우편번호와 주소 정보를 해당 필드에 넣는다.
|
|
|
+ $('#cancelRequestFrm input[name=chgerZipNo]').val(data.zonecode);
|
|
|
+ $('#cancelRequestFrm input[name=chgerBaseAddr]').val(cfnGetDaumRoadAddr(data));
|
|
|
+ $('#cancelRequestFrm input[name=chgerDtlAddr]').focus();
|
|
|
+
|
|
|
+ cfnCloseDaumAddr();
|
|
|
+ },
|
|
|
+ width: '100%'
|
|
|
+ });
|
|
|
+
|
|
|
+ cfnOpenDaumAddr(daumZip);
|
|
|
+}
|
|
|
+
|
|
|
+// 회수지정보 셋팅
|
|
|
+var fnSetChger = function(){
|
|
|
+ var data = orderDelvAddrInfo[0];
|
|
|
+ var spRecipPhnno = (data.recipPhnno != null) ? data.recipPhnno.split('-') : null;
|
|
|
+ var spRecipTelno = (data.recipTelno != null) ? data.recipTelno.split('-') : null;
|
|
|
+
|
|
|
+ $("#cancelRequestFrm input[name=chgerNm]").val(data.recipNm);
|
|
|
+ $("#cancelRequestFrm input[name=chgerZipNo]").val(data.recipZipNo);
|
|
|
+ $("#cancelRequestFrm input[name=chgerBaseAddr]").val(data.recipBaseAddr);
|
|
|
+ $("#cancelRequestFrm input[name=chgerDtlAddr]").val(data.recipDtlAddr);
|
|
|
+
|
|
|
+ if (spRecipPhnno) {
|
|
|
+ $("#cancelRequestFrm select[name=chgerPhnno1]").val(spRecipPhnno[0]);
|
|
|
+ $("#cancelRequestFrm input[name=chgerPhnno2]").val(spRecipPhnno[1]);
|
|
|
+ $("#cancelRequestFrm input[name=chgerPhnno3]").val(spRecipPhnno[2]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (spRecipTelno) {
|
|
|
+ $("#cancelRequestFrm select[name=chgerTelno1]").val(spRecipTelno[0]);
|
|
|
+ $("#cancelRequestFrm input[name=chgerTelno2]").val(spRecipTelno[1]);
|
|
|
+ $("#cancelRequestFrm input[name=chgerTelno3]").val(spRecipTelno[2]);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+$(document).ready(function() {
|
|
|
+ // 1. 그리드생성
|
|
|
+ gagaAgGrid.createGrid('gridOrderCancelRequestList' , gridOptionsExchangeReqList); // 주문정보
|
|
|
+ gagaAgGrid.createGrid('gridOrderCancelRequestToBeList' , gridOptionsExchangeReqToBeList); // 취소정보
|
|
|
+ gagaAgGrid.createGrid('gridDelvCdList' , gridOptionsDelvCdList); // 배송비정보
|
|
|
+ //gagaAgGrid.createGrid('gridRefundAccountInfo' , gridOptionsRefundAccountInfo); // 환불계좌정보
|
|
|
+ gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
|
|
|
+
|
|
|
+ // 2.1 TOTAL ROWS 없애기
|
|
|
+ gagaAgGrid.hideStatusBar('gridOrderCancelRequestList');
|
|
|
+ gagaAgGrid.hideStatusBar('gridOrderCancelRequestToBeList');
|
|
|
+ gagaAgGrid.hideStatusBar('gridDelvCdList');
|
|
|
+ //gagaAgGrid.hideStatusBar('gridRefundAccountInfo');
|
|
|
+
|
|
|
+ // 3. 환불정보계산
|
|
|
+ //fnCalculateRefundAmt(null);
|
|
|
+
|
|
|
+ // 4. 무통장입금아일때 환불계좌 그리드 숨김처리
|
|
|
+ if (payMeans !== 'G014_20') {
|
|
|
+ $('#wrapRefundAccount').addClass("off");
|
|
|
+ //fnBindOrderRfAccountInfo();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 5. 회수지정보설정
|
|
|
+ fnSetChger();
|
|
|
+});
|
|
|
+</script>
|
|
|
+</html>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|