diff --git a/src/main/java/com/no1/wms/category/CategoryController.java b/src/main/java/com/no1/wms/category/CategoryController.java index e0bf66d..c30c745 100644 --- a/src/main/java/com/no1/wms/category/CategoryController.java +++ b/src/main/java/com/no1/wms/category/CategoryController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import com.no1.wms.excel.ExcelUtils; @@ -193,4 +194,8 @@ public class CategoryController { return "modal/categorysearch"; } + + + + } diff --git a/src/main/java/com/no1/wms/price/PriceController.java b/src/main/java/com/no1/wms/price/PriceController.java index c2fbb7c..e389aea 100644 --- a/src/main/java/com/no1/wms/price/PriceController.java +++ b/src/main/java/com/no1/wms/price/PriceController.java @@ -5,13 +5,18 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import com.no1.wms.category.CategoryDto; +import com.no1.wms.product.ProductDto; +import com.no1.wms.product.ProductService; @@ -21,18 +26,21 @@ public class PriceController { @Autowired PriceService priceService; + @Autowired + ProductService productService; @GetMapping("/list") public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn, @RequestParam(name = "search", defaultValue = "") String search, @RequestParam(name = "p", defaultValue = "1") int page, Model m) { - - int count = priceService.count(searchn, search); + + + int count = priceService.count2(searchn, search); int perPage = 15; // 한 페이지에 보일 글의 개수 int startRow = (page - 1) * perPage; - List dto = priceService.priceList2(searchn, search, startRow ,perPage); + List dto = priceService.priceList3(searchn, search, startRow ,perPage); m.addAttribute("list", dto); m.addAttribute("start", startRow + 1); @@ -62,30 +70,100 @@ public class PriceController { // 생성 - 폼 - @PostMapping("/create") - public String create() { - return "price/create"; - } + @PostMapping("/create") + public String create() { + return "price/create"; + } - // 생성 - Ajax - @PostMapping("/price/create_process") - @ResponseBody - public boolean createProcess(PriceDto dto) { - int i = priceService.createProcess(dto); - if (i == 1) { - return true; - } else { - return false; - } + // 생성 - Ajax + @PostMapping("/create_process") + @ResponseBody + public boolean createProcess(PriceDto dto) { + int i = priceService.createProcess(dto); + if (i == 1) { + return true; + } else { + return false; } + } + + // 상세페이지 + @PostMapping("/read") + public String read(String id, Model m) { + // 선택한 id를 바탕으로 원하는 상세정보 출력하는 메서드 작성 + PriceDto dto = priceService.selectById(id); + m.addAttribute("dto", dto); + return "price/read"; + } + + // 수정 폼 + @PostMapping("/update") + public String update(String id, Model m) { + PriceDto dto = priceService.selectById(id); + m.addAttribute("dto", dto); + return "price/update"; + } + + // 수정 - Ajax + @PutMapping("/update_process") + @ResponseBody + public boolean update_process(PriceDto dto) { + int i = priceService.updateById(dto); + if (i == 1) { + return true; + } else { + return false; + } + } + // 삭제 + @DeleteMapping("/delete") + @ResponseBody + public boolean delete(String id) { + int i = priceService.deactivateById(id); + if(i == 1) { + return true; + }else { + return false; + } + } - - - - + //모달화면 + @PostMapping("/show_modal") + public ModelAndView categoryShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn, + @RequestParam(name = "search", defaultValue = "") String search, + @RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) { + int count = productService.count(searchn, search); + + int perPage = 10; // 한 페이지에 보일 글의 개수 + int startRow = (page - 1) * perPage; + + List dto = productService.productList(searchn, search, startRow ,perPage); + + m.addObject("list", dto); + m.addObject("start", startRow + 1); + + int pageNum = 5;//보여질 페이지 번호 수 + int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수 + + int begin = (page - 1) / pageNum * pageNum + 1; + int end = begin + pageNum - 1; + if (end > totalPages) { + end = totalPages; + } + + m.addObject("searchn",searchn); + m.addObject("search",search); + m.addObject("begin", begin); + m.addObject("end", end); + m.addObject("pageNum", pageNum); + m.addObject("totalPages", totalPages); + m.addObject("p" , page); + m.setViewName(name); + return m; + } } diff --git a/src/main/java/com/no1/wms/price/PriceMapper.java b/src/main/java/com/no1/wms/price/PriceMapper.java index cc89535..f46f083 100644 --- a/src/main/java/com/no1/wms/price/PriceMapper.java +++ b/src/main/java/com/no1/wms/price/PriceMapper.java @@ -14,4 +14,12 @@ public interface PriceMapper { int count(Map m);//카운터 List priceList2(Map m);//검색기능까지 포함 int createProcess(PriceDto dto); + + List priceList3(Map m); + int count2(Map m);//카운터 + + PriceDto selectById(String id); + int updateById(PriceDto dto); + int deactivateById(String id); + } diff --git a/src/main/java/com/no1/wms/price/PriceService.java b/src/main/java/com/no1/wms/price/PriceService.java index 9189284..c559bf2 100644 --- a/src/main/java/com/no1/wms/price/PriceService.java +++ b/src/main/java/com/no1/wms/price/PriceService.java @@ -48,9 +48,42 @@ public class PriceService { return mapper.priceList2(m); } + public List priceList3(int searchn, String search, int start, int perPage){ + Map m = new HashMap(); + m.put("searchn",searchn); + m.put("search", search); + m.put("start", start); + m.put("perPage", perPage); + + return mapper.priceList3(m); + } + + public int createProcess(PriceDto dto) { return mapper.createProcess(dto); } + public int count2(int searchn, String search) { + Map m = new HashMap(); + m.put("searchn",searchn); + m.put("search", search); + return mapper.count2(m); + };//카운터 + + public PriceDto selectById(String id) { + return mapper.selectById(id); + } + + + public int updateById(PriceDto dto) { + return mapper.updateById(dto); + } + public int deactivateById(String id) { + return mapper.deactivateById(id); + } + + + + } diff --git a/src/main/java/com/no1/wms/product/ProductController.java b/src/main/java/com/no1/wms/product/ProductController.java index 973c57c..d4476ce 100644 --- a/src/main/java/com/no1/wms/product/ProductController.java +++ b/src/main/java/com/no1/wms/product/ProductController.java @@ -12,9 +12,11 @@ import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; import com.no1.wms.category.CategoryDto; import com.no1.wms.category.CategoryService; +import com.no1.wms.price.PriceDto; @Controller @RequestMapping("/product") @@ -22,8 +24,10 @@ public class ProductController { @Autowired ProductService productService; + @Autowired + CategoryService categoryService; - + /* @GetMapping("list") public String list(@RequestParam(name = "p", defaultValue = "1") int p, Model m) { @@ -32,6 +36,44 @@ public class ProductController { m.addAttribute("list", dto); return "/product/list"; } + */ + @GetMapping("/list") + public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn, + @RequestParam(name = "search", defaultValue = "") String search, + @RequestParam(name = "p", defaultValue = "1") int page, Model m) { + + + int count = productService.count(searchn, search); + + int perPage = 15; // 한 페이지에 보일 글의 개수 + int startRow = (page - 1) * perPage; + + List dto = productService.productList(searchn, search, startRow ,perPage); + + m.addAttribute("list", dto); + m.addAttribute("start", startRow + 1); + + int pageNum = 5;//보여질 페이지 번호 수 + int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수 + + int begin = (page - 1) / pageNum * pageNum + 1; + int end = begin + pageNum - 1; + if (end > totalPages) { + end = totalPages; + } + + m.addAttribute("searchn",searchn); + m.addAttribute("search",search); + m.addAttribute("begin", begin); + m.addAttribute("end", end); + m.addAttribute("pageNum", pageNum); + m.addAttribute("totalPages", totalPages); + m.addAttribute("p" , page); + return "/product/list"; + + } + + // 생성 - 폼 @PostMapping("/create") @@ -92,8 +134,39 @@ public class ProductController { } - - + //모달화면 + @PostMapping("/show_modal") + public ModelAndView categoryShowModal(@RequestParam(name = "searchn", defaultValue = "4") int searchn, + @RequestParam(name = "search", defaultValue = "") String search, + @RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) { + int count = categoryService.count(searchn, search); + + int perPage = 10; // 한 페이지에 보일 글의 개수 + int startRow = (page - 1) * perPage; + + List dto = categoryService.categoryList2(searchn, search, startRow ,perPage); + + m.addObject("list", dto); + m.addObject("start", startRow + 1); + + int pageNum = 5;//보여질 페이지 번호 수 + int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수 + + int begin = (page - 1) / pageNum * pageNum + 1; + int end = begin + pageNum - 1; + if (end > totalPages) { + end = totalPages; + } + m.addObject("searchn",searchn); + m.addObject("search",search); + m.addObject("begin", begin); + m.addObject("end", end); + m.addObject("pageNum", pageNum); + m.addObject("totalPages", totalPages); + m.addObject("p" , page); + m.setViewName(name); + return m; + } diff --git a/src/main/java/com/no1/wms/product/ProductMapper.java b/src/main/java/com/no1/wms/product/ProductMapper.java index b34f763..a7e1a7c 100644 --- a/src/main/java/com/no1/wms/product/ProductMapper.java +++ b/src/main/java/com/no1/wms/product/ProductMapper.java @@ -8,10 +8,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ProductMapper { - List productList(Map m); + List productList(Map m);//페이징 검색 적용 리스트 int createProcess(ProductDto dto); ProductDto selectById(String id); int updateById(ProductDto dto); int deactivateById(String id); - + int count(Map m);//카운터 } diff --git a/src/main/java/com/no1/wms/product/ProductService.java b/src/main/java/com/no1/wms/product/ProductService.java index 4922f5b..b82ba60 100644 --- a/src/main/java/com/no1/wms/product/ProductService.java +++ b/src/main/java/com/no1/wms/product/ProductService.java @@ -7,22 +7,20 @@ import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; + @Service public class ProductService { @Autowired ProductMapper mapper; - public List productList(int p){ - //페이징 완료되면 수정해야함. - - int start = 0; - int count = 10; - - Map m = new HashMap(); + public List productList(int searchn, String search, int start, int perPage){ + Map m = new HashMap(); + m.put("searchn",searchn); + m.put("search", search); m.put("start", start); - m.put("count", count); - + m.put("perPage", perPage); + return mapper.productList(m); } @@ -42,4 +40,11 @@ public class ProductService { return mapper.deactivateById(id); } + + public int count(int searchn, String search) { + Map m = new HashMap(); + m.put("searchn",searchn); + m.put("search", search); + return mapper.count(m); + };//카운터 } diff --git a/src/main/resources/mappers/PriceMapper.xml b/src/main/resources/mappers/PriceMapper.xml index 04265f0..29ecf0b 100644 --- a/src/main/resources/mappers/PriceMapper.xml +++ b/src/main/resources/mappers/PriceMapper.xml @@ -22,12 +22,27 @@ - + INSERT INTO prices (id, price, registration_date, manager_id, product_id, activation) VALUES (UUID(), #{price}, curdate(), #{manager_id}, #{product_id}, 1) + + + + UPDATE prices + SET price = #{price}, registration_date = CURDATE() + WHERE id = #{id} + + + + UPDATE prices + SET activation = 0 + WHERE id = #{id} + + + @@ -86,10 +101,66 @@ order by p.registration_date limit #{start} , #{perPage} + + + + \ No newline at end of file diff --git a/src/main/resources/mappers/ProductMapper.xml b/src/main/resources/mappers/ProductMapper.xml index 8839021..4bebf18 100644 --- a/src/main/resources/mappers/ProductMapper.xml +++ b/src/main/resources/mappers/ProductMapper.xml @@ -58,6 +58,7 @@ + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/category.jsp b/src/main/webapp/WEB-INF/views/modal/category.jsp new file mode 100644 index 0000000..859198e --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/category.jsp @@ -0,0 +1,69 @@ +<%@ page contentType="text/html; charset=UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
대분류중분류소분류세분류KAN코드선택
${dto.cls_nm_1 }${dto.cls_nm_2 }${dto.cls_nm_3 }${dto.cls_nm_4 }${dto.kan_code }
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/product.jsp b/src/main/webapp/WEB-INF/views/modal/product.jsp new file mode 100644 index 0000000..3092221 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/product.jsp @@ -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"%> + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
제품명회사명분류거래처등록날짜담당자선택
${dto.name }${dto.company_name }${dto.categoryDto.cls_nm_4 }${dto.vendorDto.name }${dto.accountDto.name }
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/price/create.jsp b/src/main/webapp/WEB-INF/views/price/create.jsp index 6dde325..958e58e 100644 --- a/src/main/webapp/WEB-INF/views/price/create.jsp +++ b/src/main/webapp/WEB-INF/views/price/create.jsp @@ -26,44 +26,30 @@
+
제품명 - + aria-describedby="basic-addon1" readonly> - + style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('제품 검색','product')" >검색 +
- 중분류 - 가격 +
-
- 소분류 - -
-
- 세분류 - -
-
- KAN 분류코드 - - - -
+ + + + + +
@@ -72,17 +58,101 @@
-
- - + + diff --git a/src/main/webapp/WEB-INF/views/price/list.jsp b/src/main/webapp/WEB-INF/views/price/list.jsp index d19014a..cb50366 100644 --- a/src/main/webapp/WEB-INF/views/price/list.jsp +++ b/src/main/webapp/WEB-INF/views/price/list.jsp @@ -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(); + } + diff --git a/src/main/webapp/WEB-INF/views/price/read.jsp b/src/main/webapp/WEB-INF/views/price/read.jsp new file mode 100644 index 0000000..9071a73 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/price/read.jsp @@ -0,0 +1,123 @@ +<%@ page contentType="text/html; charset=UTF-8"%> + + + + +제품 가격 상세페이지 + + +
+ +
+

