CancelRequestForm.html 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054
  1. <!DOCTYPE html>
  2. <html lang="ko" xmlns:th="http://www.thymeleaf.org">
  3. <!--
  4. *******************************************************************************
  5. * @source : CancelRequestForm.html
  6. * @desc : 취소요청 화면
  7. *============================================================================
  8. * Pastelmall
  9. * Copyright(C) 2019 TSIT, All rights reserved.
  10. *============================================================================
  11. * VER DATE AUTHOR DESCRIPTION
  12. * === =========== ========== =============================================
  13. * 1.0 2020.12.12 jsh77b 최초 작성
  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('popupCancelRequestForm');"><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="cancelRequestFrm" name="cancelRequestFrm" action="/order/cancel" method="post" target="hdFrameForOrderCancel">
  24. <input type="hidden" name="ordNo" th:value="${ordNo}"/>
  25. <input type="hidden" name="chgReason" value=""/>
  26. <input type="hidden" name="chgReasonDesc" value=""/>
  27. <h3>주문정보</h3>
  28. <div id="gridOrderCancelRequestList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
  29. <h3>취소정보</h3>
  30. <div id="gridOrderCancelRequestToBeList" style="width:100%; height: 200px;" class="ag-theme-balham"></div>
  31. <h3>배송비정보</h3>
  32. <div id="gridDelvCdList" style="width:100%; height: 140px;" class="ag-theme-balham"></div>
  33. <div style="text-align:right; padding-bottom:5px; padding-top:5px;">
  34. <!--
  35. <button type="button" class="btn btn-success" id="btnCancelRequestEscrow" onclick="fnCancelRequestEscrow();" style="display:none;">에스크로 결제생성</button>
  36. <label th:if="${sessionInfo.userId == 'jsh77b'}">
  37. <input type="checkbox" name="pgStats" value="N">PG 전문 미전송
  38. </label>
  39. -->
  40. <button type="button" class="btn btn-success" id="btnCancelRequestPartOk" onclick="fnCancelRequestPartOk();">요청</button>
  41. </div>
  42. <table class="frmStyle">
  43. <colgroup>
  44. <col style="width:160px;" />
  45. <col style="width:320px;" />
  46. <col style="width:160px;" />
  47. <col />
  48. </colgroup>
  49. <tbody>
  50. <tr>
  51. <th>취소사유 <i class="star"></i></th>
  52. <td>
  53. <select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
  54. <option value="">[선택하세요]</option>
  55. <option th:if="${chgReasonList}" th:each="oneData, status : ${chgReasonList}" th:value="|${oneData.cd}:${oneData.cdNm}|" th:text="|[${oneData.cd}] ${oneData.cdNm}|"></option>
  56. </select>
  57. </td>
  58. <th>귀책사유</th>
  59. <td><span id="imputeReason"></span></td>
  60. </tr>
  61. <tr>
  62. <th>요청메모</th>
  63. <td colspan="3">
  64. <textarea id="chgMemo" name="chgMemo" style="height:80px;" placeholder="취소사유를 300자내외로 작성해 주세요"></textarea>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <h4>환불예정금액</h4>
  70. <table class="frmStyle">
  71. <colgroup>
  72. <col style="width:20%;"/>
  73. <col style="width:30%;"/>
  74. <col style="width:20%;"/>
  75. <col style="width:30%;"/>
  76. </colgroup>
  77. <tbody>
  78. <tr>
  79. <th>총 결제 금액</th>
  80. <td colspan="3"><span id="spanPayAmt"></span>원 (상품 실결제 금액 : <span id="spanSumRealOrdAmt"></span>원, 배송금액 : <span id="spanSumDeliveryFee"></span>원) </td>
  81. </tr>
  82. <tr>
  83. <th>주문 상품 금액</th>
  84. <td><span id="spanOrdAmt"></span>원</td>
  85. <th>취소 상품 금액</th>
  86. <td><span id="spanCnclRtnAmt"></span>원</td>
  87. </tr>
  88. <tr>
  89. <th>취소 사용 포인트</th>
  90. <td colspan="3"><span id="spanTotPntDcAmt"></span>원 (고객 포인트 : <span id="spanPntDcAmt"></span>원 + 상품 선포인트 : <span id="spanPrePntDcAmt"></span>원) </td>
  91. </tr>
  92. <tr>
  93. <th>취소 사용 쿠폰금액</th>
  94. <td colspan="3"><span id="spanCpnDcAmt"></span>원 (즉시할인쿠폰 : <span id="spanCpn1DcAmt"></span>원 + 상품쿠폰 : <span id="spanGoodsCpnDcAmt"></span>원 + 장바구니쿠폰 : <span id="spanCartCpnDcAmt"></span>원)</td>
  95. </tr>
  96. <tr>
  97. <th>취소 다다익선 금액</th>
  98. <td colspan="3"><span id="spanTmtbDcAmt"></span>원 (수량할인 : <span id="spanTmtb1DcAmt"></span>원 + 금액할인 : <span id="spanTmtb2DcAmt"></span>원)</td>
  99. </tr>
  100. <tr>
  101. <th>취소 고객 상품권 금액</th>
  102. <td colspan="3"><span id="spanGfcdUseAmt"></span>원</td>
  103. </tr>
  104. <tr>
  105. <th>취소 상품 실결제 금액</th>
  106. <td><span id="spanRealCnclRtnAmt"></span>원</td>
  107. <th>추가 배송 금액</th>
  108. <td><span id="spanTotDeliveryFee"></span>원 </td>
  109. </tr>
  110. <tr>
  111. <th>추가 반품배송 금액</th>
  112. <td><span id="spanTotRtnDelvFee"></span>원</td>
  113. <th>추가 교환배송 금액</th>
  114. <td><span id="spanTotExcDelvFee"></span>원 </td>
  115. </tr>
  116. <tr>
  117. <th>환불 금액 합계</th>
  118. <td colspan="3"><span id="spanRefundAmt"></span>원</td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <div id="wrapRefundAccount" style="width:50%;">
  123. <h4>환불계좌정보</h4>
  124. <button type="button" id="btnSaveAccount" class="btn btnRight btn-base btn-sm" style="margin-left:10px;" onclick="fnCreateOrderRfAccount();">등록</button>
  125. <div id="gridRefundAccountInfo" style="height: 150px;" class="ag-theme-balham"></div>
  126. </div>
  127. </form>
  128. </div>
  129. </div>
  130. </div>
  131. <!-- data -->
  132. <script th:inline="javascript">
  133. /*<![CDATA[*/
  134. var cancelRequestTargetList = [[${cancelRequestTargetList}]]; // 취소대상목록
  135. var ordNo = [[${ordNo}]]; // 주문번호
  136. var orderInfoList = [[${orderInfoList}]]; // 주문기본정보
  137. var payMeans = orderInfoList[0].payMeans; // 결제수단
  138. var temp1 = true;
  139. var temp2 = false;
  140. // specify the columns
  141. var columnCancelReqList = [
  142. {
  143. headerName : "주문상세정보",
  144. children : [
  145. {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
  146. {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
  147. {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
  148. {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
  149. {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center', hide: temp1},
  150. {headerName: "상품명" , field: "goodsNm" , width: 200 , cellClass: 'text-center', hide: temp1},
  151. {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
  152. ]
  153. },
  154. {
  155. headerName : "주문상세단품정보",
  156. children : [
  157. {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
  158. {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  159. {headerName: "단품명" , field: "itemNm" , width: 200 , cellClass: 'text-center', hide: temp2},
  160. {headerName: "옵션1" , field: "optCd1" , width: 80 , cellClass: 'text-center', hide: temp1},
  161. {headerName: "옵션2" , field: "optCd2" , width: 80 , cellClass: 'text-center', hide: temp2},
  162. {
  163. headerName : "단품수량"
  164. , field : "itemQty"
  165. , width : 80
  166. , cellClass : 'text-center'
  167. , cellRenderer : function (params) {
  168. return params.value.addComma();
  169. }
  170. },
  171. {
  172. headerName : "단품금액"
  173. , field : "itemPrice"
  174. , width : 80
  175. , cellClass : 'text-right'
  176. , cellRenderer : function (params) {
  177. return params.value.addComma();
  178. }
  179. },
  180. {
  181. headerName : "단품옵션금액"
  182. , field : "optAddPrice"
  183. , width : 80
  184. , cellClass : 'text-right'
  185. , cellRenderer : function (params) {
  186. return params.value.addComma();
  187. }
  188. }
  189. ]
  190. },
  191. {
  192. headerName : "주문상세수량",
  193. children : [
  194. {
  195. headerName : "주문"
  196. , field : "ordQty"
  197. , width : 80
  198. , cellClass : 'text-center'
  199. , cellRenderer : function (params) {
  200. return params.value.addComma();
  201. }
  202. },
  203. {
  204. headerName : "취소/요청"
  205. , field : "cnclRtnQty"
  206. , width : 80
  207. , cellClass : 'text-center'
  208. , cellRenderer : function (params) {
  209. var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
  210. return cnclRtnReqQty;
  211. }
  212. },
  213. {
  214. headerName : "취소"
  215. , field : "ordCanChgQty"
  216. , width : 100
  217. , cellClass : 'text-center'
  218. , cellRenderer : function (params) {
  219. var ordQty = parseInt(params.data.ordQty);
  220. var cnclRtnQty = parseInt(params.data.cnclRtnQty);
  221. var ordReqChgQty = parseInt(params.data.ordReqChgQty);
  222. var ordCanChgQty = ordQty - (cnclRtnQty + ordReqChgQty);
  223. var strVal = "";
  224. strVal += "<select class='ordCanChgQty' name='ordCanChgQty' ordDtlNo='"+params.data.ordDtlNo+"' onChange='fnCalculateRefundAmt(this);'>";
  225. for (i=0 ; i<=ordCanChgQty ; i++) {
  226. if (i == params.data.ordCanChgQty) {
  227. strVal += " <option value='"+i+"' selected>"+i+"</option>";
  228. } else {
  229. strVal += " <option value='"+i+"'>"+i+"</option>";
  230. }
  231. }
  232. strVal += "</select>";
  233. return strVal;
  234. }
  235. }
  236. ]
  237. },
  238. {
  239. headerName : "주문단품금액",
  240. children : [
  241. {
  242. headerName : "주문"
  243. , field : "ordAmt"
  244. , width : 80
  245. , cellClass : 'text-right'
  246. , cellRenderer : function (params) {
  247. return params.value.addComma();
  248. }
  249. },
  250. {
  251. headerName : "취소"
  252. , field : "cnclRtnAmt"
  253. , width : 80
  254. , cellClass : 'text-right'
  255. , cellRenderer : function (params) {
  256. return params.value.addComma();
  257. }
  258. },
  259. {
  260. headerName : "즉시할인"
  261. , field : "cpn1DcAmt"
  262. , width : 80
  263. , cellClass : 'text-right'
  264. , cellRenderer : function (params) {
  265. return params.value.addComma();
  266. }
  267. },
  268. {
  269. headerName : "다다익선1"
  270. , field : "tmtb1DcAmt"
  271. , width : 80
  272. , cellClass : 'text-right'
  273. , cellRenderer : function (params) {
  274. return params.value.addComma();
  275. }
  276. },
  277. {
  278. headerName : "다다익선2"
  279. , field : "tmtb2DcAmt"
  280. , width : 80
  281. , cellClass : 'text-right'
  282. , cellRenderer : function (params) {
  283. return params.value.addComma();
  284. }
  285. },
  286. {
  287. headerName : "상품쿠폰"
  288. , field : "goodsCpnDcAmt"
  289. , width : 80
  290. , cellClass : 'text-right'
  291. , cellRenderer : function (params) {
  292. return params.value.addComma();
  293. }
  294. },
  295. {
  296. headerName : "장바구니쿠폰"
  297. , field : "cartCpnDcAmt"
  298. , width : 80
  299. , cellClass : 'text-right'
  300. , cellRenderer : function (params) {
  301. return params.value.addComma();
  302. }
  303. },
  304. {
  305. headerName : "포인트"
  306. , field : "pntDcAmt"
  307. , width : 80
  308. , cellClass : 'text-right'
  309. , cellRenderer : function (params) {
  310. return params.value.addComma();
  311. }
  312. },
  313. {
  314. headerName : "선포인트"
  315. , field : "prePntDcAmt"
  316. , width : 80
  317. , cellClass : 'text-right'
  318. , cellRenderer : function (params) {
  319. return params.value.addComma();
  320. }
  321. },
  322. {
  323. headerName : "상품권"
  324. , field : "gfcdUseAmt"
  325. , width : 80
  326. , cellClass : 'text-right'
  327. , cellRenderer : function (params) {
  328. return params.value.addComma();
  329. }
  330. },
  331. {
  332. headerName : "실결제금액"
  333. , field : "realOrdAmt"
  334. , width : 80
  335. , cellClass : 'text-right'
  336. , cellRenderer : function (params) {
  337. return params.value.addComma();
  338. }
  339. }
  340. ]
  341. },
  342. {
  343. headerName : "주문배송비정보",
  344. children : [
  345. {
  346. headerName : "배송비"
  347. , field : "delvFee"
  348. , width : 80
  349. , cellClass : 'text-right'
  350. , cellRenderer : function (params) {
  351. return params.value.addComma();
  352. }
  353. , hide : temp2
  354. },
  355. {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  356. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  357. {
  358. headerName : "무료배송비"
  359. , field : "minOrdAmt"
  360. , width : 80
  361. , cellClass : 'text-right'
  362. , cellRenderer : function (params) {
  363. return params.value.addComma();
  364. }
  365. , hide : temp2
  366. },
  367. {
  368. headerName : "기본배송비"
  369. , field : "orgDelvFee"
  370. , width : 80
  371. , cellClass : 'text-right'
  372. , cellRenderer : function (params) {
  373. return params.value.addComma();
  374. }
  375. , hide : temp2
  376. },
  377. {
  378. headerName : "반품배송비"
  379. , field : "rtnDelvFee"
  380. , width : 80
  381. , cellClass : 'text-right'
  382. , cellRenderer : function (params) {
  383. return params.value.addComma();
  384. }
  385. , hide : temp2
  386. },
  387. {
  388. headerName : "교환배송비"
  389. , field : "excDelvFee"
  390. , width : 80
  391. , cellClass : 'text-right'
  392. , cellRenderer : function (params) {
  393. return params.value.addComma();
  394. }
  395. , hide : temp2
  396. },
  397. {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
  398. ]
  399. }
  400. ];
  401. var gridOptionsCancelReqList = orderAgGrid.getGridOptions(columnCancelReqList);
  402. // Add on options
  403. gridOptionsCancelReqList.suppressRowClickSelection = true;
  404. gridOptionsCancelReqList.rowSelection = 'multiple';
  405. //specify the columns
  406. var columnCancelReqToBeList = [
  407. {
  408. headerName : "주문상세정보",
  409. children : [
  410. {headerName: "주문번호" , field: "ordNo" , width: 80 , cellClass: 'text-center', hide: temp1},
  411. {headerName: "주문상세" , field: "ordDtlNo" , width: 80 , cellClass: 'text-center'},
  412. {headerName: "주문상세" , field: "ordDtlStat" , width: 80 , cellClass: 'text-center', hide: temp1},
  413. {headerName: "주문상세상태" , field: "ordDtlStatNm" , width: 100 , cellClass: 'text-center', hide: temp1},
  414. {headerName: "상품코드" , field: "goodsCd" , width: 100 , cellClass: 'text-center', hide: temp1},
  415. {headerName: "상품명" , field: "goodsNm" , width: 200 , cellClass: 'text-center', hide: temp1},
  416. {headerName: "상품타입" , field: "goodsTypeNm" , width: 100 , cellClass: 'text-center', hide: temp2}
  417. ]
  418. },
  419. {
  420. headerName : "주문상세단품정보",
  421. children : [
  422. {headerName: "단품번호" , field: "ordDtlItemSq" , width: 100 , cellClass: 'text-center', hide: temp2},
  423. {headerName: "단품코드" , field: "itemCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  424. {headerName: "단품명" , field: "itemNm" , width: 200 , cellClass: 'text-center', hide: temp2},
  425. {headerName: "칼라코드" , field: "optCd1" , width: 80 , cellClass: 'text-center', hide: temp1},
  426. {headerName: "사이즈코드" , field: "optCd2" , width: 80 , cellClass: 'text-center', hide: temp2},
  427. {
  428. headerName : "단품수량"
  429. , field : "itemQty"
  430. , width : 80
  431. , cellClass : 'text-center'
  432. , cellRenderer : function (params) {
  433. return params.value.addComma();
  434. }
  435. },
  436. {
  437. headerName : "단품금액"
  438. , field : "itemPrice"
  439. , width : 80
  440. , cellClass : 'text-right'
  441. , cellRenderer : function (params) {
  442. return params.value.addComma();
  443. }
  444. },
  445. {
  446. headerName : "단품옵션금액"
  447. , field : "optAddPrice"
  448. , width : 80
  449. , cellClass : 'text-right'
  450. , cellRenderer : function (params) {
  451. return params.value.addComma();
  452. }
  453. }
  454. ]
  455. },
  456. {
  457. headerName : "주문상세수량",
  458. children : [
  459. {
  460. headerName : "주문"
  461. , field : "ordQty"
  462. , width : 80
  463. , cellClass : 'text-center'
  464. , cellRenderer : function (params) {
  465. return params.value.addComma();
  466. }
  467. },
  468. {
  469. headerName : "취소/요청"
  470. , field : "cnclRtnQty"
  471. , width : 80
  472. , cellClass : 'text-center'
  473. , cellRenderer : function (params) {
  474. var cnclRtnReqQty = parseInt(params.data.cnclRtnQty) + parseInt(params.data.ordReqChgQty);
  475. return cnclRtnReqQty;
  476. }
  477. },
  478. {
  479. headerName : "취소"
  480. , field : "ordCanChgQty"
  481. , width : 100
  482. , cellClass : 'text-center'
  483. , cellRenderer : function (params) {
  484. return params.value.addComma();
  485. }
  486. }
  487. ]
  488. },
  489. {
  490. headerName : "주문단품금액",
  491. children : [
  492. {
  493. headerName : "주문"
  494. , field : "ordAmt"
  495. , width : 80
  496. , cellClass : 'text-right'
  497. , cellRenderer : function (params) {
  498. return params.value.addComma();
  499. }
  500. },
  501. {
  502. headerName : "취소"
  503. , field : "cnclRtnAmt"
  504. , width : 80
  505. , cellClass : 'text-right'
  506. , cellRenderer : function (params) {
  507. return params.value.addComma();
  508. }
  509. },
  510. {
  511. headerName : "즉시할인"
  512. , field : "cpn1DcAmt"
  513. , width : 80
  514. , cellClass : 'text-right'
  515. , cellRenderer : function (params) {
  516. return params.value.addComma();
  517. }
  518. },
  519. {
  520. headerName : "다다익선1"
  521. , field : "tmtb1DcAmt"
  522. , width : 80
  523. , cellClass : 'text-right'
  524. , cellRenderer : function (params) {
  525. return params.value.addComma();
  526. }
  527. },
  528. {
  529. headerName : "다다익선2"
  530. , field : "tmtb2DcAmt"
  531. , width : 80
  532. , cellClass : 'text-right'
  533. , cellRenderer : function (params) {
  534. return params.value.addComma();
  535. }
  536. },
  537. {
  538. headerName : "상품쿠폰"
  539. , field : "goodsCpnDcAmt"
  540. , width : 80
  541. , cellClass : 'text-right'
  542. , cellRenderer : function (params) {
  543. return params.value.addComma();
  544. }
  545. },
  546. {
  547. headerName : "장바구니쿠폰"
  548. , field : "cartCpnDcAmt"
  549. , width : 80
  550. , cellClass : 'text-right'
  551. , cellRenderer : function (params) {
  552. return params.value.addComma();
  553. }
  554. },
  555. {
  556. headerName : "포인트"
  557. , field : "pntDcAmt"
  558. , width : 80
  559. , cellClass : 'text-right'
  560. , cellRenderer : function (params) {
  561. return params.value.addComma();
  562. }
  563. },
  564. {
  565. headerName : "선포인트"
  566. , field : "prePntDcAmt"
  567. , width : 80
  568. , cellClass : 'text-right'
  569. , cellRenderer : function (params) {
  570. return params.value.addComma();
  571. }
  572. },
  573. {
  574. headerName : "상품권"
  575. , field : "gfcdUseAmt"
  576. , width : 80
  577. , cellClass : 'text-right'
  578. , cellRenderer : function (params) {
  579. return params.value.addComma();
  580. }
  581. },
  582. {
  583. headerName : "환불금액"
  584. , field : "realOrdAmt"
  585. , width : 80
  586. , cellClass : 'text-right'
  587. , cellRenderer : function (params) {
  588. return params.value.addComma();
  589. }
  590. }
  591. ]
  592. },
  593. {
  594. headerName : "주문배송비정보",
  595. children : [
  596. {
  597. headerName : "배송비"
  598. , field : "delvFee"
  599. , width : 80
  600. , cellClass : 'text-right'
  601. , cellRenderer : function (params) {
  602. return params.value.addComma();
  603. }
  604. , hide : temp2
  605. },
  606. {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  607. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  608. {
  609. headerName : "무료배송비"
  610. , field : "minOrdAmt"
  611. , width : 80
  612. , cellClass : 'text-right'
  613. , cellRenderer : function (params) {
  614. return params.value.addComma();
  615. }
  616. , hide : temp2
  617. },
  618. {
  619. headerName : "기본배송비"
  620. , field : "orgDelvFee"
  621. , width : 80
  622. , cellClass : 'text-right'
  623. , cellRenderer : function (params) {
  624. return params.value.addComma();
  625. }
  626. , hide : temp2
  627. },
  628. {
  629. headerName : "반품배송비"
  630. , field : "rtnDelvFee"
  631. , width : 80
  632. , cellClass : 'text-right'
  633. , cellRenderer : function (params) {
  634. return params.value.addComma();
  635. }
  636. , hide : temp2
  637. },
  638. {
  639. headerName : "교환배송비"
  640. , field : "excDelvFee"
  641. , width : 80
  642. , cellClass : 'text-right'
  643. , cellRenderer : function (params) {
  644. return params.value.addComma();
  645. }
  646. , hide : temp2
  647. },
  648. {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
  649. ]
  650. }
  651. ];
  652. var gridOptionsCancelReqToBeList = orderAgGrid.getGridOptions(columnCancelReqToBeList);
  653. //specify the columns
  654. var columnDelvCdList = [
  655. {
  656. headerName : "배송코드기준금액",
  657. children : [
  658. {headerName: "업체" , field: "supplyCompCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  659. {headerName: "배송비코드" , field: "delvFeeCd" , width: 100 , cellClass: 'text-center', hide: temp2},
  660. {
  661. headerName : "주문"
  662. , field : "ordAmt"
  663. , width : 100
  664. , cellClass : 'text-right'
  665. , cellRenderer : function (params) {
  666. return params.value.addComma();
  667. }
  668. },
  669. {
  670. headerName : "취소"
  671. , field : "cnclRtnAmt"
  672. , width : 100
  673. , cellClass : 'text-right'
  674. , cellRenderer : function (params) {
  675. return params.value.addComma();
  676. }
  677. },
  678. {
  679. headerName : "환불"
  680. , field : "realOrdAmt"
  681. , width : 100
  682. , cellClass : 'text-right'
  683. , cellRenderer : function (params) {
  684. return params.value.addComma();
  685. }
  686. }
  687. ]
  688. },
  689. {
  690. headerName : "배송비정보",
  691. children : [
  692. {
  693. headerName : "배송비"
  694. , field : "delvFee"
  695. , width : 100
  696. , cellClass : 'text-right'
  697. , cellRenderer : function (params) {
  698. return params.value.addComma();
  699. }
  700. , hide : temp2
  701. },
  702. {
  703. headerName : "무료배송비"
  704. , field : "minOrdAmt"
  705. , width : 100
  706. , cellClass : 'text-right'
  707. , cellRenderer : function (params) {
  708. return params.value.addComma();
  709. }
  710. , hide : temp2
  711. },
  712. {
  713. headerName : "기본배송비"
  714. , field : "orgDelvFee"
  715. , width : 100
  716. , cellClass : 'text-right'
  717. , cellRenderer : function (params) {
  718. return params.value.addComma();
  719. }
  720. , hide : temp2
  721. },
  722. {
  723. headerName : "반품배송비"
  724. , field : "rtnDelvFee"
  725. , width : 80
  726. , cellClass : 'text-right'
  727. , cellRenderer : function (params) {
  728. return params.value.addComma();
  729. }
  730. , hide : temp2
  731. },
  732. {
  733. headerName : "교환배송비"
  734. , field : "excDelvFee"
  735. , width : 80
  736. , cellClass : 'text-right'
  737. , cellRenderer : function (params) {
  738. return params.value.addComma();
  739. }
  740. , hide : temp2
  741. },
  742. {headerName: "추가배송비여부" , field: "addDelvFeeYn" , width: 140 , cellClass: 'text-center', hide: temp2},
  743. {
  744. headerName : "추가배송비"
  745. , field : "addDelvFee"
  746. , width : 100
  747. , cellClass : 'text-right'
  748. , cellRenderer : function (params) {
  749. return params.value.addComma();
  750. }
  751. , hide : temp2
  752. },
  753. {headerName: "전체취소가능" , field: "allCanYn" , width: 100 , cellClass: 'text-center', hide: temp2},
  754. ]
  755. }
  756. ];
  757. var gridOptionsDelvCdList = orderAgGrid.getGridOptions(columnDelvCdList);
  758. // 10. 무통장 환불정보
  759. var columnDefsRefundAccountInfo = [
  760. {width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: false, checkboxSelection: true, filter: false},
  761. {headerName: "은행명" , field: "bankNm" , width: 140 , cellClass: 'text-center'},
  762. {headerName: "은행코드" , field: "bankCd" , width: 120 , cellClass: 'text-center', hidden:true},
  763. {headerName: "계좌번호" , field: "accountNo" , width: 150 , cellClass: 'text-center'},
  764. {headerName: "예금주" , field: "accountNm" , width: 120 , cellClass: 'text-center'},
  765. {headerName: "기본" , field: "defaultYn" , width: 100 , cellClass: 'text-center'}
  766. ];
  767. var gridOptionsRefundAccountInfo = orderAgGrid.getGridOptions(columnDefsRefundAccountInfo);
  768. </script>
  769. <!-- AgGrid 컬럼 세팅 -->
  770. <script>
  771. // 공통1. 주문상세 그리드 옵션 정보 적용
  772. var orderAgGrid = {
  773. getGridOptions : function(colDefs) {
  774. return {
  775. columnDefs : colDefs
  776. , detailCellRendererParams : {
  777. detailGridOptions : {
  778. columnDefs : []
  779. , defaultColDef : {
  780. resizable: true
  781. }
  782. , suppressLoadingOverlay: false
  783. , onGridReady : function (params) {
  784. params.api.setDomLayout('autoHeight');
  785. }
  786. , onFirstDataRendered : function (params) {
  787. params.api.sizeColumnsToFit();
  788. }
  789. }
  790. , getDetailRowData: function (params) {
  791. params.successCallback(params.data.orderDetailList);
  792. }
  793. }
  794. , defaultColDef: {
  795. resizable: true
  796. }
  797. , isRowMaster: function (dataItem) {
  798. return dataItem ? dataItem.orderDetailList.length > 1 : false;
  799. }
  800. , suppressRowTransform: true
  801. , enableRangeSelection: true
  802. };
  803. }
  804. }
  805. </script>
  806. <script>
  807. // 취소정보계산
  808. var fnCalculateRefundAmt = function (obj) {
  809. // 취소정보담은목록
  810. var cancelRequestTargetToBeList = [];
  811. if (obj != null) {
  812. for (i=0 ; i<cancelRequestTargetList.length ; i++) {
  813. var orDtlNo = $(obj).attr("ordDtlNo");
  814. var ordCanChgQty = $(obj).val();
  815. if (cancelRequestTargetList[i].ordDtlNo == orDtlNo) {
  816. cancelRequestTargetList[i].ordCanChgQty = ordCanChgQty;
  817. }
  818. }
  819. // 주문정보 다시 셋팅 (체크해봐야할문제)
  820. gridOptionsCancelReqList.api.setRowData(cancelRequestTargetList);
  821. }
  822. // 환불금액계산호출
  823. var jsonData = JSON.stringify(cancelRequestTargetList);
  824. gagajf.ajaxJsonSubmit(
  825. '/order/cancel/refundAmt'
  826. , jsonData
  827. , function(result) {
  828. gridOptionsCancelReqToBeList.api.setRowData(result.cancelOrderRefundList);
  829. gridOptionsDelvCdList.api.setRowData(result.cancelDelvRefundList);
  830. $("#spanPayAmt").text(result.spanPayAmt.addComma()); //총 결제 금액
  831. $("#spanSumRealOrdAmt").text(result.spanSumRealOrdAmt.addComma()); //상품 실결제 금액
  832. $("#spanSumDeliveryFee").text(result.spanSumDeliveryFee.addComma()); //배송금액
  833. $("#spanOrdAmt").text(result.spanOrdAmt.addComma()); //주문 상품 금액
  834. $("#spanCnclRtnAmt").text(result.spanCnclRtnAmt.addComma()); //취소 상품 금액
  835. $("#spanTotPntDcAmt").text(result.spanTotPntDcAmt.addComma()); //취소 사용 포인트
  836. $("#spanPntDcAmt").text(result.spanPntDcAmt.addComma()); //고객 포인트
  837. $("#spanPrePntDcAmt").text(result.spanPrePntDcAmt.addComma()); //상품 선포인트
  838. $("#spanCpnDcAmt").text(result.spanCpnDcAmt.addComma()); //취소 사용 쿠폰금액
  839. $("#spanCpn1DcAmt").text(result.spanCpn1DcAmt.addComma()); //즉시할인쿠폰
  840. $("#spanGoodsCpnDcAmt").text(result.spanGoodsCpnDcAmt.addComma()); //상품쿠폰
  841. $("#spanCartCpnDcAmt").text(result.spanCartCpnDcAmt.addComma()); //장바구니쿠폰
  842. $("#spanTmtbDcAmt").text(result.spanTmtbDcAmt.addComma()); //취소 다다익선 금액
  843. $("#spanTmtb1DcAmt").text(result.spanTmtb1DcAmt.addComma()); //수량할인
  844. $("#spanTmtb2DcAmt").text(result.spanTmtb2DcAmt.addComma()); //금액할인
  845. $("#spanGfcdUseAmt").text(result.spanGfcdUseAmt.addComma()); //취소 고객 상품권 금액
  846. $("#spanRealCnclRtnAmt").text(result.spanRealCnclRtnAmt.addComma()); //취소 상품 실결제 금액
  847. $("#spanTotDeliveryFee").text(result.spanTotDeliveryFee.addComma()); //환불 배송 금액
  848. $("#spanTotRtnDelvFee").text(result.spanTotRtnDelvFee.addComma()); //환불 배송 금액
  849. $("#spanTotExcDelvFee").text(result.spanTotExcDelvFee.addComma()); //환불 배송 금액
  850. $("#spanRefundAmt").text(result.spanRefundAmt.addComma()); //환불 금액 합계
  851. }
  852. );
  853. }
  854. // 사유
  855. var fnChangeChgReason = function(reasonCd){
  856. var arrREasonCd = reasonCd.split(":");
  857. // 취소, 반품, 교환 사유 판단
  858. if (arrREasonCd[0] == 'G686_10') {
  859. $("#imputeReason").text("고객");
  860. isImputationCustomers = true;
  861. } else {
  862. $("#imputeReason").text("회사");
  863. isImputationCustomers = false;
  864. }
  865. $('#cancelRequestFrm input[name=chgReason]').val(arrREasonCd[0]);
  866. $('#cancelRequestFrm input[name=chgReasonDesc]').val(arrREasonCd[1]);
  867. //fnCalculateRefundAmt(); //환불예정금액 계산.
  868. }
  869. // 취소요청
  870. var fnCancelRequestPartOk = function () {
  871. var temp = false;
  872. var ordDtlStat = cancelRequestTargetList[0].ordDtlStat;
  873. var allCanYn = "N";
  874. // 1. 취소수량 체크
  875. for (i=0 ; i<cancelRequestTargetList.length ; i++) {
  876. if (cancelRequestTargetList[i].ordCanChgQty > 0) {
  877. temp = true;
  878. }
  879. }
  880. if (temp == false) {
  881. mcxDialog.alert('취소 할 수량을 입력하세요.');
  882. return;
  883. }
  884. // 2. 입금대기건 && 전체취소 체크
  885. if (ordDtlStat == "G013_10" && $("#spanPayAmt").text() != $("#spanRefundAmt").text()) {
  886. alert("입금대기건은 전체 취소만 가능합니다.");
  887. return;
  888. }
  889. // 2.1 전체취소 여부 적용
  890. if (ordDtlStat == "G013_10" && $("#spanPayAmt").text() == $("#spanRefundAmt").text()) {
  891. allCanYn = "Y";
  892. }
  893. // 3. 취소사유 체크
  894. var chgReason = $("#cancelRequestFrm select[name=selectChgReason]").val();
  895. if (gagajf.isNull(chgReason)) {
  896. mcxDialog.alert("취소사유를 입력하세요."); return ;
  897. }
  898. // 4. 환불계좌 체크
  899. var accountNo = "";
  900. var accountNm = "";
  901. var bankCd = "";
  902. if (payMeans == 'G014_20') {
  903. var refundAccount = gridOptionsRefundAccountInfo.api.getSelectedRows();
  904. if (refundAccount.length == 0) {
  905. mcxDialog.alert('선택된 행이 없습니다.');
  906. return;
  907. }
  908. accountNo = refundAccount[0].accountNo;
  909. accountNm = refundAccount[0].accountNm;
  910. bankCd = refundAccount[0].bankCd;
  911. }
  912. // 5. PG 전송 여부
  913. var pgStat = "N";
  914. if ($('#cancelRequestFrm input:checkbox[name=pgStats]').is(":checked")) {
  915. pgStat = "Y";
  916. }
  917. $("#cancelRequestFrm input[name=pgStat]").val(pgStat);
  918. var jsonObj = {
  919. "ordNo" : $('#cancelRequestFrm input[name=ordNo]').val()
  920. ,"chgReason" : $('#cancelRequestFrm input[name=chgReason]').val()
  921. ,"chgMemo" : $('#chgMemo').val()
  922. ,"cancelReqList" : cancelRequestTargetList
  923. ,"accountNo" : accountNo
  924. ,"accountNm" : accountNm
  925. ,"bankCd" : bankCd
  926. ,"allCanYn" : allCanYn
  927. }
  928. // 주문번호, 취소사유, 취소메모, (취소, 반품, 교환 신청 정보 목록), 환불계좌
  929. var jsonData = JSON.stringify(jsonObj);
  930. mcxDialog.confirm('취소요청하시겠습니까?', {
  931. cancelBtnText : "취소",
  932. sureBtnClick : function(){
  933. // 취소 실행
  934. gagajf.ajaxJsonSubmit(
  935. '/order/cancel/'
  936. , jsonData
  937. , function() {
  938. uifnPopupClose('popupOrderDetail');
  939. fnReOpenOrderDetailPopup();
  940. uifnPopupClose('popupCancelRequestForm');
  941. }
  942. );
  943. }
  944. });
  945. }
  946. // 환불계좌 등록
  947. var fnCreateOrderRfAccount = function () {
  948. var actionUrl = "/order/refund/account/create/form?ordNo=" + ordNo ;
  949. cfnOpenModalPopup(actionUrl, 'popupCreateRefundAccount');
  950. };
  951. // 환불계좌 정보
  952. var fnBindOrderRfAccountInfo = function () {
  953. gagaAgGrid.fetch(
  954. "/order/refund/account/info/list?ordNo=" + ordNo
  955. , gridOptionsRefundAccountInfo
  956. , null
  957. , function (result) {
  958. }
  959. )
  960. };
  961. $(document).ready(function() {
  962. // 1. Create a agGrid
  963. gagaAgGrid.createGrid('gridOrderCancelRequestList' , gridOptionsCancelReqList); // 주문정보
  964. gridOptionsCancelReqList.api.setRowData(cancelRequestTargetList);
  965. gagaAgGrid.createGrid('gridOrderCancelRequestToBeList' , gridOptionsCancelReqToBeList); // 취소정보
  966. gagaAgGrid.createGrid('gridDelvCdList' , gridOptionsDelvCdList); // 배송비 정보
  967. gagaAgGrid.createGrid('gridRefundAccountInfo' , gridOptionsRefundAccountInfo); // 환불계좌정보
  968. //gridOptionsRefundAccountInfo.api.setRowData(orderRfAccountInfo);
  969. // 취소정보계산
  970. fnCalculateRefundAmt(null);
  971. // 그리드 숨김처리
  972. if (payMeans !== 'G014_20') {
  973. $('#wrapRefundAccount').addClass("off");
  974. }
  975. if (payMeans === 'G014_20' && mallGb === 'G011_10' ) {
  976. // 환불계좌정보
  977. fnBindOrderRfAccountInfo();
  978. }
  979. });
  980. </script>
  981. </html>