mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-05 04:03:45 +09:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
69
src/main/webapp/WEB-INF/views/modal/category.jsp
Normal file
69
src/main/webapp/WEB-INF/views/modal/category.jsp
Normal file
@@ -0,0 +1,69 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<script>
|
||||
function onSearch(){
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
function onSelectAuth(tag){
|
||||
const $tag = $(tag);
|
||||
const tid = $tag.data('tid');
|
||||
const name = $tag.data('tname');
|
||||
|
||||
$("#cls_nm_4").val(name);
|
||||
$("#kan_code").val(tid);
|
||||
hideSearchModal();
|
||||
}
|
||||
</script>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="div_auth_search" class="text-end">
|
||||
<div class="input-group mb-3 w-50 col-centered">
|
||||
<div class="w-30">
|
||||
<select class="form-select" name="searchn" id="searchn">
|
||||
<option selected="selected" value="4">세분류</option>
|
||||
<option value="1">대분류</option>
|
||||
<option value="2">중분류</option>
|
||||
<option value="3">소분류</option>
|
||||
<option value="0">KAN코드</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
|
||||
<!-- 페이징작업용 -->
|
||||
<input type="hidden" id="searchn1" value="${searchn}">
|
||||
<input type="hidden" id="search1" value="${search}">
|
||||
<!-- 페이징작업용 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>대분류</th>
|
||||
<th>중분류</th>
|
||||
<th>소분류</th>
|
||||
<th>세분류</th>
|
||||
<th>KAN코드</th>
|
||||
<th>선택</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto">
|
||||
<tr class="detailTr" data-kan_code="${dto.kan_code}" >
|
||||
<td>${dto.cls_nm_1 }</td>
|
||||
<td>${dto.cls_nm_2 }</td>
|
||||
<td>${dto.cls_nm_3 }</td>
|
||||
<td>${dto.cls_nm_4 }</td>
|
||||
<td>${dto.kan_code }</td>
|
||||
<td><button data-tid="${dto.kan_code}" data-tname="${dto.cls_nm_4}" class="btn btn-primary" onclick="onSelectAuth(this)">선택</button></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
72
src/main/webapp/WEB-INF/views/modal/product.jsp
Normal file
72
src/main/webapp/WEB-INF/views/modal/product.jsp
Normal file
@@ -0,0 +1,72 @@
|
||||
<%@ 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"%>
|
||||
<script>
|
||||
function onSearch(){
|
||||
//
|
||||
//
|
||||
}
|
||||
|
||||
function onSelectAuth(tag){
|
||||
const $tag = $(tag);
|
||||
const tid = $tag.data('tid');
|
||||
const name = $tag.data('tname');
|
||||
|
||||
$("#productName").val(name);
|
||||
$("#product_id").val(tid);
|
||||
hideSearchModal();
|
||||
}
|
||||
</script>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="div_auth_search" class="text-end">
|
||||
<div class="input-group mb-3 w-50 col-centered">
|
||||
<div class="w-30">
|
||||
<select class="form-select" name="searchn" id="searchn">
|
||||
<option selected="selected" value="0">제품명</option>
|
||||
<option value="1">회사명</option>
|
||||
<option value="2">분류</option>
|
||||
<option value="3">담당자명</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
|
||||
<!-- 페이징작업용 -->
|
||||
<input type="hidden" id="searchn1" value="${searchn}">
|
||||
<input type="hidden" id="search1" value="${search}">
|
||||
<!-- 페이징작업용 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>제품명</th>
|
||||
<th>회사명</th>
|
||||
<th>분류</th>
|
||||
<th>거래처</th>
|
||||
<th>등록날짜</th>
|
||||
<th>담당자</th>
|
||||
<th>선택</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto">
|
||||
<tr class="detailTr" data-product_id="${dto.id}" >
|
||||
<td>${dto.name }</td>
|
||||
<td>${dto.company_name }</td>
|
||||
<td>${dto.categoryDto.cls_nm_4 }</td>
|
||||
<td>${dto.vendorDto.name }</td>
|
||||
<td><fmt:formatDate value="${dto.registration_date }"
|
||||
dateStyle="short" /></td>
|
||||
<td>${dto.accountDto.name }</td>
|
||||
<td><button data-tid="${dto.id}" data-tname="${dto.name}" class="btn btn-primary" onclick="onSelectAuth(this)">선택</button></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -26,44 +26,30 @@
|
||||
<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" name="productDto.name" id="productDto.name" class="form-control"
|
||||
<input type="text" name="productName" id="productName" class="form-control"
|
||||
placeholder="제품명을 검색하세요" aria-label="제품명" value="${dto.productDto.name }"
|
||||
aria-describedby="basic-addon1">
|
||||
aria-describedby="basic-addon1" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchProductName"
|
||||
style="background-color:#FF5E5E;" type="button" >검색</button>
|
||||
<input type='hidden' id='searchProductName' value='0'>
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('제품 검색','product')" >검색</button>
|
||||
<input type='hidden' id="product_id" value="">
|
||||
|
||||
</div>
|
||||
<!-- 설명만 있는 입력 -->
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">중분류</span>
|
||||
<input type="text" name="cls_nm_2" id="cls_nm_2" class="form-control"
|
||||
placeholder="중분류를 입력하세요" aria-label="중분류" value="${dto.cls_nm_2 }"
|
||||
<span class="input-group-text" id="basic-addon2">가격</span>
|
||||
<input type="number" name="price" id="price" class="form-control"
|
||||
placeholder="가격을 입력하세요" aria-label="가격" value="${dto.price }"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">소분류</span>
|
||||
<input type="text" name="cls_nm_3" id="cls_nm_3" class="form-control"
|
||||
placeholder="소분류를 입력하세요" aria-label="소분류" value="${dto.cls_nm_3 }"
|
||||
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="cls_nm_4" id="cls_nm_4" class="form-control"
|
||||
placeholder="세분류를 입력하세요" aria-label="세분류" value="${dto.cls_nm_4 }"
|
||||
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="number" min="1" name="kan_code" id="kan_code" class="form-control"
|
||||
placeholder="KAN 분류코드를 입력하세요" aria-label="KAN 분류코드" value="${dto.kan_code }"
|
||||
aria-describedby="button-addon2">
|
||||
<button class="btn btn-outline-secondary rounded-end" id="checkKan"
|
||||
style="background-color:#FF5E5E;" type="button" >중복확인</button>
|
||||
<input type='hidden' id='kan_chack' value='0'>
|
||||
</div>
|
||||
|
||||
<!-- 추후 수정 -->
|
||||
<input type='hidden' id="manager_id" value="83bdda69-ae95-11ee-935d-0242ac110006">
|
||||
|
||||
|
||||
<!-- 추후 수정 -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -72,17 +58,101 @@
|
||||
<div class="w-40 col-centered" style="text-align: right">
|
||||
<button type="button" class="btn btn-success" id="submitBtn">생성</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
|
||||
|
||||
</script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#cancelBtn").on("click", function(){
|
||||
$(location).attr("href", "/product/list");
|
||||
|
||||
})
|
||||
|
||||
$("#submitBtn").on("click", function(){
|
||||
|
||||
var price = $("#price").val();
|
||||
var manager_id = $("#manager_id").val();// 수정해야함.
|
||||
var product_id = $("#product_id").val();// 수정해야함.
|
||||
|
||||
if(!price){
|
||||
alert("가격을 입력해야 합니다.");
|
||||
$("#price").focus();
|
||||
return false;
|
||||
}
|
||||
if(!product_id){
|
||||
alert("제품을 선택해야합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "/price/create_process",
|
||||
type: "post",
|
||||
data: {
|
||||
"price": price,
|
||||
"manager_id": manager_id, // 추후 수정해야함.
|
||||
"product_id": product_id, // 추후 수정해야함.
|
||||
"activation": true
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("제품 가격을 추가했습니다.");
|
||||
$(location).attr("href", "/price/list");
|
||||
|
||||
|
||||
//생각해서 바꿔야함.
|
||||
// 조건 : DB에서 생성되는 uuid를 어떻게 자바스크립트에서 가져올것인지 궁리.
|
||||
/*
|
||||
var form = document.createElement("form");
|
||||
form.action = "/product/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = data.id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
*/
|
||||
} else {
|
||||
alert("제품 가격 추가에 실패하였습니다.");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});//ready
|
||||
|
||||
function showSearchModal(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/price/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)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -109,7 +109,94 @@
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
});//createButton
|
||||
|
||||
//상세페이지
|
||||
$("body").on("click", ".detailTr", function(){
|
||||
var id = $(this).data("id");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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();
|
||||
|
||||
});
|
||||
|
||||
$("#searchBtn").on("click",function(){
|
||||
|
||||
var searchn = $("#searchn").val();
|
||||
var search = $("#search").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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 pagingFunction(clickedId){
|
||||
var searchn1 = $("#searchn1").val();
|
||||
var search1 = $("#search1").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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>
|
||||
|
||||
123
src/main/webapp/WEB-INF/views/price/read.jsp
Normal file
123
src/main/webapp/WEB-INF/views/price/read.jsp
Normal file
@@ -0,0 +1,123 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>제품 가격 상세페이지</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" id="yes_no_modal_show_button">삭제</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="${dto.price }" 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="${dto.registration_date }" 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="${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", "/price/list");
|
||||
|
||||
})//checkBtn click
|
||||
|
||||
$("#modifyBtn").on("click", function() {
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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
|
||||
|
||||
yesNoModal.yesFunction = deletePriceFunction;
|
||||
|
||||
|
||||
|
||||
|
||||
});//ready
|
||||
|
||||
function deletePriceFunction(){
|
||||
var id = $("#id").val();
|
||||
$.ajax({
|
||||
url: "/price/delete",
|
||||
type: "delete",
|
||||
data: {
|
||||
"id": id
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("삭제되었습니다.");
|
||||
$(location).attr("href", "/price/list");
|
||||
} else {
|
||||
alert("정상적으로 삭제되지 않았습니다..");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
}//deletePriceFunction
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
125
src/main/webapp/WEB-INF/views/price/update.jsp
Normal file
125
src/main/webapp/WEB-INF/views/price/update.jsp
Normal file
@@ -0,0 +1,125 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<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" placeholder="제품명" id="name"
|
||||
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="가격" id="price"
|
||||
aria-label="가격" value="${dto.price }">
|
||||
</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="${dto.registration_date }" 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="${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="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() {
|
||||
$("#submitBtn").on("click", function() {
|
||||
var id = $("#id").val();
|
||||
var price = $("#price").val();
|
||||
|
||||
if (!price || isNaN(price)) {
|
||||
alert("올바른 가격을 입력하세요.");
|
||||
$("#price").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/price/update_process",
|
||||
type: "put",
|
||||
data: {
|
||||
"id": id,
|
||||
"price": price
|
||||
},
|
||||
datatype: "json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("제품 가격을 수정했습니다.");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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
|
||||
|
||||
$("#cancelBtn").on("click", function() {
|
||||
var id = $("#id").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/price/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
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -44,12 +44,13 @@
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">분류</span>
|
||||
<input type="number" min="1" name="cls_nm_4" id="cls_nm_4" class="form-control"
|
||||
placeholder="KAN 분류코드를 입력하세요(모달이 만들어지면 분류로 바꿀예정)" aria-label="분류"
|
||||
aria-describedby="button-addon2">
|
||||
<input type="text" name="cls_nm_4" id="cls_nm_4" class="form-control"
|
||||
placeholder="분류를 검색하세요" aria-label="분류"
|
||||
aria-describedby="button-addon2" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchKan"
|
||||
style="background-color:#FF5E5E;" type="button" >검색</button>
|
||||
<input type='hidden' id='searchKanChack' value='0'>
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('분류 검색','category')" >검색</button>
|
||||
<input type='hidden' id="kan_code" value="">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
@@ -58,14 +59,14 @@
|
||||
placeholder="거래처를 입력하세요" aria-label="거래처"
|
||||
aria-describedby="button-addon2">
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchVendor"
|
||||
style="background-color:#FF5E5E;" type="button" >검색</button>
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal2('거래처 검색','vendor')">검색</button>
|
||||
<input type='hidden' id='searchVendorChack' value='0'>
|
||||
</div>
|
||||
|
||||
<!-- 추후 수정 -->
|
||||
<input type='hidden' id="manager_id" value="83bdda69-ae95-11ee-935d-0242ac110006">
|
||||
<input type='hidden' id="vendor_id" value="">
|
||||
<input type='hidden' id="kan_code" value="">
|
||||
<input type='hidden' id="vendor_id" value="52f16bb8-aeb9-11ee-935d-0242ac110006">
|
||||
|
||||
|
||||
<!-- 추후 수정 -->
|
||||
|
||||
@@ -92,8 +93,8 @@
|
||||
$("#submitBtn").on("click", function(){
|
||||
var name = $("#name").val();
|
||||
var company_name = $("#company_name").val();
|
||||
var kan_code = $("#cls_nm_4").val();// 수정해야함.
|
||||
var vendor = $("#vendor").val();
|
||||
var kan_code = $("#kan_code").val();
|
||||
var vendor = $("#vendor_id").val();// 수정해야함.
|
||||
var manager_id = $("#manager_id").val();
|
||||
if(!name){
|
||||
alert("제품명을 입력해야 합니다.");
|
||||
@@ -104,8 +105,7 @@
|
||||
company_name = "미지정";
|
||||
}
|
||||
if(!kan_code){
|
||||
alert("KAN 분류코드를 입력해야 합니다.");
|
||||
$("#kan_code").focus();
|
||||
alert("분류를 검색해야 합니다.");
|
||||
return false;
|
||||
}
|
||||
if(!vendor){
|
||||
@@ -164,36 +164,45 @@
|
||||
|
||||
})
|
||||
|
||||
|
||||
$("#searchKan").on("click", function(){
|
||||
searchKanCode();
|
||||
});//searchKan
|
||||
|
||||
$("#searchVendor").on("click", function(){
|
||||
searchModalBootStrap.show();
|
||||
});//searcVendor
|
||||
|
||||
|
||||
function searchKanCode(){
|
||||
$.ajax({
|
||||
url:"/category/categorysearch",
|
||||
type:"get",
|
||||
datatype:"html"
|
||||
}).done(function(data){
|
||||
$("body").append(data);
|
||||
$("#searchKanModal").modal("show");
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//alert("항상뜨는 창입니다.");
|
||||
});
|
||||
}
|
||||
|
||||
function searchVendor(){
|
||||
|
||||
}
|
||||
|
||||
});//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 : '/category/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)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -18,16 +18,20 @@
|
||||
<form action="productSearch">
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select">
|
||||
<option selected="selected" value="name">제품명</option>
|
||||
<option value="cls_nm_1">회사명</option>
|
||||
<option value="cls_nm_2">등록날짜</option>
|
||||
<option value="cls_nm_3">담당자명</option>
|
||||
<option value="kan_code">KAN코드</option>
|
||||
<select class="form-select" name="searchn" id="searchn">
|
||||
<option selected="selected" value="0">제품명</option>
|
||||
<option value="1">회사명</option>
|
||||
<option value="2">분류</option>
|
||||
<option value="3">담당자명</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="productSearch" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="button-addon2 searchBtn">검색</button>
|
||||
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
|
||||
|
||||
<!-- 페이징작업용 -->
|
||||
<input type="hidden" id="searchn1" value="${searchn}">
|
||||
<input type="hidden" id="search1" value="${search}">
|
||||
<!-- 페이징작업용 -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -73,31 +77,23 @@
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#"><</a>
|
||||
</li>
|
||||
<li class="page-item active">
|
||||
<a class="page-link" href="#">1</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">2</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">3</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">4</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">5</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">6</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item">
|
||||
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(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 href="javascript:void(0);" class="page-link " onclick="pagingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||
</li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item">
|
||||
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${end + 1 }">></a>
|
||||
</li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-3 text-end">
|
||||
@@ -136,10 +132,40 @@
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
|
||||
});
|
||||
|
||||
});//body detailTr
|
||||
|
||||
$("#searchBtn").on("click",function(){
|
||||
|
||||
var searchn = $("#searchn").val();
|
||||
var search = $("#search").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/product/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();
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -147,6 +173,36 @@
|
||||
|
||||
});//ready
|
||||
|
||||
function pagingFunction(clickedId){
|
||||
var searchn1 = $("#searchn1").val();
|
||||
var search1 = $("#search1").val();
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/product/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>
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
//
|
||||
});
|
||||
|
||||
}//deleteCategoryFunction
|
||||
}//deleteProductFunction
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -30,17 +30,18 @@
|
||||
<input type="text" class="form-control" name="newCompanyName" placeholder="회사명을 입력하세요(선택)"
|
||||
aria-label="회사명" id="company_name" value="${dto.company_name }">
|
||||
</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" name="newCategory" placeholder="분류를 입력해도 바뀌는건 없습니다 ㅎㅎ(수정예정)"
|
||||
aria-label="분류" id="cls_nm_4" value="${dto.categoryDto.cls_nm_4 }">
|
||||
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchKan"
|
||||
style="background-color:#FF5E5E;" type="button" >검색</button>
|
||||
<input type='hidden' id='searchKanChack' value='0'>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">분류</span>
|
||||
<input type="text" name="cls_nm_4" id="cls_nm_4" class="form-control"
|
||||
placeholder="분류를 검색하세요" aria-label="분류" value="${dto.categoryDto.cls_nm_4 }"
|
||||
aria-describedby="button-addon2" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchKan"
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('분류 검색','category')" >검색</button>
|
||||
<input type='hidden' id="kan_code" value="${dto.kan_code }">
|
||||
|
||||
</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" name="newVendor" placeholder="거래처를 입력해도 바뀌는 건 없습니다."
|
||||
@@ -61,7 +62,7 @@
|
||||
<!-- 추후 수정 -->
|
||||
<input type='hidden' id="manager_id" value="83bdda69-ae95-11ee-935d-0242ac110006">
|
||||
<input type='hidden' id="vendor_id" value="${dto.vendor_id }">
|
||||
<input type='hidden' id="kan_code" value="${dto.kan_code }">
|
||||
|
||||
|
||||
<!-- 추후 수정 -->
|
||||
|
||||
@@ -117,8 +118,7 @@
|
||||
company_name = "미지정";
|
||||
}
|
||||
if(!kan_code){
|
||||
alert("KAN 분류코드를 입력해야 합니다.");
|
||||
//$("#kan_code").focus();
|
||||
alert("분류를 검색해야 합니다.");
|
||||
return false;
|
||||
}
|
||||
if(!vendor_id){
|
||||
@@ -126,15 +126,7 @@
|
||||
//$("#vendor").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
console.log(name);
|
||||
console.log(company_name);
|
||||
console.log(kan_code);
|
||||
console.log(vendor_id);
|
||||
console.log(manager_id);
|
||||
console.log(id);
|
||||
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "/product/update_process",
|
||||
type: "put",
|
||||
@@ -180,7 +172,23 @@
|
||||
|
||||
|
||||
});//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)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user