201 lines
7.7 KiB
Plaintext
201 lines
7.7 KiB
Plaintext
<%--
|
|
Created by IntelliJ IDEA.
|
|
User: CHAMDAHAN
|
|
Date: 2024-10-08
|
|
Time: 오후 3:30
|
|
To change this template use File | Settings | File Templates.
|
|
--%>
|
|
<%@ 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" %>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<%--<title>일반 관리자</title>--%>
|
|
</head>
|
|
<style>
|
|
|
|
</style>
|
|
<script>
|
|
$(document).ready(function(){
|
|
fn_set_niceSelect_datePicker('.select-box');
|
|
})
|
|
|
|
/* 목록 > 전체선택 체인지 이벤트 */
|
|
$(document).on('change', '#checkAll', function () {
|
|
let checkbox = $(this).closest('table').find('input[name="erpGoodsChk"]');
|
|
|
|
$(checkbox).prop('checked', false);
|
|
$(checkbox).prop('checked', $(this).is(':checked'));
|
|
});
|
|
|
|
$('.erpGoodsChk').on('change',function(){
|
|
if(!$(this).is(":checked")) {
|
|
$('#checkAll').prop('checked', false);
|
|
} else {
|
|
const allChecked = $('.erpGoodsChk').length === $('.erpGoodsChk:checked').length;
|
|
$('#checkAll').prop('checked', allChecked);
|
|
}
|
|
})
|
|
|
|
// 선택대상 업데이트
|
|
$('#updateBtn').on('click',function(){
|
|
event.preventDefault();
|
|
let selectData = [];
|
|
|
|
$('.erpGoodsChk:checked').each(function(){
|
|
const tr = $(this).closest('tr');
|
|
const rowDate = {
|
|
id : $(this).val(),
|
|
goodsEa : tr.find('input[name="goodsEa"]').val(),
|
|
goodsSameCode : tr.find('input[name="goodsSameCode"]').val(),
|
|
goodsManager : tr.find('input[name="goodsManager"]').val()
|
|
};
|
|
selectData.push(rowDate);
|
|
});
|
|
|
|
if(selectData.length === 0 ) {
|
|
alert("수정대상을 선택해주세요");
|
|
return;
|
|
}
|
|
|
|
console.log("updatedata" + selectData);
|
|
|
|
$.ajax({
|
|
url: '/mngr/analytics/update/erp-goods',
|
|
type: 'POST',
|
|
contentType: 'application/json',
|
|
data: JSON.stringify(selectData),
|
|
success : function(result) {
|
|
if (result.resBody && result.resBody.result) {
|
|
const response = JSON.parse(result.resBody.result);
|
|
alert(response.message);
|
|
window.location.reload();
|
|
} else {
|
|
alert('응답 형식이 올바르지 않습니다.');
|
|
}
|
|
|
|
},
|
|
error: function(xhr, status, error) {
|
|
console.error("업데이트 실패:", error);
|
|
alert("업데이트 중 오류가 발생했습니다.");
|
|
}
|
|
});
|
|
|
|
})
|
|
</script>
|
|
<body>
|
|
<section class="content-section">
|
|
<div class="form-control-container">
|
|
<div class="left">
|
|
<div class="search-number">
|
|
<span class="search-number__text">총 <strong><c:out value="${ resultMap.paginationInfo.totalRecordCount }"/></strong>건</span>
|
|
</div>
|
|
</div>
|
|
<div class="center">
|
|
</div>
|
|
<div class="right">
|
|
<div class="select-box">
|
|
<select id="pageUnit" name="pageUnit" title="페이지당 출력될 목록건수" onchange="fn_select_list(1);">
|
|
<c:forEach items="${ resultMap.paginationInfo.pageUnitArr }" var="pageUnit" varStatus="pageUnitStatus">
|
|
<option value="<c:out value="${ pageUnit }"/>" <c:if test="${ resultMap.paginationInfo.recordCountPerPage eq pageUnit}">selected="selected"</c:if>><c:out value="${ pageUnit }"/>개씩</option>
|
|
</c:forEach>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<hr class="horizontal-line">
|
|
<div class="form-control-container">
|
|
<div class="center">
|
|
</div>
|
|
</div>
|
|
<hr class="spacing">
|
|
<div class="table-wrapper">
|
|
<table class="table vertical">
|
|
<form id='updateForm' name="updateForm" method="post"
|
|
action="<c:url value="/mngr/analytics/update/erp-goods"/>">
|
|
<caption>상품정보 목록</caption>
|
|
<colgroup>
|
|
<col style="width: 4%;">
|
|
<col style="width: 5%;">
|
|
<col style="width: 10%;">
|
|
<col style="width: 45%;">
|
|
<col style="width: 15%;">
|
|
<col style="width: 7%;">
|
|
<col style="width: 7%;">
|
|
<col style="width: 10%;">
|
|
<col style="width: 10%; ">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<th>
|
|
<label class="b-checkbox checkbox is-medium">
|
|
<input type="checkbox" id="checkAll" value="">
|
|
<span class="check"></span>
|
|
</label>
|
|
</th>
|
|
<th>번호</th>
|
|
<th>쇼핑몰</th>
|
|
<th>상품명</th>
|
|
<th>바코드</th>
|
|
<th>상품갯수</th>
|
|
<th>단품 수량 입력</th>
|
|
<th>동일상품코드</th>
|
|
<th>상품 담당자</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tbody">
|
|
<c:choose>
|
|
<c:when test="${ not empty resultMap.list }">
|
|
<c:forEach items="${ resultMap.list }" var="list" varStatus="status">
|
|
<tr class="list-row">
|
|
<td>
|
|
<label class="b-checkbox checkbox is-medium">
|
|
<input type="checkbox" name="erpGoodsChk" class="erpGoodsChk" value="${list.analysisErpGoodsInnb}">
|
|
<span class="check"></span>
|
|
</label>
|
|
</td>
|
|
<td><c:out value="${ resultMap.paginationInfo.totalRecordCount - list.rnum + 1 }" /></td>
|
|
<td>${list.sopmalCd}</td>
|
|
<td>${list.goodsNm}</td>
|
|
<td>${list.barcode}</td>
|
|
<td>${list.goodsQy}</td>
|
|
<td><input type="number" id="goodsEa" class="input-text" value="${list.goodsEa}" title="단품수량" name="goodsEa"></td>
|
|
<td><input type="text" id="goodsSameCode" class="input-text" value="${list.goodsSameCode}" title="동일상품코드" name="goodsSameCode"></td>
|
|
<td><input type="text" id="goodsManager" class="input-text" value="${list.goodsManager}" title="상품담당자" name="goodsManager"></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="100%"><spring:message code="common.nodata"/></td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</form>
|
|
</table>
|
|
</div>
|
|
<div class="form-control-container">
|
|
<div class="right" style="margin-left:1450px !important;">
|
|
<button class="btn primary" id="updateBtn" type="button">수정</button>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<div class="pagination__container">
|
|
<ui:pagination paginationInfo="${resultMap.paginationInfo}" type="image" jsFunction="fn_select_list"/>
|
|
</div>
|
|
|
|
|
|
</body>
|
|
</html>
|