ExchangeRequestForm.html 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  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. <h4>배송정보</h4>
  30. <div id="gridDelvCdList" style="width:100%; height: 140px;" class="ag-theme-balham"></div>
  31. <div style="text-align:right; padding-bottom:5px; padding-top:5px;">
  32. <button type="button" class="btn btn-success" th:unless="${ordChgSq > 0}" id="fnExchangeRequestSubmit" onclick="fnExchange()">교환요청</button>
  33. <button type="button" class="btn btn-success" id="fnExchangeCancelRequestSubmit" onclick="fnExchangeCancel()">교환철회</button>
  34. <button type="button" class="btn btn-success" th:if="${ordChgSq > 0 and (ordChgGb == 'G681_20' or ordChgGb == 'G681_40')}" id="fnReturnToExchangeSubmit" onclick="fnExchange()">교환변경</button>
  35. </div>
  36. <table class="frmStyle">
  37. <colgroup>
  38. <col style="width:160px;" />
  39. <col style="width:320px;" />
  40. <col style="width:160px;" />
  41. <col style="width:320px;" />
  42. <col style="width:160px;" />
  43. <col />
  44. </colgroup>
  45. <tbody>
  46. <tr>
  47. <th>교환사유 <i class="star"></i></th>
  48. <td th:if="${ordChgSq <= 0 or ordChgGb == 'G681_40'}">
  49. <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
  50. <option value="">[선택하세요]</option>
  51. <option th:if="${chgReasonList}" th:each="oneData, status : ${chgReasonList}" th:value="|${oneData.cd}:${oneData.cdNm}|" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
  52. </select>
  53. </td>
  54. <td th:if="${ordChgSq > 0 and ordChgGb != 'G681_40'}" th:id="chgReason"></td>
  55. <th>귀책사유</th>
  56. <td><span id="imputeReason"></span></td>
  57. <th>선발송</th>
  58. <td>
  59. <label class="chkBox">
  60. <input type="checkbox" name="wdBfSendYn" id="wdBfSendYn" disabled="disabled"/>
  61. </label>
  62. </td>
  63. </tr>
  64. <tr>
  65. <th>회수방법</th>
  66. <td>
  67. <label class="rdoBtn"><input type="radio" name="wdGb" th:id="wdGb" value="W" onclick="fnChangeWdGb(this)"/>회수요청<span></span></label>
  68. <label class="rdoBtn"><input type="radio" name="wdGb" th:id="wdGb" value="D" onclick="fnChangeWdGb(this)"/>직접발송<span></span></label>
  69. </td>
  70. <th>추가배송비</th>
  71. <td id="addDelvFee" colspan="3"></td>
  72. </tr>
  73. <tr>
  74. <th>요청메모</th>
  75. <td colspan="5">
  76. <textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="교환사유를 300자내외로 작성해 주세요"></textarea>
  77. </td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. <h4 class="chger">회수지 정보</h4>
  82. <button style="float: right" type="button" class="btn btn-success" th:if="${#strings.isEmpty(ordChgGb) and ordChgSq > 0 and (chgStat == 'G685_20' or chgStat == 'G685_21')}" onclick="fnChangeChgerInfo();">회수지 수정</button>
  83. <table class="frmStyle chger">
  84. <colgroup>
  85. <col style="width:160px;" />
  86. <col style="width:320px;" />
  87. <col style="width:160px;" />
  88. <col />
  89. </colgroup>
  90. <tbody>
  91. <tr>
  92. <th>보내는사람 <i class="star"></i></th>
  93. <td colspan="3"><input type="text" name ="chgerNm" class=""/></td>
  94. </tr>
  95. <tr>
  96. <th>회수지주소 <i class="star"></i></th>
  97. <td colspan="3">
  98. <input type="text" name ="chgerZipcode" class="w100" readonly="readonly"/>
  99. <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>
  100. <input type="text" name ="chgerBaseAddr" class="w300"/>
  101. <input type="text" name ="chgerDtlAddr" class="w300"/>
  102. </td>
  103. </tr>
  104. <tr>
  105. <th>일반전화</th>
  106. <td>
  107. <select name="chgerTelno1" class="w100">
  108. <option value="">[선택하세요]</option>
  109. <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  110. </select>
  111. - <input type="text" name ="chgerTelno2" class="w60"/>
  112. - <input type="text" name ="chgerTelno3" class="w60"/>
  113. </td>
  114. <th>휴대전화 <i class="star"></i></th>
  115. <td>
  116. <select name="chgerPhnno1" class="w100">
  117. <option value="">[선택하세요]</option>
  118. <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  119. </select>
  120. - <input type="text" name ="chgerPhnno2" class="w60"/>
  121. - <input type="text" name ="chgerPhnno3" class="w60"/>
  122. </td>
  123. </tr>
  124. <tr>
  125. <th>반품메모</th>
  126. <td colspan="3">
  127. <textarea id="chgerRtnMemo" name="chgerRtnMemo" style="height:80px;" placeholder="반품메모(수거시요청사항)를 300자내외로 작성해 주세요"></textarea>
  128. </td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <h4>교환지 정보</h4>
  133. <button style="float: right" type="button" class="btn btn-success" th:unless="${ordChgSq == 0 or !#strings.isEmpty(ordChgGb) or (chgStat == 'G685_40' and (chgOrdDtlStat != 'G013_20' or chgOrdDtlStat != 'G013_30' or chgOrdDtlStat != 'G013_35'))}" onclick="fnChangeRecipInfo();">교환지 수정</button>
  134. <table class="frmStyle">
  135. <colgroup>
  136. <col style="width:160px;" />
  137. <col style="width:320px;" />
  138. <col style="width:160px;" />
  139. <col />
  140. </colgroup>
  141. <tbody>
  142. <tr>
  143. <th>받는사람 <i class="star"></i></th>
  144. <td colspan="3"><input type="text" name ="recipNm" class=""/></td>
  145. </tr>
  146. <tr>
  147. <th>교환지주소 <i class="star"></i></th>
  148. <td colspan="3">
  149. <input type="text" name ="recipZipcode" class="w100" readonly="readonly"/>
  150. <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'))}" onclick="fnOpenDaumAddr('exchange');">우편번호찾기</button>
  151. <input type="text" name ="recipBaseAddr" class="w300"/>
  152. <input type="text" name ="recipDtlAddr" class="w300"/>
  153. </td>
  154. </tr>
  155. <tr>
  156. <th>일반전화</th>
  157. <td>
  158. <select name="recipTelno1" class="w100">
  159. <option value="">[선택하세요]</option>
  160. <option th:if="${TelExcNoList}" th:each="oneData, status : ${TelExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  161. </select>
  162. - <input type="text" name ="recipTelno2" class="w60"/>
  163. - <input type="text" name ="recipTelno3" class="w60"/>
  164. </td>
  165. <th>휴대전화 <i class="star"></i></th>
  166. <td>
  167. <select name="recipPhnno1" class="w100">
  168. <option value="">[선택하세요]</option>
  169. <option th:if="${PhnExcNoList}" th:each="oneData, status : ${PhnExcNoList}" th:value="${oneData.cd}" th:text="${oneData.cd}"></option>
  170. </select>
  171. - <input type="text" name ="recipPhnno2" class="w60"/>
  172. - <input type="text" name ="recipPhnno3" class="w60"/>
  173. </td>
  174. </tr>
  175. <tr>
  176. <th>배송메모</th>
  177. <td colspan="3">
  178. <textarea id="delvMemo" name="delvMemo" style="height:80px;" placeholder="배송메모를 300자내외로 작성해 주세요"></textarea>
  179. </td>
  180. </tr>
  181. </tbody>
  182. </table>
  183. </form>
  184. </div>
  185. </div>
  186. </div>
  187. <!-- data -->
  188. <script th:inline="javascript">
  189. /*<![CDATA[*/
  190. var cancelRequestTargetList = [[${cancelRequestTargetList}]]; // 교환대상목록
  191. var ordNo = [[${ordNo}]]; // 주문번호
  192. var ordChgSq = [[${ordChgSq}]]; // 주문변경번호
  193. var chgStat = [[${chgStat}]]; // 변경상태
  194. var orderInfoList = [[${orderInfoList}]]; // 주문기본정보
  195. var payMeans = orderInfoList[0].payMeans; // 결제수단
  196. var orderDelvAddrInfo = [[${orderDelvAddrInfo}]]; // 회수지정보
  197. var addDelvFee = 0; // 추가배송비
  198. var addDelvFeeList = []; // 추가배송비정보
  199. var exchangeRequestList = []; // 교환요청목록
  200. var exchangeInfoList; // 교환정보
  201. var wdGb; // 회수방법
  202. var ordChgGb; // 변경요청변경구분
  203. var orderChangeDetailList; // 취소/반품/교환요청 정보
  204. var chgOrdDtlStat; // 교환상품상세상태값
  205. var delvAddrSq; // 교환상품배송지일련번호
  206. var temp1 = true;
  207. var temp2 = true;
  208. // 변경요청정보 승인, 철회
  209. if (ordChgSq > 0) {
  210. orderChangeDetailList = [[${orderChangeDetailList}]]; // 취소/반품/교환요청 정보
  211. exchangeInfoList = [[${exchangeInfoList}]]; // 교환정보
  212. ordChgGb = [[${ordChgGb}]]; // 변경요청변경구분
  213. if (ordChgGb == 'G681_40') {
  214. chgReason = orderChangeDetailList[0].chgReason; // 변경사유코드
  215. chgReasonNm = orderChangeDetailList[0].chgReasonNm; // 변경사유코드명
  216. chgMemo = orderChangeDetailList[0].chgMemo; // 변경사유메모
  217. wdGb = orderChangeDetailList[0].wdGb; // 회수방법
  218. chgOrdDtlStat = ''; // 교환상품상세상태값
  219. delvAddrSq = ''; // 교환상품배송지일련번호
  220. } else {
  221. chgReason = exchangeInfoList[0].chgReason; // 변경사유코드
  222. chgReasonNm = exchangeInfoList[0].chgReasonNm; // 변경사유코드명
  223. chgMemo = exchangeInfoList[0].chgMemo; // 변경사유메모
  224. wdGb = exchangeInfoList[0].wdGb; // 회수방법
  225. chgOrdDtlStat = exchangeInfoList[0].ordDtlStat; // 교환상품상세상태값
  226. delvAddrSq = exchangeInfoList[0].delvAddrSq; // 교환상품배송지일련번호
  227. }
  228. }
  229. // 1. 주문정보(교환대상)
  230. var columnExchangeReqList = [
  231. {
  232. headerName : "주문상세정보",
  233. children : [
  234. {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
  235. {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
  236. {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
  237. {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
  238. {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center', hide: temp1},
  239. {headerName: "상품명" , field: "goodsNm" , width: 200 , cellClass: 'text-center', hide: temp1},
  240. {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
  241. ]
  242. },
  243. {
  244. headerName : "주문상세단품정보",
  245. children : [
  246. {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
  247. {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  248. {headerName: "단품명" , field: "itemNm" , width: 200 , cellClass: 'text-center', hide: temp2},
  249. {headerName: "옵션1" , field: "optCd1" , width: 80 , cellClass: 'text-center', hide: temp1},
  250. {headerName: "옵션2" , field: "optCd2" , width: 80 , cellClass: 'text-center', hide: temp2},
  251. {
  252. headerName : "단품수량"
  253. , field : "itemQty"
  254. , width : 80
  255. , cellClass : 'text-center'
  256. , cellRenderer : function (params) {
  257. return params.value.addComma();
  258. }
  259. },
  260. {
  261. headerName : "단품금액"
  262. , field : "itemPrice"
  263. , width : 80
  264. , cellClass : 'text-right'
  265. , cellRenderer : function (params) {
  266. return params.value.addComma();
  267. }
  268. },
  269. {
  270. headerName : "단품옵션금액"
  271. , field : "optAddPrice"
  272. , width : 80
  273. , cellClass : 'text-right'
  274. , cellRenderer : function (params) {
  275. return params.value.addComma();
  276. }
  277. }
  278. ]
  279. },
  280. {
  281. headerName : "주문상세수량",
  282. children : [
  283. {
  284. headerName : "주문"
  285. , field : "ordQty"
  286. , width : 80
  287. , cellClass : 'text-center'
  288. , cellRenderer : function (params) {
  289. return params.value.addComma();
  290. }
  291. },
  292. {
  293. headerName : "취소/요청"
  294. , field : "cnclRtnQty"
  295. , width : 80
  296. , cellClass : 'text-center'
  297. , cellRenderer : function (params) {
  298. var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
  299. return cnclRtnReqQty;
  300. }
  301. },
  302. {headerName: "교환가능옵션" , field: "optCd2s" , width: 200 , cellClass: 'text-center', hide: temp2},
  303. {
  304. headerName : "교환옵션"
  305. , field : "ordChgOpt"
  306. , width : 100
  307. , cellClass : "text-center"
  308. , cellRenderer : function (params) {
  309. if (ordChgSq > 0 && ordChgGb != 'G681_40') {
  310. $.each(exchangeInfoList, function(idx, item) {
  311. if (params.data.itemCd == item.itemCd && params.data.optCd1 == item.optCd1) {
  312. strVal = item.optCd2;
  313. }
  314. });
  315. } else {
  316. var optArr = params.data.optCd2s.split(',');
  317. var ordChgOpt = params.data.ordChgOpt;
  318. var strVal = '';
  319. strVal += '<select class="ordChgOpt" name="ordChgOpt" ordDtlNo="' + params.data.ordDtlNo + '" ordDtlItemSq="' + params.data.ordDtlItemSq + '" onchange="fnChangeOption(this)">';
  320. if (gagajf.isNull(ordChgOpt)) {
  321. strVal += '<option value="">선택</option>';
  322. } else {
  323. strVal += '<option value="" selected>선택</option>';
  324. }
  325. $.each(optArr, function (idx, item) {
  326. if (ordChgOpt == item) {
  327. strVal += '<option value="' + item + '" selected>' + item + '</option>';
  328. } else {
  329. strVal += '<option value="' + item + '">' + item + '</option>';
  330. }
  331. });
  332. }
  333. return strVal;
  334. }
  335. },
  336. {headerName: "재고수량" , field: "currStockQty" , width: 100 , cellClass: 'text-center', hide: temp2},
  337. {
  338. headerName : "교환신청수량"
  339. , field : "chgQty"
  340. , width : 100
  341. , cellClass : 'text-center'
  342. , cellRenderer : function (params) {
  343. if (ordChgSq > 0) {
  344. // 반품TO교환, 교환TO교환
  345. if (ordChgGb == 'G681_40' || ordChgGb == 'G681_20') {
  346. strVal = params.data.chgQty;
  347. }
  348. // 교환상세
  349. else {
  350. $.each(exchangeInfoList, function (idx, item) {
  351. if (params.data.itemCd == item.itemCd && params.data.optCd1 == item.optCd1) {
  352. strVal = item.chgQty;
  353. }
  354. });
  355. }
  356. } else {
  357. var ordQty = parseInt(params.data.ordQty);
  358. var cnclRtnQty = parseInt(params.data.cnclRtnQty);
  359. var ordReqChgQty = parseInt(params.data.ordReqChgQty);
  360. var ordCanChgQty = ordQty - (cnclRtnQty + ordReqChgQty);
  361. //// 교환TO교환
  362. //if (ordChgGb == 'G681_20') {
  363. // ordCanChgQty = parseInt(params.data.ordCanChgQty);
  364. //}
  365. var strVal = "";
  366. strVal += '<select class="ordCanChgQty ' + params.data.ordDtlNo + '" name="chgQty" ordDtlNo="' + params.data.ordDtlNo + '" onchange="fnChangeQty(this)">';
  367. for (i = 0; i <= ordCanChgQty; i++) {
  368. if (i == params.data.chgQty) {
  369. strVal += " <option value='" + i + "' selected>" + i + "</option>";
  370. } else {
  371. strVal += " <option value='" + i + "'>" + i + "</option>";
  372. }
  373. }
  374. strVal += "</select>";
  375. }
  376. return strVal;
  377. }
  378. }
  379. ]
  380. },
  381. {
  382. headerName : "주문단품금액",
  383. children : [
  384. {
  385. headerName : "주문"
  386. , field : "ordAmt"
  387. , width : 80
  388. , cellClass : 'text-right'
  389. , cellRenderer : function (params) {
  390. return params.value.addComma();
  391. }
  392. },
  393. {
  394. headerName : "취소"
  395. , field : "cnclRtnAmt"
  396. , width : 80
  397. , cellClass : 'text-right'
  398. , cellRenderer : function (params) {
  399. return params.value.addComma();
  400. }
  401. },
  402. {
  403. headerName : "즉시할인"
  404. , field : "cpn1DcAmt"
  405. , width : 80
  406. , cellClass : 'text-right'
  407. , cellRenderer : function (params) {
  408. return params.value.addComma();
  409. }
  410. },
  411. {
  412. headerName : "다다익선1"
  413. , field : "tmtb1DcAmt"
  414. , width : 80
  415. , cellClass : 'text-right'
  416. , cellRenderer : function (params) {
  417. return params.value.addComma();
  418. }
  419. },
  420. {
  421. headerName : "다다익선2"
  422. , field : "tmtb2DcAmt"
  423. , width : 80
  424. , cellClass : 'text-right'
  425. , cellRenderer : function (params) {
  426. return params.value.addComma();
  427. }
  428. },
  429. {
  430. headerName : "상품쿠폰"
  431. , field : "goodsCpnDcAmt"
  432. , width : 80
  433. , cellClass : 'text-right'
  434. , cellRenderer : function (params) {
  435. return params.value.addComma();
  436. }
  437. },
  438. {
  439. headerName : "장바구니쿠폰"
  440. , field : "cartCpnDcAmt"
  441. , width : 80
  442. , cellClass : 'text-right'
  443. , cellRenderer : function (params) {
  444. return params.value.addComma();
  445. }
  446. },
  447. {
  448. headerName : "포인트"
  449. , field : "pntDcAmt"
  450. , width : 80
  451. , cellClass : 'text-right'
  452. , cellRenderer : function (params) {
  453. return params.value.addComma();
  454. }
  455. },
  456. {
  457. headerName : "선포인트"
  458. , field : "prePntDcAmt"
  459. , width : 80
  460. , cellClass : 'text-right'
  461. , cellRenderer : function (params) {
  462. return params.value.addComma();
  463. }
  464. },
  465. {
  466. headerName : "상품권"
  467. , field : "gfcdUseAmt"
  468. , width : 80
  469. , cellClass : 'text-right'
  470. , cellRenderer : function (params) {
  471. return params.value.addComma();
  472. }
  473. },
  474. {
  475. headerName : "실결제금액"
  476. , field : "realOrdAmt"
  477. , width : 80
  478. , cellClass : 'text-right'
  479. , cellRenderer : function (params) {
  480. return params.value.addComma();
  481. }
  482. }
  483. ]
  484. },
  485. {
  486. headerName : "주문배송비정보",
  487. children : [
  488. {
  489. headerName : "배송비"
  490. , field : "delvFee"
  491. , width : 80
  492. , cellClass : 'text-right'
  493. , cellRenderer : function (params) {
  494. return params.value.addComma();
  495. }
  496. , hide : temp2
  497. },
  498. {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  499. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  500. {
  501. headerName : "무료배송비"
  502. , field : "minOrdAmt"
  503. , width : 80
  504. , cellClass : 'text-right'
  505. , cellRenderer : function (params) {
  506. return params.value.addComma();
  507. }
  508. , hide : temp2
  509. },
  510. {
  511. headerName : "기본배송비"
  512. , field : "orgDelvFee"
  513. , width : 80
  514. , cellClass : 'text-right'
  515. , cellRenderer : function (params) {
  516. return params.value.addComma();
  517. }
  518. , hide : temp2
  519. },
  520. {
  521. headerName : "반품배송비"
  522. , field : "rtnDelvFee"
  523. , width : 80
  524. , cellClass : 'text-right'
  525. , cellRenderer : function (params) {
  526. return params.value.addComma();
  527. }
  528. , hide : temp2
  529. },
  530. {
  531. headerName : "교환배송비"
  532. , field : "excDelvFee"
  533. , width : 80
  534. , cellClass : 'text-right'
  535. , cellRenderer : function (params) {
  536. return params.value.addComma();
  537. }
  538. , hide : temp2
  539. },
  540. {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
  541. ]
  542. }
  543. ];
  544. var gridOptionsExchangeReqList = gagaAgGrid.getGridOptions(columnExchangeReqList);
  545. // Add on options
  546. gridOptionsExchangeReqList.suppressRowClickSelection = true;
  547. gridOptionsExchangeReqList.rowSelection = 'multiple';
  548. // 3. 배송정보(환불정보)
  549. var columnDelvCdList = [
  550. {headerName: "업체" , field: "supplyCompNm" , width: 100 , cellClass: 'text-center'},
  551. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center'},
  552. {
  553. headerName : "추가배송비"
  554. , field : "addDelvFee"
  555. , width : 100
  556. , cellClass : 'text-right'
  557. , cellRenderer : function (params) {
  558. return params.value.addComma();
  559. }
  560. },
  561. {headerName: "반품지명" , field: "rtnLocNm" , width: 100 , cellClass: 'text-center'},
  562. {headerName: "반품지전화번호" , field: "rtnLocTelno" , width: 100 , cellClass: 'text-center'},
  563. {headerName: "반품지우편번호" , field: "rtnLocZipcode" , width: 100 , cellClass: 'text-center'},
  564. {headerName: "반품지기본주소" , field: "rtnLocBaseAddr" , width: 300 , cellClass: 'text-center'},
  565. {headerName: "반품지상세주소" , field: "rtnLocDtlAddr" , width: 300 , cellClass: 'text-center'},
  566. ];
  567. var gridOptionsDelvCdList = gagaAgGrid.getGridOptions(columnDelvCdList);
  568. </script>
  569. <script>
  570. //현재 사유는 회사 입니다.
  571. var isCustomer = false;
  572. // 사유 변경
  573. var fnChangeChgReason = function(reasonCd){
  574. var arrReasonCd = reasonCd.split(":");
  575. var customerReasonArr = ['G689_10', 'G689_30', 'G688_10'];
  576. isCustomer = false;
  577. // 취소, 반품, 교환 사유 판단
  578. for (i=0 ; i<customerReasonArr.length ; i++) {
  579. if (customerReasonArr[i] == arrReasonCd[0]) {
  580. isCustomer = true;
  581. }
  582. }
  583. // 귀책사유설정 회사, 고객
  584. if (isCustomer) {
  585. $("#imputeReason").text("고객");
  586. if ($('#wdBfSendYn').is(':checked')) {
  587. $('#wdBfSendYn').prop('checked', false);
  588. }
  589. $('#wdBfSendYn').attr('disabled', true);
  590. } else {
  591. $("#imputeReason").text("회사");
  592. if (ordChgSq == null || ordChgSq <= 0) {
  593. $('#wdBfSendYn').attr('disabled', false);
  594. }
  595. }
  596. // 2021.05.25 반품접수, 반품대기 상태에서만 철회가능
  597. if (chgStat != "G685_20" && chgStat != "G685_21" && chgStat != "G685_30" && chgStat != "G685_31") {
  598. $("#fnExchangeCancelRequestSubmit").css("display", "none");
  599. }
  600. $('#exchangeRequestFrm input[name=chgReason]').val(arrReasonCd[0]);
  601. $('#exchangeRequestFrm input[name=chgReasonDesc]').val(arrReasonCd[1]);
  602. // 추가배송비 설정
  603. fnChangeQty();
  604. }
  605. // 교환요청
  606. var fnExchange = function () {
  607. var qty = true;
  608. var opt = true;
  609. var wdGb = $('#wdGb:checked').val();
  610. // 1. 교환수량 체크
  611. //$.each(cancelRequestTargetList, function(idx, item) {
  612. // if (item.chgQty > 0) {
  613. // qty = true;
  614. //
  615. // if (!gagajf.isNull(item.ordChgOpt)) {
  616. // opt = true;
  617. // }
  618. // }
  619. //});
  620. // 교환TO교환, 반품TO교환 신청 수량 설정
  621. if (ordChgGb == 'G681_20' || ordChgGb == 'G681_40') {
  622. exchangeRequestList = cancelRequestTargetList;
  623. //$.each(exchangeRequestList, function(idx, exchangeRequest) {
  624. // $.each(exchangeInfoList , function(idx2, exchangeInfo) {
  625. // if (exchangeRequest.itemCd == exchangeInfo.itemCd && exchangeRequest.optCd1 == exchangeInfo.optCd1) {
  626. // exchangeRequest.chgQty = exchangeInfo.chgQty;
  627. // }
  628. // });
  629. //});
  630. }
  631. $.each(exchangeRequestList, function(idx, item) {
  632. if (item.chgQty == null || item.chgQty == 0) {
  633. qty = false;
  634. }
  635. if (gagajf.isNull(item.ordChgOpt)) {
  636. opt = false;
  637. }
  638. });
  639. if (qty == false) {
  640. mcxDialog.alert('교환 할 수량을 입력하세요.');
  641. return;
  642. }
  643. if (opt == false) {
  644. mcxDialog.alert('교환옵션을 선택해주세요.');
  645. return;
  646. }
  647. // 2. 교환사유 체크
  648. var chgReason = $("#exchangeRequestFrm select[name=selectChgReason]").val();
  649. if (ordChgGb == 'G681_20') {
  650. chgReason = $('#exchangeRequestFrm input[name=chgReason]').val();
  651. }
  652. //var chgReason = $('#exchangeRequestFrm input[name=chgReason]').val();
  653. if (gagajf.isNull(chgReason)) {
  654. mcxDialog.alert("교환사유를 입력하세요.");
  655. return;
  656. }
  657. // 5. 회수지정보설정
  658. if (wdGb == 'W') {
  659. var chgerNm = $("#exchangeRequestFrm input[name=chgerNm]").val();
  660. var chgerZipcode = $("#exchangeRequestFrm input[name=chgerZipcode]").val();
  661. var chgerBaseAddr = $("#exchangeRequestFrm input[name=chgerBaseAddr]").val();
  662. var chgerDtlAddr = $("#exchangeRequestFrm input[name=chgerDtlAddr]").val();
  663. var chgerPhnno1 = $("#exchangeRequestFrm select[name=chgerPhnno1]").val();
  664. var chgerPhnno2 = $("#exchangeRequestFrm input[name=chgerPhnno2]").val();
  665. var chgerPhnno3 = $("#exchangeRequestFrm input[name=chgerPhnno3]").val();
  666. var chgerTelno1 = $("#exchangeRequestFrm select[name=chgerTelno1]").val();
  667. var chgerTelno2 = $("#exchangeRequestFrm input[name=chgerTelno2]").val();
  668. var chgerTelno3 = $("#exchangeRequestFrm input[name=chgerTelno3]").val();
  669. if (gagajf.isNull(chgerZipcode)) {
  670. mcxDialog.alert("회수지주소를 입력하세요."); return;
  671. }
  672. if (gagajf.isNull(chgerBaseAddr)) {
  673. mcxDialog.alert("회수지주소를 입력하세요."); return;
  674. }
  675. if (gagajf.isNull(chgerDtlAddr)) {
  676. mcxDialog.alert("회수지주소를 입력하세요."); return;
  677. }
  678. if (gagajf.isNull(chgerPhnno1)) {
  679. mcxDialog.alert("휴대전화를 입력하세요."); return;
  680. }
  681. if (gagajf.isNull(chgerPhnno2)) {
  682. mcxDialog.alert("휴대전화를 입력하세요."); return;
  683. }
  684. if (gagajf.isNull(chgerPhnno3)) {
  685. mcxDialog.alert("휴대전화를 입력하세요."); return;
  686. }
  687. var chgerPhnno = chgerPhnno1 + '-' + chgerPhnno2 + '-' + chgerPhnno3;
  688. var chgerEmail = orderInfoList[0].ordEmail;
  689. var chgerTelno;
  690. if (gagajf.isNull(chgerTelno1) && gagajf.isNull(chgerTelno2) && gagajf.isNull(chgerTelno3)) {
  691. chgerTelno = '';
  692. } else {
  693. chgerTelno = chgerTelno1 + '-' + chgerTelno2 + '-' + chgerTelno3;
  694. }
  695. }
  696. // 교환지정보 설정
  697. var recipNm = $("#exchangeRequestFrm input[name=recipNm]").val();
  698. var recipZipcode = $("#exchangeRequestFrm input[name=recipZipcode]").val();
  699. var recipBaseAddr = $("#exchangeRequestFrm input[name=recipBaseAddr]").val();
  700. var recipDtlAddr = $("#exchangeRequestFrm input[name=recipDtlAddr]").val();
  701. var recipPhnno1 = $("#exchangeRequestFrm select[name=recipPhnno1]").val();
  702. var recipPhnno2 = $("#exchangeRequestFrm input[name=recipPhnno2]").val();
  703. var recipPhnno3 = $("#exchangeRequestFrm input[name=recipPhnno3]").val();
  704. var recipTelno1 = $("#exchangeRequestFrm select[name=recipTelno1]").val();
  705. var recipTelno2 = $("#exchangeRequestFrm input[name=recipTelno2]").val();
  706. var recipTelno3 = $("#exchangeRequestFrm input[name=recipTelno3]").val();
  707. if (gagajf.isNull(recipZipcode)) {
  708. mcxDialog.alert("교환지주소를 입력하세요."); return;
  709. }
  710. if (gagajf.isNull(recipBaseAddr)) {
  711. mcxDialog.alert("교환지주소를 입력하세요."); return;
  712. }
  713. if (gagajf.isNull(recipDtlAddr)) {
  714. mcxDialog.alert("교환지주소를 입력하세요."); return;
  715. }
  716. if (gagajf.isNull(recipPhnno1)) {
  717. mcxDialog.alert("휴대전화를 입력하세요."); return;
  718. }
  719. if (gagajf.isNull(recipPhnno2)) {
  720. mcxDialog.alert("휴대전화를 입력하세요."); return;
  721. }
  722. if (gagajf.isNull(recipPhnno3)) {
  723. mcxDialog.alert("휴대전화를 입력하세요."); return;
  724. }
  725. var recipPhnno = recipPhnno1 + '-' + recipPhnno2 + '-' + recipPhnno3;
  726. var recipEmail = orderInfoList[0].ordEmail;
  727. var recipTelno;
  728. if (gagajf.isNull(recipTelno1) && gagajf.isNull(recipTelno2) && gagajf.isNull(recipTelno3)) {
  729. recipTelno = '';
  730. } else {
  731. recipTelno = recipTelno1 + '-' + recipTelno2 + '-' + recipTelno3;
  732. }
  733. // 선발송 여부 설정
  734. let wdBfSendYn = $('#wdBfSendYn').is(':checked') ? 'Y' : 'N';
  735. var jsonObj = {
  736. "ordNo" : $('#exchangeRequestFrm input[name=ordNo]').val()
  737. ,"chgReason" : $('#exchangeRequestFrm input[name=chgReason]').val()
  738. ,"chgMemo" : $('#chgMemo').val()
  739. ,"cancelReqList" : exchangeRequestList
  740. ,"isCustomer" : isCustomer
  741. ,"wdGb" : wdGb
  742. ,"addPayCost" : addDelvFee
  743. ,"chgerNm" : chgerNm
  744. ,"chgerEmail" : chgerEmail
  745. ,"chgerZipcode" : chgerZipcode
  746. ,"chgerBaseAddr" : chgerBaseAddr
  747. ,"chgerDtlAddr" : chgerDtlAddr
  748. ,"chgerPhnno" : chgerPhnno
  749. ,"chgerTelno" : chgerTelno
  750. ,"chgerRtnMemo" : $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val()
  751. ,"recipNm" : recipNm
  752. ,"recipEmail" : recipEmail
  753. ,"recipZipcode" : recipZipcode
  754. ,"recipBaseAddr" : recipBaseAddr
  755. ,"recipDtlAddr" : recipDtlAddr
  756. ,"recipPhnno" : recipPhnno
  757. ,"recipTelno" : recipTelno
  758. ,"delvMemo" : $("#exchangeRequestFrm textarea[name=delvMemo]").val()
  759. ,"ordChgSq" : ordChgSq
  760. ,"wdBfSendYn" : wdBfSendYn
  761. }
  762. // 주문번호, 교환사유, 교환메모, (취소, 반품, 교환 신청 정보 목록)
  763. var jsonData = JSON.stringify(jsonObj);
  764. // URL 설정
  765. var url;
  766. if (ordChgGb == 'G681_40') {
  767. url = '/orderChange/return/to/exchange/';
  768. } else if (ordChgGb == 'G681_20') {
  769. url = '/orderChange/exchange/to/exchange/';
  770. } else {
  771. url = '/orderChange/exchange/request/';
  772. }
  773. mcxDialog.confirm('교환요청하시겠습니까?', {
  774. cancelBtnText : "반품",
  775. sureBtnClick : function(){
  776. // 교환 실행
  777. gagajf.ajaxJsonSubmit(
  778. url
  779. , jsonData
  780. , function() {
  781. uifnPopupClose('popupOrderDetail');
  782. fnReOpenOrderDetailPopup();
  783. uifnPopupClose('popupExchangeRequestForm');
  784. }
  785. );
  786. }
  787. });
  788. }
  789. // 교환철회 처리
  790. var fnExchangeCancel = function() {
  791. let data = {};
  792. data.ordChgSq = ordChgSq;
  793. data.ordNo = ordNo;
  794. let jsonData = JSON.stringify(data);
  795. mcxDialog.confirm('요청번호 [' + ordChgSq + '] 에 대한 요청철회 처리를 하시겠습니까?', {
  796. cancelBtnText : "취소",
  797. sureBtnClick : function(){
  798. // 교환 실행
  799. gagajf.ajaxJsonSubmit(
  800. '/orderChange/exchangeCancelRequest/'
  801. , jsonData
  802. , function() {
  803. uifnPopupClose('popupOrderDetail');
  804. fnReOpenOrderDetailPopup();
  805. uifnPopupClose('popupExchangeRequestForm');
  806. }
  807. );
  808. }
  809. });
  810. }
  811. // 우편번호 DAUM을 이용한 우편번호 팝업 레이어
  812. var fnOpenDaumAddr = function(loc) {
  813. let daumZip = new daum.Postcode({
  814. oncomplete: function(data) {
  815. // 우편번호와 주소 정보를 해당 필드에 넣는다.
  816. if (loc == 'withdraw') {
  817. $('#exchangeRequestFrm input[name=chgerZipcode]').val(data.zonecode);
  818. $('#exchangeRequestFrm input[name=chgerBaseAddr]').val(cfnGetDaumRoadAddr(data));
  819. $('#exchangeRequestFrm input[name=chgerDtlAddr]').focus();
  820. } else if (loc == 'exchange') {
  821. $('#exchangeRequestFrm input[name=recipZipcode]').val(data.zonecode);
  822. $('#exchangeRequestFrm input[name=recipBaseAddr]').val(cfnGetDaumRoadAddr(data));
  823. $('#exchangeRequestFrm input[name=recipDtlAddr]').focus();
  824. }
  825. cfnCloseDaumAddr();
  826. },
  827. width: '100%'
  828. });
  829. cfnOpenDaumAddr(daumZip);
  830. }
  831. // 회수지정보 설정
  832. var fnSetChger = function(){
  833. var data;
  834. if (ordChgSq > 0) {
  835. data = orderChangeDetailList[0];
  836. data.recipPhnno = data.chgerPhnno;
  837. data.recipTelno = data.chgerTelno;
  838. data.recipNm = data.chgerNm;
  839. data.recipZipcode = data.chgerZipcode;
  840. data.recipBaseAddr = data.chgerBaseAddr;
  841. data.recipDtlAddr = data.chgerDtlAddr;
  842. } else {
  843. data = orderDelvAddrInfo[0];
  844. }
  845. var spRecipPhnno = (data.recipPhnno != null) ? data.recipPhnno.split('-') : null;
  846. var spRecipTelno = (data.recipTelno != null) ? data.recipTelno.split('-') : null;
  847. $("#exchangeRequestFrm input[name=chgerNm]").val(data.recipNm);
  848. $("#exchangeRequestFrm input[name=chgerZipcode]").val(data.recipZipcode);
  849. $("#exchangeRequestFrm input[name=chgerBaseAddr]").val(data.recipBaseAddr);
  850. $("#exchangeRequestFrm input[name=chgerDtlAddr]").val(data.recipDtlAddr);
  851. $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val(data.chgerRtnMemo);
  852. if (spRecipPhnno) {
  853. $("#exchangeRequestFrm select[name=chgerPhnno1]").val(spRecipPhnno[0]);
  854. $("#exchangeRequestFrm input[name=chgerPhnno2]").val(spRecipPhnno[1]);
  855. $("#exchangeRequestFrm input[name=chgerPhnno3]").val(spRecipPhnno[2]);
  856. }
  857. if (spRecipTelno) {
  858. $("#exchangeRequestFrm select[name=chgerTelno1]").val(spRecipTelno[0]);
  859. $("#exchangeRequestFrm input[name=chgerTelno2]").val(spRecipTelno[1]);
  860. $("#exchangeRequestFrm input[name=chgerTelno3]").val(spRecipTelno[2]);
  861. }
  862. }
  863. // 교환지정보 설정
  864. var fnSetExchangeAddr = function(){
  865. var data;
  866. if (ordChgSq > 0 && ordChgGb != 'G681_40') {
  867. data = exchangeInfoList[0];
  868. } else {
  869. data = orderDelvAddrInfo[0];
  870. }
  871. var spRecipPhnno = (data.recipPhnno != null) ? data.recipPhnno.split('-') : null;
  872. var spRecipTelno = (data.recipTelno != null) ? data.recipTelno.split('-') : null;
  873. $("#exchangeRequestFrm input[name=recipNm]").val(data.recipNm);
  874. $("#exchangeRequestFrm input[name=recipZipcode]").val(data.recipZipcode);
  875. $("#exchangeRequestFrm input[name=recipBaseAddr]").val(data.recipBaseAddr);
  876. $("#exchangeRequestFrm input[name=recipDtlAddr]").val(data.recipDtlAddr);
  877. $("#exchangeRequestFrm textarea[name=delvMemo]").val(data.delvMemo);
  878. if (spRecipPhnno) {
  879. $("#exchangeRequestFrm select[name=recipPhnno1]").val(spRecipPhnno[0]);
  880. $("#exchangeRequestFrm input[name=recipPhnno2]").val(spRecipPhnno[1]);
  881. $("#exchangeRequestFrm input[name=recipPhnno3]").val(spRecipPhnno[2]);
  882. }
  883. if (spRecipTelno) {
  884. $("#exchangeRequestFrm select[name=recipTelno1]").val(spRecipTelno[0]);
  885. $("#exchangeRequestFrm input[name=recipTelno2]").val(spRecipTelno[1]);
  886. $("#exchangeRequestFrm input[name=recipTelno3]").val(spRecipTelno[2]);
  887. }
  888. }
  889. // 교환옵션 변경 이벤트
  890. var fnChangeOption = function(param) {
  891. var optCd2 = $(param).val();
  892. var ordDtlNo = $(param).attr('ordDtlNo');
  893. var ordDtlItemSq = $(param).attr('ordDtlItemSq');
  894. $.each(cancelRequestTargetList, function(idx, item){
  895. if (item.ordDtlNo == ordDtlNo && item.ordDtlItemSq == ordDtlItemSq) {
  896. var stockQtyArr = item.currStockQtys.split(',');
  897. var sizeCdArr = item.optCd2s.split(',');
  898. var stockIdx = sizeCdArr.indexOf(optCd2);
  899. var stockQty = stockQtyArr[stockIdx];
  900. item.currStockQty = stockQty;
  901. item.ordChgOpt = optCd2;
  902. }
  903. });
  904. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  905. }
  906. // 교환수량 변경 이벤트
  907. var fnChangeQty = function(param) {
  908. var chgQty = $(param).val();
  909. var ordDtlNo = $(param).attr('ordDtlNo');
  910. var exchangeRequestTargetList = [];
  911. $.each(cancelRequestTargetList, function(idx, item){
  912. if (item.ordDtlNo == ordDtlNo) {
  913. if (gagajf.isNull(item.ordChgOpt)) {
  914. mcxDialog.alert('교환옵션을 선택해주세요.');
  915. return false;
  916. }
  917. item.chgQty = chgQty;
  918. if (chgQty > 0) {
  919. exchangeRequestTargetList.push(item);
  920. }
  921. } else if (item.chgQty > 0) {
  922. exchangeRequestTargetList.push(item);
  923. } else if (ordChgSq > 0 && item.ordCanChgQty > 0) {
  924. exchangeRequestTargetList.push(item);
  925. }
  926. });
  927. // 추가배송비 설정
  928. fnAddDelvFee(exchangeRequestTargetList);
  929. // 교환대상목록 설정
  930. exchangeRequestList = exchangeRequestTargetList;
  931. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  932. }
  933. // 추가배송비 설정
  934. var fnAddDelvFee = function (exchangeRequestTargetList) {
  935. var delvCdList = [];
  936. var delvFeeList = [];
  937. var delvFee = 0;
  938. // 고객 귀책사유에 한하여 추가배송비 설정
  939. $.each(exchangeRequestTargetList, function (idx, item) {
  940. if (!delvCdList.includes(item.delvFeeCd)) {
  941. if (isCustomer) {
  942. var delvFeeTmp = $('#wdGb:checked').val() == 'W' ? item.excDelvFee : item.rtnDelvFee;
  943. delvFee += delvFeeTmp;
  944. item.addDelvFeeYn = 'Y';
  945. item.addDelvFee = delvFeeTmp;
  946. } else {
  947. item.addDelvFeeYn = 'N';
  948. item.addDelvFee = 0;
  949. }
  950. delvCdList.push(item.delvFeeCd);
  951. delvFeeList.push(item);
  952. }
  953. });
  954. addDelvFee = delvFee;
  955. addDelvFeeList = delvFeeList;
  956. // 회수방법 > 직접발송일 경우 그리드 표시
  957. if ($('#wdGb:checked').val() == 'D') {
  958. gridOptionsDelvCdList.api.setRowData(addDelvFeeList);
  959. } else {
  960. gridOptionsDelvCdList.api.setRowData();
  961. }
  962. $('#addDelvFee').text(addDelvFee.addComma() + '원');
  963. }
  964. // 회수방법 라디오 클릭 이벤트
  965. var fnChangeWdGb = function(param) {
  966. let wdGb = $(param).val();
  967. // 회수지정보 히든 처리
  968. if (wdGb == 'D') {
  969. $('.chger').css('display', 'none');
  970. } else {
  971. $('.chger').css('display', '');
  972. }
  973. // 추가배송비 계산
  974. fnChangeQty();
  975. }
  976. // 회수지 정보 수정
  977. var fnChangeChgerInfo = function() {
  978. let url = '/orderChange/change/chger/addr';
  979. let chgerNm = $("#exchangeRequestFrm input[name=chgerNm]").val();
  980. let chgerZipcode = $("#exchangeRequestFrm input[name=chgerZipcode]").val();
  981. let chgerBaseAddr = $("#exchangeRequestFrm input[name=chgerBaseAddr]").val();
  982. let chgerDtlAddr = $("#exchangeRequestFrm input[name=chgerDtlAddr]").val();
  983. let chgerPhnno1 = $("#exchangeRequestFrm select[name=chgerPhnno1]").val();
  984. let chgerPhnno2 = $("#exchangeRequestFrm input[name=chgerPhnno2]").val();
  985. let chgerPhnno3 = $("#exchangeRequestFrm input[name=chgerPhnno3]").val();
  986. let chgerTelno1 = $("#exchangeRequestFrm select[name=chgerTelno1]").val();
  987. let chgerTelno2 = $("#exchangeRequestFrm input[name=chgerTelno2]").val();
  988. let chgerTelno3 = $("#exchangeRequestFrm input[name=chgerTelno3]").val();
  989. if (gagajf.isNull(chgerZipcode)) {
  990. mcxDialog.alert("회수지주소를 입력하세요."); return;
  991. }
  992. if (gagajf.isNull(chgerBaseAddr)) {
  993. mcxDialog.alert("회수지주소를 입력하세요."); return;
  994. }
  995. if (gagajf.isNull(chgerDtlAddr)) {
  996. mcxDialog.alert("회수지주소를 입력하세요."); return;
  997. }
  998. if (gagajf.isNull(chgerPhnno1)) {
  999. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1000. }
  1001. if (gagajf.isNull(chgerPhnno2)) {
  1002. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1003. }
  1004. if (gagajf.isNull(chgerPhnno3)) {
  1005. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1006. }
  1007. let chgerPhnno = chgerPhnno1 + '-' + chgerPhnno2 + '-' + chgerPhnno3;
  1008. let chgerRtnMemo = $("#exchangeRequestFrm textarea[name=chgerRtnMemo]").val();
  1009. let chgerTelno = '';
  1010. if (!gagajf.isNull(chgerTelno1) && !gagajf.isNull(chgerTelno2) && !gagajf.isNull(chgerTelno3)) {
  1011. chgerTelno = chgerTelno1 + '-' + chgerTelno2 + '-' + chgerTelno3;
  1012. }
  1013. let data = {};
  1014. data.ordChgSq = ordChgSq;
  1015. data.chgerNm = chgerNm;
  1016. data.chgerPhnno = chgerPhnno;
  1017. data.chgerZipcode = chgerZipcode;
  1018. data.chgerBaseAddr = chgerBaseAddr;
  1019. data.chgerDtlAddr = chgerDtlAddr;
  1020. data.chgerRtnMemo = chgerRtnMemo;
  1021. let jsonData = JSON.stringify(data);
  1022. gagajf.ajaxJsonSubmit(url, jsonData, function(result){
  1023. });
  1024. }
  1025. var fnChangeRecipInfo = function() {
  1026. let url = '/order/deliver/addr/update';
  1027. var recipNm = $("#exchangeRequestFrm input[name=recipNm]").val();
  1028. var recipZipcode = $("#exchangeRequestFrm input[name=recipZipcode]").val();
  1029. var recipBaseAddr = $("#exchangeRequestFrm input[name=recipBaseAddr]").val();
  1030. var recipDtlAddr = $("#exchangeRequestFrm input[name=recipDtlAddr]").val();
  1031. var delvMemo = $("#exchangeRequestFrm textarea[name=delvMemo]").val();
  1032. var recipPhnno1 = $("#exchangeRequestFrm select[name=recipPhnno1]").val();
  1033. var recipPhnno2 = $("#exchangeRequestFrm input[name=recipPhnno2]").val();
  1034. var recipPhnno3 = $("#exchangeRequestFrm input[name=recipPhnno3]").val();
  1035. var recipTelno1 = $("#exchangeRequestFrm select[name=recipTelno1]").val();
  1036. var recipTelno2 = $("#exchangeRequestFrm input[name=recipTelno2]").val();
  1037. var recipTelno3 = $("#exchangeRequestFrm input[name=recipTelno3]").val();
  1038. if (gagajf.isNull(recipZipcode)) {
  1039. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1040. }
  1041. if (gagajf.isNull(recipBaseAddr)) {
  1042. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1043. }
  1044. if (gagajf.isNull(recipDtlAddr)) {
  1045. mcxDialog.alert("교환지주소를 입력하세요."); return;
  1046. }
  1047. if (gagajf.isNull(recipPhnno1)) {
  1048. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1049. }
  1050. if (gagajf.isNull(recipPhnno2)) {
  1051. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1052. }
  1053. if (gagajf.isNull(recipPhnno3)) {
  1054. mcxDialog.alert("휴대전화를 입력하세요."); return;
  1055. }
  1056. var recipPhnno = recipPhnno1 + '-' + recipPhnno2 + '-' + recipPhnno3;
  1057. var recipTelno;
  1058. if (gagajf.isNull(recipTelno1) && gagajf.isNull(recipTelno2) && gagajf.isNull(recipTelno3)) {
  1059. recipTelno = '';
  1060. } else {
  1061. recipTelno = recipTelno1 + '-' + recipTelno2 + '-' + recipTelno3;
  1062. }
  1063. let data = {};
  1064. data.delvAddrSq = delvAddrSq;
  1065. data.recipNm = recipNm;
  1066. data.recipPhnno = recipPhnno;
  1067. data.recipZipcode = recipZipcode;
  1068. data.recipBaseAddr = recipBaseAddr;
  1069. data.recipDtlAddr = recipDtlAddr;
  1070. data.delvMemo = delvMemo;
  1071. let jsonData = JSON.stringify(data);
  1072. gagajf.ajaxJsonSubmit(url, jsonData, function(result){
  1073. });
  1074. }
  1075. $(document).ready(function() {
  1076. // 1. 그리드생성
  1077. gagaAgGrid.createGrid('gridOrderCancelRequestList' , gridOptionsExchangeReqList); // 주문정보
  1078. gagaAgGrid.createGrid('gridDelvCdList' , gridOptionsDelvCdList); // 배송정보
  1079. gridOptionsExchangeReqList.api.setRowData(cancelRequestTargetList);
  1080. // 2.1 TOTAL ROWS 없애기
  1081. gagaAgGrid.hideStatusBar('gridOrderCancelRequestList');
  1082. gagaAgGrid.hideStatusBar('gridOrderCancelRequestToBeList');
  1083. gagaAgGrid.hideStatusBar('gridDelvCdList');
  1084. // 3. 회수지정보설정
  1085. fnSetChger();
  1086. // 4. 교환지정보설정
  1087. fnSetExchangeAddr();
  1088. // 5. 회수방법 라디오 체크 처리
  1089. if (wdGb == 'D') {
  1090. $('input:radio[name="wdGb"]:radio[value="D"]').prop('checked', true);
  1091. $('.chger').css('display', 'none');
  1092. } else {
  1093. $('input:radio[name="wdGb"]:radio[value="W"]').prop('checked', true);
  1094. }
  1095. // 교환철회 처리
  1096. if (ordChgSq > 0) {
  1097. // 5. 교환사유설정
  1098. $('#chgReason').text(chgReasonNm);
  1099. // 6. 교환요청메모설정
  1100. $('#chgMemo').text(chgMemo);
  1101. // 7. 귀책사유 설정
  1102. fnChangeChgReason(chgReason);
  1103. // 8. 데이터 Disabled 처리
  1104. $('input:radio[name=wdGb]').attr('disabled', true); // 8-1. 회수방법
  1105. $('input[name=chgerBaseAddr]').attr('readOnly', true); // 8-4. 회수지정보 > 기본주소
  1106. $('input[name=recipBaseAddr]').attr('readOnly', true); // 8-10. 교환지정보 > 기본주소
  1107. $('#chgMemo').attr('readOnly', true); // 8-2. 요청메모
  1108. // 2021.06.25 교환접수, 교환대기 상태에서는 회수지 정보 수정 가능
  1109. if (!gagajf.isNull(ordChgGb) || (chgStat != 'G685_20' && chgStat != 'G685_21')) {
  1110. $('input[name=chgerNm]').attr('readOnly', true); // 8-3. 회수지정보 > 보내는사람
  1111. $('input[name=chgerDtlAddr]').attr('readOnly', true); // 8-5. 회수지정보 > 상세주소
  1112. $('select[name=chgerTelno1]').attr('disabled', true); // 8-6. 회수지정보 > 일반전화
  1113. $('input[name=chgerTelno2]').attr('readOnly', true); // 8-6. 회수지정보 > 일반전화
  1114. $('input[name=chgerTelno3]').attr('readOnly', true); // 8-6. 회수지정보 > 일반전화
  1115. $('select[name=chgerPhnno1]').attr('disabled', true); // 8-7. 회수지정보 > 휴대전화
  1116. $('input[name=chgerPhnno2]').attr('readOnly', true); // 8-7. 회수지정보 > 휴대전화
  1117. $('input[name=chgerPhnno3]').attr('readOnly', true); // 8-7. 회수지정보 > 휴대전화
  1118. $('#chgerRtnMemo').attr('readOnly', true); // 8-8. 회수지정보 > 반품메모
  1119. }
  1120. // 2021.06.25 교환상품 배송중 상태 전까지 정보 수정 가능
  1121. if (ordChgGb == 'G681_20' || (chgStat == 'G685_40' && (chgOrdDtlStat != 'G013_20' && chgOrdDtlStat != 'G013_30' && chgOrdDtlStat != 'G013_35'))) {
  1122. $('input[name=recipNm]').attr('readOnly', true); // 8-9. 교환지정보 > 받는사람
  1123. $('input[name=recipDtlAddr]').attr('readOnly', true); // 8-11. 교환지정보 > 상세주소
  1124. $('select[name=recipTelno1]').attr('disabled', true); // 8-12. 교환지정보 > 일반전화
  1125. $('input[name=recipTelno2]').attr('readOnly', true); // 8-12. 교환지정보 > 일반전화
  1126. $('input[name=recipTelno3]').attr('readOnly', true); // 8-12. 교환지정보 > 일반전화
  1127. $('select[name=recipPhnno1]').attr('disabled', true); // 8-13. 교환지정보 > 휴대전화
  1128. $('input[name=recipPhnno2]').attr('readOnly', true); // 8-13. 교환지정보 > 휴대전화
  1129. $('input[name=recipPhnno3]').attr('readOnly', true); // 8-13. 교환지정보 > 휴대전화
  1130. $('#delvMemo').attr('readOnly', true); // 8-14. 교환지정보 > 배송메모
  1131. }
  1132. }
  1133. });
  1134. </script>
  1135. </html>