diff --git a/WebContent/WEB-INF/view/salesMng/purchaseRequestRegList.jsp b/WebContent/WEB-INF/view/salesMng/purchaseRequestRegList.jsp
new file mode 100644
index 0000000..10fdff3
--- /dev/null
+++ b/WebContent/WEB-INF/view/salesMng/purchaseRequestRegList.jsp
@@ -0,0 +1,714 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
+<%@ page import="com.pms.common.utils.*"%>
+<%@ page import="java.util.*" %>
+<%@include file= "/init.jsp" %>
+
+
+<%
+// DB에서 메뉴명 조회 (공통 유틸 사용)
+String menuObjId = request.getParameter("menuObjId");
+String menuName = CommonUtils.getMenuName(menuObjId, "구매관리_구매요청서작성");
+%>
+
+
+
+
+<%=Constants.SYSTEM_NAME%>
+
+
+
+
+
+
+
+
+
diff --git a/WebContent/WEB-INF/view/salesMng/salesRequestFormPopUp.jsp b/WebContent/WEB-INF/view/salesMng/salesRequestFormPopUp.jsp
index e79a02a..09da6a9 100644
--- a/WebContent/WEB-INF/view/salesMng/salesRequestFormPopUp.jsp
+++ b/WebContent/WEB-INF/view/salesMng/salesRequestFormPopUp.jsp
@@ -10,6 +10,7 @@
( CommonUtils.checkNull(info.get("STATUS_TITLE")).equals( "결재중" )
||CommonUtils.checkNull(info.get("STATUS_TITLE")).equals( "결재완료" )
||CommonUtils.checkNull(info.get("STATUS_TITLE")).equals( "접수" )
+ ||CommonUtils.checkNull(info.get("STATUS")).equals( "confirmed" )
)
){
isModify = false; //수정불가
@@ -84,6 +85,11 @@ $(function(){
fn_deleteRow();
});
+ // 확정 버튼 클릭
+ $("#btnConfirm").click(function(){
+ fn_confirm();
+ });
+
$("#btnAppr").click(function(){ //결재상신
if(fnc_valitate("form1")){
var objId = "${resultMap.OBJID}";
@@ -285,17 +291,16 @@ function fn_getSalesRequestTargetPartList(masterObjId,bomObjId){
appendText += " ";
appendText += " ";
appendText += " | ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
+ // 공급업체
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
+ // 단가
+ var PARTNER_PRICE = fnc_checkNull(resultData[i].PARTNER_PRICE);
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
appendText += " ";
@@ -316,10 +321,9 @@ function fn_getSalesRequestTargetPartList(masterObjId,bomObjId){
var PART_NO = fnc_checkNull(resultData[i].PART_NO);
var PART_NAME = fnc_checkNull(resultData[i].PART_NAME);
- // 공급업체 제거로 주석처리
- // var PARTNER_OBJID = fnc_checkNull(resultData[i].PARTNER_OBJID);
- // fnc_getAdminSupCdListAppend("", "PARTNER_OBJID_"+rowObjId, PARTNER_OBJID);
- // $("#PARTNER_OBJID_"+rowObjId).val(PARTNER_OBJID);
+ // 공급업체 셋팅
+ var PARTNER_OBJID = fnc_checkNull(resultData[i].PARTNER_OBJID);
+ fnc_getAdminSupCdListAppend("", "PARTNER_OBJID_"+rowObjId, PARTNER_OBJID);
fn_addBomPart("PART_OBJID_"+rowObjId, PART_OBJID, "PART_NAME_"+rowObjId,"");
@@ -377,31 +381,29 @@ function fn_AddRow(){
//appendText += " ";
//appendText += " ";
//appendText += " | ";
- //appendText += " | ";
- appendText += " ";
- appendText += " ";
- appendText += " | ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
- //appendText += " ";
- //appendText += " ";
- //appendText += " | ";
- appendText += " ";
-
- if(0 < $("#partListArea tr:first").lenght || typeof $("#partListArea tr:first").lenght != "undefined") {
- $("#partListArea tr:first").before(appendText);
- }else{
- $("#partListArea").append(appendText);
- }
- // 공급업체 제거로 주석처리
- // fnc_getAdminSupCdListAppend("", "PARTNER_OBJID_"+rowObjId, "");
- fn_addBomPart("PART_OBJID_"+rowObjId, "", "PART_NAME_"+rowObjId, "");
+ //appendText += " | ";
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
+ // 공급업체
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
+ // 단가
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
+ appendText += " ";
+
+if(0 < $("#partListArea tr:first").lenght || typeof $("#partListArea tr:first").lenght != "undefined") {
+ $("#partListArea tr:first").before(appendText);
+}else{
+ $("#partListArea").append(appendText);
+}
+// 공급업체 셋팅
+fnc_getAdminSupCdListAppend("", "PARTNER_OBJID_"+rowObjId, "");
+fn_addBomPart("PART_OBJID_"+rowObjId, "", "PART_NAME_"+rowObjId, "");
fnc_datepick();
$(".select2").select2();
}
@@ -498,6 +500,61 @@ function fn_Supply_save(){
}
}
+// 구매요청서 확정 처리
+function fn_confirm(){
+ var masterObjId = $("#SALES_REQUEST_MASTER_OBJID").val();
+
+ if(fnc_checkNull(masterObjId) == ""){
+ Swal.fire("먼저 저장해주세요.");
+ return;
+ }
+
+ // 품목이 있는지 확인
+ if($("#partListArea tr").length < 1){
+ Swal.fire("품목이 없습니다. 먼저 품목을 추가하고 저장해주세요.");
+ return;
+ }
+
+ Swal.fire({
+ title: '확정',
+ text: '확정하시겠습니까? 확정 후에는 수정이 불가능합니다.',
+ icon: 'warning',
+ showCancelButton: true,
+ confirmButtonColor: '#5cb85c',
+ cancelButtonColor: '#d33',
+ confirmButtonText: '확정',
+ cancelButtonText: '취소'
+ }).then((result) => {
+ if (result.isConfirmed) {
+ $.ajax({
+ type: "POST",
+ url: "/salesMng/confirmSalesRequest.do",
+ data: { "SALES_REQUEST_MASTER_OBJID": masterObjId },
+ dataType: "json",
+ success: function(data){
+ if(data.result){
+ Swal.fire({
+ title: '완료',
+ text: '확정되었습니다.',
+ icon: 'success'
+ }).then(() => {
+ if(typeof opener.fn_search == "function"){
+ opener.fn_search();
+ }
+ self.close();
+ });
+ } else {
+ Swal.fire('오류', data.msg || '확정 처리 중 오류가 발생했습니다.', 'error');
+ }
+ },
+ error: function(jqxhr, status, error){
+ Swal.fire('오류', '서버 통신 중 오류가 발생했습니다.', 'error');
+ }
+ });
+ }
+ });
+}
+
// ★★★ 프로젝트 선택 시 M-BOM 품목 자동 로드 ★★★
function fn_loadMbomParts(projectObjId){
if(fnc_checkNull(projectObjId) == "") return;
@@ -539,12 +596,23 @@ function fn_loadMbomParts(projectObjId){
appendText += " ";
appendText += " ";
appendText += " | ";
+ // 공급업체
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
+ // 단가
+ appendText += " ";
+ appendText += " ";
+ appendText += " | ";
appendText += "";
$("#partListArea").append(appendText);
// 품번 드롭다운에 M-BOM 전체 품목 옵션 추가
fn_addBomPart("PART_OBJID_"+rowObjId, PART_OBJID, "PART_NAME_"+rowObjId, "");
+ // 공급업체 셋팅
+ fnc_getAdminSupCdListAppend("", "PARTNER_OBJID_"+rowObjId, "");
});
$(".select2").select2();
@@ -633,6 +701,7 @@ function fn_callbackFnc(){