Kaynağa Gözat

[CS개선][클레임] 환불컨펌 사유 변경 기능 추가

jsh77b 4 yıl önce
ebeveyn
işleme
89868823a2

+ 5 - 0
src/main/java/com/style24/admin/biz/service/TsaWithdrawService.java

@@ -451,6 +451,11 @@ public class TsaWithdrawService {
 			OrderChange orderChange = new OrderChange();
 			orderChange.setOrdChgSq(ordChgSq);
 			orderChange.setUserNo(userNo);
+			
+			// 2021.11.15 반품사유 업데이트
+			orderChange.setChgReason(chgReason);
+			orderChange.setUpdNo(userNo);
+			orderChangeDao.updateOrderChangeChgReason(orderChange);
 
 			GagaMap info = orderChangeService.refundConfirmPreInfo(orderChange);
 

+ 69 - 21
src/main/webapp/WEB-INF/views/withdraw/RefundDetailForm.html

@@ -50,7 +50,12 @@
 					<tr>
 						<th>최종요청사유</th>
 						<td>
-							<span id="chgReasonNm"></span>
+							<span id="chgReasonNm">
+								<select name="selectChgReason" onchange="fnChangeChgReason($(this).val());">
+									<option value="">[선택하세요]</option>
+									<option th:if="${chgReasonList}" th:each="oneData, status : ${chgReasonList}" th:value="|${oneData.cd}|" th:text="|${oneData.cdNm}|"></option>
+								</select>
+							</span>
 						</td>
 						<th>귀책사유<i class="star"></i></th>
 						<td>
@@ -366,11 +371,10 @@
 		
 		// 전체 회수 완료 일 때
 		if (result.dataList.length == confirmCnt ) {
-			setReadOnly(true);
+			//setReadOnly(true);
 			$('#pgBtn').hide();
 			$('#divRefundInfo').hide();
 			$('#divRefundInfo2').show();
-			
 		}
 		
 		// 회수리스트 설정
@@ -439,25 +443,28 @@
 		// 환불컨펌 상세
 		$("#wdGbNm").text(data.wdGbNm); 													// 회수구분 
 		$("#arriValDt").text(data.arrivalDt); 												// arriValDt 도착일
-		$("#chgReasonNm").text(data.chgReasonNm); 											// 최종요청사유 
+		//$("#chgReasonNm").text(data.chgReasonNm); 										// 최종요청사유 
 		$("#chgReasonText").text(data.chgReasonText); 										// 귀책사유 
 		$("#withdrawDetailForm input[name=encloseFee]").val(data.encloseFee); 				// 동봉비 
 		$("#withdrawDetailForm input[name=codFee]").val(data.codFee); 						// 착불비 
 		$("#withdrawDetailForm input[name=addPayCost]").val(data.addPayCost); 				// 추가결제비 
 		$("#chgMemo").text(data.chgMemo); 													// 클레임메모 
 		$("#wdMemo").text(data.wdMemo); 													// 회수메모
+		
+		// 2021.11.15 사유변경설정
+		$("#withdrawDetailForm select[name=selectChgReason]").val(data.chgReason);
 
-		if(delvExpnYn == "Y"){
-			$('#withdrawDetailForm input[name=codFee]').attr('readonly', 'readonly');
-			$('#withdrawDetailForm input[name=encloseFee]').attr('readonly', 'readonly');
-			
-		} else {
-			if(wdGb == "W"){
-				$('#withdrawDetailForm input[name=codFee]').attr('readonly', 'readonly');
-			} else {
-				$('#withdrawDetailForm input[name=codFee]').remove('readonly');	
-			}
-		}
+		// 2021.11.15 동봉비, 착불비 칼럼 전체 허용 (CS 개선업무)
+		//if(delvExpnYn == "Y"){
+			//$('#withdrawDetailForm input[name=codFee]').attr('readonly', 'readonly');
+			//$('#withdrawDetailForm input[name=encloseFee]').attr('readonly', 'readonly');
+		//} else {
+			//if(wdGb == "W"){
+				//$('#withdrawDetailForm input[name=codFee]').attr('readonly', 'readonly');
+			//} else {
+				//$('#withdrawDetailForm input[name=codFee]').remove('readonly');	
+			//}
+		//}
 		
 		fnSetTotRefundData();
 	}
