ExchangeRequestForm.html 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612
  1. <!DOCTYPE html>
  2. <html lang="ko" xmlns:th="http://www.thymeleaf.org">
  3. <!--
  4. *******************************************************************************
  5. * @source : ExchangeRequestForm.html
  6. * @desc : 교환요청 화면
  7. *============================================================================
  8. * STYLE24
  9. * Copyright(C) 2021 TSIT, All rights reserved.
  10. *============================================================================
  11. * VER DATE AUTHOR DESCRIPTION
  12. * === =========== ========== =============================================
  13. * 1.0 2021.01.15 card007 최초 작성
  14. *******************************************************************************
  15. -->
  16. <div class="modalPopup" data-width="1400" data-height="600">
  17. <div class="panelStyle">
  18. <div class="panelTitle">
  19. <h2>교환요청</h2>
  20. <button type="button" class="close" onclick="uifnPopupClose('popupExchangeRequestForm');"><i class="fa fa-times"></i></button>
  21. </div>
  22. <div class="panelContent" style="height:90%; overflow-y:auto; padding:0px 20px !important; ">
  23. <form id="exchangeRequestFrm" name="exchangeRequestFrm" action="/orderChange/exchange" method="post" target="hdFrameForOrderExchange">
  24. <input type="hidden" name="ordNo" th:value="${ordNo}"/>
  25. <input type="hidden" name="chgReason" value=""/>
  26. <input type="hidden" name="chgReasonDesc" value=""/>
  27. <h4>주문정보</h4>
  28. <div id="gridOrderCancelRequestList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
  29. <div id="delvCdList">
  30. <h4>배송정보</h4>
  31. <div id="gridDelvCdList" style="width:100%; height: 66px;" class="ag-theme-balham"></div>
  32. </div>
  33. <div style="text-align:right; padding-bottom:5px; padding-top:5px;">
  34. <button type="button" class="btn btn-success" th:unless="${ordChgSq > 0}" id="fnExchangeRequestSubmit" onclick="fnExchange()">교환요청</button>
  35. <!-- 2021.07.22 선발송 처리 시 교환철회 불가 처리 -->
  36. <th:block th:if="${wdBfSendYn == 'N'}">
  37. <!-- 2021.07.22 택배사 회수 불가 시 회수요청상태에서 교환철회 처리 -->
  38. <!-- 2021.10.01 card007 CS 요청으로 상품검수중까지 교환철회 오픈 처리 -->
  39. <!-- <button type="button" class="btn btn-success" th:if="${chgStat == 'G685_20' or chgStat == 'G685_21' or (recallExceptionInfo != null and (chgStat == 'G685_30' or chgStat == 'G685_31'))}" id="fnExchangeCancelRequestSubmit" onclick="fnExchangeCancel()">교환철회</button> -->
  40. <!-- <button type="button" class="btn btn-success" th:if="${chgStat == 'G685_20' or chgStat == 'G685_21' or chgStat == 'G685_22' or (chgStat == 'G685_30' and (canRequestCancelYn == 'Y' or recallExceptionInfo != null)) or (chgStat == 'G685_31' and recallExceptionInfo != null)}" id="fnExchangeCancelRequestSubmit" onclick="fnExchangeCancel()">교환철회</button> -->
  41. <button type="button" class="btn btn-success" th:if="${chgStat == 'G685_20' or chgStat == 'G685_21' or chgStat == 'G685_22' or chgStat == 'G685_30' or chgStat == 'G685_31'}" id="fnExchangeCancelRequestSubmit" onclick="fnExchangeCancel()">교환철회</button>
  42. </th:block>
  43. <th:block th:if="${ordChgSq > 0 and (ordChgGb == 'G681_20' or ordChgGb == 'G681_40')}">
  44. <!-- 선발송 처리 시 교TO교 접수 불가 처리 -->
  45. <button type="button" class="btn btn-success" th:unless="${ordChgGb == 'G681_20' and wdBfSendYn == 'Y'}" id="fnReturnToExchangeSubmit" onclick="fnExchange()">교환변경</button>
  46. </th:block>
  47. <th:block th:if="${ordChgSq > 0 and chgStat == 'G685_22'}">
  48. <!-- 네이버페이 주문형 교환승인 버튼 -->
  49. <button type="button" class="btn btn-success" id="fnExchangeApprovalSubmit" onclick="fnExchange()">교환승인</button>
  50. </th:block>
  51. <th:block th:if="${ordChgSq > 0 and chgStat != 'G685_40'}">
  52. <!-- 네이버페이 주문형 교환보류 버튼 -->
  53. <button type="button" class="btn btn-success" id="fnExchangeHold" npayChangeHoldYn="N" onclick="fnNpayExchangeHold(this)">교환보류</button>
  54. <button type="button" class="btn btn-success" id="fnReleaseExchangeHold" npayChangeHoldYn="Y" onclick="fnNpayExchangeHold(this)">교환보류해제</button>
  55. </th:block>
  56. </div>
  57. <table class="frmStyle">
  58. <colgroup>
  59. <col style="width:160px;" />
  60. <col style="width:320px;" />
  61. <col style="width:160px;" />
  62. <col style="width:320px;" />
  63. <col style="width:160px;" />
  64. <col />
  65. </colgroup>
  66. <tbody>
  67. <tr>
  68. <th>교환사유 <i class="star"></i></th>
  69. <td th:if="${ordChgSq <= 0 or ordChgGb == 'G681_40'}">
  70. <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
  71. <option value="">[선택하세요]</option>
  72. <option th:if="${chgReasonList}" th:each="oneData, status : ${chgReasonList}" th:value="|${oneData.cd}:${oneData.cdNm}|" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
  73. </select>
  74. </td>
  75. <td th:if="${ordChgSq > 0 and ordChgGb != 'G681_40'}" th:id="chgReason"></td>
  76. <th>귀책사유</th>
  77. <td><span id="imputeReason"></span></td>
  78. <th>선발송</th>
  79. <td>
  80. <label class="chkBox">
  81. <input type="checkbox" name="wdBfSendYn" id="wdBfSendYn" disabled="disabled"/>
  82. </label>
  83. </td>
  84. </tr>
  85. <tr>
  86. <th>회수방법</th>
  87. <td>
  88. <label class="rdoBtn"><input type="radio" name="wdGb" th:id="wdGb" value="W" onclick="fnChangeWdGb(this)"/>회수요청<span></span></label>
  89. <label class="rdoBtn"><input type="radio" name="wdGb" th:id="wdGb" value="D" onclick="fnChangeWdGb(this)"/>직접발송<span></span></label>
  90. </td>
  91. <th>추가배송비</th>
  92. <td id="addDelvFee"></td>
  93. <th>알림톡미전송여부</th>
  94. <td>
  95. <label class="chkBox">
  96. <input type="checkbox" name="msgStat" id="msgStat" checked/>
  97. </label>
  98. </td>
  99. </tr>
  100. <tr>
  101. <th>요청메모<br/><span id="chgMemoCount">0</span>/1,000Byte</th>
  102. <td colspan="5">
  103. <textarea id="chgMemo" name="chgMemo" style="height:80px;" onkeyup="cfnGetTextLength(this, 1000, $('#chgMemoCount'));"></textarea>
  104. </td>
  105. </tr>
  106. </tbody>
  107. </table>
  108. <h4 class="chger">회수지 정보</h4>
  109. <button style="float: right" type="button" class="btn btn-success chger" id="chgerButton" onclick="fnChangeChgerInfo();">회수지 수정</button>
  110. <!-- <button style="float: right" type="button" class="btn btn-success chger" id="chgerButton" th:if="${(#strings.isEmpty(ordChgGb) or ordChgGb == 'G681_50') and ordChgSq > 0 and wdGb == 'W' and (chgStat == 'G685_20' or chgStat == 'G685_21')}" onclick="fnChangeChgerInfo();">회수지 수정</button>-->
  111. <table class="frmStyle chger">
  112. <colgroup>
  113. <col style="width:160px;" />
  114. <col style="width:320px;" />
  115. <col style="width:160px;" />
  116. <col />
  117. </colgroup>
  118. <tbody>
  119. <tr>
  120. <th>보내는사람 <i class="star"></i></th>
  121. <td colspan="3"><input type="text" name ="chgerNm" class=""/></td>
  122. </tr>
  123. <tr>
  124. <th>회수지주소 <i class="star"></i></th>
  125. <td colspan="3">
  126. <input type="text" name ="chgerZipcode" class="w100" readonly="readonly"/>
  127. <!-- <button type="button" class="btn btn-info" th:if="${#strings.isEmpty(ordChgGb) and (ordChgSq == 0 or chgStat == 'G685_20' or chgStat == 'G685_21')}" onclick="fnOpenDaumAddr('withdraw');">우편번호찾기</button>-->
  128. <button type="button" class="btn btn-info" id="chgerFindAddr" onclick="fnOpenDaumAddr('withdraw');">우편번호찾기</button>
  129. <input type="text" name ="chgerBaseAddr" class="w300" readonly="readonly"/>
  130. <input type="text" name ="chgerDtlAddr" class="w300"/>
  131. </td>
  132. </tr>
  133. <tr>
  134. <th>일반전화</th>
  135. <td>
  136. <select name="chgerTelno1" class="w100">
  137. <option value="">[선택하세요]</option>
  138. <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  139. </select>
  140. - <input type="text" name ="chgerTelno2" class="w60"/>
  141. - <input type="text" name ="chgerTelno3" class="w60"/>
  142. </td>
  143. <th>휴대전화 <i class="star"></i></th>
  144. <td>
  145. <select name="chgerPhnno1" class="w100">
  146. <option value="">[선택하세요]</option>
  147. <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  148. </select>
  149. - <input type="text" name ="chgerPhnno2" class="w60"/>
  150. - <input type="text" name ="chgerPhnno3" class="w60"/>
  151. </td>
  152. </tr>
  153. <tr>
  154. <th>반품메모<br/><span id="chgerRtnMemoCount">0</span>/1,000Byte</th>
  155. <td colspan="3">
  156. <textarea id="chgerRtnMemo" name="chgerRtnMemo" style="height:80px;" onkeyup="cfnGetTextLength(this, 1000, $('#chgerRtnMemoCount'));"></textarea>
  157. </td>
  158. </tr>
  159. </tbody>
  160. </table>
  161. <h4>교환지 정보</h4>
  162. <button style="float: right" type="button" class="btn btn-success" id="recipButton" onclick="fnChangeRecipInfo();">교환지 수정</button>
  163. <!-- <button style="float: right" type="button" class="btn btn-success" th:unless="${ordChgSq == 0 or ordChgGb == 'G681_20' or (chgStat == 'G685_40' and (chgOrdDtlStat != 'G013_20' or chgOrdDtlStat != 'G013_30' or chgOrdDtlStat != 'G013_35'))}" onclick="fnChangeRecipInfo();">교환지 수정</button>-->
  164. <table class="frmStyle">
  165. <colgroup>
  166. <col style="width:160px;" />
  167. <col style="width:320px;" />
  168. <col style="width:160px;" />
  169. <col />
  170. </colgroup>
  171. <tbody>
  172. <tr>
  173. <th>받는사람 <i class="star"></i></th>
  174. <td colspan="3"><input type="text" name ="recipNm" class=""/></td>
  175. </tr>
  176. <tr>
  177. <th>교환지주소 <i class="star"></i></th>
  178. <td colspan="3">
  179. <input type="text" name ="recipZipcode" class="w100" readonly="readonly"/>
  180. <!-- <button type="button" class="btn btn-info" th:unless="${ordChgGb == 'G681_20' or (chgStat == 'G685_40' and (chgOrdDtlStat != 'G013_20' or chgOrdDtlStat != 'G013_30' or chgOrdDtlStat != 'G013_35')) or chgStat == 'G685_22'}" onclick="fnOpenDaumAddr('exchange');">우편번호찾기</button>-->
  181. <button type="button" class="btn btn-info" id="recipFindAddr" onclick="fnOpenDaumAddr('exchange');">우편번호찾기</button>
  182. <input type="text" name ="recipBaseAddr" class="w300" readonly="readonly"/>
  183. <input type="text" name ="recipDtlAddr" class="w300"/>
  184. </td>
  185. </tr>
  186. <tr>
  187. <th>일반전화</th>
  188. <td>
  189. <select name="recipTelno1" class="w100">
  190. <option value="">[선택하세요]</option>
  191. <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  192. </select>
  193. - <input type="text" name ="recipTelno2" class="w60"/>
  194. - <input type="text" name ="recipTelno3" class="w60"/>
  195. </td>
  196. <th>휴대전화 <i class="star"></i></th>
  197. <td>
  198. <select name="recipPhnno1" class="w100">
  199. <option value="">[선택하세요]</option>
  200. <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  201. </select>
  202. - <input type="text" name ="recipPhnno2" class="w60"/>
  203. - <input type="text" name ="recipPhnno3" class="w60"/>
  204. </td>
  205. </tr>
  206. <tr>
  207. <th>배송메모<br/><span id="delvMemoCount">0</span>/1,000Byte</th>
  208. <td colspan="3">
  209. <textarea id="delvMemo" name="delvMemo" style="height:80px;" onkeyup="cfnGetTextLength(this, 1000, $('#delvMemoCount'));"></textarea>
  210. </td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <h4>접수자 정보</h4>
  215. <table class="frmStyle">
  216. <colgroup>
  217. <col style="width:15%;" />
  218. <col style="width:35%;" />
  219. <col style="width:15%;" />
  220. <col />
  221. </colgroup>
  222. <tbody>
  223. <tr>
  224. <th>접수자</th>
  225. <td id="exchCompleteRegNm"></td>
  226. <th>최종수정자</th>
  227. <td id="exchCompleteUpdNm"></td>
  228. </tr>
  229. </tbody>
  230. </table>
  231. </form>
  232. </div>
  233. </div>
  234. </div>
  235. <!-- data -->
  236. <script th:inline="javascript">
  237. /*<![CDATA[*/
  238. var cancelRequestTargetList = [[${cancelRequestTargetList}]]; // 교환대상목록
  239. var ordNo = [[${ordNo}]]; // 주문번호
  240. var ordChgSq = [[${ordChgSq}]]; // 주문변경번호
  241. var chgStat = [[${chgStat}]]; // 변경상태
  242. var orderInfoList = [[${orderInfoList}]]; // 주문기본정보
  243. var payMeans = orderInfoList[0].payMeans; // 결제수단
  244. var pgGb = orderInfoList[0].pgGb; // PG구분
  245. var orderDelvAddrInfo = [[${orderDelvAddrInfo}]]; // 회수지정보
  246. var recallExceptionInfo = [[${recallExceptionInfo}]]; // 회수 예외 정보
  247. var rtnLocInfo = [[${rtnLocInfo}]]; // 반송지주소정보
  248. var addPayCost = 0; // 추가배송비
  249. var addDelvFee = 0; // 추가배송비
  250. var exchangeRequestList = []; // 교환요청목록
  251. var exchangeInfoList; // 교환정보
  252. var wdGb; // 회수방법
  253. var ordChgGb = [[${ordChgGb}]]; // 변경요청변경구분
  254. var orderChangeDetailList; // 취소/반품/교환요청 정보
  255. var chgOrdDtlStat; // 교환상품상세상태값
  256. var delvAddrSq; // 교환상품배송지일련번호
  257. var npayChangeHoldYn = ''; // 네이버페이 주문형 반품/교환 보류 여부
  258. var selfGoodsYn = cancelRequestTargetList[0].selfGoodsYn; // 자사,입점여부
  259. var wdBfSendYn = "";
  260. var canDeliveryCancelYn = "";
  261. var temp1 = true;
  262. var temp2 = true;
  263. // 변경요청정보 승인, 철회
  264. if (ordChgSq > 0) {
  265. orderChangeDetailList = [[${orderChangeDetailList}]]; // 취소/반품/교환요청 정보
  266. exchangeInfoList = [[${exchangeInfoList}]]; // 교환정보
  267. npayChangeHoldYn = orderChangeDetailList[0].npayChangeHoldYn; // 네이버페이 주문형 반품/교환 보류 여부
  268. if (ordChgGb == 'G681_40') {
  269. chgReason = orderChangeDetailList[0].chgReason; // 변경사유코드
  270. chgReasonNm = orderChangeDetailList[0].chgReasonNm; // 변경사유코드명
  271. chgMemo = orderChangeDetailList[0].chgMemo; // 변경사유메모
  272. wdGb = orderChangeDetailList[0].wdGb; // 회수방법
  273. chgOrdDtlStat = ''; // 교환상품상세상태값
  274. delvAddrSq = ''; // 교환상품배송지일련번호
  275. } else {
  276. chgReason = exchangeInfoList[0].chgReason; // 변경사유코드
  277. chgReasonNm = exchangeInfoList[0].chgReasonNm; // 변경사유코드명
  278. chgMemo = exchangeInfoList[0].chgMemo; // 변경사유메모
  279. wdGb = exchangeInfoList[0].wdGb; // 회수방법
  280. chgOrdDtlStat = exchangeInfoList[0].ordDtlStat; // 교환상품상세상태값
  281. delvAddrSq = exchangeInfoList[0].delvAddrSq; // 교환상품배송지일련번호
  282. addPayCost = exchangeInfoList[0].addPayCost; // 추가배송비
  283. }
  284. wdBfSendYn = orderChangeDetailList[0].wdBfSendYn; // 선발송여부
  285. canDeliveryCancelYn = [[${canDeliveryCancelYn}]];
  286. }
  287. // 1. 주문정보(교환대상)
  288. var columnExchangeReqList = [
  289. {
  290. headerName : "주문상세정보",
  291. children : [
  292. {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
  293. {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
  294. {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
  295. {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
  296. {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center'},
  297. {headerName: "상품명" , field: "goodsNm" , width: 130 , cellClass: 'text-center'},
  298. {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
  299. ]
  300. },
  301. {
  302. headerName : "주문상세단품정보",
  303. children : [
  304. {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
  305. {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center'},
  306. {headerName: "SKUCODE" , field: "optCd" , width: 100 , cellClass: 'text-center'},
  307. {headerName: "단품명" , field: "itemNm" , width: 130 , cellClass: 'text-center'},
  308. {headerName: "옵션1" , field: "optCd1" , width: 60 , cellClass: 'text-center'},
  309. {headerName: "옵션2" , field: "optCd2" , width: 60 , cellClass: 'text-center'},
  310. {
  311. headerName : "단품수량"
  312. , field : "itemQty"
  313. , width : 60
  314. , cellClass : 'text-center'
  315. , cellRenderer : function (params) {
  316. return params.value.addComma();
  317. }
  318. },
  319. {
  320. headerName : "단품금액"
  321. , field : "itemPrice"
  322. , width : 80
  323. , cellClass : 'text-right'
  324. , cellRenderer : function (params) {
  325. return params.value.addComma();
  326. }
  327. },
  328. {
  329. headerName : "단품옵션금액"
  330. , field : "optAddPrice"
  331. , width : 90
  332. , cellClass : 'text-right'
  333. , cellRenderer : function (params) {
  334. return params.value.addComma();
  335. }
  336. }
  337. ]
  338. },
  339. {
  340. headerName : "주문상세수량",
  341. children : [
  342. {
  343. headerName : "주문"
  344. , field : "ordQty"
  345. , width : 70
  346. , cellClass : 'text-center'
  347. , cellRenderer : function (params) {
  348. return params.value.addComma();
  349. }
  350. },
  351. {
  352. headerName : "취소/요청"
  353. , field : "cnclRtnQty"
  354. , width : 70
  355. , cellClass : 'text-center'
  356. , cellRenderer : function (params) {
  357. var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
  358. return cnclRtnReqQty;
  359. }
  360. , hide : temp1
  361. },
  362. {headerName: "교환가능옵션" , field: "optCd2s" , width: 200 , cellClass: 'text-center', hide: temp2},
  363. {
  364. headerName : "교환옵션"
  365. , field : "ordChgOpt"
  366. , width : 100
  367. , cellClass : "text-center"
  368. , cellRenderer : function (params) {
  369. if (ordChgSq > 0 && ordChgGb != 'G681_40' && chgStat != 'G685_22') {
  370. $.each(exchangeInfoList, function(idx, item) {
  371. if (params.data.itemCd == item.itemCd && params.data.optCd1 == item.optCd1) {
  372. strVal = item.optCd2;
  373. }
  374. });
  375. } else {
  376. var optCd2Arr = params.data.optCd2s.split(',');
  377. var optCdArr = params.data.optCds.split(',');
  378. var ordChgOpt = params.data.ordChgOpt;
  379. var ordQty = parseInt(params.data.ordQty);
  380. var cnclRtnQty = parseInt(params.data.cnclRtnQty);
  381. var ordReqChgQty = parseInt(params.data.ordReqChgQty);
  382. var ordCanChgQty = ordQty - (cnclRtnQty + ordReqChgQty);
  383. if (ordChgGb == 'G681_40' || chgStat == 'G685_22') {
  384. ordCanChgQty = params.data.chgQty;
  385. }
  386. var strVal = '';
  387. if (ordCanChgQty == 0) {
  388. strVal += '<select class="ordChgOpt" name="ordChgOpt" ordDtlNo="' + params.data.ordDtlNo + '" ordDtlItemSq="' + params.data.ordDtlItemSq + '" onchange="fnChangeOption(this)" disabled="disabled">';
  389. } else {
  390. strVal += '<select class="ordChgOpt" name="ordChgOpt" ordDtlNo="' + params.data.ordDtlNo + '" ordDtlItemSq="' + params.data.ordDtlItemSq + '" onchange="fnChangeOption(this)">';
  391. }
  392. if (gagajf.isNull(ordChgOpt)) {
  393. strVal += '<option value="">선택</option>';
  394. } else {
  395. strVal += '<option value="" selected>선택</option>';
  396. }
  397. $.each(optCdArr, function (idx, item) {
  398. // 2021.07.26 교환옵션 optCd2 -> optCd로 변경 처리
  399. if (ordChgOpt == item) {
  400. //strVal += '<option value="' + item + '" selected>' + item + '</option>';
  401. strVal += '<option value="' + item + '/' + optCd2Arr[idx] + '" selected>' + optCd2Arr[idx] + '</option>';
  402. } else {
  403. //strVal += '<option value="' + item + '">' + item + '</option>';
  404. strVal += '<option value="' + item + '/' + optCd2Arr[idx] + '">' + optCd2Arr[idx] + '</option>';
  405. }
  406. });
  407. }
  408. return strVal;
  409. }
  410. },
  411. {headerName: "재고수량" , field: "currStockQty" , width: 100 , cellClass: 'text-center', hide: temp2},
  412. {
  413. headerName : "교환신청수량"
  414. , field : "chgQty"
  415. , width : 100
  416. , cellClass : 'text-center'
  417. , cellRenderer : function (params) {
  418. if (ordChgSq > 0) {
  419. // 반품TO교환, 교환TO교환
  420. if (ordChgGb == 'G681_40' || ordChgGb == 'G681_20') {
  421. strVal = params.data.chgQty;
  422. }
  423. // 교환상세
  424. else {
  425. $.each(exchangeInfoList, function (idx, item) {
  426. if (params.data.itemCd == item.itemCd && params.data.optCd1 == item.optCd1) {
  427. strVal = item.chgQty;
  428. }
  429. });
  430. }
  431. } else {
  432. var ordQty = parseInt(params.data.ordQty);
  433. var cnclRtnQty = parseInt(params.data.cnclRtnQty);
  434. var ordReqChgQty = parseInt(params.data.ordReqChgQty);
  435. var ordCanChgQty = ordQty - (cnclRtnQty + ordReqChgQty);
  436. //// 교환TO교환
  437. //if (ordChgGb == 'G681_20') {
  438. // ordCanChgQty = parseInt(params.data.ordCanChgQty);
  439. //}
  440. var strVal = "";
  441. if (ordCanChgQty == 0) {
  442. strVal += '<select class="ordCanChgQty ' + params.data.ordDtlNo + '" name="chgQty" ordDtlNo="' + params.data.ordDtlNo + '" onchange="fnChangeQty(this)" disabled="disabled">';
  443. } else {
  444. strVal += '<select class="ordCanChgQty ' + params.data.ordDtlNo + '" name="chgQty" ordDtlNo="' + params.data.ordDtlNo + '" onchange="fnChangeQty(this)">';
  445. }
  446. for (i = 0; i <= ordCanChgQty; i++) {
  447. if (i == params.data.chgQty) {
  448. strVal += " <option value='" + i + "' selected>" + i + "</option>";
  449. } else {
  450. strVal += " <option value='" + i + "'>" + i + "</option>";
  451. }
  452. }
  453. strVal += "</select>";
  454. }
  455. return strVal;
  456. }
  457. }
  458. ]
  459. },
  460. {
  461. headerName : "주문단품금액",
  462. children : [
  463. {
  464. headerName : "주문"
  465. , field : "ordAmt"
  466. , width : 80
  467. , cellClass : 'text-right'
  468. , cellRenderer : function (params) {
  469. return params.value.addComma();
  470. }
  471. },
  472. {
  473. headerName : "취소"
  474. , field : "cnclRtnAmt"
  475. , width : 80
  476. , cellClass : 'text-right'
  477. , cellRenderer : function (params) {
  478. return params.value.addComma();
  479. }
  480. },
  481. {
  482. headerName : "즉시할인"
  483. , field : "cpn1DcAmt"
  484. , width : 80
  485. , cellClass : 'text-right'
  486. , cellRenderer : function (params) {
  487. return params.value.addComma();
  488. }
  489. },
  490. {
  491. headerName : "다다익선1"
  492. , field : "tmtb1DcAmt"
  493. , width : 80
  494. , cellClass : 'text-right'
  495. , cellRenderer : function (params) {
  496. return params.value.addComma();
  497. }
  498. },
  499. {
  500. headerName : "다다익선2"
  501. , field : "tmtb2DcAmt"
  502. , width : 80
  503. , cellClass : 'text-right'
  504. , cellRenderer : function (params) {
  505. return params.value.addComma();
  506. }
  507. },
  508. {
  509. headerName : "상품쿠폰"
  510. , field : "goodsCpnDcAmt"
  511. , width : 80
  512. , cellClass : 'text-right'
  513. , cellRenderer : function (params) {
  514. return params.value.addComma();
  515. }
  516. },
  517. {
  518. headerName : "장바구니쿠폰"
  519. , field : "cartCpnDcAmt"
  520. , width : 80
  521. , cellClass : 'text-right'
  522. , cellRenderer : function (params) {
  523. return params.value.addComma();
  524. }
  525. },
  526. {
  527. headerName : "포인트"
  528. , field : "pntDcAmt"
  529. , width : 80
  530. , cellClass : 'text-right'
  531. , cellRenderer : function (params) {
  532. return params.value.addComma();
  533. }
  534. },
  535. {
  536. headerName : "선포인트"
  537. , field : "prePntDcAmt"
  538. , width : 80
  539. , cellClass : 'text-right'
  540. , cellRenderer : function (params) {
  541. return params.value.addComma();
  542. }
  543. },
  544. {
  545. headerName : "상품권"
  546. , field : "gfcdUseAmt"
  547. , width : 80
  548. , cellClass : 'text-right'
  549. , cellRenderer : function (params) {
  550. return params.value.addComma();
  551. }
  552. },
  553. {
  554. headerName : "실결제금액"
  555. , field : "realOrdAmt"
  556. , width : 80
  557. , cellClass : 'text-right'
  558. , cellRenderer : function (params) {
  559. return params.value.addComma();
  560. }
  561. }
  562. ]
  563. },
  564. {
  565. headerName : "주문배송비정보",
  566. children : [
  567. {
  568. headerName : "배송비"
  569. , field : "delvFee"
  570. , width : 80
  571. , cellClass : 'text-right'
  572. , cellRenderer : function (params) {
  573. return params.value.addComma();
  574. }
  575. , hide : temp2
  576. },
  577. {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  578. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  579. {
  580. headerName : "무료배송비"
  581. , field : "minOrdAmt"
  582. , width : 80
  583. , cellClass : 'text-right'
  584. , cellRenderer : function (params) {
  585. if (params.data.delvFeeCrite == 'G078_30') {
  586. return 0;
  587. } else {
  588. return params.value.addComma();
  589. }
  590. }
  591. , hide : temp2
  592. },
  593. {
  594. headerName : "기본배송비"
  595. , field : "orgDelvFee"
  596. , width : 80
  597. , cellClass : 'text-right'
  598. , cellRenderer : function (params) {
  599. return params.value.addComma();
  600. }
  601. , hide : temp2
  602. },
  603. {
  604. headerName : "반품배송비"
  605. , field : "rtnDelvFee"
  606. , width : 80
  607. , cellClass : 'text-right'
  608. , cellRenderer : function (params) {
  609. return params.value.addComma();
  610. }
  611. , hide : temp2
  612. },
  613. {
  614. headerName : "교환배송비"
  615. , field : "excDelvFee"
  616. , width : 80
  617. , cellClass : 'text-right'
  618. , cellRenderer : function (params) {
  619. return params.value.addComma();
  620. }
  621. , hide : temp2
  622. },
  623. {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
  624. ]
  625. }
  626. ];
  627. var gridOptionsExchangeReqList = gagaAgGrid.getGridOptions(columnExchangeReqList);
  628. // Add on options
  629. gridOptionsExchangeReqList.suppressRowClickSelection = true;
  630. gridOptionsExchangeReqList.rowSelection = 'multiple';
  631. // 3. 배송정보(환불정보)
  632. var columnDelvCdList = [
  633. {headerName: "업체" , field: "supplyCompNm" , width: 100 , cellClass: 'text-center'},
  634. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center'},
  635. {
  636. headerName : "추가배송비"
  637. , field : "addDelvFee"
  638. , width : 100
  639. , cellClass : 'text-right'
  640. , cellRenderer : function (params) {
  641. return params.value.addComma();
  642. }
  643. , hide : true
  644. },
  645. {headerName: "반품지명" , field: "rtnLocNm" , width: 100 , cellClass: 'text-center'},
  646. {headerName: "반품지전화번호" , field: "rtnLocTelno" , width: 100 , cellClass: 'text-center'},
  647. {headerName: "반품지우편번호" , field: "rtnLocZipcode" , width: 100 , cellClass: 'text-center'},
  648. {headerName: "반품지기본주소" , field: "rtnLocBaseAddr" , width: 300 , cellClass: 'text-center'},
  649. {headerName: "반품지상세주소" , field: "rtnLocDtlAddr" , width: 300 , cellClass: 'text-center'},
  650. ];
  651. var gridOptionsDelvCdList = gagaAgGrid.getGridOptions(columnDelvCdList);
  652. </script>
  653. <script>
  654. //현재 사유는 회사 입니다.
  655. var isCustomer = false;
  656. var exchangeChk = false;
  657. // 사유 변경
  658. var fnChangeChgReason = function(reasonCd){
  659. var arrReasonCd = reasonCd.split(":");
  660. var customerReasonArr = ['G689_10', 'G689_30', 'G688_10'];
  661. isCustomer = false;
  662. // 취소, 반품, 교환 사유 판단
  663. for (i=0 ; i<customerReasonArr.length ; i++) {
  664. if (customerReasonArr[i] == arrReasonCd[0]) {
  665. isCustomer = true;
  666. }
  667. }
  668. // 귀책사유설정 회사, 고객
  669. if (isCustomer) {
  670. $("#imputeReason").text("고객");
  671. if ($('#wdBfSendYn').is(':checked')) {
  672. $('#wdBfSendYn').prop('checked', false);
  673. }
  674. $('#wdBfSendYn').attr('disabled', true);
  675. } else {
  676. $("#imputeReason").text("회사");
  677. if (selfGoodsYn == 'Y' && (ordChgSq == null || ordChgSq <= 0)) {
  678. $('#wdBfSendYn').attr('disabled', false);
  679. }
  680. }
  681. $('#exchangeRequestFrm input[name=chgReason]').val(arrReasonCd[0]);
  682. $('#exchangeRequestFrm input[name=chgReasonDesc]').val(arrReasonCd[1]);
  683. // 추가배송비 설정
  684. fnChangeQty();
  685. }
  686. // 교환요청
  687. var fnExchange = function () {
  688. var qty = true;
  689. var opt = true;
  690. var wdGb = $('#wdGb:checked').val();
  691. // 교환신청 버튼 클릭 여부 체크
  692. if (exchangeChk) {
  693. return false;
  694. }
  695. if (ordChgGb == 'G681_50') {
  696. wdGb = 'D';
  697. }
  698. // 1. 교환수량 체크
  699. //$.each(cancelRequestTargetList, function(idx, item) {
  700. // if (item.chgQty > 0) {
  701. // qty = true;
  702. //
  703. // if (!gagajf.isNull(item.ordChgOpt)) {
  704. // opt = true;
  705. // }
  706. // }
  707. //});
  708. // 교환TO교환, 반품TO교환 신청 수량 설정
  709. if (ordChgGb == 'G681_20' || ordChgGb == 'G681_40') {
  710. exchangeRequestList = cancelRequestTargetList;
  711. //$.each(exchangeRequestList, function(idx, exchangeRequest) {
  712. // $.each(exchangeInfoList , function(idx2, exchangeInfo) {
  713. // if (exchangeRequest.itemCd == exchangeInfo.itemCd && exchangeRequest.optCd1 == exchangeInfo.optCd1) {
  714. // exchangeRequest.chgQty = exchangeInfo.chgQty;
  715. // }
  716. // });
  717. //});
  718. }
  719. $.each(exchangeRequestList, function(idx, item) {
  720. if (item.chgQty == null || item.chgQty == 0) {
  721. qty = false;
  722. }
  723. if (gagajf.isNull(item.ordChgOpt)) {
  724. opt = false;
  725. }
  726. });
  727. if (qty == false) {
  728. mcxDialog.alert('교환 할 수량을 입력하세요.');
  729. return;
  730. }
  731. if (opt == false) {
  732. mcxDialog.alert('교환옵션을 선택해주세요.');
  733. return;
  734. }
  735. // 2. 교환사유 체크
  736. var chgReason = $("#exchangeRequestFrm select[name=selectChgReason]").val();
  737. if (ordChgGb == 'G681_20' || chgStat == 'G685_22') {
  738. chgReason = $('#exchangeRequestFrm input[name=chgReason]').val();
  739. }
  740. //var chgReason = $('#exchangeRequestFrm input[name=chgReason]').val();
  741. if (gagajf.isNull(chgReason)) {
  742. mcxDialog.alert("교환사유를 입력하세요.");
  743. return;
  744. }
  745. // 5. 회수지정보설정
  746. var chgerNm = "";
  747. var chgerZipcode = "";
  748. var chgerBaseAddr = "";
  749. var chgerDtlAddr = "";
  750. var chgerPhnno1 = "";
  751. var chgerPhnno2 = "";
  752. var chgerPhnno3 = "";
  753. var chgerTelno1 = "";
  754. var chgerTelno2 = "";
  755. var chgerTelno3 = "";
  756. var chgerPhnno = "";
  757. var chgerTelno = "";
  758. var chgerEmail = "";
  759. var chgerRtnMemo = "";
  760. if (wdGb == 'W' && selfGoodsYn == 'Y') {
  761. chgerNm = $("#exchangeRequestFrm input[name=chgerNm]").val();
  762. chgerZipcode = $("#exchangeRequestFrm input[name=chgerZipcode]").val();
  763. chgerBaseAddr = $("#exchangeRequestFrm input[name=chgerBaseAddr]").val();
  764. chgerDtlAddr = $("#exchangeRequestFrm input[name=chgerDtlAddr]").val();
  765. chgerPhnno1 = $("#exchangeRequestFrm select[name=chgerPhnno1]").val();
  766. chgerPhnno2 = $("#exchangeRequestFrm input[name=chgerPhnno2]").val();
  767. chgerPhnno3 = $("#exchangeRequestFrm input[name=chgerPhnno3]").val();
  768. chgerTelno1 = $("#exchangeRequestFrm select[name=chgerTelno1]").val();
  769. chgerTelno2 = $("#exchangeRequestFrm input[name=chgerTelno2]").val();
  770. chgerTelno3 = $("#exchangeRequestFrm input[name=chgerTelno3]").val();
  771. chgerRtnMemo = $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val();
  772. if (gagajf.isNull(chgerZipcode)) {
  773. mcxDialog.alert("회수지주소를 입력하세요."); return;
  774. }
  775. if (gagajf.isNull(chgerBaseAddr)) {
  776. mcxDialog.alert("회수지주소를 입력하세요."); return;
  777. }
  778. if (gagajf.isNull(chgerDtlAddr)) {
  779. mcxDialog.alert("회수지주소를 입력하세요."); return;
  780. }
  781. if (gagajf.isNull(chgerPhnno1)) {
  782. mcxDialog.alert("휴대전화를 입력하세요."); return;
  783. }
  784. if (gagajf.isNull(chgerPhnno2)) {
  785. mcxDialog.alert("휴대전화를 입력하세요."); return;
  786. }
  787. if (gagajf.isNull(chgerPhnno3)) {
  788. mcxDialog.alert("휴대전화를 입력하세요."); return;
  789. }
  790. chgerPhnno = chgerPhnno1 + '-' + chgerPhnno2 + '-' + chgerPhnno3;
  791. chgerEmail = orderInfoList[0].ordEmail;
  792. if (gagajf.isNull(chgerTelno1) && gagajf.isNull(chgerTelno2) && gagajf.isNull(chgerTelno3)) {
  793. chgerTelno = '';
  794. } else {
  795. chgerTelno = chgerTelno1 + '-' + chgerTelno2 + '-' + chgerTelno3;
  796. }
  797. // 2021.11.09 card007 휴대폰번호 유효성검증 추가
  798. if (!gagajf.checkPhnno(chgerPhnno)) {
  799. mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
  800. return false;
  801. }
  802. }
  803. // 교환지정보 설정
  804. var recipNm = $("#exchangeRequestFrm input[name=recipNm]").val();
  805. var recipZipcode = $("#exchangeRequestFrm input[name=recipZipcode]").val();
  806. var recipBaseAddr = $("#exchangeRequestFrm input[name=recipBaseAddr]").val();
  807. var recipDtlAddr = $("#exchangeRequestFrm input[name=recipDtlAddr]").val();
  808. var recipPhnno1 = $("#exchangeRequestFrm select[name=recipPhnno1]").val();
  809. var recipPhnno2 = $("#exchangeRequestFrm input[name=recipPhnno2]").val();
  810. var recipPhnno3 = $("#exchangeRequestFrm input[name=recipPhnno3]").val();
  811. var recipTelno1 = $("#exchangeRequestFrm select[name=recipTelno1]").val();
  812. var recipTelno2 = $("#exchangeRequestFrm input[name=recipTelno2]").val();
  813. var recipTelno3 = $("#exchangeRequestFrm input[name=recipTelno3]").val();
  814. if (gagajf.isNull(recipZipcode)) {
  815. mcxDialog.alert("교환지주소를 입력하세요."); return;
  816. }
  817. if (gagajf.isNull(recipBaseAddr)) {
  818. mcxDialog.alert("교환지주소를 입력하세요."); return;
  819. }
  820. if (gagajf.isNull(recipDtlAddr)) {
  821. mcxDialog.alert("교환지주소를 입력하세요."); return;
  822. }
  823. if (gagajf.isNull(recipPhnno1)) {
  824. mcxDialog.alert("휴대전화를 입력하세요."); return;
  825. }
  826. if (gagajf.isNull(recipPhnno2)) {
  827. mcxDialog.alert("휴대전화를 입력하세요."); return;
  828. }
  829. if (gagajf.isNull(recipPhnno3)) {
  830. mcxDialog.alert("휴대전화를 입력하세요."); return;
  831. }
  832. var recipPhnno = recipPhnno1 + '-' + recipPhnno2 + '-' + recipPhnno3;
  833. var recipEmail = orderInfoList[0].ordEmail;
  834. var recipTelno;
  835. if (gagajf.isNull(recipTelno1) && gagajf.isNull(recipTelno2) && gagajf.isNull(recipTelno3)) {
  836. recipTelno = '';
  837. } else {
  838. recipTelno = recipTelno1 + '-' + recipTelno2 + '-' + recipTelno3;
  839. }
  840. // 2021.11.09 card007 휴대폰번호 유효성검증 추가
  841. if (!gagajf.checkPhnno(recipPhnno)) {
  842. mcxDialog.alert("교환배송지 휴대폰 번호가 유효하지 않습니다.");
  843. return false;
  844. }
  845. // 선발송 여부 설정
  846. let wdBfSendYn = $('#wdBfSendYn').is(':checked') ? 'Y' : 'N';
  847. var jsonObj = {
  848. "ordNo" : $('#exchangeRequestFrm input[name=ordNo]').val()
  849. ,"chgReason" : $('#exchangeRequestFrm input[name=chgReason]').val()
  850. ,"chgMemo" : $('#chgMemo').val()
  851. ,"cancelReqList" : exchangeRequestList
  852. ,"isCustomer" : isCustomer
  853. ,"wdGb" : wdGb
  854. ,"addPayCost" : addDelvFee
  855. ,"chgerNm" : chgerNm
  856. ,"chgerEmail" : chgerEmail
  857. ,"chgerZipcode" : chgerZipcode
  858. ,"chgerBaseAddr" : chgerBaseAddr
  859. ,"chgerDtlAddr" : chgerDtlAddr
  860. ,"chgerPhnno" : chgerPhnno
  861. ,"chgerTelno" : chgerTelno
  862. ,"chgerRtnMemo" : chgerRtnMemo
  863. ,"recipNm" : recipNm
  864. ,"recipEmail" : recipEmail
  865. ,"recipZipcode" : recipZipcode
  866. ,"recipBaseAddr" : recipBaseAddr
  867. ,"recipDtlAddr" : recipDtlAddr
  868. ,"recipPhnno" : recipPhnno
  869. ,"recipTelno" : recipTelno
  870. ,"delvMemo" : $("#exchangeRequestFrm textarea[name=delvMemo]").val()
  871. ,"ordChgSq" : ordChgSq
  872. ,"wdBfSendYn" : wdBfSendYn
  873. ,"ordChgGb" : ordChgGb
  874. ,"msgStat" : $('#msgStat').is(':checked') ? 'Y' : 'N'
  875. }
  876. // 주문번호, 교환사유, 교환메모, (취소, 반품, 교환 신청 정보 목록)
  877. var jsonData = JSON.stringify(jsonObj);
  878. // URL 설정
  879. var url;
  880. if (ordChgGb == 'G681_40') {
  881. url = '/orderChange/return/to/exchange/';
  882. } else if (ordChgGb == 'G681_20') {
  883. url = '/orderChange/exchange/to/exchange/';
  884. } else if (chgStat == 'G685_22') {
  885. url = '/orderChange/exchange/approval/';
  886. } else {
  887. url = '/orderChange/exchange/request/';
  888. }
  889. // 교환신청 버튼 클릭 여부 설정
  890. exchangeChk = true;
  891. mcxDialog.confirm('교환요청하시겠습니까?', {
  892. cancelBtnText : "취소",
  893. sureBtnClick : function(){
  894. // 교환 실행
  895. gagajf.ajaxJsonSubmit(
  896. url
  897. , jsonData
  898. , function() {
  899. if (chgStat == 'G685_22') {
  900. uifnPopupClose('popupExchangeRequestForm');
  901. fnSearchList();
  902. } else {
  903. uifnPopupClose('popupOrderDetail');
  904. fnReOpenOrderDetailPopup();
  905. uifnPopupClose('popupExchangeRequestForm');
  906. }
  907. }
  908. , function() {
  909. exchangeChk = false;
  910. }
  911. );
  912. }
  913. });
  914. }
  915. // 교환철회 처리
  916. var fnExchangeCancel = function() {
  917. let data = {};
  918. data.ordChgSq = ordChgSq;
  919. data.ordNo = ordNo;
  920. // 교환배송비 철회 가능여부 체크
  921. let message = '요청번호 [' + ordChgSq + '] 에 대한 요청철회 처리를 하시겠습니까?';
  922. if (canDeliveryCancelYn == 'N') {
  923. message = '교환배송비 [' + addPayCost.addComma() + '원] 취소불가로 PG점프 처리 됩니다. <br /> 요청번호 [' + ordChgSq + '] 에 대한 요청철회 처리를 하시겠습니까?';
  924. }
  925. let jsonData = JSON.stringify(data);
  926. mcxDialog.confirm(message, {
  927. cancelBtnText : "취소",
  928. sureBtnClick : function(){
  929. // 교환 실행
  930. gagajf.ajaxJsonSubmit(
  931. '/orderChange/exchangeCancelRequest/'
  932. , jsonData
  933. , function() {
  934. uifnPopupClose('popupOrderDetail');
  935. fnReOpenOrderDetailPopup();
  936. uifnPopupClose('popupExchangeRequestForm');
  937. }
  938. );
  939. }
  940. });
  941. }
  942. // 네이버페이 주문형 교환보류 버튼 클릭 이벤트
  943. var fnNpayExchangeHold = function(param) {
  944. let url = '/orderChange/nPay/order/exchange/hold';
  945. let npayChangeHoldYn = $(param).attr('npayChangeHoldYn');
  946. let data = {};
  947. data.cancelReqList = exchangeRequestList;
  948. data.npayChangeHoldYn = npayChangeHoldYn;
  949. data.ordChgSq = ordChgSq;
  950. let jsonData = JSON.stringify(data);
  951. gagajf.ajaxJsonSubmit(url, jsonData, function(result) {
  952. uifnPopupClose('popupOrderDetail');
  953. fnReOpenOrderDetailPopup();
  954. uifnPopupClose('popupExchangeRequestForm');
  955. });
  956. }
  957. // 우편번호 DAUM을 이용한 우편번호 팝업 레이어
  958. var fnOpenDaumAddr = function(loc) {
  959. let daumZip = new daum.Postcode({
  960. oncomplete: function(data) {
  961. // 우편번호와 주소 정보를 해당 필드에 넣는다.
  962. if (loc == 'withdraw') {
  963. $('#exchangeRequestFrm input[name=chgerZipcode]').val(data.zonecode);
  964. $('#exchangeRequestFrm input[name=chgerBaseAddr]').val(cfnGetDaumRoadAddr(data));
  965. $('#exchangeRequestFrm input[name=chgerDtlAddr]').focus();
  966. } else if (loc == 'exchange') {
  967. $('#exchangeRequestFrm input[name=recipZipcode]').val(data.zonecode);
  968. $('#exchangeRequestFrm input[name=recipBaseAddr]').val(cfnGetDaumRoadAddr(data));
  969. $('#exchangeRequestFrm input[name=recipDtlAddr]').focus();
  970. }
  971. cfnCloseDaumAddr();
  972. },
  973. width: '100%'
  974. });
  975. cfnOpenDaumAddr(daumZip);
  976. }
  977. // 회수지정보 설정
  978. var fnSetChger = function(){
  979. var data;
  980. if (ordChgSq > 0) {
  981. data = orderChangeDetailList[0];
  982. data.recipPhnno = data.chgerPhnno;
  983. data.recipTelno = data.chgerTelno;
  984. data.recipNm = data.chgerNm;
  985. data.recipZipcode = data.chgerZipcode;
  986. data.recipBaseAddr = data.chgerBaseAddr;
  987. data.recipDtlAddr = data.chgerDtlAddr;
  988. } else {
  989. data = orderDelvAddrInfo[0];
  990. }
  991. var spRecipPhnno = (data.recipPhnno != null) ? data.recipPhnno.split('-') : null;
  992. var spRecipTelno = (data.recipTelno != null) ? data.recipTelno.split('-') : null;
  993. $("#exchangeRequestFrm input[name=chgerNm]").val(data.recipNm);
  994. $("#exchangeRequestFrm input[name=chgerZipcode]").val(data.recipZipcode);
  995. $("#exchangeRequestFrm input[name=chgerBaseAddr]").val(data.recipBaseAddr);
  996. $("#exchangeRequestFrm input[name=chgerDtlAddr]").val(data.recipDtlAddr);
  997. $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val(data.chgerRtnMemo);
  998. if (spRecipPhnno) {
  999. $("#exchangeRequestFrm select[name=chgerPhnno1]").val(spRecipPhnno[0]);
  1000. $("#exchangeRequestFrm input[name=chgerPhnno2]").val(spRecipPhnno[1]);
  1001. $("#exchangeRequestFrm input[name=chgerPhnno3]").val(spRecipPhnno[2]);
  1002. }
  1003. if (spRecipTelno) {
  1004. $("#exchangeRequestFrm select[name=chgerTelno1]").val(spRecipTelno[0]);
  1005. $("#exchangeRequestFrm input[name=chgerTelno2]").val(spRecipTelno[1]);
  1006. $("#exchangeRequestFrm input[name=chgerTelno3]").val(spRecipTelno[2]);
  1007. }
  1008. }
  1009. // 교환지정보 설정
  1010. var fnSetExchangeAddr = function(){
  1011. var data;
  1012. if (ordChgSq > 0 && ordChgGb != 'G681_40') {
  1013. data = exchangeInfoList[0];
  1014. } else {
  1015. data = orderDelvAddrInfo[0];
  1016. }
  1017. var spRecipPhnno = (data.recipPhnno != null) ? data.recipPhnno.split('-') : null;
  1018. var spRecipTelno = (data.recipTelno != null) ? data.recipTelno.split('-') : null;
  1019. $("#exchangeRequestFrm input[name=recipNm]").val(data.recipNm);
  1020. $("#exchangeRequestFrm input[name=recipZipcode]").val(data.recipZipcode);
  1021. $("#exchangeRequestFrm input[name=recipBaseAddr]").val(data.recipBaseAddr);
  1022. $("#exchangeRequestFrm input[name=recipDtlAddr]").val(data.recipDtlAddr);
  1023. $("#exchangeRequestFrm textarea[name=delvMemo]").val(data.delvMemo);
  1024. if (spRecipPhnno) {
  1025. $("#exchangeRequestFrm select[name=recipPhnno1]").val(spRecipPhnno[0]);
  1026. $("#exchangeRequestFrm input[name=recipPhnno2]").val(spRecipPhnno[1]);
  1027. $("#exchangeRequestFrm input[name=recipPhnno3]").val(spRecipPhnno[2]);
  1028. }
  1029. if (spRecipTelno) {
  1030. $("#exchangeRequestFrm select[name=recipTelno1]").val(spRecipTelno[0]);
  1031. $("#exchangeRequestFrm input[name=recipTelno2]").val(spRecipTelno[1]);
  1032. $("#exchangeRequestFrm input[name=recipTelno3]").val(spRecipTelno[2]);
  1033. }
  1034. }
  1035. // 교환옵션 변경 이벤트
  1036. var fnChangeOption = function(param) {
  1037. var opt = $(param).val().split('/');
  1038. var optCd = opt[0];
  1039. var optCd2 = opt[1];
  1040. var ordDtlNo = $(param).attr('ordDtlNo');
  1041. var ordDtlItemSq = $(param).attr('ordDtlItemSq');
  1042. $.each(cancelRequestTargetList, function(idx, item){
  1043. if (item.ordDtlNo == ordDtlNo && item.ordDtlItemSq == ordDtlItemSq) {
  1044. var stockQtyArr = item.currStockQtys.split(',');
  1045. var sizeCdArr = item.optCd2s.split(',');
  1046. var stockIdx = sizeCdArr.indexOf(optCd2);
  1047. var stockQty = stockQtyArr[stockIdx];
  1048. item.currStockQty = stockQty;
  1049. item.ordChgOpt = optCd;
  1050. }
  1051. });
  1052. fnChangeQty();
  1053. }
  1054. //환불예상금액계산
  1055. var fnCalculateRefundAmt = function (obj) {
  1056. if (obj != null) {
  1057. for (i=0 ; i<cancelRequestTargetList.length ; i++) {
  1058. var orDtlNo = $(obj).attr("ordDtlNo");
  1059. var ordCanChgQty = $(obj).val();
  1060. if (cancelRequestTargetList[i].ordDtlNo == orDtlNo) {
  1061. cancelRequestTargetList[i].ordCanChgQty = ordCanChgQty;
  1062. }
  1063. }
  1064. // 주문변경대상정보 재설정
  1065. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  1066. }
  1067. if (cancelRequestTargetList.length == 0) {
  1068. alert("요청 대상정보가 존재 하지 않습니다.");
  1069. uifnPopupClose('popupCancelRequestForm');
  1070. return false;
  1071. }
  1072. // 2021.05.25 수정
  1073. var ordDtlNoArr = [];
  1074. var cnclRtnReqQtyArr = [];
  1075. // 1. 반품신청수량 체크
  1076. for (i=0 ; i<cancelRequestTargetList.length ; i++) {
  1077. if (cancelRequestTargetList[i].ordCanChgQty > 0) {
  1078. // 반품신청값설정
  1079. ordDtlNoArr.push(cancelRequestTargetList[i].ordDtlNo);
  1080. cnclRtnReqQtyArr.push(cancelRequestTargetList[i].ordCanChgQty);
  1081. }
  1082. }
  1083. // 2. 추가정보설정
  1084. var chgerNm = orderInfoList[0].ordNm;
  1085. var chgerEmail = orderInfoList[0].ordEmail;
  1086. var chgerPhnno = orderInfoList[0].ordPhnno;
  1087. var chgerTelno = orderInfoList[0].ordTelno;
  1088. var custNo = orderInfoList[0].custNo;
  1089. var delvFeeCd = orderInfoList[0].delvFeeCd;
  1090. // 환불금액계산호출
  1091. var jsonObj = {
  1092. "ordNo" : ordNo
  1093. ,"ordDtlNoArr" : ordDtlNoArr
  1094. ,"cnclRtnReqQtyArr" : cnclRtnReqQtyArr
  1095. ,"isCustomer" : isCustomer
  1096. ,"chgerNm" : chgerNm
  1097. ,"chgerEmail" : chgerEmail
  1098. ,"chgerPhnno" : chgerPhnno
  1099. ,"custNo" : custNo
  1100. ,"ordNm" : chgerNm
  1101. ,"ordPhnno" : chgerPhnno
  1102. ,"delvFeeCd" : delvFeeCd
  1103. }
  1104. var jsonData = JSON.stringify(jsonObj);
  1105. gagajf.ajaxJsonSubmit(
  1106. '/orderChange/cancel/refundAmt'
  1107. , jsonData
  1108. , function(result) {
  1109. // 2021.12.01 취소금액설정
  1110. if (result.cancelOrderRefundList != null && result.cancelOrderRefundList.length > 0) {
  1111. for (i=0 ; i<result.cancelOrderRefundList.length ; i++) {
  1112. for (j=0 ; j<cancelRequestTargetList.length ; j++) {
  1113. if (result.cancelOrderRefundList[i].ordDtlNo == cancelRequestTargetList[j].ordDtlNo) {
  1114. cancelRequestTargetList[j].cnclRtnAmt = result.cancelOrderRefundList[i].cnclRtnAmt; // 취소금액
  1115. cancelRequestTargetList[j].cpn1DcAmt = result.cancelOrderRefundList[i].cpn1DcAmt; // 즉시할인쿠폰금액
  1116. cancelRequestTargetList[j].tmtb1DcAmt = result.cancelOrderRefundList[i].tmtb1DcAmt; // 수량할인다다익선금액
  1117. cancelRequestTargetList[j].tmtb2DcAmt = result.cancelOrderRefundList[i].tmtb2DcAmt; // 금액할인다다익선금액
  1118. cancelRequestTargetList[j].goodsCpnDcAmt = result.cancelOrderRefundList[i].goodsCpnDcAmt; // 상품쿠폰금액
  1119. cancelRequestTargetList[j].cartCpnDcAmt = result.cancelOrderRefundList[i].cartCpnDcAmt; // 장바구니쿠폰금액
  1120. cancelRequestTargetList[j].pntDcAmt = result.cancelOrderRefundList[i].pntDcAmt; // 포인트금액
  1121. cancelRequestTargetList[j].prePntDcAmt = result.cancelOrderRefundList[i].prePntDcAmt; // 선포인트금액
  1122. cancelRequestTargetList[j].gfcdUseAmt = result.cancelOrderRefundList[i].gfcdUseAmt; // 상품권적용금액
  1123. cancelRequestTargetList[j].realOrdAmt = result.cancelOrderRefundList[i].realOrdAmt; // 실결제금액
  1124. }
  1125. }
  1126. }
  1127. // 주문변경대상정보 재설정
  1128. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  1129. }
  1130. }
  1131. );
  1132. }
  1133. // 교환수량 변경 이벤트
  1134. var fnChangeQty = function(param) {
  1135. var chgQty = $(param).val(); // 변경수량
  1136. var ordDtlNo = $(param).attr('ordDtlNo'); // 주문상세번호
  1137. var exchangeRequestTargetList = [];
  1138. var temp = true;
  1139. $.each(cancelRequestTargetList, function(idx, item){
  1140. if (item.ordDtlNo == ordDtlNo) {
  1141. if (gagajf.isNull(item.ordChgOpt) && chgQty > 0) {
  1142. temp = false;
  1143. }
  1144. item.chgQty = chgQty;
  1145. if (chgQty > 0) {
  1146. exchangeRequestTargetList.push(item);
  1147. }
  1148. } else if (item.chgQty > 0) {
  1149. exchangeRequestTargetList.push(item);
  1150. } else if (ordChgSq > 0 && item.ordCanChgQty > 0) {
  1151. exchangeRequestTargetList.push(item);
  1152. }
  1153. });
  1154. // 2021.12.02 소스수정
  1155. if (temp == false) {
  1156. mcxDialog.alert('교환옵션을 선택해주세요.');
  1157. return false;
  1158. }
  1159. // 추가배송비 설정
  1160. fnAddDelvFee(exchangeRequestTargetList);
  1161. // 교환대상목록 설정
  1162. exchangeRequestList = exchangeRequestTargetList;
  1163. // 2021.12.02 교환취소금액계산
  1164. fnCalculateRefundAmt(param);
  1165. }
  1166. // 추가배송비 설정
  1167. var fnAddDelvFee = function (exchangeRequestTargetList) {
  1168. var delvCdList = [];
  1169. var delvFeeList = [];
  1170. var delvFee = 0;
  1171. // 고객 귀책사유에 한하여 추가배송비 설정
  1172. $.each(exchangeRequestTargetList, function (idx, item) {
  1173. if (!delvCdList.includes(item.delvFeeCd)) {
  1174. if (isCustomer) {
  1175. var delvFeeTmp = $('#wdGb:checked').val() == 'W' ? item.excDelvFee : item.rtnDelvFee;
  1176. delvFee += delvFeeTmp;
  1177. item.addDelvFeeYn = 'Y';
  1178. item.addDelvFee = delvFeeTmp;
  1179. } else {
  1180. item.addDelvFeeYn = 'N';
  1181. item.addDelvFee = 0;
  1182. }
  1183. delvCdList.push(item.delvFeeCd);
  1184. delvFeeList.push(item);
  1185. }
  1186. });
  1187. addDelvFee = delvFee;
  1188. //addDelvFeeList = delvFeeList;
  1189. // 회수방법 > 직접발송일 경우 그리드 표시
  1190. // 2021.07.19 그리드 표시 여부 처리 변경
  1191. //if ($('#wdGb:checked').val() == 'D') {
  1192. // gridOptionsDelvCdList.api.setRowData(addDelvFeeList);
  1193. //} else {
  1194. // gridOptionsDelvCdList.api.setRowData();
  1195. //}
  1196. if (ordChgSq > 0) {
  1197. $('#addDelvFee').text(addPayCost.addComma() + '원');
  1198. } else {
  1199. $('#addDelvFee').text(addDelvFee.addComma() + '원');
  1200. }
  1201. }
  1202. // 회수방법 라디오 클릭 이벤트
  1203. var fnChangeWdGb = function(param) {
  1204. let wdGb = $(param).val();
  1205. // 회수지정보 히든 처리
  1206. if (wdGb == 'D') {
  1207. $('.chger').css('display', 'none');
  1208. $('#delvCdList').css('display', '');
  1209. } else {
  1210. $('.chger').css('display', '');
  1211. $('#delvCdList').css('display', 'none');
  1212. if (ordChgSq == 0) {
  1213. $('#chgerButton').css('display', 'none');
  1214. }
  1215. }
  1216. // 추가배송비 계산
  1217. fnChangeQty();
  1218. }
  1219. // 회수지 정보 수정
  1220. var fnChangeChgerInfo = function() {
  1221. let url = '/orderChange/change/chger/addr';
  1222. let chgerNm = $("#exchangeRequestFrm input[name=chgerNm]").val();
  1223. let chgerZipcode = $("#exchangeRequestFrm input[name=chgerZipcode]").val();
  1224. let chgerBaseAddr = $("#exchangeRequestFrm input[name=chgerBaseAddr]").val();
  1225. let chgerDtlAddr = $("#exchangeRequestFrm input[name=chgerDtlAddr]").val();
  1226. let chgerPhnno1 = $("#exchangeRequestFrm select[name=chgerPhnno1]").val();
  1227. let chgerPhnno2 = $("#exchangeRequestFrm input[name=chgerPhnno2]").val();
  1228. let chgerPhnno3 = $("#exchangeRequestFrm input[name=chgerPhnno3]").val();
  1229. let chgerTelno1 = $("#exchangeRequestFrm select[name=chgerTelno1]").val();
  1230. let chgerTelno2 = $("#exchangeRequestFrm input[name=chgerTelno2]").val();
  1231. let chgerTelno3 = $("#exchangeRequestFrm input[name=chgerTelno3]").val();
  1232. if (gagajf.isNull(chgerZipcode)) {
  1233. mcxDialog.alert("회수지주소를 입력하세요."); return;
  1234. }
  1235. if (gagajf.isNull(chgerBaseAddr)) {
  1236. mcxDialog.alert("회수지주소를 입력하세요."); return;
  1237. }
  1238. if (gagajf.isNull(chgerDtlAddr)) {
  1239. mcxDialog.alert("회수지주소를 입력하세요."); return;
  1240. }
  1241. if (gagajf.isNull(chgerPhnno1)) {
  1242. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1243. }
  1244. if (gagajf.isNull(chgerPhnno2)) {
  1245. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1246. }
  1247. if (gagajf.isNull(chgerPhnno3)) {
  1248. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1249. }
  1250. let chgerPhnno = chgerPhnno1 + '-' + chgerPhnno2 + '-' + chgerPhnno3;
  1251. let chgerRtnMemo = $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val();
  1252. let chgerTelno = '';
  1253. if (!gagajf.isNull(chgerTelno1) && !gagajf.isNull(chgerTelno2) && !gagajf.isNull(chgerTelno3)) {
  1254. chgerTelno = chgerTelno1 + '-' + chgerTelno2 + '-' + chgerTelno3;
  1255. }
  1256. // 2021.11.09 card007 휴대폰번호 유효성검증 추가
  1257. if (!gagajf.checkPhnno(chgerPhnno)) {
  1258. mcxDialog.alert("회수지 휴대폰 번호가 유효하지 않습니다.");
  1259. return false;
  1260. }
  1261. let data = {};
  1262. data.ordNo = ordNo;
  1263. data.ordChgSq = ordChgSq;
  1264. data.chgerNm = chgerNm;
  1265. data.chgerPhnno = chgerPhnno;
  1266. data.chgerZipcode = chgerZipcode;
  1267. data.chgerBaseAddr = chgerBaseAddr;
  1268. data.chgerDtlAddr = chgerDtlAddr;
  1269. data.chgerRtnMemo = chgerRtnMemo;
  1270. let jsonData = JSON.stringify(data);
  1271. gagajf.ajaxJsonSubmit(url, jsonData, function(result){
  1272. });
  1273. }
  1274. // 교환지 정보 수정
  1275. var fnChangeRecipInfo = function() {
  1276. let url = '/order/deliver/addr/update';
  1277. var recipNm = $("#exchangeRequestFrm input[name=recipNm]").val();
  1278. var recipZipcode = $("#exchangeRequestFrm input[name=recipZipcode]").val();
  1279. var recipBaseAddr = $("#exchangeRequestFrm input[name=recipBaseAddr]").val();
  1280. var recipDtlAddr = $("#exchangeRequestFrm input[name=recipDtlAddr]").val();
  1281. var delvMemo = $("#exchangeRequestFrm textarea[name=delvMemo]").val();
  1282. var recipPhnno1 = $("#exchangeRequestFrm select[name=recipPhnno1]").val();
  1283. var recipPhnno2 = $("#exchangeRequestFrm input[name=recipPhnno2]").val();
  1284. var recipPhnno3 = $("#exchangeRequestFrm input[name=recipPhnno3]").val();
  1285. var recipTelno1 = $("#exchangeRequestFrm select[name=recipTelno1]").val();
  1286. var recipTelno2 = $("#exchangeRequestFrm input[name=recipTelno2]").val();
  1287. var recipTelno3 = $("#exchangeRequestFrm input[name=recipTelno3]").val();
  1288. if (gagajf.isNull(recipZipcode)) {
  1289. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1290. }
  1291. if (gagajf.isNull(recipBaseAddr)) {
  1292. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1293. }
  1294. if (gagajf.isNull(recipDtlAddr)) {
  1295. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1296. }
  1297. if (gagajf.isNull(recipPhnno1)) {
  1298. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1299. }
  1300. if (gagajf.isNull(recipPhnno2)) {
  1301. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1302. }
  1303. if (gagajf.isNull(recipPhnno3)) {
  1304. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1305. }
  1306. var recipPhnno = recipPhnno1 + '-' + recipPhnno2 + '-' + recipPhnno3;
  1307. var recipTelno;
  1308. if (gagajf.isNull(recipTelno1) && gagajf.isNull(recipTelno2) && gagajf.isNull(recipTelno3)) {
  1309. recipTelno = '';
  1310. } else {
  1311. recipTelno = recipTelno1 + '-' + recipTelno2 + '-' + recipTelno3;
  1312. }
  1313. // 2021.11.09 card007 휴대폰번호 유효성검증 추가
  1314. if (!gagajf.checkPhnno(recipPhnno)) {
  1315. mcxDialog.alert("교환배송지 휴대폰 번호가 유효하지 않습니다.");
  1316. return false;
  1317. }
  1318. let data = {};
  1319. data.ordNo = ordNo;
  1320. data.delvAddrSq = delvAddrSq;
  1321. data.recipNm = recipNm;
  1322. data.recipPhnno = recipPhnno;
  1323. data.recipZipcode = recipZipcode;
  1324. data.recipBaseAddr = recipBaseAddr;
  1325. data.recipDtlAddr = recipDtlAddr;
  1326. data.delvMemo = delvMemo;
  1327. let jsonData = JSON.stringify(data);
  1328. gagajf.ajaxJsonSubmit(url, jsonData, function(result){
  1329. });
  1330. }
  1331. $(document).ready(function() {
  1332. // 1. 그리드생성
  1333. gagaAgGrid.createGrid('gridOrderCancelRequestList' , gridOptionsExchangeReqList); // 주문정보
  1334. gagaAgGrid.createGrid('gridDelvCdList' , gridOptionsDelvCdList); // 배송정보
  1335. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  1336. gridOptionsDelvCdList.api.setRowData(rtnLocInfo);
  1337. // 2.1 TOTAL ROWS 없애기
  1338. gagaAgGrid.hideStatusBar('gridOrderCancelRequestList');
  1339. gagaAgGrid.hideStatusBar('gridOrderCancelRequestToBeList');
  1340. gagaAgGrid.hideStatusBar('gridDelvCdList');
  1341. // 3. 회수지정보설정
  1342. fnSetChger();
  1343. // 4. 교환지정보설정
  1344. fnSetExchangeAddr();
  1345. // 5. 회수방법 라디오 체크 처리
  1346. if (ordChgGb == 'G681_50') {
  1347. $('input:radio[name="wdGb"]:radio[value="D"]').prop('checked', true);
  1348. $('.chger').css('display', 'none');
  1349. $('input:radio[name=wdGb]').attr('disabled', true);
  1350. $('#delvCdList').css('display', 'none');
  1351. }
  1352. // 2021.07.15 입점업체인 경우에는 회수요청만 해당
  1353. else if (selfGoodsYn == "N") {
  1354. $('input:radio[name="wdGb"]:radio[value="W"]').prop('checked', true);
  1355. $('.chger').css('display', 'none');
  1356. $('input:radio[name=wdGb]').attr('disabled', true);
  1357. } else {
  1358. if (wdGb == 'D') {
  1359. $('input:radio[name="wdGb"]:radio[value="D"]').prop('checked', true);
  1360. $('.chger').css('display', 'none');
  1361. } else {
  1362. $(' [name="wdGb"]:radio[value="W"]').prop('checked', true);
  1363. $('#delvCdList').css('display', 'none');
  1364. }
  1365. }
  1366. // 교환철회 처리
  1367. if (ordChgSq > 0) {
  1368. // 5. 교환사유설정
  1369. $('#chgReason').text(chgReasonNm);
  1370. // 6. 교환요청메모설정
  1371. $('#chgMemo').text(chgMemo);
  1372. // 7. 귀책사유 설정
  1373. fnChangeChgReason(chgReason);
  1374. // 8. 데이터 Disabled 처리
  1375. $('input:radio[name=wdGb]').attr('disabled', true); // 8-1. 회수방법
  1376. $('input[name=chgerBaseAddr]').attr('readOnly', true); // 8-4. 회수지정보 > 기본주소
  1377. $('input[name=recipBaseAddr]').attr('readOnly', true); // 8-10. 교환지정보 > 기본주소
  1378. $('#chgMemo').attr('readOnly', true); // 8-2. 요청메모
  1379. // 2021.06.25 교환접수, 교환대기 상태에서는 회수지 정보 수정 가능
  1380. if (!gagajf.isNull(ordChgGb) || (chgStat != 'G685_20' && chgStat != 'G685_21') || pgGb == 'NAVER_ORDER') {
  1381. $('input[name=chgerNm]').attr('readOnly', true); // 8-3. 회수지정보 > 보내는사람
  1382. $('input[name=chgerDtlAddr]').attr('readOnly', true); // 8-5. 회수지정보 > 상세주소
  1383. $('select[name=chgerTelno1]').attr('disabled', true); // 8-6. 회수지정보 > 일반전화
  1384. $('input[name=chgerTelno2]').attr('readOnly', true); // 8-6. 회수지정보 > 일반전화
  1385. $('input[name=chgerTelno3]').attr('readOnly', true); // 8-6. 회수지정보 > 일반전화
  1386. $('select[name=chgerPhnno1]').attr('disabled', true); // 8-7. 회수지정보 > 휴대전화
  1387. $('input[name=chgerPhnno2]').attr('readOnly', true); // 8-7. 회수지정보 > 휴대전화
  1388. $('input[name=chgerPhnno3]').attr('readOnly', true); // 8-7. 회수지정보 > 휴대전화
  1389. $('#chgerRtnMemo').attr('readOnly', true); // 8-8. 회수지정보 > 반품메모
  1390. $('#chgerButton').css('display', 'none'); // 회수지 수정 버튼
  1391. $('#chgerFindAddr').css('display', 'none'); // 회수지 우편번호 찾기 버튼
  1392. }
  1393. // 2021.06.25 교환상품 배송중 상태 전까지 정보 수정 가능
  1394. if (ordChgGb == 'G681_20' || (chgStat == 'G685_40' && (chgOrdDtlStat != 'G013_20' && chgOrdDtlStat != 'G013_30' && chgOrdDtlStat != 'G013_35')) || chgStat == 'G685_22' || pgGb == 'NAVER_ORDER') {
  1395. $('input[name=recipNm]').attr('readOnly', true); // 8-9. 교환지정보 > 받는사람
  1396. $('input[name=recipDtlAddr]').attr('readOnly', true); // 8-11. 교환지정보 > 상세주소
  1397. $('select[name=recipTelno1]').attr('disabled', true); // 8-12. 교환지정보 > 일반전화
  1398. $('input[name=recipTelno2]').attr('readOnly', true); // 8-12. 교환지정보 > 일반전화
  1399. $('input[name=recipTelno3]').attr('readOnly', true); // 8-12. 교환지정보 > 일반전화
  1400. $('select[name=recipPhnno1]').attr('disabled', true); // 8-13. 교환지정보 > 휴대전화
  1401. $('input[name=recipPhnno2]').attr('readOnly', true); // 8-13. 교환지정보 > 휴대전화
  1402. $('input[name=recipPhnno3]').attr('readOnly', true); // 8-13. 교환지정보 > 휴대전화
  1403. $('#delvMemo').attr('readOnly', true); // 8-14. 교환지정보 > 배송메모
  1404. $('#recipButton').css('display', 'none'); // 교환지 수정 버튼
  1405. $('#recipFindAddr').css('display', 'none'); // 교환지 우편번호 찾기 버튼
  1406. }
  1407. // 반품TO교환
  1408. if (ordChgGb == 'G681_40') {
  1409. $('#recipButton').css('display', 'none'); // 교환지 수정 버튼
  1410. }
  1411. // 2021.10.14 선발송여부 체크
  1412. if ("Y" == wdBfSendYn) {
  1413. $('#wdBfSendYn').attr('checked', "checked");
  1414. }
  1415. // 네이버페이 주문형 보류 버튼 처리
  1416. if (pgGb == 'NAVER_ORDER') {
  1417. if (!gagajf.isNull(npayChangeHoldYn)) {
  1418. if (npayChangeHoldYn == 'Y') {
  1419. $('#fnExchangeHold').css('display', 'none');
  1420. } else {
  1421. $('#fnReleaseExchangeHold').css('display', 'none');
  1422. }
  1423. }
  1424. } else {
  1425. $('#fnExchangeHold').css('display', 'none');
  1426. $('#fnReleaseExchangeHold').css('display', 'none');
  1427. }
  1428. } else {
  1429. $('#chgerButton').css('display', 'none'); // 회수지 수정 버튼
  1430. $('#recipButton').css('display', 'none'); // 교환지 수정 버튼
  1431. }
  1432. // 글자수 제한 byte 표기
  1433. cfnGetTextLength($('#chgMemo'), 1000, $('#chgMemoCount'));
  1434. cfnGetTextLength($('#chgerRtnMemo'), 1000, $('#chgerRtnMemoCount'));
  1435. cfnGetTextLength($('#delvMemo'), 1000, $('#delvMemoCount'));
  1436. // 수량체크
  1437. fnChangeQty();
  1438. if (orderChangeDetailList != null) {
  1439. $('#exchCompleteRegNm').text(orderChangeDetailList[0].regNm);
  1440. $('#exchCompleteUpdNm').text(orderChangeDetailList[0].updNm);
  1441. }
  1442. });
  1443. </script>
  1444. </html>