mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-05 04:03:45 +09:00
#수정
stock/create.jsp stock/list.jsp stock/read.jsp stock/update.jsp WarehouseController.java WarehouseMapper.xml
This commit is contained in:
@@ -24,50 +24,51 @@
|
||||
</div>
|
||||
<hr>
|
||||
<div style="text-align: center">
|
||||
<form>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon2">용적</span>
|
||||
<input type="text" class="form-control" aria-label="용적" value="${One.capacity }" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon3">적재량</span>
|
||||
<input type="text" class="form-control" aria-label="적재량" value="${One.currentCapacity }" readonly>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon2">용적</span>
|
||||
<input type="text" class="form-control" aria-label="용적" value="${One.capacity }" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-4">
|
||||
<span class="input-group-text" id="basic-addon3">적재량</span>
|
||||
<input type="text" class="form-control" aria-label="적재량" value="${One.currentCapacity }" readonly>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<hr>
|
||||
</div>
|
||||
<div id="productSearch">
|
||||
<div class="container-fluid">
|
||||
<div class="col-12" id="search">
|
||||
<form action="list">
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select" name="searchn">
|
||||
<option value="0">제품명</option>
|
||||
<option value="1">재고수</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="search" class="form-control"
|
||||
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
||||
<div class="col-12">
|
||||
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select" id="searchn">
|
||||
<option value="0">제품명</option>
|
||||
<option value="1">재고수</option>
|
||||
</select>
|
||||
</div>
|
||||
</form>
|
||||
<input type=hidden id="id" value="${One.id}">
|
||||
<input type="text" name="search" class="form-control" id="search"
|
||||
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<input class="btn btn-info" type="submit" id="searchBtn" value="검색"/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row row-table">
|
||||
<div class="col-12">
|
||||
<div id="searchResults" class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
@@ -115,29 +116,50 @@
|
||||
</ul>
|
||||
</nev>
|
||||
</div>
|
||||
<div class="col-3 ">
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="align: center">
|
||||
<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>
|
||||
|
||||
<!-- 모달내용 -->
|
||||
<div class="modal fade" id="yes_no_modal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h1 class="modal-title fs-5" id="yesNoModalLabel">ㅎㅇ</h1>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
모달의 내용
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||
<button id="modal_yes_button" type="button" class="modal_yes btn btn-primary">확인</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#checkBtn").on("click", function() {
|
||||
$(document).ready(function () {
|
||||
$("#checkBtn").on("click", function () {
|
||||
$(location).attr("href", "/warehouse/list");
|
||||
})//checkBtn click
|
||||
|
||||
|
||||
$("#modifyBtn").on("click", function() {
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/update";
|
||||
form.method = "GET";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
@@ -150,25 +172,63 @@
|
||||
|
||||
})//modifyBtn click
|
||||
|
||||
yesNoModal.yesFunction = deleteCategoryFunction;
|
||||
|
||||
|
||||
function deleteCategoryFunction(){
|
||||
var id = $("#id").val();
|
||||
$.ajax({
|
||||
url: "/warehouse/delete",
|
||||
type: "delete",
|
||||
data: {
|
||||
"id": id
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("삭제되었습니다.");
|
||||
$(location).attr("href", "/warehouse/list");
|
||||
} else {
|
||||
alert("정상적으로 삭제되지 않았습니다..");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
|
||||
}//deleteCategoryFunction
|
||||
|
||||
|
||||
// 검색 버튼 클릭 시 Ajax로 검색 결과를 갱신
|
||||
$("#searchBtn").click(function () {
|
||||
var search = $("#search").val();
|
||||
var searchn = $("#searchn").val();
|
||||
var id = $("#id").val();
|
||||
|
||||
$.ajax({
|
||||
url: "read.jsp",
|
||||
method: "POST",
|
||||
data: {
|
||||
search: search,
|
||||
searchn: searchn,
|
||||
id: id
|
||||
|
||||
},
|
||||
success: function (result) {
|
||||
// 검색 결과를 받아와서 결과를 보여주는 영역 업데이트
|
||||
$("#searchResults").html(result);
|
||||
},
|
||||
error: function () {
|
||||
alert("검색 중 오류가 발생했습니다.");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});//ready
|
||||
|
||||
|
||||
$(function () {
|
||||
$("a[id]").click(function () {
|
||||
let no = $(this).attr("id");// 글번호
|
||||
$.ajax({
|
||||
url: "/deleteWarehouse/delete",
|
||||
data: "id=" + id,
|
||||
method: "delete"
|
||||
}
|
||||
).done(function () {
|
||||
alert("삭제되었습니다.");
|
||||
location.href = "/warehouse/list";
|
||||
})
|
||||
return false;//하이퍼링크 이동 X
|
||||
})//click
|
||||
})
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user