| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- <!DOCTYPE html>
- <html lang="ko" xmlns:th="http://www.thymeleaf.org">
- <!--
- *******************************************************************************
- * @source : OrderWithdrawConfirmForm.html
- * @desc : 입점업체 회수컨펌 화면
- *============================================================================
- * STYLE24
- * Copyright(C) 2019 TSIT, All rights reserved.
- *============================================================================
- * VER DATE AUTHOR DESCRIPTION
- * === =========== ========== =============================================
- * 1.0 2021.05.18 jsh77b 최초 작성
- *******************************************************************************
- -->
- <div class="modalPopup" data-width="1400" data-height="520">
- <div class="panelStyle">
- <div class="panelTitle">
- <h2>회수컨펌</h2>
- <button type="button" class="close" onclick="uifnPopupClose('popupReturnRequestForm');"><i class="fa fa-times"></i></button>
- </div>
-
- <div class="panelContent" style="height:90%; overflow-y:auto; padding:0px 20px !important; ">
- <form id="cancelRequestFrm" name="cancelRequestFrm" method="post" target="hdFrameForOrderCancel">
- <input type="hidden" name="ordNo" th:value="${ordNo}"/>
- <input type="hidden" name="ordChgSq" th:value="${ordChgSq}"/>
- <input type="hidden" name="chgReason" th:value="${chgReason}"/>
-
- <th:block th:if="${chgGb} == 'G680_30'">
- <h4>반품정보</h4>
- </th:block>
- <th:block th:if="${chgGb} == 'G680_40'">
- <h4>교환정보</h4>
- </th:block>
- <div id="gridOrderWithdrawList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
-
- <div style="text-align:right; padding-bottom:5px; padding-top:5px;">
- <button type="button" class="btn btn-success" id="widthdrawConfirmBtn">회수컨펌</button>
- </div>
-
- <table class="frmStyle">
- <colgroup>
- <col style="width:160px;" />
- <col style="width:320px;" />
- <col style="width:160px;" />
- <col style="width:320px;" />
- <col style="width:160px;" />
- <col />
- </colgroup>
- <tbody>
- <tr>
- <!-- 반품회수 -->
- <th:block th:if="${chgGb} == 'G680_30'">
- <th>반품사유 <i class="star"></i></th>
- <td>
- <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
- <option value="">[선택하세요]</option>
- <th:block th:if="${chgReasonList1}" th:each="oneData, status : ${chgReasonList1}">
- <th:block th:if="${oneData.cd} == ${chgReason}">
- <option th:value="|${oneData.cd}|" th:text="|${oneData.cdNm}|" selected></option>
- </th:block>
- <th:block th:unless="${oneData.cd} == ${chgReason}">
- <option th:value="|${oneData.cd}|" th:text="|${oneData.cdNm}|"></option>
- </th:block>
- </th:block>
- </select>
- </td>
- </th:block>
- <!-- //반품회수 -->
-
- <!-- 교환회수 -->
- <th:block th:if="${chgGb} == 'G680_40'">
- <th>교환사유 <i class="star"></i></th>
- <td>
- <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
- <option value="">[선택하세요]</option>
- <th:block th:if="${chgReasonList2}" th:each="oneData, status : ${chgReasonList2}">
- <th:block th:if="${oneData.cd} == ${chgReason}">
- <option th:value="|${oneData.cd}|" th:text="|${oneData.cdNm}|" selected></option>
- </th:block>
- <th:block th:unless="${oneData.cd} == ${chgReason}">
- <option th:value="|${oneData.cd}|" th:text="|${oneData.cdNm}|"></option>
- </th:block>
- </th:block>
- </select>
- </td>
- </th:block>
- <!-- //교환회수 -->
-
- <th>회수방법</th>
- <td>
- <th:blcok th:if="${wdGb} == 'W'">회수요청</th:blcok>
- <th:blcok th:if="${wdGb} == 'D'">직접발송</th:blcok>
- </td>
- <th>귀책사유</th>
- <td><span id="imputeReason"></span></td>
- </tr>
- <tr>
- <th>요청메모</th>
- <td colspan="5">
- <textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="취소사유를 300자내외로 작성해 주세요" th:text="${chgMemo}"></textarea>
- </td>
- </tr>
- </tbody>
- </table>
- </form>
- </div>
- </div>
- </div>
- <!-- data -->
- <script th:inline="javascript">
- /*<![CDATA[*/
- var orderWithdrawList = [[${orderWithdrawList}]]; // 회수대상목록
- var sessRoleCd = [[${sessionInfo.roleCd}]]; // 권한코드
- var chgReason = [[${chgReason}]]; // 사유코드
- var chgGb = [[${chgGb}]]; // 요천구분
- var orderInfoList = [[${orderInfoList}]]; // 주문기본정보
- var ordNo = orderInfoList[0].ordNo; // 주문번호
- var payGb = orderInfoList[0].payGb; // 결제수단
- var payMeans = orderInfoList[0].payMeans; // 결제방법
- var payStat = orderInfoList[0].payStat; // 결제상태
- var columnWidthdrawList = [
- {headerName: "입점업체", field:"supplyCompNm", width:120, cellClass: 'text-center' , hide: true},
- {headerName: "입점업체코드", field:"supplyCompCd", width:120, cellClass: 'text-center' , hide: true},
- {headerName: "브랜드", field:"brandKnm", width:100, cellClass: 'text-center' , hide: true},
- {headerName: "변경번호", field:"ordChgSq", width:80, cellClass: 'text-center'},
- {headerName: "주문번호", field:"ordNo", width:80, cellClass: 'text-center'},
- {headerName: "상세번호", field:"ordDtlNo", width:80, cellClass: 'text-center'},
- {headerName: "클레임상태", field:"chgStatNm", width:100, cellClass: 'text-center'},
- {headerName: "요청일시", field:"regDt", width:150, cellClass: 'text-center'},
- {headerName: "요청자명", field:"chgerNm", width:100, cellClass: 'text-center'},
- {headerName: "휴대전화", field:"chgerPhnno", width:120, cellClass: 'text-center'},
- {headerName: "회수지우편번호", field:"chgerZipcode", width:120, cellClass: 'text-center' , hide: true},
- {headerName: "회수지기본주소", field:"chgerBaseAddr", width:150, cellClass: 'text-left' , hide: true},
- {headerName: "회수지상세주소", field:"chgerDtlAddr", width:120, cellClass: 'text-left' , hide: true},
- {headerName: "업체상품코드", field:"supplyGoodsCd", width:100, cellClass: 'text-center'},
- {headerName: "상품코드", field:"goodsCd", width:100, cellClass: 'text-center'},
- {headerName: "상품명", field:"goodsNm", width:100, cellClass: 'text-center'},
- {headerName: "옵션1", field:"optCd1", width:100, cellClass: 'text-center'},
- {headerName: "옵션2", field:"optCd2", width:100, cellClass: 'text-center'},
- {headerName: "요청수량", field:"chgQty", width:100, cellClass: 'text-center'},
- {headerName: "교환상세번호", field:"exchangeOrdDtlNo", width:100, cellClass: 'text-center'},
- {headerName: "교환옵션1", field:"optCd11", width:100, cellClass: 'text-center'},
- {headerName: "교환옵션2", field:"optCd12", width:100, cellClass: 'text-center'},
- {headerName: "물류메모", field:"whMemo", width:200, cellClass: 'text-left' , editable:true},
- {
- 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 : 100
- , 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 : 100
- , cellClass : 'text-right'
- , cellRenderer : function (params) {
- return params.value.addComma();
- }
- },
- {headerName: "주문자명", field:"ordNm", width:120, cellClass: 'text-left' , hide: true},
- {headerName: "주문자핸드폰번호", field:"ordPhnno", width:120, cellClass: 'text-left' , hide: true},
- ];
- var gridOptionsWidthdrawList = gagaAgGrid.getGridOptions(columnWidthdrawList);
- </script>
- <script th:inline="javascript">
- // 사유코드체크
- var fnChangeChgReason = function(reasonCd) {
- var customerReasonArr = ['G688_10', 'G689_10'];
- isCustomer = false;
-
- // 귀책사유체크(취소,반품,교환)
- for (i=0 ; i<customerReasonArr.length ; i++) {
- if (customerReasonArr[i] == reasonCd) {
- isCustomer = true;
- }
- }
-
- // 귀책사유체크(회사,고객)
- if (isCustomer) {
- $("#imputeReason").text("고객");
- } else {
- $("#imputeReason").text("회사");
- }
-
- $('#cancelRequestFrm input[name=chgReason]').val(reasonCd);
- }
- // 환불예상금액계산
- var fnCalculateRefundAmt = function (obj) {
-
- // 2021.05.25 수정
- var ordDtlNoArr = [];
- var cnclRtnReqQtyArr = [];
-
- // 1. 반품신청수량 체크
- for (i=0 ; i<orderWithdrawList.length ; i++) {
- if (orderWithdrawList[i].chgQty > 0) {
- // 반품신청값설정
- ordDtlNoArr.push(orderWithdrawList[i].ordDtlNo);
- cnclRtnReqQtyArr.push(orderWithdrawList[i].chgQty);
- }
- }
-
- // 2. 추가정보설정
- var chgerNm = orderInfoList[0].ordNm;
- var chgerEmail = orderInfoList[0].ordEmail;
- var chgerPhnno = orderInfoList[0].ordPhnno;
- var chgerTelno = orderInfoList[0].ordTelno;
- var custNo = orderInfoList[0].custNo;
- var delvFeeCd = orderInfoList[0].delvFeeCd;
-
- // 환불금액계산호출
- var jsonObj = {
- "ordNo" : ordNo
- ,"ordDtlNoArr" : ordDtlNoArr
- ,"cnclRtnReqQtyArr" : cnclRtnReqQtyArr
- ,"isCustomer" : isCustomer
- ,"chgerNm" : chgerNm
- ,"chgerEmail" : chgerEmail
- ,"chgerPhnno" : chgerPhnno
- ,"custNo" : custNo
- ,"ordNm" : chgerNm
- ,"ordPhnno" : chgerPhnno
- ,"delvFeeCd" : delvFeeCd
- }
-
- var jsonData = JSON.stringify(jsonObj);
-
- gagajf.ajaxJsonSubmit(
- '/orderChange/cancel/refundAmt'
- , jsonData
- , function(result) {
- // 2021.12.01 취소금액설정
- if (result.cancelOrderRefundList != null && result.cancelOrderRefundList.length > 0) {
- for (i=0 ; i<result.cancelOrderRefundList.length ; i++) {
- for (j=0 ; j<orderWithdrawList.length ; j++) {
- if (result.cancelOrderRefundList[i].ordDtlNo == orderWithdrawList[j].ordDtlNo) {
- orderWithdrawList[j].cnclRtnAmt = result.cancelOrderRefundList[i].cnclRtnAmt; // 취소금액
- orderWithdrawList[j].cpn1DcAmt = result.cancelOrderRefundList[i].cpn1DcAmt; // 즉시할인쿠폰금액
- orderWithdrawList[j].tmtb1DcAmt = result.cancelOrderRefundList[i].tmtb1DcAmt; // 수량할인다다익선금액
- orderWithdrawList[j].tmtb2DcAmt = result.cancelOrderRefundList[i].tmtb2DcAmt; // 금액할인다다익선금액
- orderWithdrawList[j].goodsCpnDcAmt = result.cancelOrderRefundList[i].goodsCpnDcAmt; // 상품쿠폰금액
- orderWithdrawList[j].cartCpnDcAmt = result.cancelOrderRefundList[i].cartCpnDcAmt; // 장바구니쿠폰금액
- orderWithdrawList[j].pntDcAmt = result.cancelOrderRefundList[i].pntDcAmt; // 포인트금액
- orderWithdrawList[j].prePntDcAmt = result.cancelOrderRefundList[i].prePntDcAmt; // 선포인트금액
- orderWithdrawList[j].gfcdUseAmt = result.cancelOrderRefundList[i].gfcdUseAmt; // 상품권적용금액
- orderWithdrawList[j].realOrdAmt = result.cancelOrderRefundList[i].realOrdAmt; // 실결제금액
- }
- }
- }
-
- // 주문변경대상정보 재설정
- gridOptionsWidthdrawList.api.setRowData(orderWithdrawList);
- }
- }
- );
- }
- $(document).ready(function() {
- // 1. 그리드생성
- gagaAgGrid.createGrid('gridOrderWithdrawList', gridOptionsWidthdrawList);
- gridOptionsWidthdrawList.api.setRowData(orderWithdrawList);
-
- // 2. TOTAL ROWS 없애기
- gagaAgGrid.hideStatusBar('gridOrderWithdrawList');
-
- // 사유체크실행
- fnChangeChgReason(chgReason);
-
- // 2021.12.10 취소금액계산
- fnCalculateRefundAmt(null);
- });
- // 회수컨펌버튼
- $("#widthdrawConfirmBtn").on("click", function(){
-
- // 1. 취소사유 체크
- var chgReason = $("#cancelRequestFrm select[name=selectChgReason]").val();
- if (gagajf.isNull(chgReason)) {
- mcxDialog.alert("취소사유를 입력하세요.");
- return ;
- }
-
- // 변경신청목록
- var withdrawConfirmList = [];
-
- for (i=0 ; i<orderWithdrawList.length ; i++) {
- var obj = new Object();
- obj.ordChgSq = orderWithdrawList[i].ordChgSq;
- obj.ordNo = orderWithdrawList[i].ordNo;
- obj.ordDtlNo = orderWithdrawList[i].ordDtlNo;
- obj.whMemo = orderWithdrawList[i].whMemo;
- obj.supplyCompCd = orderWithdrawList[i].supplyCompCd;
- obj.ordNm = orderWithdrawList[i].ordNm;
- obj.ordPhnno = orderWithdrawList[i].ordPhnno;
- obj.chgQty = orderWithdrawList[i].chgQty;
- obj.exchangeOrdDtlNo = orderWithdrawList[i].exchangeOrdDtlNo;
-
- withdrawConfirmList.push(obj);
- }
-
- // 2. 데이타적재
- var jsonObj = {
- "ordNo" : $('#cancelRequestFrm input[name=ordNo]').val()
- ,"ordChgSq" : $('#cancelRequestFrm input[name=ordChgSq]').val()
- ,"chgReason" : $('#cancelRequestFrm input[name=chgReason]').val()
- ,"chgGb" : chgGb
- ,"chgMemo" : $('#chgMemo').val()
- ,"isCustomer" : isCustomer
- ,"withdrawConfirmList" : withdrawConfirmList
- }
-
- // 주문번호, 취소사유, 취소메모, (취소, 반품, 교환 신청 정보 목록), 환불계좌
- var jsonData = JSON.stringify(jsonObj);
-
- mcxDialog.confirm('회수컨펌을 진행 하시겠습니까?', {
- cancelBtnText : "취소",
- sureBtnClick : function(){
- gagajf.ajaxJsonSubmit(
- "/orderChange/seller/widthdraw/confirm/update"
- , jsonData
- , function() {
- uifnPopupClose('popupReturnRequestForm');
- fnSearch();
- }
- );
- }
- });
- });
- </script>
- </html>
|