Przeglądaj źródła

[ST24PRJ-124] [MD개선] 예약등록팝업 : 숫자 입력시 자동 콤마표시 해줄것

jmh 4 lat temu
rodzic
commit
9fcc34db2c

+ 14 - 4
src/main/webapp/WEB-INF/views/goods/GoodsPriceReservePopupForm.html

@@ -31,7 +31,7 @@
 					</colgroup>
 					<tr>
 						<th>상품예약가격<em class="required" title="필수"></em></th>
-						<td><input type="text" class="w100p aR" id="resGoodsPrice" name="resGoodsPrice" maxlength="10" data-valid-type="numeric" /></td>
+						<td><input type="text" class="w100p aR" id="resGoodsPrice" name="resGoodsPrice" maxlength="10" data-valid-type="pinteger" /></td>
 						<th>예약일시<em class="required" title="필수"></em></th>
 						<td>
 							<input name="applyStYMD" id="applyStYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="예약시작일" th:value="${#calendars.format(#calendars.createNow(), 'yyyy-MM-dd')}"/>
@@ -152,7 +152,17 @@
 			});
 			return false;
 		}
-
+		
+		if( 1 > $("#goodsPriceRsvtForm input[name=resGoodsPrice]").val()) {
+			mcxDialog.alertC("상품 예약가격을 입력하세요.",{
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsPriceRsvtForm input[name=resGoodsPrice]").focus();
+				}
+			});
+			return false;
+		}
+		
 		var fromDate = $('#goodsPriceRsvtForm input[name=applyStYMD]').val();
 		var toDate = $('#goodsPriceRsvtForm input[name=applyEdYMD]').val();
 
@@ -188,7 +198,7 @@
 		
 		var optCheck = false;
 		$.each(allRowData, function(index, item) {
-			if (item.listPrice < $("#goodsPriceRsvtForm input[name=resGoodsPrice]").val()){
+			if (item.listPrice < $("#goodsPriceRsvtForm input[name=resGoodsPrice]").val().removeComma()){
 				optCheck = true;
 				mcxDialog.alertC("가격예약 상품중 정상가가 예약가 보다 낮은 상품이 상품이 존재합니다.<br/>확인해 주세요", {
 					sureBtnText: "확인",
@@ -265,7 +275,7 @@
 					arrEndGoodsPrice.push(item.currPrice);
 				});
 				
-				var data = {resGoodsPrice : $('#goodsPriceRsvtForm input[name=resGoodsPrice]').val()
+				var data = {resGoodsPrice : $('#goodsPriceRsvtForm input[name=resGoodsPrice]').val().removeComma()
 							, applyStdt : $('#goodsPriceRsvtForm input[name=applyStdt]').val()
 							, applyEddt : $('#goodsPriceRsvtForm input[name=applyEddt]').val()
 							, arrGoodsCd : arrGoodsCd