Explorar el Código

상품목록 브랜드 조회 팝업 추가

eskim hace 5 años
padre
commit
ef363f5153

+ 15 - 0
style24.admin/src/main/java/com/style24/admin/biz/web/TsaBusinessController.java

@@ -600,5 +600,20 @@ public class TsaBusinessController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0003"));
 	}
 
+	/**
+	 * 브랜드 목록 화면(팝업)
+	 * @param brandMd - 담당MD 정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 11. 4
+	 */
+	@GetMapping("/brand/search/form")
+	public ModelAndView brandSearchForm(Brand brand) {
+		ModelAndView mav = new ModelAndView();
+
+		mav.addObject("params", brand);
+		mav.setViewName("business/BrandSearchForm");
+		return mav;
+	}
 
 }

+ 1 - 0
style24.admin/src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -481,6 +481,7 @@ public class TsaGoodsController extends TsaBaseController {
 	@ResponseBody
 	public GagaMap getGoodsList(@RequestBody GoodsSearch goodsSearch) {
 
+		log.info("[getGoodsList] goodsSearch=>{}", goodsSearch);
 		GagaMap result = new GagaMap();
 
 		// 입점업체담당자는 업체코드 설정

+ 1 - 0
style24.admin/src/main/java/com/style24/persistence/domain/Brand.java

@@ -39,5 +39,6 @@ public class Brand extends TscBaseDomain {
 
 	// 검색조건
 	private String searchTxt;		// 검색어
+	private String callbackFn;	// 콜백함수
 
 }

+ 3 - 3
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaBusiness.xml

@@ -424,11 +424,11 @@
 		AND    (
 		        A.BRAND_CD LIKE CONCAT('%',#{searchTxt},'%')
 		        OR
-		        A.BRAND_ENM LIKE CONCAT('%',#{searchTxt},'%')
+		        UPPER(A.BRAND_ENM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
 		        OR
-		        A.BRAND_KNM LIKE CONCAT('%',#{searchTxt},'%')
+		        UPPER(A.BRAND_KNM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
 		        OR
-		        A.BRAND_GRP_NM LIKE CONCAT('%',#{searchTxt},'%')
+		        UPPER(A.BRAND_GRP_NM) LIKE CONCAT('%',UPPER(#{searchTxt}),'%')
 		       )
 		</if>
 		<if test='useYn != null and useYn != ""'>

+ 128 - 0
style24.admin/src/main/webapp/WEB-INF/views/business/BrandSearchForm.html

@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : BrandSearchForm.html
+ * @desc    : 브랜드 팝업 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2020.12.15   eskim       최초 작성
+ *******************************************************************************
+ -->
+<div class="modalPopup" data-width="500" id="popupBrandList">
+	<div class="panelStyle">
+		<!-- TITLE -->
+		<div class="panelTitle">
+			<strong>브랜드 목록</strong>
+			<button type="button" class="close" onclick="uifnPopupClose('popupBrandList');"><em class="fa fa-times"></em></button>
+		</div>
+		<!-- //TITLE -->
+		
+		<!-- 검색 조건 -->
+		<div class="panelContent">
+			<form id="searchBrandListForm" name="searchBrandListForm" action="#" th:action="@{'/business/brand/list'}" onsubmit="$('#btnSearchBrandList').trigger('click'); return false;">
+				<table class="frmStyle" aria-describedby="검색조건">
+					<colgroup>
+						<col style="width:15%;"/>
+						<col/>
+					</colgroup>
+					<tbody>
+						<tr>
+							<th>브랜드명</th>
+							<td>
+								<input type="text" name="searchTxt" th:value="${params.searchTxt}" maxlength="20" onkeypress="if (event.keyCode == 13) { $('#btnSearchBrandList').trigger('click'); }"/>
+							</td>
+						</tr>
+					</tbody>
+				</table>
+				<ul class="panelBar">
+					<li class="center">
+						<button type="button" class="btn btn-base btn-lg" id="btnSearchBrandList">조회</button>
+					</li>
+				</ul>
+			</form>
+		</div>
+		<!-- //검색 조건 -->
+		
+		<!-- 리스트 영역 -->
+		<div class="panelContent">
+			<div id="gridBrandList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
+		</div>
+		<!-- //리스트 영역 -->
+		
+		<!-- 버튼 배치 영역 -->
+		<ul class="panelBar">
+			<li class="right">
+				<button type="button" class="btn btn-info btn-lg" id="btnConfirmBrand">확인</button>
+			</li>
+		</ul>
+	</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	let columnDefsMdList = [
+		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: false, checkboxSelection: true, filter: false},
+		{headerName: "브랜드번호", field: "brandCd", width: 120, cellClass: 'text-center'},
+		{headerName: "브랜드국문명", field: "brandEnm", width: 150, cellClass: 'text-center'},
+		{headerName: "브랜드영문명", field: "brandKnm", width: 150, cellClass: 'text-center'}
+	];
+
+	let gridOptionsBrandList = gagaAgGrid.getGridOptions(columnDefsMdList);
+
+	// Row double click
+	gridOptionsBrandList.onRowDoubleClicked = function(event) {
+		$('#btnConfirmBrand').trigger('click');
+	}
+
+	// 조회
+	$('#btnSearchBrandList').on('click', function() {
+		// Fetch data
+		gagaAgGrid.fetch($('#searchBrandListForm').prop('action'), gridOptionsBrandList, '#searchBrandListForm');
+	});
+	
+	// 확인
+	$('#btnConfirmBrand').on('click', function() {
+		var selectedData = gagaAgGrid.selectedRowData(gridOptionsBrandList);
+		
+		if (selectedData.length == 0) {
+			mcxDialog.alert('선택된 브랜드가 없습니다.');
+			return false;
+		}
+		
+		var callbackFn = [[${params.callbackFn}]];
+
+		var jsonData = JSON.stringify(selectedData);
+
+		if (typeof callbackFn != 'undefined' && callbackFn) {
+			if (typeof callbackFn == 'function') {
+				callbackFn(jsonData);
+			} else {
+				if (callbackFn) {
+					if (callbackFn.indexOf("(") == -1) {
+						eval(callbackFn + "(" + jsonData + ")");
+					} else {
+						eval(callbackFn(jsonData));
+					}
+				}
+			}
+			uifnPopupClose('popupBrandList');
+		}
+	});
+	
+	$(document).ready(function() {
+		// Create a agGrid
+		gagaAgGrid.createGrid('gridBrandList', gridOptionsBrandList);
+		
+		$('#btnSearchBrandList').trigger('click');
+	});
+/*]]>*/
+</script>
+
+</div>
+
+</html>

+ 30 - 7
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsListForm.html

@@ -62,12 +62,11 @@
 							</select>
 							<span id="multiBrand"></span>
 						</td>
-						<th>상품타입</th>
+						<th>브랜드<em class="required" title="필수"></em></th>
 						<td>
-							<select name="goodsType" id="goodsType">
-								<option value="">[전체]</option>
-								<option th:if="${goodsTypeList}" th:each="oneData, status : ${goodsTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-							</select>
+							<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>
+							<input type="text" class="w100" name="brandCd" readonly="readonly"/>
 						</td>
 						<th rowspan="4">키워드<em class="required" title="필수"></em></th>
 						<td rowspan="4">
@@ -204,7 +203,14 @@
 					</tr>
 					<tr>
 						<th>발생일<em class="required" title="필수"></em></th>
-						<td colspan="7" id="sellTerms"></td>
+						<td colspan="5" id="sellTerms"></td>
+						<th>상품타입</th>
+						<td>
+							<select name="goodsType" id="goodsType">
+								<option value="">[전체]</option>
+								<option th:if="${goodsTypeList}" th:each="oneData, status : ${goodsTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+						</td>
 					</tr>
 				</table>
 				<ul class="panelBar">
@@ -593,7 +599,7 @@
 				|| !gagajf.isNull($("#searchForm select[name=statSupplyCompCd]").val()) 
 				|| !gagajf.isNull($("#searchForm textarea[name=condition]").val())
 				|| (!gagajf.isNull($("#searchForm input[name=stDate]").val()) && !gagajf.isNull($("#searchForm input[name=edDate]").val()))
-				|| !gagajf.isNull($("#searchForm select[name=brandGrpNm]").val())
+				|| !gagajf.isNull($("#searchForm input[name=brandCd]").val())
 			){
 			searchFlag = true;
 		}else{
@@ -1079,6 +1085,23 @@
 		cfnCreateCombo('/renderer/delvFee/list/' + $('#searchForm select[name=statSupplyCompCd]').val(), $('#searchForm select[name=delvFeeCdC]'), "[선택]");
 	});
 	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		$("#searchForm input[name=brandCd]").val(result[0].brandCd);
+	}
+	
+	// 브랜드 조회 선택시
+	$('#btnSearchBrand').on('click', function() {
+
+		if (gagajf.isNull($("#searchForm input[name=searchTxt]").val())){
+			mcxDialog.alert('브랜드 검색어를 입력하세요.');
+			return false;
+		}
+		
+		cfnOpenBrandListPopup('fnSetBrandInfo', $("#searchForm input[name=searchTxt]").val());
+		
+	});
+	
 	$(document).ready(function() {
 
 		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일', 'X');

+ 32 - 9
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsPopupListForm.html

@@ -51,13 +51,12 @@
 						</select>
 						<span id="multiBrand"></span>
 					</td>
-					<th>상품타입</th>
-					<td>
-						<select name="goodsType" id="goodsType">
-							<option value="">[전체]</option>
-							<option th:if="${goodsTypeList}" th:each="oneData, status : ${goodsTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
-						</select>
-					</td>
+					<th>브랜드<em class="required" title="필수"></em></th>
+						<td>
+							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
+							<button type="button" class="btn icn" id="btnPopupSearchBrand"><i class="fa fa-search"></i></button>
+							<input type="text" class="w100" name="brandCd" readonly="readonly"/>
+						</td>
 					<th rowspan="4">키워드<em class="required" title="필수"></em></th>
 					<td rowspan="4">
 						<select name="search" id="search">
@@ -194,7 +193,14 @@
 				</tr>
 				<tr>
 					<th>발생일<em class="required" title="필수"></em></th>
-					<td colspan="7" id="sellTermsP"></td>
+					<td colspan="5" id="sellTermsP"></td>
+					<th>상품타입</th>
+					<td>
+						<select name="goodsType" id="goodsType">
+							<option value="">[전체]</option>
+							<option th:if="${goodsTypeList}" th:each="oneData, status : ${goodsTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+						</select>
+					</td>
 				</tr>
 			</table>
 			<ul class="panelBar">
@@ -384,7 +390,7 @@
 		if( !gagajf.isNull($("#goodsPopupForm select[name=supplyCompCd]").val())
 				|| !gagajf.isNull($("#goodsPopupForm textarea[name=condition]").val())
 				|| (!gagajf.isNull($("#goodsPopupForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsPopupForm input[name=edDate]").val())
-				|| !gagajf.isNull($("#goodsPopupForm select[name=brandGrpNm]").val())
+				|| !gagajf.isNull($("#goodsPopupForm input[name=brandCd]").val())
 
 				)
 			){
@@ -531,6 +537,23 @@
 		cfnCreateCombo(actionUrl, $('#goodsPopupForm select[name=supplyCompCd]'), "[전체]", "");
 		
 	});
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetPopupBrandInfo = function(result) {
+		$("#goodsPopupForm input[name=brandCd]").val(result[0].brandCd);
+	}
+	
+	// 브랜드 조회 선택시
+	$('#btnPopupSearchBrand').on('click', function() {
+
+		if (gagajf.isNull($("#goodsPopupForm input[name=searchTxt]").val())){
+			mcxDialog.alert('브랜드 검색어를 입력하세요.');
+			return false;
+		}
+		
+		cfnOpenBrandListPopup('fnSetPopupBrandInfo', $("#goodsPopupForm input[name=searchTxt]").val());
+		
+	});
 
 	$(document).ready(function() {
 		cfnCreateCalendar('#sellTermsP', 'stDate', 'edDate', true, '등록일', 'X');

+ 21 - 0
style24.admin/src/main/webapp/ux/js/admin.popup.js

@@ -665,3 +665,24 @@ var cfnOpenFrontGoodsPopup = function(goodsCd, siteCd) {
 
 	window.open(actionUrl);
 }
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 브랜드 목록 팝업
+ * <pre>
+ *     cfnOpenBrandListPopup();
+ *     or
+ *     cfnOpenBrandListPopup('fnResult');
+ *     or
+ *     cfnOpenBrandListPopup('fnResult', 'TBJ');
+ * </pre>
+ * @since  : 2020/12/15
+ * @author : eskim
+ */
+var cfnOpenBrandListPopup = function(callbackfn, searchTxt) {
+	var actionUrl = '/business/brand/search/form';
+	if (typeof(callbackfn) != 'undefined') actionUrl += "?callbackFn=" + callbackfn;
+	if (typeof(searchTxt) != 'undefined') actionUrl += "&searchTxt=" + encodeURIComponent(searchTxt);
+	cfnOpenModalPopup(actionUrl, "popupBrandList");
+}

+ 2 - 1
style24.admin/src/main/webapp/ux/js/admin.ui.js

@@ -101,8 +101,9 @@ function uifnPopupClose(id) {
 	} else if ( $thisId.hasClass("videoPopup") ) {  //비디오팝업
 		$thisId.css({display:"none"});
 		$("#iframe_video").attr("src","");
-		$thisId.remove();
+
 	};
+	$thisId.remove();
 };
 
 //비디오 팝업 열기