@@ -473,9 +480,14 @@
 	*  환불 금액 계산
 	**************************************************************************/		
 	var fnSetTotRefundData = function() {
-		var enCloseFee			= $("#withdrawDetailForm input[name=encloseFee]").val(); 	//동봉비 
-		var codFee				= $("#withdrawDetailForm input[name=codFee]").val(); 		//착불비 
-		var addPaycost			= $("#withdrawDetailForm input[name=addPayCost]").val(); 	//추가결제비
+		var enCloseFee			= $("#withdrawDetailForm input[name=encloseFee]").val(); 		//동봉비 
+		var codFee				= $("#withdrawDetailForm input[name=codFee]").val(); 			//착불비 
+		var addPaycost			= $("#withdrawDetailForm input[name=addPayCost]").val(); 		//추가결제비
+		var chgReason			= $("#withdrawDetailForm select[name=selectChgReason]").val(); 	//변경사유
+		
+		if (chgReason != 'G688_10') {
+			isCustomer = false;
+		}
 
 		enCloseFee				= enCloseFee.replaceAll(',', '');
 		codFee					= codFee.replaceAll(',', '');
@@ -483,6 +495,7 @@
 
 		addDeliveryFee			= 0;
 		addDeliveryFeeYn		= "N";
+		
 		codFeeAmt				= 0;
 		codFeeYn				= "N";
 		enCloseFeeAmt			= Number(enCloseFee);
@@ -536,6 +549,16 @@
 		if (allDelvCanYn == 'Y' && returnOrderInfo != null && returnOrderInfo[0].delvGfcdUseAmt + returnOrderInfo[0].realDelvAmt == 0) {
 			orgDelvFee = returnOrderInfo[0].orgDelvFee;
 		}
+		
+		// 2021.11.15 착불비, 동봉비 사용 허용 개발
+		if (Number(codFee) > 0) {
+			codFeeAmt 	= Number(codFee);
+			codFeeYn  	= "Y";
+		}
+		
+		if (Number(enCloseFee) > 0) {
+			enCloseFeeYn = "Y";
+		}
 
 		// 출고예외(확정후 품절,불량)일 경우
 		if (delvExpnYn == "Y") {
@@ -584,11 +607,11 @@
 						leftDelvFee = Number(codFee) + orgDelvFee;
 						delvFee = 0 - orgDelvFee;
 
-						if(Number(codFee) > 0){
+						if (Number(codFee) > 0) {
 							codFeeAmt = Number(codFee);
 							codFeeYn  = "Y";
-						}
-						if(Number(enCloseFee) > 0){
+						} 
+						if (Number(enCloseFee) > 0) {
 							enCloseFeeYn = "Y";
 						}
 						
@@ -796,6 +819,7 @@
 		reFundInfo.enCloseFee		= enCloseFeeAmt;
 		reFundInfo.depositAmt		= depositAmt;
 		reFundInfo.msgStat			= $('#msgStat').is(':checked') ? 'Y' : 'N';
+		reFundInfo.chgReason		= $("#withdrawDetailForm select[name=selectChgReason]").val(); 	//변경사유 
 		
 		var jsonData = JSON.stringify(reFundInfo);
 		
@@ -854,6 +878,30 @@
 		fnRefundDetailSearch();
 		fnChangePgStat();
 	}); 
+	
+	// 2021.11.15 추가 귀책사유설정
+	var fnChangeChgReason = function(reasonCd){
+		var customerReasonArr = ['G688_10'];
+
+		isCustomer = false;
+		
+		// 귀책사유체크(취소,반품,교환)
+		for (i=0 ; i<customerReasonArr.length ; i++) {
+			if (customerReasonArr[i] == reasonCd) {
+				isCustomer = true;
+			}
+		}
+		
+		// 귀책사유설정
+		if (isCustomer) {
+			$("#chgReasonText").text("고객");
+		} else {
+			$("#chgReasonText").text("회사");
+		}
+
+		// 2021.11.15 변경사유변경 환불금액 재계산
+		fnSetTotRefundData();
+	}
 
 /*]]>*/
 </script>