Преглед на файлове

상품품목관리 - 업체, 브랜드조회 팝업처리

eskim преди 4 години
родител
ревизия
2a0a899cae
променени са 2 файла, в които са добавени 91 реда и са изтрити 14 реда
  1. 90 13
      src/main/webapp/WEB-INF/views/goods/GoodsItemkindForm.html
  2. 1 1
      src/main/webapp/WEB-INF/views/goods/GoodsPriceReservePopupForm.html

+ 90 - 13
src/main/webapp/WEB-INF/views/goods/GoodsItemkindForm.html

@@ -71,15 +71,19 @@
 						</td>
 					</tr>
 					<tr>
-						<th>업체/브랜드</th>
+						<th>업체</th>
 						<td>
-							<select name="supplyCompCd" id="supplyCompCd">
-								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
-								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
-							<select name="brandCd" id="brandCd">
-								<option value="">[전체]</option>
-							</select>
+							<input type="text" class="w100" name="supplyCompSearchTxt" id="supplyCompSearchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchSupplyComp"><i class="fa fa-search"></i></button>
+							<span id="supplyCompText"></span>
+							<input type="hidden" name="supplyCompList"/>
+						</td>
+						<th>브랜드</th>
+						<td>
+							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
+							<span id="brandText"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 						<th>키워드</th>
 						<td>
@@ -91,8 +95,11 @@
 							</select>
 							<input type="text" class="w40p" name="condition" id="condition" maxlength="50"/>
 						</td>
-						<th>품목</th>
-						<td>
+						
+					</tr>
+					<tr>
+					<th>품목</th>
+						<td colspan="5">
 							<select name="itemkindCd" id="itemkindCdSearch">
 								<option value="">[전체]</option>
 								<option th:if="${itemkindList}" th:each="oneData, status : ${itemkindList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
@@ -186,12 +193,15 @@
 				return '<img width="60" src="'+ _goodsUrl+ "/" + params.value +'?RS=60" alt=""  onerror="this.src=\'/image/no.png\';"/>';
 			}
 		},
+		{headerName: "브랜드명", field: "brandEnm", width: 130, cellClass: 'text-center'},
 		{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'
+		
+		},
+		{headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'
 			,cellRenderer: function(params) {
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
 			}
 		},
-		{headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'},
 		{headerName: "품목명", field: "itemkindNm", width: 250, cellClass: 'text-left',
 			cellRenderer: function (params) {
 				if (gagajf.isNull( params.value)){
@@ -221,7 +231,7 @@
 	// Row Click
 	gridOptions.onCellClicked = function(event) {
 		var goodsCd = event.data.goodsCd;
-		if (event.colDef.field == "goodsCd"){
+		if (event.colDef.field == "goodsNm"){
 			cfnOpenGoodsDetailPopup('U',goodsCd);
 			//cfnOpenFrontGoodsPopup(goodsCd, event.data.siteCd);
 		}
@@ -263,7 +273,9 @@
 	// 조회
 	$('#btnSearch').on('click', function() {
 		if(gagajf.isNull($("#selCate2").val()) && gagajf.isNull($("#supplyCompCd").val()) && gagajf.isNull($("#condition").val()) && gagajf.isNull($("#itemkindCdSearch").val())
-			&& gagajf.isNull($("#styleYear").val()) && gagajf.isNull($("#formalGb").val()) && gagajf.isNull($("#mdNo").val())){
+			&& gagajf.isNull($("#styleYear").val()) && gagajf.isNull($("#formalGb").val()) && gagajf.isNull($("#mdNo").val())
+			&& gagajf.isNull($("#searchForm input[name=supplyCompList]").val()) && gagajf.isNull($("#searchForm input[name=brandList]").val())
+			){
 			mcxDialog.alert('검색조건을 입력해 주세요.');
 			return;
 		}
@@ -314,6 +326,10 @@
 
 	$("#btnInit").on("click", function(){
 		$("#searchForm")[0].reset();
+		$('#searchForm input[name=brandList]').val('');
+		$('#searchForm input[name=supplyCompList]').val('');
+		$('#searchForm').find('#brandText').html('');
+		$('#searchForm').find('#supplyCompText').html('');
 	});
 
 	$("#btnChangeItemKindCd").on("click", function(){
@@ -328,6 +344,67 @@
 		gridOptions.api.refreshCells();
 	});
 
+	
+	// 업체 조회 선택시
+	$('#btnSearchSupplyComp').on('click', function() {
+		cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');
+	});
+	
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompText = "";
+		var sIndex = 0;
+		$('#searchForm').find('#supplyCompText').html('');
+		$('#searchForm input[name=supplyCompSearchTxt]').val('');
+		result.forEach(function(supplyComp){
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#searchForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		}else{
+			supplyCompText = sIndex + " 개";
+			$('#searchForm').find('#supplyCompText').html(supplyCompText);	
+		}
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#searchForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandText = "";
+		var bIndex = 0;
+		$('#searchForm').find('#brandText').html('');
+		$('#searchForm input[name=searchTxt]').val('');
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#searchForm input[name=searchTxt]').val(arrbrandCd[0]);
+		}else{
+			brandText = bIndex + " 개";
+			$('#searchForm').find('#brandText').html(brandText);	
+		}
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#searchForm input[name=brandList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 선택시
+	$('#btnSearchBrand').on('click', function() {
+		/* if (gagajf.isNull($("#searchForm input[name=searchTxt]").val())){
+			mcxDialog.alert('브랜드 검색어를 입력하세요.');
+			return false;
+		} */
+		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
+	});
+	
 	$("#btnSave").on("click", function(){
 		var rowData = gagaAgGrid.getAllRowData(gridOptions);
 		var dataArr = [];

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

@@ -223,7 +223,7 @@
 		$('#goodsPriceRsvtForm input[name=applyEddt]').val(applyEddt);
 
 		if ($('#goodsPriceRsvtForm input[name=applyStdt]').val() > $('#goodsPriceRsvtForm input[name=applyEddt]').val()) {
-			mcxDialog.alertC("예약 시작일자는 종료일자 보다 클 수 없습니다.", {
+			mcxDialog.alertC("예약 시작일시는 종료일시 보다 클 수 없습니다.", {
 				sureBtnText: "확인",
 				sureBtnClick: function() {
 					$('#goodsPriceRsvtForm input[name=applyEdYMD]').focus();