mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-05 12:13:33 +09:00
입고 전체적으로 수정
This commit is contained in:
@@ -100,6 +100,13 @@
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon4">메모</span>
|
||||
<input type="text" name="note" id="note" class="form-control"
|
||||
placeholder="메모를 입력하세요" aria-label="메모" value="${dto.note }"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
|
||||
<c:set var="userData" value="${sessionScope.userData}" />
|
||||
<input type='hidden' id="manager_id" value="${userData.id }">
|
||||
@@ -130,7 +137,7 @@
|
||||
var warehouse_id = $("#warehouse_id").val();
|
||||
var in_date = $("#in_date").val();
|
||||
var manager_id = $("#manager_id").val();
|
||||
|
||||
var note = $("#note").val();
|
||||
|
||||
if(!product_id){
|
||||
alert("제품을 선택해야합니다.");
|
||||
@@ -148,14 +155,20 @@
|
||||
}
|
||||
if(!in_date){
|
||||
in_date = new Date();
|
||||
in_date = in_date.toISOString();
|
||||
}
|
||||
if(!note){
|
||||
note = "";
|
||||
}
|
||||
|
||||
|
||||
const data = {
|
||||
product_id : product_id,
|
||||
quantity : quantity,
|
||||
in_date : in_date,
|
||||
manager_id : manager_id,
|
||||
warehouse_id : warehouse_id
|
||||
warehouse_id : warehouse_id,
|
||||
note : note
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +180,7 @@
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("입고을 추가했습니다.");
|
||||
$(location).attr("href", "/price/list");
|
||||
$(location).attr("href", "/in/list");
|
||||
} else {
|
||||
alert("입고 추가에 실패하였습니다.");
|
||||
}
|
||||
@@ -176,7 +189,7 @@
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
|
||||
|
||||
});//submitBtn
|
||||
});//ready
|
||||
|
||||
|
||||
@@ -122,7 +122,23 @@
|
||||
});//createButton
|
||||
|
||||
|
||||
|
||||
$("body").on("click", ".detailTr", function(){
|
||||
var id = $(this).data("id");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/in/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
});//body detailTr
|
||||
|
||||
|
||||
|
||||
|
||||
120
src/main/webapp/WEB-INF/views/in/read.jsp
Normal file
120
src/main/webapp/WEB-INF/views/in/read.jsp
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<div class="row">
|
||||
<h1>입고 상세페이지</h1>
|
||||
<div class="col-10" style="text-align: right;">
|
||||
<button type="button" class="btn btn-danger" onclick="goDelete()">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div style="text-align: center">
|
||||
<form>
|
||||
<div class="ulTag">
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: center;">
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">제품명</span>
|
||||
<input type="text" class="form-control" placeholder="제품명" aria-label="제품명" value="${dto.productDto.name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">회사명</span>
|
||||
<input type="text" class="form-control" placeholder="회사명" aria-label="회사명" value="${pDto.company_name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">분류</span>
|
||||
<input type="text" class="form-control" placeholder="분류" aria-label="분류" value="${pDto.categoryDto.cls_nm_4}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon4">거래처</span>
|
||||
<input type="text" class="form-control" placeholder="거래처" aria-label="거래처" value="${pDto.vendorDto.name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon5">수량</span>
|
||||
<input type="number" class="form-control" placeholder="수량을 입력하세요" aria-label="수량" value="${dto.quantity}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon6">창고명</span>
|
||||
<input type="text" class="form-control" placeholder="창고명" aria-label="창고명" value="${dto.warehouseDto.name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon7">입고날짜</span>
|
||||
<fmt:formatDate value="${dto.in_date}" pattern="yyyy-MM-dd HH:mm:ss" type="date" var="formattedInDate" />
|
||||
<input type="datetime-local" id="in_date" name="in_date" class="form-control" placeholder="날짜을 입력하세요" aria-label="입고날짜" value="${formattedInDate}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon8">메모</span>
|
||||
<input type="text" class="form-control" placeholder="메모가 없습니다." aria-label="메모" value="${dto.note}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon9">담당자</span>
|
||||
<input type="text" class="form-control" placeholder="담당자" aria-label="담당자" value="${dto.accountDto.name}" readonly>
|
||||
</div>
|
||||
|
||||
<input type='hidden' id="id" value="${dto.id}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 ">
|
||||
<div class="w-40 col-centered" style="text-align: right">
|
||||
<button type="button" class="btn btn-primary" id="checkBtn">확인</button>
|
||||
<button type="button" class="btn btn-warning" id="modifyBtn">수정</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#checkBtn").on("click", function() {
|
||||
$(location).attr("href", "/in/list");
|
||||
})//checkBtn click
|
||||
$("#modifyBtn").on("click", function() {
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/in/update";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
|
||||
})//modifyBtn click
|
||||
|
||||
|
||||
|
||||
});//ready
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
256
src/main/webapp/WEB-INF/views/in/update.jsp
Normal file
256
src/main/webapp/WEB-INF/views/in/update.jsp
Normal file
@@ -0,0 +1,256 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<div class="row">
|
||||
<h1>입고 수정</h1>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
<div style="text-align: center">
|
||||
<form>
|
||||
<div class="ulTag">
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: center;">
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">제품명</span>
|
||||
<input type="text" class="form-control" name="productName" placeholder="제품명을 검색하세요"
|
||||
aria-label="제품명" id="productName" value="${dto.productDto.name}" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchProductName"
|
||||
style="background-color:#FF5E5E;" type="button"
|
||||
onclick="showSearchModal_product('제품 검색','product')">검색</button>
|
||||
<input type='hidden' id="product_id" value="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='company_name_span' class="input-group-text">회사명</span>
|
||||
<input readonly id="company_name" type="text" class="form-control"
|
||||
value="${pDto.company_name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='cls_Nm_4_span' class="input-group-text">분류</span>
|
||||
<input readonly id="cls_Nm_4" type="text" class="form-control"
|
||||
value="${pDto.categoryDto.cls_nm_4}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='cls_Nm_4_span' class="input-group-text">거래처</span>
|
||||
<input readonly id="vendor_name" type="text" class="form-control"
|
||||
value="${pDto.vendorDto.name}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">수량</span>
|
||||
<input type="number" name="quantity" id="quantity" class="form-control"
|
||||
value="${dto.quantity}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">창고명</span>
|
||||
<input type="text" name="warehouse_name" id="warehouse_name" class="form-control"
|
||||
placeholder="창고를 검색하세요" aria-label="창고명" value="${dto.warehouseDto.name}"
|
||||
aria-describedby="basic-addon1" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchWarehouseName"
|
||||
style="background-color:#FF5E5E;" type="button"
|
||||
onclick="showSearchModal_warehouse('창고 검색','warehouse_capacity_currentCapacity')">검색</button>
|
||||
<input type='hidden' id="warehouse_id" value="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='address_span' class="input-group-text">주소</span>
|
||||
<input readonly id="Address_name" type="text" class="form-control"
|
||||
value="${wDto.address}">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='capacity_span' class="input-group-text">용적</span>
|
||||
<input readonly id="Capacity_name" type="text" class="form-control"
|
||||
value="${wDto.capacity}">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='remainingCapacity_span' class="input-group-text">잔여 용량</span>
|
||||
<input readonly id="remainingcapacity" type="text" placeholder=""
|
||||
value="${wDto.currentCapacity}" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon4">입고날짜</span>
|
||||
|
||||
<fmt:formatDate value="${dto.in_date}" pattern="yyyy-MM-dd HH:mm:ss" type="date" var="formattedDate" />
|
||||
<input type="datetime-local" id="in_date" name="in_date" class="form-control"
|
||||
placeholder="날짜을 입력하세요" aria-label="입고날짜" value="${formattedDate}"
|
||||
aria-describedby="basic-addon1">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon5">메모</span>
|
||||
<input type="text" name="note" id="note" class="form-control"
|
||||
placeholder="메모를 입력하세요" aria-label="메모" value="${dto.note}"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
<c:set var="userData" value="${sessionScope.userData}" />
|
||||
<input type='hidden' id="manager_id" value="${userData.id}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 ">
|
||||
<div class="w-40 col-centered" style="text-align: right">
|
||||
<button type="button" class="btn btn-primary" id="submitBtn">수정 완료</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#cancelBtn").on("click", function(){
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/in/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
})//cancelBtn
|
||||
|
||||
$("#submitBtn").on("click", function(){
|
||||
var product_id = $("#product_id").val();
|
||||
var quantity = $("#quantity").val();
|
||||
var warehouse_id = $("#warehouse_id").val();
|
||||
var in_date = $("#in_date").val();
|
||||
var manager_id = $("#manager_id").val();
|
||||
var note = $("#note").val();
|
||||
if(!name){
|
||||
alert("제품명을 입력해야 합니다.");
|
||||
$("#name").focus();
|
||||
return false;
|
||||
}
|
||||
if(!product_id){
|
||||
alert("제품을 선택해야합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!quantity){
|
||||
alert("수량을 입력해야 합니다.");
|
||||
$("#quantity").focus();
|
||||
return false;
|
||||
}
|
||||
if(!warehouse_id){
|
||||
alert("창고을 선택해야합니다.");
|
||||
return false;
|
||||
}
|
||||
if(!in_date){
|
||||
in_date = new Date();
|
||||
in_date = in_date.toISOString();
|
||||
}
|
||||
if(!note){
|
||||
note = "";
|
||||
}
|
||||
|
||||
const data = {
|
||||
product_id : product_id,
|
||||
quantity : quantity,
|
||||
in_date : in_date,
|
||||
manager_id : manager_id,
|
||||
warehouse_id : warehouse_id,
|
||||
note : note
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/in/update_process",
|
||||
type: "put",
|
||||
data: data,
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("입고 정보를 수정했습니다.");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/in/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
alert("입고 수정에 실패하였습니다.");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
});//submitBtn
|
||||
|
||||
});//ready
|
||||
function showSearchModal(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/product/show_modal', // 요청할 서버url
|
||||
dataType : 'html', // 데이터 타입 (html, xml, json, text 등등)
|
||||
data : data,
|
||||
success : function(result) { // 결과 성공 콜백함수
|
||||
$("#search_modal_body").html(result);
|
||||
searchModalBootStrap.show();
|
||||
},
|
||||
error : function(request, status, error) {
|
||||
alert(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showSearchModal2(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/product/show_modal2', // 요청할 서버url
|
||||
dataType : 'html', // 데이터 타입 (html, xml, json, text 등등)
|
||||
data : data,
|
||||
success : function(result) { // 결과 성공 콜백함수
|
||||
$("#search_modal_body").html(result);
|
||||
searchModalBootStrap.show();
|
||||
},
|
||||
error : function(request, status, error) {
|
||||
alert(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user