제품 상세페이지

+
+ +
+
+
+
+ +
+
+
+
+
+
+ 제품명 +
+ +
+ 가격 +
+ +
+ 등록날짜 +
+ +
+ 담당자 +
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/price/update.jsp b/src/main/webapp/WEB-INF/views/price/update.jsp new file mode 100644 index 0000000..e780309 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/price/update.jsp @@ -0,0 +1,125 @@ +<%@ page contentType="text/html; charset=UTF-8"%> + + + + +Insert title here + +
+
+

제품 가격 수정페이지

+
+
+
+ +
+
+
+
+
+
+ 제품명 + +
+ +
+ 가격 + +
+ +
+ 등록날짜 + +
+ +
+ 담당자 + +
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/product/create.jsp b/src/main/webapp/WEB-INF/views/product/create.jsp index 8db8f03..9e78404 100644 --- a/src/main/webapp/WEB-INF/views/product/create.jsp +++ b/src/main/webapp/WEB-INF/views/product/create.jsp @@ -44,12 +44,13 @@
분류 - + - + style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('분류 검색','category')" >검색 + +
@@ -58,14 +59,14 @@ placeholder="거래처를 입력하세요" aria-label="거래처" aria-describedby="button-addon2"> + style="background-color:#FF5E5E;" type="button" onclick="showSearchModal2('거래처 검색','vendor')">검색
- - + + @@ -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) + } + }); + } + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/product/list.jsp b/src/main/webapp/WEB-INF/views/product/list.jsp index 7bd1880..d645fc9 100644 --- a/src/main/webapp/WEB-INF/views/product/list.jsp +++ b/src/main/webapp/WEB-INF/views/product/list.jsp @@ -18,16 +18,20 @@
- + + + +
- - + + + + + + +
@@ -73,31 +77,23 @@
@@ -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(); + } + diff --git a/src/main/webapp/WEB-INF/views/product/read.jsp b/src/main/webapp/WEB-INF/views/product/read.jsp index f40ec90..46d6994 100644 --- a/src/main/webapp/WEB-INF/views/product/read.jsp +++ b/src/main/webapp/WEB-INF/views/product/read.jsp @@ -127,7 +127,7 @@ // }); - }//deleteCategoryFunction + }//deleteProductFunction diff --git a/src/main/webapp/WEB-INF/views/product/update.jsp b/src/main/webapp/WEB-INF/views/product/update.jsp index 581b4fb..8f03a25 100644 --- a/src/main/webapp/WEB-INF/views/product/update.jsp +++ b/src/main/webapp/WEB-INF/views/product/update.jsp @@ -30,17 +30,18 @@
- -
- 분류 - - - - -
- + +
+ 분류 + + + + +
+
거래처 - + @@ -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) + } + }); + }