瀏覽代碼

상품 동영상 관리

eskim 5 年之前
父節點
當前提交
e567e2b16b
共有 1 個文件被更改,包括 64 次插入12 次删除
  1. 64 12
      src/main/webapp/WEB-INF/views/goods/GoodsVideoForm.html

+ 64 - 12
src/main/webapp/WEB-INF/views/goods/GoodsVideoForm.html

@@ -125,7 +125,7 @@
 							<label class="rdoBtn"><input type="radio" name="dispYn" id="dispYn" value="N">N</label>
 						</td>
 					</tr>
-					<tr id="youtobeArea">
+					<tr id="youtubeArea">
 						<th>동영상URL<em class="required" title="필수"></em></th>
 						<td class="infoTxt" colspan="5">
 							<em><i class="fa fa-info-circle"></i>유투브의 경우 빨간색 표시로 되어있는 값만 넣으세요.</em><br/>
@@ -144,6 +144,7 @@
 								<input type="hidden" name="kufKey"/>
 								<input type="hidden" name="kmcKey"/>
 							</div>
+							<div id="keyArea">미디어키 : <input type="text" class="w200"  name="hkmcKey" disabled> upload키 : <input type="text" class="w200"  name="hkufKey" disabled></div>
 							<button type="button" class="btn btn-dark btn-lg" onclick="cfnOpenGoodsVideoPopup('filmVideoView','kmcKey', '#detailForm', $('#videoGb').val());">미리보기</button>
 							
 						</td>
@@ -206,9 +207,23 @@
 			$(formId + " input[name=goodsCd]").val(event.data.goodsCd);
 			$(formId + " select[name=videoGb]").val(event.data.videoGb);
 			$(formId + " input[name=kmcKey]").val(event.data.kmcKey);
+			$(formId + " input[name=kufKey]").val(event.data.kufKey);
+			$(formId + " input[name=hkmcKey]").val(event.data.kmcKey);
+			$(formId + " input[name=hkufKey]").val(event.data.kufKey);
 			$(formId + " input:radio[name=dispYn]:input[value="+event.data.dispYn+"]").click();
 			$(formId + " input[name=goodsCd]").prop("disabled", true);
+			$(formId + " select[name=videoGb]").prop("disabled", true);
+			
 			$(formId).closest("div").show();
+			if ("Y" == event.data.videoGb){
+				$('#youtubeArea').show();
+				$('#fileArea').hide();
+			}else{
+				$('#youtubeArea').hide();
+				$('#fileArea').show();
+				$('.uFile').hide();
+				$('#keyArea').show();
+			}
 		}
 	}
 	
@@ -217,7 +232,8 @@
 		$("#detailForm")[0].reset();
 		$("#detailForm input[name=videoSq]").val('');
 		$("#detailForm input[name=goodsCd]").prop("disabled", false);
-		$('#youtobeArea').show();
+		$("#detailForm select[name=videoGb]").prop("disabled", false);
+		$('#youtubeArea').show();
 		$('#fileArea').hide();
 	});
 
@@ -234,13 +250,17 @@
 	}
 	
 	// 동영상구분 변경시
-	var fnVideoGb = function(){debugger;
+	var fnVideoGb = function(){
 		if ("Y" == $("#detailForm select[name=videoGb]").val()){
-			$('#youtobeArea').show();
+			$('#youtubeArea').show();
 			$('#fileArea').hide();
+			$('.uFile').hide();
+			$('#keyArea').hide();
 		}else{
-			$('#youtobeArea').hide();
+			$('#youtubeArea').hide();
 			$('#fileArea').show();
+			$('.uFile').show();
+			$('#keyArea').hide();
 		}
 	}
 	
@@ -251,15 +271,47 @@
 		$("#goodsNum").val('');
 		$("#supplyGoodsCd").val('');
 		$("#"+$("#searchForm select[name=keyWord]").val()).val($("#searchForm input[name=searchTxt]").val());
-		// 기간 값 체크
-		if (!fnCalendarDateValidation('#sellTerms', 'stDate', 'edDate')){
-			return false;
-		}
+		
+		if(!fnConditionCheck()) return;
+		
+		
 		// Fetch data
 		gagaAgGrid.fetch($('#searchForm').prop('action'), gridOptions, '#searchForm');
 		$("#btnNew").click();
 	});
 	
+	//검색 조건 확인
+	var fnConditionCheck = function(){
+		var form = document.searchForm;
+
+		var searchFlag = false;
+		var cnt = 0;
+
+		for (i = 0; i < form.elements.length; i++ ) {
+			var el = form.elements[i];
+
+			if ($(el).prop("type") == "text" || ($(el).prop("type") == "select-one" && el.name != "search" && el.name != "pageSize" && el.name != "keyWord")) {
+				if (!(el.value == null || el.value == "")) {
+					cnt++;
+				}
+			}
+		}
+		if(cnt > 0) searchFlag = true;
+
+		
+		if(searchFlag == false){
+			mcxDialog.alert("검색조건을 입력하세요.");
+			return false;
+		}
+		
+		// 기간 값 체크
+		if (!fnCalendarDateValidation('#sellTerms', 'stDate', 'edDate')){
+			return false;
+		}
+
+		return true;
+	}
+	
 	// 검색조건 초기화
 	$('#btnInit').on('click', function() {
 		$("#searchForm")[0].reset();
@@ -290,8 +342,8 @@
 		var goodsCd = $(formId + " input[name=goodsCd]").val();
 		var videoGb = $(formId + " select[name=videoGb]").val();
 		var kmcKey = $(formId + " input[name=kmcKey]").val();
-		var dispYn = $(formId + " input:radio[name=dispYn]:checked").val();
 		var kufKey = $(formId + " input[name=kufKey]").val();
+		var dispYn = $(formId + " input:radio[name=dispYn]:checked").val();
 		
 		if(goodsCd==''){
 			gagajf.alertMessage(formId + " input[name=goodsCd]", 'input');
@@ -301,10 +353,10 @@
 			gagajf.alertMessage(formId + " select[name=videoGb]", 'select');
 			return;
 		}
-		if(kmcKey==''){
+		/* if(kmcKey==''){
 			gagajf.alertMessage(formId + " input[name=kmcKey]", 'input');
 			return;
-		}
+		} */
 		
 		if(kmcKey.indexOf("http")>-1){
 			mcxDialog.alert('동영상 정보를 확인해 주세요.');