Przeglądaj źródła

입점가격관리, ep제외상품관리, 사이즈별재고현황 - 업체, 브랜드 다중검색 처리

eskim 5 lat temu
rodzic
commit
231cc7b64f

+ 60 - 21
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -448,13 +448,13 @@ public class TsaGoodsController extends TsaBaseController {
 		ModelAndView mav = new ModelAndView();
 
 		// 공급업체
-		String supplyCompCd = "";
-		String selfYn = "Y";
-		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
-			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
-			selfYn = "N";
-		}
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
+//		String supplyCompCd = "";
+//		String selfYn = "Y";
+//		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+//			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+//			selfYn = "N";
+//		}
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
 		// 상품상태
 		String[] exceptCds = {"G008_00"};
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
@@ -1395,11 +1395,11 @@ public class TsaGoodsController extends TsaBaseController {
 	public ModelAndView priceForm() {
 		ModelAndView mav = new ModelAndView();
 		// 공급업체
-		String supplyCompCd = "";
-		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
-			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
-		}
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "N"));
+//		String supplyCompCd = "";
+//		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+//			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+//		}
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "N"));
 		// 사용여부
 		mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
 		// 상품상태
@@ -1423,6 +1423,26 @@ public class TsaGoodsController extends TsaBaseController {
 	@ResponseBody
 	public Collection<GoodsPriceRes> getGoodsSupplyPriceList(@RequestBody GoodsPriceRes goodsPriceRes) {
 
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(goodsPriceRes.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(goodsPriceRes.getBrandList(), String[].class);
+				goodsPriceRes.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("브랜드코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
+
+		if (!StringUtils.isBlank(goodsPriceRes.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(goodsPriceRes.getSupplyCompList(), String[].class);
+				goodsPriceRes.setMultiSupplyComp(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("업체코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
 		return goodsService.getGoodsSupplyPriceList(goodsPriceRes);
 	}
 
@@ -1666,8 +1686,8 @@ public class TsaGoodsController extends TsaBaseController {
 		ModelAndView mav = new ModelAndView();
 
 		// 공급업체
-		String supplyCompCd = "";
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "Y"));
+//		String supplyCompCd = "";
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "Y"));
 		// 상품상태
 		String[] exceptCds = {"G001_00"};
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
@@ -1713,6 +1733,25 @@ public class TsaGoodsController extends TsaBaseController {
 		if (!StringUtils.isBlank(goodsSearch.getCondition())) {
 			goodsSearch.setConditionList(goodsSearch.getCondition().replaceAll("\r", "").split("\n"));
 		}
+		if (!StringUtils.isBlank(goodsSearch.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(goodsSearch.getBrandList(), String[].class);
+				goodsSearch.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("브랜드코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
+
+		if (!StringUtils.isBlank(goodsSearch.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(goodsSearch.getSupplyCompList(), String[].class);
+				goodsSearch.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("업체코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
 
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
@@ -2047,13 +2086,13 @@ public class TsaGoodsController extends TsaBaseController {
 		ModelAndView mav = new ModelAndView();
 
 		// 공급업체
-		String supplyCompCd = "";
-		String selfYn = "Y";
-		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
-			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
-			selfYn = "N";
-		}
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
+//		String supplyCompCd = "";
+//		String selfYn = "Y";
+//		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+//			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+//			selfYn = "N";
+//		}
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
 		//mav.addObject("supplyCompList", rendererService.getSupplyCompanyList());
 		// 상품상태
 		String[] exceptCds = {"G008_00"};

+ 30 - 7
src/main/java/com/style24/admin/biz/web/TsaStockController.java

@@ -5,7 +5,7 @@ import java.util.Collection;
 
 import javax.servlet.http.HttpServletRequest;
 
-import com.style24.persistence.TscPageRequest;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.core.io.InputStreamResource;
@@ -24,6 +24,7 @@ import com.style24.admin.biz.service.TsaStockService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.persistence.TscPageRequest;
 import com.style24.persistence.domain.Color;
 import com.style24.persistence.domain.Goods;
 import com.style24.persistence.domain.GoodsSearch;
@@ -60,6 +61,9 @@ public class TsaStockController extends TsaBaseController {
 	@Autowired
 	private TsaRendererService rendererService;
 
+	@Autowired
+	private ObjectMapper mapper;
+
 	/**
 	 * 사이즈별재고현황 화면
 	 *
@@ -73,12 +77,12 @@ public class TsaStockController extends TsaBaseController {
 
 		ModelAndView mav = new ModelAndView();
 
-		String supplyCompCd = "";
-		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
-			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
-		}
-		// 공급업체
-		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "Y"));
+//		String supplyCompCd = "";
+//		if ("G001_B000".equals(TsaSession.getInfo().getRoleCd())) {
+//			supplyCompCd = TsaSession.getInfo().getSupplyCompCd();
+//		}
+//		// 공급업체
+//		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, "Y"));
 		// 상품상태
 		String[] exceptCds = {"G008_00"};
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
@@ -123,7 +127,26 @@ public class TsaStockController extends TsaBaseController {
 			goodsSearch.setSupplyCompCd(TsaSession.getInfo().getSupplyCompCd());
 			goodsSearch.setMdNo(TsaSession.getInfo().getUserNo().toString());
 		}
+		// multi row 검색관련 처리
+		if (!StringUtils.isBlank(goodsSearch.getBrandList())) {
+			try {
+				String [] arrBrandCd = mapper.readValue(goodsSearch.getBrandList(), String[].class);
+				goodsSearch.setMultiBrand(arrBrandCd);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("브랜드코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
 
+		if (!StringUtils.isBlank(goodsSearch.getSupplyCompList())) {
+			try {
+				String [] arrSupplyComp = mapper.readValue(goodsSearch.getSupplyCompList(), String[].class);
+				goodsSearch.setMultiSupplyCompCd(arrSupplyComp);
+			} catch (Exception e) {
+				e.printStackTrace();
+				throw new IllegalStateException(message.getMessage("업체코드 검색중 오류로 인해 조회되지 않았습니다."));
+			}
+		}
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo());	//엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TscPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(stockService.getGoodsSizeStockCount(goodsSearch));

+ 8 - 0
src/main/java/com/style24/persistence/domain/GoodsPriceRes.java

@@ -43,6 +43,8 @@ public class GoodsPriceRes extends TscBaseDomain {
 	private String confirmY;
 	private Float goodsSellFeeRate;
 	private String searchBrandCd;
+	private String brandList;
+	private String supplyCompList;
 
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] arrGoodsCd;
@@ -53,4 +55,10 @@ public class GoodsPriceRes extends TscBaseDomain {
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private int[] arrGoodsPriceResSq;
 
+	/* Multi CheckBox 항목*/
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiBrand;
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] multiSupplyComp;
 }

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

@@ -164,7 +164,7 @@
 		AND    SC.SUPPLY_COMP_CD = #{supplyCompCd}
 		</if>
 		<if test="multiSupplyCompCd != null and multiSupplyCompCd.length > 0">
-		AND    A.BRAND_CD IN
+		AND    SC.SUPPLY_COMP_CD IN
 		    <foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
 		UPPER(#{item})
 		    </foreach>
@@ -173,7 +173,7 @@
 		AND (
 		    <foreach collection="multiSupplyCompNm" item="item" index="index" separator="or">
 		    UPPER(SC.SUPPLY_COMP_NM) LIKE CONCAT('%',UPPER(#{item}),'%')
-		  </foreach>
+		    </foreach>
 		 )
 		</if>
 		<if test='selfYn != null and (selfYn == "Y" or selfYn == "N")'>

+ 13 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -3014,7 +3014,7 @@
 		    INNER JOIN TB_SUPPLY_COMPANY S ON G.SUPPLY_COMP_CD = S.SUPPLY_COMP_CD
 		    WHERE 1 = 1
 		    <if test="goodsCd != null and goodsCd != ''">
-		    AND UPPER(G.GOODS_CD) = LIKE UPPER('%' || #{goodsCd} || '%')
+		    AND UPPER(G.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%') 
 		    </if>
 		    <if test="supplyCompCd != null and supplyCompCd != ''">
 		    AND G.SUPPLY_COMP_CD = #{supplyCompCd}
@@ -3025,6 +3025,18 @@
 		    <if test="searchBrandCd != null and searchBrandCd != ''">
 		    AND G.BRAND_CD = #{searchBrandCd}
 		    </if>
+		    <if test="multiSupplyComp != null and multiSupplyComp != ''">
+		    AND G.SUPPLY_COMP_CD IN
+		        <foreach collection="multiSupplyComp" item="item" index="index"  open="(" close=")" separator=",">
+		        #{item}
+		        </foreach>
+		    </if>
+		    <if test="multiBrand != null and multiBrand != ''">
+		    AND G.BRAND_CD IN
+		        <foreach collection="multiBrand" item="item" index="index"  open="(" close=")" separator=",">
+		        #{item}
+		        </foreach>
+		    </if>
 		    <if test="cfrmYn != null and cfrmYn != ''">
 		    AND A.CFRM_YN = #{cfrmYn}
 		    </if>

+ 6 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaStock.xml

@@ -50,6 +50,12 @@
 		        <if test="supplyCompCd != null and supplyCompCd != ''">
 		        AND G.SUPPLY_COMP_CD = #{supplyCompCd}
 		        </if>
+		        <if test="multiSupplyCompCd != null and multiSupplyCompCd != ''">
+		        AND G.SUPPLY_COMP_CD IN
+		            <foreach collection="multiSupplyCompCd" item="item" index="index"  open="(" close=")" separator=",">
+		        #{item}
+		            </foreach>
+		        </if>
 		        <if test="brandCd != null and brandCd != ''">
 		        AND G.BRAND_CD = #{brandCd}
 		        </if>

+ 94 - 22
src/main/webapp/WEB-INF/views/goods/GoodsEpSkipForm.html

@@ -36,22 +36,29 @@
 				<table class="frmStyle">
 					<colgroup>
 						<col width="8%"/>
-						<col/>
+						<col width="17%"/>
 						<col width="8%"/>
-						<col width="25%"/>
+						<col width="17%"/>
 						<col width="8%"/>
-						<col width="20%"/>
+						<col width="17%"/>
+						<col width="8%"/>
+						<col />
 					</colgroup>
 					<tr>
-						<th>업체/브랜드</th>
+						<th>업체</th>
 						<td>
-							<select name="supplyCompCd" id="supplyCompCd">
-								<option value="" th:if="${sessionInfo.roleCd} != '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>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandText"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 						<th>키워드</th>
 						<td>
@@ -77,7 +84,7 @@
 					</tr>
 					<tr>
 						<th>비노출예약일</th>
-						<td colspan="5" id="sellTerms"></td>
+						<td colspan="7" id="sellTerms"></td>
 					</tr>
 				</table>
 				<ul class="panelBar">
@@ -137,7 +144,7 @@
 		},
 		{headerName: "브랜드명", field: "brandEnm", width: 130, cellClass: 'text-center'},
 		{headerName: "상품코드", field: "goodsCd", width: 140, cellClass: 'text-center'},
-		{headerName: "상품명", field: "goodsNm", width: 180, cellClass: 'text-left'
+		{headerName: "상품명", field: "goodsNm", width: 200, cellClass: 'text-left'
 			,cellRenderer: function(params) {
 				return '<a href="javascript:void(0);">' + params.value + '</a>';
 			}
@@ -198,6 +205,10 @@
 		$("#goodsEpSkipListForm input[type=checkbox]").removeClass("checked");
 		$("#goodsEpSkipListForm input[type=checkbox]").parent("label").removeClass("checked");
 		$("#goodsEpSkipListForm input[type=radio][checked]").parent("label").addClass("checked");
+		$('#goodsEpSkipListForm input[name=brandList]').val('');
+		$('#goodsEpSkipListForm input[name=supplyCompList]').val('');
+		$('#goodsEpSkipListForm').find('#brandText').html('');
+		$('#goodsEpSkipListForm').find('#supplyCompText').html('');
 	}
 	
 	// 조회클릭시
@@ -244,17 +255,22 @@
 		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")) {
-				if (!(el.value == null || el.value == "")) {
-					cnt++;
+		if( !gagajf.isNull($("#goodsEpSkipListForm input[name=supplyCompList]").val())
+				|| !gagajf.isNull($("#goodsEpSkipListForm input[name=brandList]").val())
+			){
+			searchFlag = true;
+		}else{
+			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")) {
+					if (!(el.value == null || el.value == "")) {
+						cnt++;
+					}
 				}
 			}
+			if(cnt > 0) searchFlag = true;
 		}
-			
-		if(cnt > 0) searchFlag = true;
 
 		if(searchFlag == false){
 			mcxDialog.alert("검색조건을 입력하세요.");
@@ -307,7 +323,7 @@
 	});
 	
 	//업체변경시
-	$('#goodsEpSkipListForm select[name=supplyCompCd]').on('change', function() {
+	/* $('#goodsEpSkipListForm select[name=supplyCompCd]').on('change', function() {
 		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
 
 		if(sessRoleCd == "G001_B000"){
@@ -317,6 +333,62 @@
 
 		cfnCreateCombo(actionUrl, $('#goodsEpSkipListForm select[name=brandCd]'), "[전체]", "");
 	});
+	 */
+	// 업체 조회 선택시
+	$('#btnSearchSupplyComp').on('click', function() {
+		cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');
+	});
+	
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompText = "";
+		var sIndex = 0;
+		$('#goodsEpSkipListForm').find('#supplyCompText').html('');
+		$('#goodsEpSkipListForm input[name=supplyCompSearchTxt]').val('');
+		result.forEach(function(supplyComp){
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#goodsEpSkipListForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		}else{
+			supplyCompText = sIndex + " 개";
+			$('#goodsEpSkipListForm').find('#supplyCompText').html(supplyCompText);	
+		}
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#goodsEpSkipListForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 선택시
+	$('#btnSearchBrand').on('click', function() {
+		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
+	});
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandText = "";
+		var bIndex = 0;
+		$('#goodsEpSkipListForm').find('#brandText').html('');
+		$('#goodsEpSkipListForm input[name=searchTxt]').val('');
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#goodsEpSkipListForm input[name=searchTxt]').val(arrbrandCd[0]);
+		}else{
+			brandText = bIndex + " 개";
+			$('#goodsEpSkipListForm').find('#brandText').html(brandText);	
+		}
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#goodsEpSkipListForm input[name=brandList]").val(jsonData);
+	}
 	
 	//엑셀 상품 조회
 	$('#btnGoodsExcelUpLoad').on('click', function() {

+ 82 - 32
src/main/webapp/WEB-INF/views/goods/GoodsSupplyPriceForm.html

@@ -32,31 +32,37 @@
 			<div class="panelContent">
 				<table class="frmStyle">
 					<colgroup>
-						<col width="7%"/>
-						<col/>
-						<col width="7%"/>
-						<col width="18%"/>
-						<col width="7%"/>
 						<col width="10%"/>
-						<col width="7%"/>
+						<col width="15%"/>
 						<col width="10%"/>
+						<col width="15%"/>
+						<col width="10%"/>
+						<col width="15%"/>
+						<col width="10%"/>
+						<col />
 					</colgroup>
 					<tr>
-						<th>업체/브랜드<em class="required" title="필수"></em></th>
+						<th>업체<em class="required" title="필수"></em></th>
 						<td>
-							<select name="supplyCompCd" id="supplyCompCd">
+							<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"/>
+							<!-- <select name="supplyCompCd" id="supplyCompCd">
 								<option value="" >[전체]</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>
+							</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="btnSearchBrand"><i class="fa fa-search"></i></button>
-							<input type="text" class="w100" name="searchBrandCd" readonly="readonly"/>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandText"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 						<th>상품코드<em class="required" title="필수"></em></th>
 						<td>
@@ -220,6 +226,10 @@
 		//$("#goodsPriceHstForm input[type=radio]").parent("label").removeClass("checked");
 		$("#goodsPriceHstForm input[type=checkbox]").parent("label").removeClass("checked");
 		$("#goodsPriceHstForm input[type=radio][checked]").parent("label").addClass("checked");
+		$('#goodsPriceHstForm input[name=brandList]').val('');
+		$('#goodsPriceHstForm input[name=supplyCompList]').val('');
+		$('#goodsPriceHstForm').find('#brandText').html('');
+		$('#goodsPriceHstForm').find('#supplyCompText').html('');
 	}
 	
 	// 조회클릭시
@@ -253,10 +263,10 @@
 		var searchFlag = false;
 		var cnt = 0;
 
-		 if( !gagajf.isNull($("#goodsPriceHstForm select[name=supplyCompCd]").val())
+		 if( !gagajf.isNull($("#goodsPriceHstForm input[name=supplyCompList]").val())
 				|| !gagajf.isNull($("#goodsPriceHstForm input[name=goodsCd]").val())
 				|| (!gagajf.isNull($("#goodsPriceHstForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsPriceHstForm input[name=edDate]").val()))
-				|| !gagajf.isNull($("#goodsPriceHstForm input[name=searchBrandCd]").val())
+				|| !gagajf.isNull($("#goodsPriceHstForm input[name=brandList]").val())
 			){
 			searchFlag = true;
 		}else{ 
@@ -283,7 +293,7 @@
 	}
 	
 	//업체변경시
-	$('#goodsPriceHstForm select[name=supplyCompCd]').on('change', function() {
+/* 	$('#goodsPriceHstForm select[name=supplyCompCd]').on('change', function() {
 		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
 
 		if(sessRoleCd == "G001_A1001"){
@@ -293,10 +303,10 @@
 
 		cfnCreateCombo(actionUrl, $('#goodsPriceHstForm select[name=brandCd]'), "[전체]", "");
 		
-	});
+	}); */
 	
 	//브랜드 변경시
-	$('#goodsPriceHstForm select[name=brandCd]').on('change', function() {
+/* 	$('#goodsPriceHstForm select[name=brandCd]').on('change', function() {
 		
 		var supplyCompCd = $('#goodsPriceHstForm select[name=supplyCompCd]').val();
 		var brandCd = $('#goodsPriceHstForm select[name=brandCd]').val();
@@ -306,8 +316,65 @@
 			cfnCreateCombo(url, $('#goodsPriceHstForm select[name=sellStoreCd]'), "[전체]", "");	
 		}
 		
+	});
+	 */
+	// 업체 조회 선택시
+	$('#btnSearchSupplyComp').on('click', function() {
+		cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');
+	});
+	
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompText = "";
+		var sIndex = 0;
+		$('#goodsPriceHstForm').find('#supplyCompText').html('');
+		$('#goodsPriceHstForm input[name=supplyCompSearchTxt]').val('');
+		result.forEach(function(supplyComp){
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#goodsPriceHstForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		}else{
+			supplyCompText = sIndex + " 개";
+			$('#goodsPriceHstForm').find('#supplyCompText').html(supplyCompText);	
+		}
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#goodsPriceHstForm input[name=supplyCompList]").val(jsonData);
+	}
+	
+	// 브랜드 조회 선택시
+	$('#btnSearchBrand').on('click', function() {
+		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
 	});
 	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandText = "";
+		var bIndex = 0;
+		$('#goodsPriceHstForm').find('#brandText').html('');
+		$('#goodsPriceHstForm input[name=searchTxt]').val('');
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#goodsPriceHstForm input[name=searchTxt]').val(arrbrandCd[0]);
+		}else{
+			brandText = bIndex + " 개";
+			$('#goodsPriceHstForm').find('#brandText').html(brandText);	
+		}
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#goodsPriceHstForm input[name=brandList]").val(jsonData);
+	}
+	
+	
 	// 승인 클릭 시
 	$('#btnSaveGoodsPriceConfirm').on('click', function() {
 		
@@ -355,23 +422,6 @@
 		fnGoodsPriceHstListSearch('N');
 	}
 	
-	// 브랜드 조회 팝업에서 호출
-	var fnSetBrandInfo = function(result) {
-		$("#goodsPriceHstForm input[name=searchBrandCd]").val(result[0].brandCd);
-	}
-	
-	// 브랜드 조회 선택시
-	$('#btnSearchBrand').on('click', function() {
-
-		if (gagajf.isNull($("#goodsPriceHstForm input[name=searchTxt]").val())){
-			mcxDialog.alert('브랜드 검색어를 입력하세요.');
-			return false;
-		}
-		
-		cfnOpenBrandListPopup('fnSetBrandInfo', $("#goodsPriceHstForm input[name=searchTxt]").val());
-		
-	});
-	
 	$(document).ready(function() {
 		
 		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일', 'X');

+ 67 - 18
src/main/webapp/WEB-INF/views/stock/GoodsSizeStockForm.html

@@ -49,7 +49,11 @@
 					<tr>
 						<th>업체/브랜드<em class="required" title="필수"></em></th>
 						<td colspan="3">
-							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnY" value="Y"  checked/>자사</label>
+							<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"/>
+							<!-- <label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnY" value="Y"  checked/>자사</label>
 							<label class="rdoBtn"><input type="radio" name="selfYn" id="selfYnN" value="N"/>입점</label>
 							<select name="supplyCompCd" id="supplyCompCd">
 								<option value="" th:if="${sessionInfo.roleCd} != 'G001_B000'">[전체]</option>
@@ -57,13 +61,15 @@
 							</select>
 							<select name="brandCd" id="brandCd">
 								<option value="">[전체]</option>
-							</select>
+							</select> -->
 						</td>
 						<th>브랜드<em class="required" title="필수"></em></th>
 						<td colspan="3">
 							<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="searchBrandCd" readonly="readonly"/>
+							<!-- <input type="text" class="w100" name="brandCd" readonly="readonly"/> -->
+							<span id="brandText"></span>
+							<input type="hidden" name="brandList"/>
 						</td>
 					</tr>
 					<tr>
@@ -305,6 +311,10 @@
 		//$("#goodsSizeStockForm input[type=radio][checked]").parent("label").addClass("checked");
 		
 		$("#goodsSizeStockForm input[name=selfYn]:input[value='Y']").trigger('click');
+		$('#goodsSizeStockForm input[name=brandList]').val('');
+		$('#goodsSizeStockForm input[name=supplyCompList]').val('');
+		$('#goodsSizeStockForm').find('#brandText').html('');
+		$('#goodsSizeStockForm').find('#supplyCompText').html('');
 		
 	}
 	
@@ -343,10 +353,10 @@
 		var searchFlag = false;
 		var cnt = 0;
 
-		if( !gagajf.isNull($("#goodsSizeStockForm select[name=supplyCompCd]").val())
+		if( !gagajf.isNull($("#goodsSizeStockForm input[name=supplyCompList]").val())
 				|| !gagajf.isNull($("#goodsSizeStockForm input[name=condition]").val())
 				|| (!gagajf.isNull($("#goodsSizeStockForm input[name=stDate]").val()) && !gagajf.isNull($("#goodsSizeStockForm input[name=edDate]").val()))
-				|| !gagajf.isNull($("#goodsSizeStockForm input[name=searchBrandCd]").val())
+				|| !gagajf.isNull($("#goodsSizeStockForm input[name=brandList]").val())
 				
 			){
 			searchFlag = true;
@@ -441,7 +451,7 @@
 
 	
 	//업체변경시
-	$('#goodsSizeStockForm select[name=supplyCompCd]').on('change', function() {
+	/* $('#goodsSizeStockForm select[name=supplyCompCd]').on('change', function() {
 		var supplyCompCd = $(this).val();
 		
 		var actionUrl = '/renderer/supplyCompany/brand/list/' + supplyCompCd;
@@ -453,7 +463,7 @@
 
 		cfnCreateCombo(actionUrl, $('#goodsSizeStockForm select[name=brandCd]'), "[전체]", "");
 
-	});
+	}); */
 	
 	//엑셀양식 다운로드
 	$('#btnExcelSampleDownLoad').on('click', function (){
@@ -530,7 +540,7 @@
 	}
 	
 	// 자사/입점 변경여부
-	$("#goodsSizeStockForm input[name=selfYn]").bind('click change', function () {
+	/* $("#goodsSizeStockForm input[name=selfYn]").bind('click change', function () {
 	//$('#goodsSizeStockForm input[name=selfYn]').on('change', function() {
 		var radioValue = $(this).val();
 		var selfGb = "S";	// 자사 공급 업체
@@ -544,24 +554,63 @@
 
 		cfnCreateCombo(actionUrl, $('#goodsSizeStockForm select[name=supplyCompCd]'), "[전체]", "");
 		
+	}); */
+	
+	// 업체 조회 선택시
+	$('#btnSearchSupplyComp').on('click', function() {
+		cfnOpenCompanyListPopup('fnSetSupplyCompInfo', 'M');
 	});
 	
-	// 브랜드 조회 팝업에서 호출
-	var fnSetBrandInfo = function(result) {
-		$("#goodsSizeStockForm input[name=searchBrandCd]").val(result[0].brandCd);
+	// 업체 조회 팝업에서 호출
+	var fnSetSupplyCompInfo = function(result) {
+		var arrSupplyComp = [];
+		var supplyCompText = "";
+		var sIndex = 0;
+		$('#goodsSizeStockForm').find('#supplyCompText').html('');
+		$('#goodsSizeStockForm input[name=supplyCompSearchTxt]').val('');
+		result.forEach(function(supplyComp){
+			sIndex++; 
+			arrSupplyComp.push(supplyComp.supplyCompCd);
+		});
+
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (sIndex == 1) {
+			$('#goodsSizeStockForm input[name=supplyCompSearchTxt]').val(arrSupplyComp[0]);
+		}else{
+			supplyCompText = sIndex + " 개";
+			$('#goodsSizeStockForm').find('#supplyCompText').html(supplyCompText);	
+		}
+		var jsonData = JSON.stringify(arrSupplyComp);
+		$("#goodsSizeStockForm input[name=supplyCompList]").val(jsonData);
 	}
 	
 	// 브랜드 조회 선택시
 	$('#btnSearchBrand').on('click', function() {
+		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
+	});
+	
+	// 브랜드 조회 팝업에서 호출
+	var fnSetBrandInfo = function(result) {
+		var arrbrandCd = [];
+		var brandText = "";
+		var bIndex = 0;
+		$('#goodsSizeStockForm').find('#brandText').html('');
+		$('#goodsSizeStockForm input[name=searchTxt]').val('');
+		result.forEach(function(brand){
+			bIndex++; 
+			arrbrandCd.push(brand.brandCd);
+		});
 
-		if (gagajf.isNull($("#goodsSizeStockForm input[name=searchTxt]").val())){
-			mcxDialog.alert('브랜드 검색어를 입력하세요.');
-			return false;
+		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
+		if (bIndex == 1) {
+			$('#goodsSizeStockForm input[name=searchTxt]').val(arrbrandCd[0]);
+		}else{
+			brandText = bIndex + " 개";
+			$('#goodsSizeStockForm').find('#brandText').html(brandText);	
 		}
-		
-		cfnOpenBrandListPopup('fnSetBrandInfo', $("#goodsSizeStockForm input[name=searchTxt]").val());
-		
-	});
+		var jsonData = JSON.stringify(arrbrandCd);
+		$("#goodsSizeStockForm input[name=brandList]").val(jsonData);
+	}
 	
 	$(document).ready(function() {