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:
@@ -32,6 +32,13 @@
|
||||
<div class="ulTag">
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: center;">
|
||||
|
||||
|
||||
<-- 세션 만들어지고 value 수정-->
|
||||
<input type='hidden' id="managerId" value="e9882095-aeb2-11ee-935d-0242ac110006">
|
||||
|
||||
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
@@ -73,6 +80,7 @@
|
||||
|
||||
|
||||
$("#submitBtn").on("click", function(){
|
||||
var managerId = $("#managerId").val();
|
||||
var name = $("#name").val();
|
||||
var capacity = $("#capacity").val();
|
||||
var address = $("#address").val();
|
||||
@@ -99,10 +107,11 @@
|
||||
url: "/warehouse/create_process",
|
||||
type: "post",
|
||||
data: {
|
||||
"managerId" : managerId,
|
||||
"name": name,
|
||||
"capacity": capacity,
|
||||
"address": address,
|
||||
"activation": true
|
||||
"address": address
|
||||
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
|
||||
@@ -25,19 +25,24 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="container-fluid">
|
||||
<div class="col-12" id="search">
|
||||
<div class="col-12">
|
||||
<form action="list">
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select" name="searchn">
|
||||
<select class="form-select" name="searchn" id="searchn">
|
||||
<option value="0">창고명</option>
|
||||
<option value="1">용량</option>
|
||||
<option value="2">적재량</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="search" class="form-control"
|
||||
<input type="text" name="search" id="search" class="form-control"
|
||||
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
||||
<input class="btn btn-info" type="submit" id="searchBtn" value="검색"/>
|
||||
|
||||
<!-- 페이징작업용 -->
|
||||
<input type="hidden" id="searchn1" value="${searchn}">
|
||||
<input type="hidden" id="search1" value="${search}">
|
||||
<!-- 페이징작업용 -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -57,7 +62,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${wlist }" var="dto">
|
||||
<tr class="detailTr" data-id="${dto.id}" )>
|
||||
<tr class="detailTr" data-id="${dto.id}">
|
||||
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
||||
<td>${dto.name }</td>
|
||||
<td>${dto.capacity }</td>
|
||||
@@ -75,28 +80,29 @@
|
||||
|
||||
</div>
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<nev>
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="list?p=${begin - 1 }"><</a>
|
||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }"><</a>
|
||||
</li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||
<a class="page-link " href="list?p=${i }">${i }</a>
|
||||
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||
</li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="list?p=${end + 1 }">></a>
|
||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">></a>
|
||||
</li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</nev>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-3 text-end">
|
||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
||||
<button type="button" class="btn btn-primary" onclick="window.location.href='/warehouse/create'">생성</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -109,14 +115,7 @@
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
//POST방식으로 create폼화면 출력
|
||||
$("#createButton").on("click", function () {
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/create";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
});
|
||||
|
||||
|
||||
$("body").on("click", ".detailTr", function () {
|
||||
var id = $(this).data("id");
|
||||
@@ -135,7 +134,70 @@
|
||||
form.submit();
|
||||
});
|
||||
|
||||
//검색기능
|
||||
$("#searchBtn").on("click",function(){
|
||||
|
||||
var searchn = $("#searchn").val();
|
||||
var search = $("#search").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/list";
|
||||
form.method = "get";
|
||||
|
||||
var input1 = document.createElement("input");
|
||||
input1.type = "hidden";
|
||||
input1.name = "searchn";
|
||||
input1.value = searchn;
|
||||
form.appendChild(input1);
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
input2.type = "hidden";
|
||||
input2.name = "search";
|
||||
input2.value = search;
|
||||
form.appendChild(input2);
|
||||
|
||||
var input3 = document.createElement("input");
|
||||
input3.type = "hidden";
|
||||
input3.name = "p";
|
||||
input3.value = 1;
|
||||
form.appendChild(input3);
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
|
||||
});
|
||||
|
||||
});//ready
|
||||
|
||||
function pageingFunction(clickedId){
|
||||
var searchn1 = $("#searchn1").val();
|
||||
var search1 = $("#search1").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/list";
|
||||
form.method = "get";
|
||||
|
||||
var input1 = document.createElement("input");
|
||||
input1.type = "hidden";
|
||||
input1.name = "searchn";
|
||||
input1.value = searchn1;
|
||||
form.appendChild(input1);
|
||||
|
||||
var input2 = document.createElement("input");
|
||||
input2.type = "hidden";
|
||||
input2.name = "search";
|
||||
input2.value = search1;
|
||||
form.appendChild(input2);
|
||||
|
||||
var input3 = document.createElement("input");
|
||||
input3.type = "hidden";
|
||||
input3.name = "p";
|
||||
input3.value = clickedId;
|
||||
form.appendChild(input3);
|
||||
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -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>
|
||||
|
||||
@@ -1,154 +1,164 @@
|
||||
<%@ 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>제품 카테고리 수정페이지</title>
|
||||
<title>창고 정보 수정페이지</title>
|
||||
<style>
|
||||
.body{
|
||||
text-align: center;
|
||||
}
|
||||
.col-centered{
|
||||
margin: 0 auto;
|
||||
float: none;
|
||||
}
|
||||
.col-margin-left-32{
|
||||
margin-left: 32%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<h1>제품 카테고리 수정페이지</h1>
|
||||
<h1>창고 정보 수정페이지</h1>
|
||||
</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="대분류" id="cls_nm_1"--%>
|
||||
<%-- aria-label="대분류" value="${dto.cls_nm_1 }">--%>
|
||||
<%-- </div>--%>
|
||||
<form id="createForm">
|
||||
|
||||
<%-- <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="중분류" id="cls_nm_2"--%>
|
||||
<%-- aria-label="중분류" value="${dto.cls_nm_2 }">--%>
|
||||
<%-- </div>--%>
|
||||
<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-addon3">소분류</span> <input--%>
|
||||
<%-- type="text" class="form-control" placeholder="소분류" id="cls_nm_3"--%>
|
||||
<%-- aria-label="소분류" value="${dto.cls_nm_3 }">--%>
|
||||
<%-- </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="세분류" id="cls_nm_4"--%>
|
||||
<%-- aria-label="세분류" value="${dto.cls_nm_4 }">--%>
|
||||
<%-- </div>--%>
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||
<input type="text" name="name" id="name" class="form-control"
|
||||
placeholder="창고명을 입력하세요" aria-label="창고명" value="${dto.name }"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
<!-- 설명만 있는 입력 -->
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">용적</span>
|
||||
<input type="text" name="capacity" id="capacity" class="form-control"
|
||||
placeholder="용적을 입력하세요" aria-label="용적" value="${dto.capacity }"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
<%-- <div class="input-group mb-3 w-40 col-centered">--%>
|
||||
<%-- <span class="input-group-text" id="basic-addon5">KAN 코드</span> <input--%>
|
||||
<%-- type="text" class="form-control" placeholder="KAN 코드"--%>
|
||||
<%-- aria-label="KAN 코드" value="${dto.kan_code }" id="kan_code" readonly>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">주소</span>
|
||||
<input type="text" name="address" id="address" class="form-control"
|
||||
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
|
||||
aria-describedby="basic-addon1">
|
||||
</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="updateBtn">수정 완료</button>--%>
|
||||
<%-- <button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
<%-- </div>--%>
|
||||
|
||||
|
||||
<input type="hidden" name="name" id="id" class="form-control"
|
||||
placeholder="창고명을 입력하세요" aria-label="창고명" value="${dto.id }"
|
||||
aria-describedby="basic-addon1">
|
||||
</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="updateBtn">수정 완료</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() {
|
||||
// $("#updateBtn").on("click", function() {
|
||||
//
|
||||
// var clsnm1 = $("#cls_nm_1").val();
|
||||
// var clsnm2 = $("#cls_nm_2").val();
|
||||
// var clsnm3 = $("#cls_nm_3").val();
|
||||
// var clsnm4 = $("#cls_nm_4").val();
|
||||
// var kan_code = $("#kan_code").val();
|
||||
// if(!clsnm1){
|
||||
// alert("대분류를 입력해야 합니다.");
|
||||
// $("#cls_nm_1").focus();
|
||||
// return false;
|
||||
// }
|
||||
// if(!clsnm2){
|
||||
// alert("중분류를 입력해야 합니다.");
|
||||
// $("#cls_nm_2").focus();
|
||||
// return false;
|
||||
// }
|
||||
// if(!clsnm3){
|
||||
// alert("소분류를 입력해야 합니다.");
|
||||
// $("#cls_nm_3").focus();
|
||||
// return false;
|
||||
// }
|
||||
// if(!clsnm4){
|
||||
// alert("세분류를 입력해야 합니다.");
|
||||
// $("#cls_nm_4").focus();
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// $.ajax({
|
||||
// url: "/category/update_process",
|
||||
// type: "put",
|
||||
// data: {
|
||||
// "cls_nm_1": clsnm1,
|
||||
// "cls_nm_2": clsnm2,
|
||||
// "cls_nm_3": clsnm3,
|
||||
// "cls_nm_4": clsnm4,
|
||||
// "kan_code": kan_code,
|
||||
// "activation": true
|
||||
// },
|
||||
// datatype:"json"
|
||||
// }).done(function(data) {
|
||||
// if (data == true) {
|
||||
// alert("카테고리를 수정하였습니다.");
|
||||
//
|
||||
// var form = document.createElement("form");
|
||||
// form.action = "/category/read";
|
||||
// form.method = "POST";
|
||||
// document.body.appendChild(form);
|
||||
//
|
||||
// var input = document.createElement("input");
|
||||
// input.type = "hidden";
|
||||
// input.name = "kan_code";
|
||||
// input.value = kan_code;
|
||||
// form.appendChild(input);
|
||||
//
|
||||
// form.submit();
|
||||
// } else {
|
||||
// alert("카테고리 수정에 실패하였습니다.");
|
||||
// }
|
||||
// }).fail(function() {
|
||||
// alert("오류가 발생했습니다.");
|
||||
// }).always(function() {
|
||||
// //
|
||||
// });
|
||||
//
|
||||
// });//updateBtn
|
||||
//
|
||||
// $("#cancelBtn").on("click", function(){
|
||||
// var kan_code = $("#kan_code").val();
|
||||
//
|
||||
// var form = document.createElement("form");
|
||||
// form.action = "/category/read";
|
||||
// form.method = "POST";
|
||||
// document.body.appendChild(form);
|
||||
//
|
||||
// var input = document.createElement("input");
|
||||
// input.type = "hidden";
|
||||
// input.name = "kan_code";
|
||||
// input.value = kan_code;
|
||||
// form.appendChild(input);
|
||||
//
|
||||
// form.submit();
|
||||
//
|
||||
// })
|
||||
$(document).ready(function() {
|
||||
$("#updateBtn").on("click", function() {
|
||||
|
||||
var name = $("#name").val();
|
||||
var capacity = $("#capacity").val();
|
||||
var address = $("#address").val();
|
||||
var id = $("#id").val();
|
||||
|
||||
if(!name){
|
||||
alert("창고명을 입력해야 합니다.");
|
||||
$("#name").focus();
|
||||
return false;
|
||||
}
|
||||
if(!capacity){
|
||||
alert("용적크기를 입력해야 합니다.");
|
||||
$("#capacity").focus();
|
||||
return false;
|
||||
}
|
||||
if(!address){
|
||||
alert("주소를 입력해야 합니다.");
|
||||
$("#address").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "/warehouse/update_process",
|
||||
type: "put",
|
||||
data: {
|
||||
"name": name,
|
||||
"capacity": capacity,
|
||||
"address": address,
|
||||
"id": id
|
||||
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("창고를 수정하였습니다.");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/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() {
|
||||
//
|
||||
});
|
||||
|
||||
});//updateBtn
|
||||
|
||||
$("#cancelBtn").on("click", function(){
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/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();
|
||||
|
||||
})
|
||||
});//ready
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user