설정 > 원가 설정 추가
This commit is contained in:
309
src/main/webapp/WEB-INF/views/mngr/setup/cost/CostPriceUpdtU.jsp
Normal file
309
src/main/webapp/WEB-INF/views/mngr/setup/cost/CostPriceUpdtU.jsp
Normal file
@@ -0,0 +1,309 @@
|
||||
<%@ 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="ui" uri="http://www.winbit.kr/ctl/ui" %>
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%--
|
||||
Class Name : CostPriceUpdtU.jsp
|
||||
Description : 원가 설정 상세
|
||||
Modification Information
|
||||
|
||||
수정일 수정자 수정내용
|
||||
------- -------- ---------------------------
|
||||
2026-05-29 이대환 최초 생성
|
||||
--%>
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<%-- 공통 include --%>
|
||||
<%@include file ="/WEB-INF/views/comm/mngr/Include.jsp" %>
|
||||
</head>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// 숫자 처리
|
||||
$('.sep').each(function () {
|
||||
fn_format_sep($(this));
|
||||
});
|
||||
});
|
||||
|
||||
/* ********************************************************
|
||||
* 입력창 추가
|
||||
******************************************************** */
|
||||
const fn_add_emptyBox = function() {
|
||||
|
||||
stplatChk = false;
|
||||
let trClone = '';
|
||||
|
||||
trClone = '<tr>'
|
||||
+ ' <td>'
|
||||
+ ' <label class="b-checkbox checkbox is-medium">'
|
||||
+ ' <input type="checkbox" name="costChk" value=""><span class="check"></span>'
|
||||
+ ' <input type="hidden" class="input-text number xl" name="ctInnbArr" title="원가고유번호" value="0">'
|
||||
+ ' </label>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text number xl" name="stdrDeArr" title="기준일자" maxlength="8">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text digit2 xl" name="usdRateArr" title="USD 환율 (1,000 円)" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text sep xl" name="jpDlvyCtArr" title="일본 내 물류비" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text sep xl" name="intlDlvyAmtArr" title="운임비용(JP)" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text digit2 xl" name="pltfomFeeArr" title="플랫폼 수수료율" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text digit3 xl" name="expctTaxArr" title="예상세율" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text sep xl" name="cstmsFeeArr" title="통관수수료" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ ' <td>'
|
||||
+ ' <div class="td-inner">'
|
||||
+ ' <input type="text" class="input-text sep xl" name="krDlvyCtArr" title="운임비용(KR)" maxlength="25">'
|
||||
+ ' </div>'
|
||||
+ ' </td>'
|
||||
+ '</tr>';
|
||||
|
||||
$('#tableCostSorting').append(trClone);
|
||||
$('#noData').hide();
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 입력창 삭제
|
||||
******************************************************** */
|
||||
const fn_remove_box = function() {
|
||||
|
||||
const target = $('[name=costChk]:checked');
|
||||
|
||||
if (target.length === 0) {
|
||||
alert('항목을 선택해 주세요.');
|
||||
} else {
|
||||
target.each(function() {
|
||||
$(this).parents('tr').remove();
|
||||
});
|
||||
}
|
||||
|
||||
$('#costAll').prop('checked', false);
|
||||
const total = $('#tableCostSorting').find('tr').length;
|
||||
|
||||
if (total === 1) {
|
||||
|
||||
$('#noData').show();
|
||||
|
||||
} else {
|
||||
|
||||
$('#noData').hide();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ********************************************************
|
||||
* 원가 설정 저장
|
||||
******************************************************** */
|
||||
const fn_update_cost = function () {
|
||||
if (confirm('원가 설정을 <spring:message code="confirm.common.save"/>')) {
|
||||
// 콤마 제거
|
||||
$('.sep').each(function () {
|
||||
fn_format_sep($(this), false);
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: 'post',
|
||||
url: '<c:url value="/mngr/setup/cost/updateCostPriceSetup"/>',
|
||||
data: $('#updtForm').serialize(),
|
||||
success: function () {
|
||||
alert("<spring:message code="success.common.save"/>");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
fn_format_sep($(this));
|
||||
}
|
||||
}
|
||||
|
||||
// 숫자 처리
|
||||
$(document).on('input', '.number', function () {
|
||||
var input = $(this).val();
|
||||
$(this).val(input.replace(/[^0-9]/g, ""));
|
||||
});
|
||||
$(document).on('input', '.sep', function () {
|
||||
fn_format_sep($(this));
|
||||
});
|
||||
const fn_format_sep = function ($target, unformat) {
|
||||
var value = $target.val();
|
||||
|
||||
if (unformat == undefined) {
|
||||
value = value
|
||||
.replace(/[^0-9]/g, "")
|
||||
.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
|
||||
} else {
|
||||
value = value.replace(/,/g, "");
|
||||
}
|
||||
|
||||
$target.val(value);
|
||||
}
|
||||
|
||||
// 자릿수 제한
|
||||
$(document).on('input', '.digit2', function () {
|
||||
let value = this.value;
|
||||
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||
value = value.replace(/(\.\d{2}).*/, '$1'); // 소수 2자리 제한
|
||||
this.value = value;
|
||||
});
|
||||
$(document).on('input', '.digit3', function () {
|
||||
let value = this.value;
|
||||
value = value.replace(/[^\d.]/g, ''); // 숫자와 .만 허용
|
||||
value = value.replace(/(\..*)\./g, '$1'); // . 하나만 허용
|
||||
value = value.replace(/(\.\d{3}).*/, '$1'); // 소수 3자리 제한
|
||||
this.value = value;
|
||||
});
|
||||
</script>
|
||||
<body>
|
||||
<%-- 상단메뉴 공통화 적용 : 2023-11-30 / 박철민 추가 --%>
|
||||
<%@include file ="/WEB-INF/views/comm/mngr/Header.jsp" %>
|
||||
<main class="main">
|
||||
<%-- 좌측메뉴 공통화 적용 : 2023-11-30 / 박철민 추가 --%>
|
||||
<%@include file ="/WEB-INF/views/comm/mngr/Left.jsp" %>
|
||||
<div class="content">
|
||||
<div class="content__inner">
|
||||
<button class="side-nav__fold"><span class="visually-hidden">좌측메뉴 펼치기/닫기</span></button>
|
||||
<div class="page-title">
|
||||
<h2 class="page-title__title">원가 설정</h2>
|
||||
<div class="page-title__btn-container">
|
||||
<button class="btn primary" onclick="fn_update_cost()">저장하기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<form id="updtForm">
|
||||
<section class="content-section">
|
||||
<div class="form-control-container mb-8">
|
||||
<div class="left">
|
||||
<h3 class="content-section__inner-title">원가 설정</h3>
|
||||
</div>
|
||||
<div class="center"></div>
|
||||
<div class="right">
|
||||
<button type="button" class="btn primary outline xsm" onclick="fn_add_emptyBox('costChk');"><spring:message code="button.add"/></button>
|
||||
<button type="button" class="btn dark xsm" onclick="fn_remove_box();"><spring:message code="button.delete"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-wrapper">
|
||||
<table class="table vertical">
|
||||
<caption>원가 설정</caption>
|
||||
<colgroup>
|
||||
<col style="width: 4%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
<col style="width: 12%;">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<label class="b-checkbox checkbox is-medium check-all">
|
||||
<input type="checkbox" value="" id="costAll"><span class="check"></span>
|
||||
</label>
|
||||
</th>
|
||||
<th>기준일자</th>
|
||||
<th>USD 환율 (1,000 円)</th>
|
||||
<th>일본 내 물류비</th>
|
||||
<th>운임비용(JP)</th>
|
||||
<th>플랫폼 수수료율</th>
|
||||
<th>예상세율</th>
|
||||
<th>통관수수료</th>
|
||||
<th>운임비용(KR)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableCostSorting">
|
||||
<c:if test="${not empty resultMap.costList}">
|
||||
<c:forEach var="cost" items="${resultMap.costList}" varStatus="status">
|
||||
<tr>
|
||||
<td>
|
||||
<label class="b-checkbox checkbox is-medium">
|
||||
<input type="checkbox" name="costChk" value=""><span class="check"></span>
|
||||
<input type="hidden" class="input-text number xl" name="ctInnbArr" title="원가고유번호" value="${cost.ctInnb}">
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text number xl" name="stdrDeArr" title="기준일자" maxlength="8" value="${cost.stdrDe}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text digit2 xl" name="usdRateArr" title="USD 환율 (1,000 円)" maxlength="25" value="${cost.usdRate}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text sep xl" name="jpDlvyCtArr" title="일본 내 물류비" maxlength="25" value="${cost.jpDlvyCt}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text sep xl" name="intlDlvyAmtArr" title="운임비용(JP)" maxlength="25" value="${cost.intlDlvyAmt}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text digit2 xl" name="pltfomFeeArr" title="플랫폼 수수료율" maxlength="25" value="${cost.pltfomFee}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text digit3 xl" name="expctTaxArr" title="예상세율" maxlength="25" value="${cost.expctTax}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text sep xl" name="cstmsFeeArr" title="통관수수료" maxlength="25" value="${cost.cstmsFee}">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="td-inner">
|
||||
<input type="text" class="input-text sep xl" name="krDlvyCtArr" title="운임비용(KR)" maxlength="25" value="${cost.krDlvyCt}">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<tr id="noData" style="display: none;"><td class="row-no-data" colspan="9">원가를 설정해 주세요.</td></tr>
|
||||
</c:if>
|
||||
<c:if test="${empty resultMap.costList}">
|
||||
<tr id="noData"><td class="row-no-data" colspan="9">원가를 설정해 주세요.</td></tr>
|
||||
</c:if>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
<button class="scroll-to-top"><span class="visually-hidden">위로가기</span></button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user