초기소스
This commit is contained in:
437
src/main/webapp/WEB-INF/views/itrnt/stock/StockManageR.jsp
Normal file
437
src/main/webapp/WEB-INF/views/itrnt/stock/StockManageR.jsp
Normal file
@@ -0,0 +1,437 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="ui" uri="http://www.winbit.kr/ctl/ui"%>
|
||||
<%@ taglib prefix="f" uri="/WEB-INF/tlds/f.tld"%>
|
||||
<%--
|
||||
Class Name : ItrntBbscttListR.jsp
|
||||
Description : 인트라넷 게시판 목록 화면
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
------- -------- ---------------------------
|
||||
2024-03-26 이운산 최초 생성(퍼블리싱 적용)
|
||||
--%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<%-- 공통 include --%>
|
||||
<%@ include file="/WEB-INF/views/comm/itrnt/Include.jsp" %>
|
||||
</head>
|
||||
<script>
|
||||
$("header").ready(function () {
|
||||
$("#unfold").click();
|
||||
});
|
||||
$(document).ready(function (){
|
||||
// 본부 선택
|
||||
$("#goodsPosHdqrtrsCd").on("change", function () {
|
||||
document.location.href = "/itrnt/stock/selectStockIngire?srchGoodsPosHdqrtrsCd=" + $(this).val();
|
||||
});
|
||||
|
||||
// 매장 선택
|
||||
$("#srchStrPosCd").on("change", function () {
|
||||
document.location.href = "/itrnt/stock/selectStockIngire?srchGoodsPosHdqrtrsCd=" + $("#goodsPosHdqrtrsCd").val() + "&srchStrPosCd=" + $(this).val();
|
||||
});
|
||||
|
||||
// 분류 선택
|
||||
$("select.sc_select").on("change", function () {
|
||||
// 대분류 선택 -> 중/소분류 리셋
|
||||
if ($(this).attr("id") == "sc_grp_1") {
|
||||
$("#sc_grp_2").val("");
|
||||
$("#sc_grp_3").val("");
|
||||
}
|
||||
// 중분류 선택 -> 소분류 리셋
|
||||
if ($(this).attr("id") == "sc_grp_2") {
|
||||
$("#sc_grp_3").val("");
|
||||
}
|
||||
// 분류 옵션 설정
|
||||
set_sc_grp();
|
||||
});
|
||||
|
||||
// 검색어 입력
|
||||
$("input.sc_input").on("change", function () {
|
||||
$(this).val($(this).val().trim());
|
||||
|
||||
// 필터 적용
|
||||
set_filter();
|
||||
});
|
||||
|
||||
// 제품 선택
|
||||
$("#tbl_data td.td_menuname").on("click", function () {
|
||||
var tr = $(this).closest("tr");
|
||||
if (tr.hasClass("chk_goods"))
|
||||
tr.removeClass("chk_goods");
|
||||
else
|
||||
tr.addClass("chk_goods");
|
||||
});
|
||||
|
||||
// 선택한 제품만 표시
|
||||
$("#onlyGoods").on("click", function () {
|
||||
if ($(this).prop("checked"))
|
||||
$("#tbl_data tbody tr").addClass("chk_goods_only");
|
||||
else
|
||||
$("#tbl_data tbody tr").removeClass("chk_goods_only");
|
||||
|
||||
// 필터 적용
|
||||
set_filter();
|
||||
});
|
||||
|
||||
// 선택한 매장만 표시
|
||||
$("#onlyStore").on("click", function () {
|
||||
if ($(this).prop("checked")) {
|
||||
if ($(".chk_store:checked").length > 0) {
|
||||
$("#tbl_data td.td_store").hide();
|
||||
$("#tbl_data td.td_qty").hide();
|
||||
$("#tbl_data td.td_avg").hide();
|
||||
|
||||
$("#tbl_data td.td_store.my").show();
|
||||
$("#tbl_data td.td_qty.my").show();
|
||||
$("#tbl_data td.td_avg.my").show();
|
||||
|
||||
$(".chk_store").each(function () {
|
||||
if ($(this).prop("checked")) {
|
||||
var str_cd = $(this).val();
|
||||
var tdElement = $("#tbl_data td[str_cd='" + str_cd + "']");
|
||||
if (tdElement.length) { // Check if the element exists
|
||||
tdElement.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
$("#tbl_data td.td_store").show();
|
||||
$("#tbl_data td.td_qty").show();
|
||||
$("#tbl_data td.td_avg").show();
|
||||
}
|
||||
});
|
||||
|
||||
// 전체 선택한 매장 해제
|
||||
$("#btn_chk_store_clear").on("click", function () {
|
||||
$(".chk_store").prop("checked", false);
|
||||
|
||||
if ($("#onlyStore").prop("checked")) {
|
||||
$("#onlyStore").prop("checked", false);
|
||||
$("#tbl_data td.td_store").show();
|
||||
$("#tbl_data td.td_qty").show();
|
||||
$("#tbl_data td.td_avg").show();
|
||||
}
|
||||
});
|
||||
|
||||
// 전체 선택한 제품 해제
|
||||
$("#btn_chk_goods_clear").on("click", function () {
|
||||
$("#onlyGoods").prop("checked", false);
|
||||
$("#tbl_data tbody tr").removeClass("chk_goods_only");
|
||||
$("#tbl_data tbody tr").removeClass("chk_goods");
|
||||
|
||||
// 필터 적용
|
||||
set_filter();
|
||||
});
|
||||
});
|
||||
|
||||
// 필터 적용
|
||||
function set_filter(){
|
||||
var grp_1 = $("#sc_grp_1").val();
|
||||
var grp_2 = $("#sc_grp_2").val();
|
||||
var grp_3 = $("#sc_grp_3").val();
|
||||
var menuname = $("#sc_menuname").val();
|
||||
var barcode = $("#sc_barcode").val();
|
||||
var chk_goods_only = $("#onlyGoods").prop("checked"); // 선택한 제품만 표시
|
||||
// 1. 검색어 적용
|
||||
console.log("menuname : ", menuname);
|
||||
console.log("barcode : ", barcode);
|
||||
$(".td_goods").each(function(){
|
||||
var chk = true;
|
||||
if(menuname != "" && $(this).find(".td_menuname").attr("title").indexOf(menuname) == -1)
|
||||
chk = false;
|
||||
if(barcode != "" && $(this).find(".td_barcode").attr("title").indexOf(barcode) == -1)
|
||||
chk = false;
|
||||
if(chk_goods_only && !$(this).hasClass("chk_goods"))
|
||||
chk = false;
|
||||
if(chk)
|
||||
$(this).addClass("sc");
|
||||
else
|
||||
$(this).removeClass("sc");
|
||||
});
|
||||
|
||||
// 2. 분류 적용
|
||||
$(".td_goods").hide();
|
||||
if(grp_3 != "")
|
||||
$(".td_goods.sc[grpcd_1='" + grp_1 + "'][grpcd_2='" + grp_2 + "'][grpcd_3='" + grp_3 + "']").show();
|
||||
else if(grp_2 != "")
|
||||
$(".td_goods.sc[grpcd_1='" + grp_1 + "'][grpcd_2='" + grp_2 + "']").show();
|
||||
else if(grp_1 != "")
|
||||
$(".td_goods.sc[grpcd_1='" + grp_1 + "']").show();
|
||||
else
|
||||
$(".td_goods.sc").show();
|
||||
|
||||
$(".no_hover").show();
|
||||
}
|
||||
|
||||
// 분류 옵션 설정
|
||||
function set_sc_grp(){
|
||||
var grp_1 = $("#sc_grp_1").val();
|
||||
var grp_2 = $("#sc_grp_2").val();
|
||||
var grp_3 = $("#sc_grp_3").val();
|
||||
let grp_2_arr = '<c:out value="${resultMap.stockData.itm_2_json}" escapeXml="false"/>';
|
||||
grp_2_arr = JSON.parse(grp_2_arr);
|
||||
let grp_3_arr = '<c:out value="${resultMap.stockData.itm_3_json}" escapeXml="false"/>';
|
||||
grp_3_arr = JSON.parse(grp_3_arr);
|
||||
// 중분류
|
||||
$("#sc_grp_2 option[value != '']").remove();
|
||||
if (grp_1 != "") {
|
||||
$.each(grp_2_arr, function (index, item) {
|
||||
if(item.grpCd1 === $("#sc_grp_1").val()){
|
||||
$("#sc_grp_2").append("<option value='" + item.grpCd2 + "'>" + item.grpNm + "</option>");
|
||||
}
|
||||
});
|
||||
$("#sc_grp_2").niceSelect('update');
|
||||
}
|
||||
|
||||
$("#sc_grp_3 option[value != '']").remove();
|
||||
if(grp_2 != ""){
|
||||
//중분류 셀렉트
|
||||
$("#sc_grp_2").val(grp_2).prop("selected", true);
|
||||
$("#sc_grp_2").niceSelect('update');
|
||||
//옵션 값 부여
|
||||
$.each(grp_3_arr, function(index, item){
|
||||
if(item.grpCd1+item.grpCd2 === $("#sc_grp_1").val()+$("#sc_grp_2").val()){
|
||||
$("#sc_grp_3").append("<option value='" + item.grpCd3 + "'>" + item.grpNm + "</option>");
|
||||
}
|
||||
});
|
||||
$("#sc_grp_3").niceSelect('update');
|
||||
}
|
||||
|
||||
if(grp_3 != "") {
|
||||
$("#sc_grp_3").val(grp_3).prop("selected", true);
|
||||
$("#sc_grp_3").niceSelect('update');
|
||||
}
|
||||
|
||||
// 필터 적용
|
||||
set_filter();
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
#tbl_data { table-layout: auto; /* 자동 레이아웃 */
|
||||
width: 100%; /* 테이블 너비 */}
|
||||
#tbl_data tr { display: table-row;}
|
||||
#tbl_data td { display: table-cell; border-bottom:1px;}
|
||||
#tbl_data td.td_grpnm_1 { min-width:90px; max-width:90px; background-color:#ffffff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
#tbl_data td.td_grpnm_2 { min-width:90px; max-width:90px; background-color:#ffffff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
#tbl_data td.td_grpnm_3 { min-width:100px; max-width:100px; background-color:#ffffff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
|
||||
#tbl_data td.td_menuname { position:sticky; left:0px; cursor:pointer; font-weight:bold; }
|
||||
#tbl_data td.td_store { min-width:100px; max-width:100px; }
|
||||
#tbl_data td.td_qty {background-color:#eeeeee; }
|
||||
#tbl_data td.td_store.my { background-color:#ffffff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:sticky; left:215px; }
|
||||
#tbl_data td.td_qty.my { background-color:#eeeeee; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:sticky; left:215px; }
|
||||
#tbl_data td.td_avg.my { background-color:#ffffff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; position:sticky; left:265px; }
|
||||
#tbl_data td.my { font-weight:bold; }
|
||||
#tbl_data td.plus { color:blue; }
|
||||
#tbl_data td.minus { color:red; }
|
||||
|
||||
#tbl_data tbody { display: table-row-group; }
|
||||
#tbl_data tbody tr:not(.no_hover):hover td {background-color: #F5FF82;}
|
||||
#tbl_data tbody tr.chk_goods td { background-color:#00eeee; }
|
||||
#tbl_data tbody tr.chk_goods:hover td { background-color:#90ee90; }
|
||||
|
||||
#tbl_data tbody tr.chk_goods_only { display:none; }
|
||||
#tbl_data tbody tr.chk_goods.chk_goods_only { display:table-row; }
|
||||
</style>
|
||||
<body>
|
||||
<%@include file="/WEB-INF/views/comm/itrnt/Header.jsp" %>
|
||||
<main class="main">
|
||||
<%@include file="/WEB-INF/views/comm/itrnt/Left.jsp" %>
|
||||
<div class="content">
|
||||
<div class="content__inner">
|
||||
<button class="side-nav__fold" id = "unfold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
|
||||
<div class="page-title">
|
||||
<h2 class="page-title__title">재고관리</h2>
|
||||
</div>
|
||||
<section class="content-section">
|
||||
<div class="table-wrapper" style="margin-bottom: 0px;">
|
||||
<table class="table">
|
||||
<caption>재고관리 검색 조건</caption>
|
||||
<colgroup>
|
||||
<col style="width: 25%;">
|
||||
<col style="width: auto;">
|
||||
<col style="width: auto;">
|
||||
<col style="width: auto;">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<div class="select-box">
|
||||
<select title="상품포스본부코드" name="srchGoodsPosHdqrtrsCd" id="goodsPosHdqrtrsCd">
|
||||
<option value="">*본부*</option>
|
||||
<c:forEach var="posHdqrtrsList" items="${resultMap.posHdqrtrsList}">
|
||||
<option value="${posHdqrtrsList.cd}" ${f:setSelected(resultMap.vo.srchGoodsPosHdqrtrsCd,posHdqrtrsList.cd)}>${posHdqrtrsList.cd}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="select-box">
|
||||
<select title="매장포스코드" name="srchStrPosCd" id="srchStrPosCd">
|
||||
<option value="">*매장*</option>
|
||||
<c:forEach var="strList" items="${resultMap.stockData.strList}">
|
||||
<option value="${strList.strPosCd}" ${f:setSelected(resultMap.vo.srchStrPosCd,strList.strPosCd)}>${strList.strNm}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="b-checkbox-container" style="margin-left: 20px;">
|
||||
<label class="b-checkbox checkbox">
|
||||
<input type="checkbox" id="onlyGoods">
|
||||
<span class="check"></span>
|
||||
<span class="control-label">선택한 제품만 표시</span>
|
||||
</label>
|
||||
<button type="button" class="btn outline" id="btn_chk_goods_clear">선택 제품 전체해제</button>
|
||||
</div>
|
||||
<div class="b-checkbox-container" style="margin-left: 20px;">
|
||||
<label class="b-checkbox checkbox">
|
||||
<input type="checkbox" id="onlyStore">
|
||||
<span class="check"></span>
|
||||
<span class="control-label">선택한 매장만 표시</span>
|
||||
</label>
|
||||
<button type="button" class="btn outline" id="btn_chk_store_clear">선택 매장 전체해제</button>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<section class="content-section">
|
||||
<div class="table-wrapper" style="margin-bottom: 0px; overflow-x: auto; height: 600px; overflow-y: auto; white-space: nowrap;">
|
||||
<table class="table vertical" style="width: 100%; border-collapse: collapse;" id = "tbl_data">
|
||||
<caption>해당 테이블에 대한 설명</caption>
|
||||
<colgroup>
|
||||
<col style="width: 100px;">
|
||||
<col style="width: 100px;">
|
||||
<col style="width: 100px;">
|
||||
<col style="width: 100px;">
|
||||
<col style="width: 200px;">
|
||||
<c:forEach var = "strList" items = "${resultMap.stockData.strList}">
|
||||
<col style="width : auto;">
|
||||
<col style="width : auto;">
|
||||
</c:forEach>
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr class="no_hover">
|
||||
<td>
|
||||
대분류
|
||||
</td>
|
||||
<td>
|
||||
중분류
|
||||
</td>
|
||||
<td>
|
||||
소분류
|
||||
</td>
|
||||
<td>
|
||||
바코드
|
||||
</td>
|
||||
<td>
|
||||
제품명
|
||||
</td>
|
||||
<c:forEach var = "strList" items = "${resultMap.stockData.strList}">
|
||||
<td colspan="2" class="td_store <c:if test = "${strList.isMy eq '1'}">my</c:if>" str_cd ="<c:out value="${strList.strIdntfcCd}"/>">
|
||||
<div class="b-checkbox-container" style="">
|
||||
<label class="b-checkbox checkbox">
|
||||
<c:if test = "${strList.isMy ne '1'}">
|
||||
<input type="checkbox" class="chk_store" value = "${strList.strIdntfcCd}">
|
||||
<span class="check"></span>
|
||||
</c:if>
|
||||
<span class="control-label">${strList.strNm}</span>
|
||||
</label>
|
||||
</div>
|
||||
</td>
|
||||
</c:forEach>
|
||||
</tr>
|
||||
<tr class="no_hover">
|
||||
<td>
|
||||
<div class="select-box">
|
||||
<select title="대분류" name="grpCd1" class="sc_select" id="sc_grp_1">
|
||||
<option value="">*대분류*</option>
|
||||
<c:forEach var="itmList" items="${resultMap.stockData.itm_1_List}">
|
||||
<option value="${itmList.grpCd1}">${itmList.grpNm}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="select-box">
|
||||
<select title="중분류" name="grpCd2" class="sc_select" id="sc_grp_2">
|
||||
<option value="">*중분류*</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="select-box">
|
||||
<select title="소분류" name="grpCd3" class="sc_select" id="sc_grp_3">
|
||||
<option value="">*소분류*</option>
|
||||
</select>
|
||||
</div>
|
||||
</td>
|
||||
<td class="">
|
||||
<input class="input-text xl sc_input" type="text" id="sc_barcode">
|
||||
</td>
|
||||
<td class="">
|
||||
<input class="input-text xl sc_input" type="text" id="sc_menuname">
|
||||
</td>
|
||||
<c:forEach var = "strList" items = "${resultMap.stockData.strList}">
|
||||
<td class="td_qty <c:if test = "${strList.isMy eq '1'}">my</c:if>" str_cd="<c:out value="${strList.strIdntfcCd}"/>">
|
||||
재고
|
||||
</td>
|
||||
<td class="td_avg <c:if test = "${strList.isMy eq '1'}">my</c:if>" str_cd="<c:out value="${strList.strIdntfcCd}"/>">
|
||||
평균
|
||||
</td>
|
||||
</c:forEach>
|
||||
</tr>
|
||||
<c:set var = "data" value = "${resultMap.stockData.data}"/>
|
||||
<c:choose>
|
||||
<c:when test = "${not empty resultMap.stockData.stockList}">
|
||||
<c:forEach var="item" items="${resultMap.stockData.goodsList}">
|
||||
<tr itm_id="${item.goodsIdntfcCd}" grpcd_1="${item.grpCd1}" grpcd_2="${item.grpCd2}" grpcd_3="${item.grpCd3}" class="td_goods">
|
||||
<td class="td_grpnm_1" title="${item.grpnm_1}">${item.grpCdNm1}</td>
|
||||
<td class="td_grpnm_2" title="${item.grpnm_2}">${item.grpCdNm2}</td>
|
||||
<td class="td_grpnm_3" title="${item.grpnm_3}">${item.grpCdNm3}</td>
|
||||
<td class="td_barcode" title="${item.goodsBrcd}">${item.goodsBrcd}</td>
|
||||
<td class="td_menuname" title="${item.goodsNm}">${item.goodsNm}</td>
|
||||
<c:if test="${not empty resultMap.stockData.strList}">
|
||||
<c:forEach var="store" items="${resultMap.stockData.strList}">
|
||||
<c:set var = "goodsIdntfcCd" value = "${item.goodsIdntfcCd}"/>
|
||||
<c:set var = "strIdntfcCd" value = "${store.strIdntfcCd}"/>
|
||||
<c:choose>
|
||||
<c:when test="${not empty data.get(goodsIdntfcCd).get(strIdntfcCd).status}">
|
||||
<c:set var = "status" value = "${data.get(goodsIdntfcCd).get(strIdntfcCd).status}"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var = "status" value = "plus"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<td str_cd="${store.strIdntfcCd}" class="td_qty ${store.isMy eq '1' ? 'my' : ''} ${status}">
|
||||
${data.get(goodsIdntfcCd).get(strIdntfcCd).invntryQy}
|
||||
</td>
|
||||
<td str_cd="${store.strIdntfcCd}" class="td_avg ${store.isMy eq '1' ? 'my' : ''}">
|
||||
${data.get(goodsIdntfcCd).get(strIdntfcCd).pdAvrgQy}
|
||||
</td>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<tr colspan = "100%"><spring:message code="common.nodata"/></tr>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user