feat: 주문서관리 수주등록 기능 구현 및 Admin 버튼 UI 개선
- 주문서관리 목록 페이지 추가 (orderMgmtList.jsp) - 수주등록 팝업 기능 구현 (orderRegistFormPopup.jsp) * 영업정보 선택 후 수주 정보 입력 * 환종/환율 자동 로드 및 금액 자동 계산 * 단가×수량 → 공급가액, 부가세, 총액 자동 계산 - Controller: orderRegistFormPopup, saveOrderInfo 메서드 추가 - Service: getContractInfo, getOrderInfo, saveOrderInfo 메서드 추가 - Mapper: 수주 정보 조회/저장 쿼리 추가 (updateOrderInfo) - CONTRACT_MGMT 테이블의 수주 관련 컬럼 활용 - Header Admin 버튼 UI 개선 (인라인 표시)
This commit is contained in:
@@ -243,6 +243,16 @@ textarea {
|
||||
.editable {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: none !important;
|
||||
overflow: hidden;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
@@ -340,6 +350,16 @@ function fn_loadData() {
|
||||
$("#model_name").val(data.estimate.MODEL_NAME || "");
|
||||
$("#model_code").val(data.estimate.MODEL_CODE || "RUV-RA500S");
|
||||
|
||||
// 비고 내용 - 기존 데이터가 있을 때만 덮어쓰기
|
||||
if(data.estimate.NOTES_CONTENT && data.estimate.NOTES_CONTENT !== "") {
|
||||
$("#notes_content").val(data.estimate.NOTES_CONTENT);
|
||||
}
|
||||
|
||||
// 견적 유효기간 - 기존 데이터가 있을 때만 덮어쓰기
|
||||
if(data.estimate.VALIDITY_PERIOD && data.estimate.VALIDITY_PERIOD !== "") {
|
||||
$("#validity_period").val(data.estimate.VALIDITY_PERIOD);
|
||||
}
|
||||
|
||||
// 품목 데이터 로드 (카테고리별로 구분된 경우)
|
||||
if(data.items && data.items.length > 0) {
|
||||
// 데이터 바인딩 로직
|
||||
@@ -390,6 +410,8 @@ function fn_save() {
|
||||
recipient: $("#recipient").val(),
|
||||
model_name: $("#model_name").val(),
|
||||
model_code: $("#model_code").val(),
|
||||
notes_content: $("#notes_content").val(),
|
||||
validity_period: $("#validity_period").val(),
|
||||
categories: JSON.stringify(categories)
|
||||
};
|
||||
|
||||
@@ -425,41 +447,29 @@ function fn_save() {
|
||||
<!-- 헤더 섹션 -->
|
||||
<div class="header-section">
|
||||
<div class="logo-section">
|
||||
<div style="border: 1px solid #ccc; padding: 20px; text-align: center; font-weight: bold; color: #0066cc;">
|
||||
RPS<br>
|
||||
<span style="font-size: 8pt;">A division of Cimcherry</span>
|
||||
</div>
|
||||
<img src="<%=request.getContextPath()%>/images/logo.png" alt="RPS Logo" style="max-width: 150px; height: auto;">
|
||||
</div>
|
||||
<div class="title-section">
|
||||
<div class="title">견 적 서</div>
|
||||
</div>
|
||||
<div class="company-info">
|
||||
<div class="company-name">RPS CO., LTD</div>
|
||||
<div>대전광역시 유성구 국제과학로 10로 8</div>
|
||||
<div>TEL: (042)602-3300, FAX: (042)672-3399</div>
|
||||
<div style="flex: 0 0 200px; text-align: right; font-size: 9pt; line-height: 1.5;">
|
||||
<!-- 빈 공간 (기존 회사정보 위치) -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 기본 정보 -->
|
||||
<div class="basic-info">
|
||||
<div class="basic-info-left">
|
||||
<div class="info-row">
|
||||
<div class="info-label">시행일자 :</div>
|
||||
<div class="info-value editable">
|
||||
<input type="text" id="executor_date" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<div class="info-label">수신처 :</div>
|
||||
<div class="info-value editable">
|
||||
<input type="text" id="recipient" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="info-row">
|
||||
<div class="info-label">품 명 :</div>
|
||||
<div class="info-value editable">
|
||||
<input type="text" id="model_name" value="RUV-RA500S">
|
||||
</div>
|
||||
<!-- 기본 정보 (좌우 배치) -->
|
||||
<div style="display: flex; justify-content: space-between; margin-top: 20px; margin-bottom: 20px; padding: 0 10px;">
|
||||
<div style="text-align: left; font-size: 10pt; line-height: 2;">
|
||||
<div><strong>시행일자 :</strong> <input type="text" id="executor_date" value="" style="width: 200px; border: none; border-bottom: 1px solid #999; background: #fffef0; padding: 2px 5px;"></div>
|
||||
<div><strong>수 신 처 :</strong> <input type="text" id="recipient" value="" style="width: 200px; border: none; border-bottom: 1px solid #999; background: #fffef0; padding: 2px 5px;"></div>
|
||||
<div><strong>품 명 :</strong> <input type="text" id="model_name" value="RUV-RA500S" style="width: 200px; border: none; border-bottom: 1px solid #999; background: #fffef0; padding: 2px 5px;"></div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
<!-- 회사정보 -->
|
||||
<div style="display: inline-block; min-width: 300px;">
|
||||
<div style="font-weight: bold; font-size: 11pt; margin-bottom: 5px;">RPS CO., LTD</div>
|
||||
<div style="font-size: 9pt; line-height: 1.5;">대전광역시 유성구 국제과학로 10로 8</div>
|
||||
<div style="font-size: 9pt; line-height: 1.5;">TEL: (042)602-3300, FAX: (042)672-3399</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -490,11 +500,10 @@ function fn_save() {
|
||||
<table class="items-table category-section" data-category="cnc_machine">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">1</td>
|
||||
<td class="col-no" rowspan="2">1</td>
|
||||
<td colspan="6">초음파 CNC Machine</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable">
|
||||
<div><input type="text" value="Hole 가공" style="margin-bottom: 5px;"></div>
|
||||
@@ -507,26 +516,17 @@ function fn_save() {
|
||||
<div class="vat-badge">VAT 별도</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td colspan="2" class="editable"><input type="text" value="기구"></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 2. 초음파 스캔용 오돔 -->
|
||||
<!-- 1. 기구 -->
|
||||
<table class="items-table category-section" data-category="scan_odom">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">2</td>
|
||||
<td colspan="6">초음파 스캔용 오돔</td>
|
||||
<td class="col-no" rowspan="2">1</td>
|
||||
<td colspan="6">기구</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -534,10 +534,23 @@ function fn_save() {
|
||||
<td class="editable"><input type="text" class="item-amount" value="" readonly></td>
|
||||
<td class="editable"><input type="text" class="item-remark" value=""></td>
|
||||
</tr>
|
||||
<tr class="subtotal-row">
|
||||
<td colspan="5">Subtotal</td>
|
||||
<td class="editable"><input type="text" class="subtotal-amount" value="-" readonly></td>
|
||||
<td></td>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 2. 초음파 스핀들 모듈 -->
|
||||
<table class="items-table category-section" data-category="scan_odom">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no" rowspan="2">2</td>
|
||||
<td colspan="6">초음파 스핀들 모듈</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-price" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-amount" value="" readonly></td>
|
||||
<td class="editable"><input type="text" class="item-remark" value=""></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -546,11 +559,10 @@ function fn_save() {
|
||||
<table class="items-table category-section" data-category="electric">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">3</td>
|
||||
<td class="col-no" rowspan="2">3</td>
|
||||
<td colspan="6">전장</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -565,11 +577,10 @@ function fn_save() {
|
||||
<table class="items-table category-section" data-category="utility">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">4</td>
|
||||
<td class="col-no" rowspan="2">4</td>
|
||||
<td colspan="6">UTILITY</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -589,11 +600,10 @@ function fn_save() {
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">5</td>
|
||||
<td class="col-no" rowspan="2">5</td>
|
||||
<td colspan="6">자동화</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -613,11 +623,10 @@ function fn_save() {
|
||||
<table class="items-table category-section" data-category="option">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">6</td>
|
||||
<td class="col-no" rowspan="2">6</td>
|
||||
<td colspan="6">Option</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -637,11 +646,10 @@ function fn_save() {
|
||||
<table class="items-table category-section" data-category="setup">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">7</td>
|
||||
<td class="col-no" rowspan="2">7</td>
|
||||
<td colspan="6">Set up</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -657,15 +665,14 @@ function fn_save() {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 8. 포장/운송 -->
|
||||
<!-- 8. 포장 /물류 -->
|
||||
<table class="items-table category-section" data-category="packing">
|
||||
<tbody>
|
||||
<tr class="category-row">
|
||||
<td class="col-no">8</td>
|
||||
<td colspan="6">포장/운송</td>
|
||||
<td class="col-no" rowspan="2">8</td>
|
||||
<td colspan="6">포장 /물류</td>
|
||||
</tr>
|
||||
<tr class="detail-row">
|
||||
<td></td>
|
||||
<td class="editable"><input type="text" class="item-desc" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-spec" value=""></td>
|
||||
<td class="editable"><input type="text" class="item-qty" value=""></td>
|
||||
@@ -682,28 +689,26 @@ function fn_save() {
|
||||
</table>
|
||||
|
||||
<!-- 비고 섹션 -->
|
||||
<div class="notes-section">
|
||||
<ul style="list-style: none; padding-left: 0;">
|
||||
<li>■ 최종 견적가는 부가세 별도입니다.</li>
|
||||
<li>■ 장비 납기 : 발주 후 7개월</li>
|
||||
<li>■ 운송 조건 : -</li>
|
||||
<li>■ 결제 조건 : 계약금 : 30% / 잔금 : 70%</li>
|
||||
<li style="padding-left: 20px;">- 계약금 : 발주</li>
|
||||
<li style="padding-left: 20px;">- 잔금 : 검사 완료 후</li>
|
||||
<li>■ 특이사항 : 최종 장비 사양 확인 후 추가 변경 발생 시 견적 재산정 진행</li>
|
||||
<li>■ Warrenty Period: 1년(소모성 parts 제외)</li>
|
||||
<li>■ 주의 : RPS 등의의인 초음파 스캔용 임의 탈거 또는 세척시 보증 할 수 없음.</li>
|
||||
<li>■ 패킹 견적은 양산 20대 기준의 견적조건 운송 장비 전달 시 동일한 가격 적용 모로.</li>
|
||||
</ul>
|
||||
<div class="notes-section editable">
|
||||
<textarea id="notes_content" style="width: 100%; min-height: 180px; border: 1px solid #ddd; padding: 10px; font-family: inherit; font-size: 9pt; line-height: 1.8; resize: vertical;">■ 최종 견적가는 부가세 별도입니다.
|
||||
■ 장비 납기 : 발주 후 0개월
|
||||
■ 운송 조건 : -
|
||||
■ 결제 조건 : 계약금 : 0% / 잔금 : 0%
|
||||
- 계약금 : 발주
|
||||
- 잔 금 : 설치 완료 후
|
||||
■ 특이사항 : 최종 장비 사양 확인 후 추가 변경 발생 시 금액 변동 가능성 있음.
|
||||
■ Warrenty Period: 0년(소모성 parts 제외)
|
||||
■ 주의 : RPS 동의없이 초음파 스핀들의 임의 탈거 또는 해체시 보증 할수 없음.
|
||||
■ 해당 견적은 양산 0대 기준의 견적으로 후속 장비 진행 시 동일한 가격 책정 요청 드림.</textarea>
|
||||
</div>
|
||||
|
||||
<!-- 푸터 -->
|
||||
<div class="footer-section">
|
||||
<div>* 견적유효기간: 4/5</div>
|
||||
<div class="company-footer">(㈜)알피에스</div>
|
||||
<div><input type="text" id="validity_period" value="* 견적유효기간: 0주 " style="width: 250px; text-align: left;"></div>
|
||||
<div class="company-footer">㈜ 알 피 에 스</div>
|
||||
</div>
|
||||
<div style="text-align: right; font-size: 7pt; color: #999; margin-top: 5px;">
|
||||
* RPS 견적서 - 문서번호: RPS-SE-사업부명 양식 제치부작성 적용본 등을은 결제안전버리
|
||||
* RPS 대외비 - 본자료는 RPS의 사전허가 없이 제3자에게 제공할 수 없음을 알려드립니다.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
655
WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp
Normal file
655
WebContent/WEB-INF/view/contractMgmt/orderMgmtList.jsp
Normal file
@@ -0,0 +1,655 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<%
|
||||
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||||
String connector = person.getUserId();
|
||||
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
|
||||
<c:set var="now" value="<%=new java.util.Date() %>"/>
|
||||
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
|
||||
|
||||
<c:set var="connector" value="<%=connector %>" />
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
//날짜
|
||||
_fnc_datepick();
|
||||
|
||||
|
||||
$('.select2').select2();
|
||||
|
||||
$("#btnSearch").click(function(){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
});
|
||||
|
||||
//SR자료등록 팝업
|
||||
$(".File").click(function(){
|
||||
var popup_width = 800;
|
||||
var popup_height = 335;
|
||||
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
var docType =$(this).attr("data-docType");
|
||||
var docTypeName = $(this).attr("data-docTypeName");
|
||||
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
|
||||
var url = "/projectConcept/FileRegistPopup.do"+params;
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
});
|
||||
|
||||
//수주 등록 팝업
|
||||
$(".btnRegist").click(function(){
|
||||
var selectedData = _tabulGrid.getSelectedData();
|
||||
if(selectedData.length < 1){
|
||||
Swal.fire("수주등록할 영업정보를 선택해주십시오.");
|
||||
return false;
|
||||
} else if(selectedData.length > 1){
|
||||
Swal.fire("한번에 한개의 수주만 등록 가능합니다.");
|
||||
return false;
|
||||
} else {
|
||||
var contractObjId = fnc_checkNull(selectedData[0].OBJID);
|
||||
var popup_width = 1000;
|
||||
var popup_height = 450;
|
||||
var params = "?actionType=regist&contractObjId="+contractObjId;
|
||||
var url = "/contractMgmt/orderRegistFormPopup.do"+params;
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//엔터 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//삭제
|
||||
$("#btnDelete").click(function(){
|
||||
fn_delete();
|
||||
});
|
||||
|
||||
|
||||
$("#btnExcel").click(function(){
|
||||
document.form1.actionType.value = "excel";
|
||||
document.form1.action = "/contractMgmt/contractList.do";
|
||||
document.form1.submit();
|
||||
});
|
||||
|
||||
fn_search();
|
||||
});
|
||||
|
||||
var columns = [
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '영업번호', field : 'CONTRACT_NO', frozen:true,
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick:function(e, cell){
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_projectConceptDetail(objid);
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '주문유형', field : 'CATEGORY_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '제품구분', field : 'PRODUCT_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '국내/해외', field : 'AREA_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '접수일', field : 'RECEIPT_DATE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'PAID_TYPE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '품번', field : 'PART_NO' },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '100', title : '품명', field : 'PART_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '150', title : 'S/N', field : 'SERIAL_NO',
|
||||
formatter: function(cell, formatterParams, onRendered){
|
||||
var value = fnc_checkNull(cell.getValue());
|
||||
if(value === '') return '';
|
||||
|
||||
// 쉼표로 구분된 S/N 개수 계산
|
||||
var serialNumbers = value.split(',').map(function(s){ return s.trim(); }).filter(function(s){ return s !== ''; });
|
||||
var count = serialNumbers.length;
|
||||
|
||||
if(count === 0) return '';
|
||||
if(count === 1) return '<a href="javascript:void(0);">' + serialNumbers[0] + '</a>';
|
||||
|
||||
// 2개 이상이면 "첫번째 외 N개" 형식
|
||||
var displayText = serialNumbers[0] + ' 외 ' + (count - 1) + '개';
|
||||
return '<a href="javascript:void(0);">' + displayText + '</a>';
|
||||
},
|
||||
cellClick:function(e, cell){
|
||||
var serialNo = fnc_checkNull(cell.getData().SERIAL_NO);
|
||||
fn_showSerialNoPopup(serialNo);
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '수량', field : 'QUANTITY' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '요청납기', field : 'DUE_DATE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객요청사항', field : 'CUSTOMER_REQUEST' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '견적현황', field : 'EST_STATUS',
|
||||
formatter:fnc_subInfoValueFormatter,
|
||||
cellClick:function(e, cell){
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_showEstimateList(objid);
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '결재상태', field : 'APPR_STATUS',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick:function(e, cell){
|
||||
var APPROVAL_OBJID = fnc_checkNull(cell.getData().APPROVAL_OBJID);
|
||||
var ROUTE_OBJID = fnc_checkNull(cell.getData().ROUTE_OBJID);
|
||||
approval_form(APPROVAL_OBJID,ROUTE_OBJID);
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '메일발송', field : 'MAIL_SEND_STATUS',
|
||||
formatter: function(cell, formatterParams, onRendered){
|
||||
var status = fnc_checkNull(cell.getValue());
|
||||
var sendDate = fnc_checkNull(cell.getData().MAIL_SEND_DATE);
|
||||
|
||||
if(status === 'Y'){
|
||||
return '<span style="color:green;">발송완료</span>';
|
||||
} else if(status === 'N'){
|
||||
return '<span style="color:red;">발송실패</span>';
|
||||
} else {
|
||||
return '<span style="color:#999;">미발송</span>';
|
||||
}
|
||||
// if(status === 'Y'){
|
||||
// return '<span style="color:green;">발송완료</span><br/><span style="font-size:11px;">' + sendDate + '</span>';
|
||||
// } else if(status === 'N'){
|
||||
// return '<span style="color:red;">발송실패</span><br/><span style="font-size:11px;">' + sendDate + '</span>';
|
||||
// } else {
|
||||
// return '<span style="color:#999;">미발송</span>';
|
||||
// }
|
||||
}
|
||||
},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '견적단가', field : 'EST_PRICE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '견적공급가액', field : 'EST_SUPPLY_PRICE' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환종', field : 'CONTRACT_CURRENCY_NAME' },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환율', field : 'EXCHANGE_RATE' },
|
||||
];
|
||||
|
||||
//var grid;
|
||||
function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/contractMgmt/contractGridList.do", columns, true);
|
||||
}
|
||||
|
||||
function _fnc_datepick(){
|
||||
var $dateinput = $("input.date_icon");
|
||||
for(var i=0; i<$dateinput.length; i++){
|
||||
$dateinput.eq(i).attr("size","10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth:true,
|
||||
changeYear:true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function fn_delete(){
|
||||
var checkedObj = _tabulGrid.getSelectedData();
|
||||
if(0 < checkedObj.length){
|
||||
var objId = fnc_checkNull(checkedObj[0].OBJID);
|
||||
//if(confirm("선택한 정보를 삭제하시겠습니까?")){
|
||||
Swal.fire({
|
||||
title: '선택한 고객정보를 삭제하시겠습니까?',
|
||||
text: '',
|
||||
icon: 'warning',
|
||||
|
||||
showCancelButton: true, // cancel버튼 보이기. 기본은 원래 없음
|
||||
confirmButtonColor: '#3085d6', // confrim 버튼 색깔 지정
|
||||
cancelButtonColor: '#d33', // cancel 버튼 색깔 지정
|
||||
confirmButtonText: '확인', // confirm 버튼 텍스트 지정
|
||||
cancelButtonText: '취소', // cancel 버튼 텍스트 지정
|
||||
reverseButtons: false, // 버튼 순서 거꾸로
|
||||
|
||||
}).then(result => {
|
||||
// 만약 Promise리턴을 받으면,
|
||||
if (result.isConfirmed) { // 만약 모달창에서 confirm 버튼을 눌렀다면
|
||||
//var param = $("#form1").serialize();
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/contractMgmt/deleteContractMngInfo.do",
|
||||
data: {
|
||||
"objId":objId
|
||||
},
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data.result == 'true'){
|
||||
Swal.fire("삭제되었습니다.");
|
||||
fn_search();
|
||||
};
|
||||
}
|
||||
,error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
Swal.fire("선택한 항목이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
function approval_form(APPROVAL_OBJID,ROUTE_OBJID){
|
||||
|
||||
url = "/approval/approvalDetail.do?approvalObjId="+APPROVAL_OBJID+"&routeObjId="+ROUTE_OBJID;
|
||||
|
||||
fn_centerPopup(650,400,url,'approvalDetailPopup')
|
||||
}
|
||||
|
||||
function fn_FileRegist(objId, docType, docTypeName){
|
||||
var popup_width = 800;
|
||||
var popup_height = 300;
|
||||
|
||||
var objId = objId;
|
||||
var docType = docType;
|
||||
var docTypeName = docTypeName;
|
||||
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
|
||||
var url = "/projectConcept/FileRegistPopup.do"+params;
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
//영업활동등록 상세
|
||||
function fn_projectConceptDetail(objId){
|
||||
var popup_width = 1000;
|
||||
var popup_height = 560;
|
||||
var url = "/contractMgmt/estimateRegistFormPopup.do?objId="+objId;
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
//검토내용 상세
|
||||
function fn_projectConceptReviewDetail(objId){
|
||||
var popup_width = 800;
|
||||
var popup_height = 250;
|
||||
var url = "/contractMgmt/contracMgmtReviewFormPopup.do?objId="+objId;
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
// 견적서 목록 팝업
|
||||
function fn_showEstimateList(contractObjId){
|
||||
$.ajax({
|
||||
url: "/contractMgmt/getEstimateTemplateList.do",
|
||||
type: "POST",
|
||||
data: { objId: contractObjId },
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
//console.log("견적서 목록 응답:", data); // 디버깅용
|
||||
|
||||
if(data.result === "success" && data.list && data.list.length > 0){
|
||||
var html = '<div style="max-height: 400px; overflow-y: auto;">';
|
||||
html += '<table style="width: 100%; border-collapse: collapse;">';
|
||||
html += '<thead><tr style="background-color: #f0f0f0;">';
|
||||
html += '<th style="border: 1px solid #ddd; padding: 8px;">차수</th>';
|
||||
html += '<th style="border: 1px solid #ddd; padding: 8px;">견적서 유형</th>';
|
||||
html += '<th style="border: 1px solid #ddd; padding: 8px;">견적번호</th>';
|
||||
html += '<th style="border: 1px solid #ddd; padding: 8px;">작성일</th>';
|
||||
html += '<th style="border: 1px solid #ddd; padding: 8px;">작성자</th>';
|
||||
html += '</tr></thead><tbody>';
|
||||
|
||||
data.list.forEach(function(item){
|
||||
//console.log("견적서 항목:", item); // 디버깅용
|
||||
|
||||
// 대문자/소문자 모두 지원하도록 안전하게 처리
|
||||
var objid = item.OBJID || item.objid || '';
|
||||
var templateType = item.TEMPLATE_TYPE || item.template_type || item.templateType || '';
|
||||
var revision = item.REVISION || item.revision || '';
|
||||
var templateTypeName = item.TEMPLATE_TYPE_NAME || item.template_type_name || item.templateTypeName || '';
|
||||
var estimateNo = item.ESTIMATE_NO || item.estimate_no || item.estimateNo || '-';
|
||||
var regdate = item.REGDATE || item.regdate || '';
|
||||
var writer = item.WRITER || item.writer || '';
|
||||
|
||||
html += '<tr style="cursor: pointer;" onclick="fn_openEstimateByObjId(\'' + objid + '\', \'' + templateType + '\')">';
|
||||
html += '<td style="border: 1px solid #ddd; padding: 8px; text-align: center;">' + revision + '차</td>';
|
||||
html += '<td style="border: 1px solid #ddd; padding: 8px; text-align: center;">' + templateTypeName + '</td>';
|
||||
html += '<td style="border: 1px solid #ddd; padding: 8px; text-align: center;">' + estimateNo + '</td>';
|
||||
html += '<td style="border: 1px solid #ddd; padding: 8px; text-align: center;">' + regdate + '</td>';
|
||||
html += '<td style="border: 1px solid #ddd; padding: 8px; text-align: center;">' + writer + '</td>';
|
||||
html += '</tr>';
|
||||
});
|
||||
|
||||
html += '</tbody></table></div>';
|
||||
|
||||
Swal.fire({
|
||||
title: '견적서 목록',
|
||||
html: html,
|
||||
width: '700px',
|
||||
showConfirmButton: false,
|
||||
showCancelButton: true,
|
||||
cancelButtonText: '닫기'
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: '견적서가 없습니다',
|
||||
text: '작성된 견적서가 없습니다.',
|
||||
icon: 'info'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error){
|
||||
console.error("견적서 목록 조회 오류:", xhr, status, error); // 디버깅용
|
||||
Swal.fire({
|
||||
title: '오류',
|
||||
text: '견적서 목록 조회 중 오류가 발생했습니다.',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// OBJID로 견적서 열기
|
||||
function fn_openEstimateByObjId(templateObjId, templateType){
|
||||
Swal.close();
|
||||
|
||||
var popup_width = 900;
|
||||
var popup_height = 800;
|
||||
var url = "";
|
||||
|
||||
if(templateType === "1"){
|
||||
// 일반 견적서
|
||||
url = "/contractMgmt/estimateTemplate1.do?templateObjId="+templateObjId;
|
||||
} else if(templateType === "2"){
|
||||
// 장비 견적서
|
||||
url = "/contractMgmt/estimateTemplate2.do?templateObjId="+templateObjId;
|
||||
}
|
||||
|
||||
window.open(url, "estimateTemplate_"+templateObjId, "width="+popup_width+",height="+popup_height+",menubar=no,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
|
||||
//견적서 양식 열기 (CONTRACT_OBJID로)
|
||||
function fn_openEstimateTemplate(objId, templateType){
|
||||
var popup_width = 900;
|
||||
var popup_height = 800;
|
||||
var url = "";
|
||||
|
||||
if(templateType === "1"){
|
||||
// 일반 견적서
|
||||
url = "/contractMgmt/estimateTemplate1.do?objId="+objId;
|
||||
} else if(templateType === "2"){
|
||||
// 장비 견적서
|
||||
url = "/contractMgmt/estimateTemplate2.do?objId="+objId;
|
||||
}
|
||||
|
||||
window.open(url, "estimateTemplate", "width="+popup_width+",height="+popup_height+",menubar=no,scrollbars=yes,resizable=yes");
|
||||
}
|
||||
|
||||
// S/N 목록 팝업 표시
|
||||
function fn_showSerialNoPopup(serialNoString){
|
||||
if(!serialNoString || serialNoString === ''){
|
||||
Swal.fire("S/N 정보가 없습니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
// 쉼표로 구분된 S/N을 배열로 변환
|
||||
var serialNumbers = serialNoString.split(',').map(function(sn){ return sn.trim(); });
|
||||
|
||||
// HTML 리스트 생성
|
||||
var listHtml = '<div style="text-align: left; max-height: 400px; overflow-y: auto;">';
|
||||
listHtml += '<ol style="padding-left: 20px; margin: 10px 0;">';
|
||||
serialNumbers.forEach(function(sn, index){
|
||||
listHtml += '<li style="padding: 5px 0; font-size: 14px;">' + sn + '</li>';
|
||||
});
|
||||
listHtml += '</ol>';
|
||||
listHtml += '</div>';
|
||||
|
||||
// SweetAlert2로 팝업 표시
|
||||
Swal.fire({
|
||||
title: 'S/N 목록',
|
||||
html: listHtml,
|
||||
icon: 'info',
|
||||
width: 500,
|
||||
confirmButtonText: '확인',
|
||||
confirmButtonColor: '#3085d6'
|
||||
});
|
||||
}
|
||||
|
||||
//코드값을 받아와서 동적으로 selectbox 생성
|
||||
function optionJobGroup(code){
|
||||
var val=code;
|
||||
var params = "";
|
||||
var option="";
|
||||
var combobox = $("#writer");
|
||||
combobox.empty();
|
||||
if(val!=""){
|
||||
params += "codeId="+val;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/projectConcept/makewrite.do",
|
||||
data : params,
|
||||
dataType:"json",
|
||||
async: false,
|
||||
success: function(data){
|
||||
if(data.RESULT !=""){
|
||||
option += "<option value=''>전체</option>";
|
||||
option += data.RESULT;
|
||||
combobox.append(option);
|
||||
}
|
||||
}
|
||||
});
|
||||
// alert(Number(lev-1));
|
||||
//$("#code"+Number(lev-1)).val(code).prop("selected", true);
|
||||
}else{
|
||||
|
||||
option += "<option value=''>전체</option>";
|
||||
combobox.append(option);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//코드값을 받아와서 동적으로 selectbox 생성
|
||||
function makeSelect(code){
|
||||
var val=code;
|
||||
var params = "";
|
||||
var option="";
|
||||
var combobox = $("#outc_cd6_td");
|
||||
combobox.empty();
|
||||
|
||||
|
||||
/* <select name="outc_cd6" id="outc_cd6" type="select">
|
||||
<option value="">선택</option>
|
||||
</select> */
|
||||
|
||||
if(val!="" && val!="PLA03000"){
|
||||
params += "codeId="+val;
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/ordermgmt/makeCodeselect.do",
|
||||
data : params,
|
||||
dataType:"json",
|
||||
async: false,
|
||||
success: function(data){
|
||||
if(data.RESULT !=""){
|
||||
option += "<select name='outc_cd6' id='outc_cd6' type='select'>"
|
||||
option += "<option value=''>선택</option>";
|
||||
option += data.RESULT;
|
||||
option += "</select>";
|
||||
combobox.append(option);
|
||||
$("#outc_cd6").val("${param.outc_cd6}");
|
||||
//$("#outc_cd6").select2();
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if(val=="PLA03000"){
|
||||
option += "<input type='text' name='outc_cd6' id='outc_cd6' value='${param.outc_cd6}'>"
|
||||
combobox.append(option);
|
||||
}else{
|
||||
option += "<select name='outc_cd6' id='outc_cd6' type='select'>"
|
||||
option += "<option value=''>선택</option>";
|
||||
option += "</select>";
|
||||
combobox.append(option);
|
||||
//$("#outc_cd6").select2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function saveexcelpop() {
|
||||
|
||||
var partLength = $("input[name=partCheckBox]:checked").length;
|
||||
if(partLength == 0){
|
||||
Swal.fire('선택된 영업정보가 없습니다.');
|
||||
return;
|
||||
}
|
||||
if(partLength > 1){
|
||||
Swal.fire('단건씩 선택해 주세요');
|
||||
return;
|
||||
}
|
||||
|
||||
var orderobjId ="";
|
||||
$("input[name=partCheckBox]:checked").each(function(){
|
||||
orderobjId = fnc_checkNull($(this).attr("data-objId").replace(" ",""));
|
||||
});
|
||||
|
||||
var url = "/ordermgmt/openOrderExcelImportPopUp.do?orderobjId="+orderobjId;
|
||||
var target = "openOrderExcelImportPopUp";
|
||||
window.open(url, target,"width=1245, height=700, menubars=no, scrollbars=yes, resizable=yes");
|
||||
}
|
||||
|
||||
|
||||
//프로젝트의 form,detail 팝업을 보여준다.
|
||||
function openProjectFormPopUp(objId){
|
||||
window.open("","projectFormPopUp","width=1150, height=676");
|
||||
var params = "?actionType=regist"
|
||||
var url = "/project/projectFormPopUp.do"+params;
|
||||
if("" != objId){
|
||||
url = "/project/projectDetailPopUp.do";
|
||||
}
|
||||
var form = document.form1;
|
||||
form.objId.value = objId;
|
||||
form.action = url;
|
||||
form.target = "projectFormPopUp";
|
||||
form.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="bodyNoScroll">
|
||||
<form name="form1" id="form1" action="" method="post">
|
||||
<input type="hidden" name="actionType" value="" />
|
||||
|
||||
<!-- 대시보드용 -->
|
||||
<input type="hidden" name="contract_month" id="contract_month" value="${param.contract_month}">
|
||||
<div class="min_part_enroll">
|
||||
<div class="content-box">
|
||||
<div class="content-box-s">
|
||||
<div class="plm_menu_name_gdnsi">
|
||||
<h2>
|
||||
<span>영업관리_주문서관리</span>
|
||||
</h2>
|
||||
<div class="btnArea">
|
||||
<input type="button" value="조회" class="plm_btns" id="btnSearch" name="btnSearch">
|
||||
<input type="button" value="수주등록" class="plm_btns btnRegist">
|
||||
</div>
|
||||
</div>
|
||||
<div id="plmSearchZon">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="category_cd">주문유형</label></td>
|
||||
<td>
|
||||
<select name="category_cd" id="category_cd" style="width:150px" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="product">제품구분</label></td>
|
||||
<td>
|
||||
<select name="product" id="product" style="width:130px" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="area_cd">국내/해외</label></td>
|
||||
<td>
|
||||
<select name="area_cd" id="area_cd" style="" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
<option value="0001220">국내</option>
|
||||
<option value="0001221">해외</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="customer_objid">고객사</label></td>
|
||||
<td>
|
||||
<select name="customer_objid" id="customer_objid" style="width:190px" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="paid_type">유/무상</label></td>
|
||||
<td>
|
||||
<select name="paid_type" id="paid_type" style="width:130px" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
<option value="paid">유상</option>
|
||||
<option value="free">무상</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="align_r">
|
||||
<label for="" class="">품번</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="search_partNo" id="search_partNo" value="${param.search_partNo}"/>
|
||||
</td>
|
||||
<td class="align_r">
|
||||
<label for="" class="">품명</label>
|
||||
</td>
|
||||
<td colspan="3">
|
||||
<input type="text" name="search_partName" id="search_partName" value="${param.search_partName}"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="">
|
||||
<label for="" class="">S/N</label>
|
||||
</td>
|
||||
<td colspan="">
|
||||
<input type="text" name="search_serialNo" id="search_serialNo" value="${param.search_serialNo}"/>
|
||||
</td>
|
||||
|
||||
<td><label for="result_cd">수주상태</label></td>
|
||||
<td>
|
||||
<select name="result_cd" id="result_cd" style="width:130px" class="select2" autocomplete="off">
|
||||
<option value="">선택</option>
|
||||
${code_map.result_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td class="">
|
||||
<label for="" class="">발주번호</label>
|
||||
</td>
|
||||
<td colspan="">
|
||||
<input type="text" name="search_serialNo" id="search_serialNo" value="${param.search_serialNo}"/>
|
||||
</td>
|
||||
|
||||
<td class="">
|
||||
<label>요청납기</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="due_start_date" id="due_start_date" style="width:90px;" autocomplete="off" value="${param.due_start_date}" class="date_icon">~
|
||||
<input type="text" name="due_end_date" id="due_end_date" style="width:90px;" autocomplete="off" value="${param.due_end_date}" class="date_icon">
|
||||
</td>
|
||||
|
||||
<td class="">
|
||||
<label>발주일</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" name="receipt_start_date" id="receipt_start_date" style="width:90px;" autocomplete="off" value="${param.receipt_start_date}" class="date_icon">~
|
||||
<input type="text" name="receipt_end_date" id="receipt_end_date" style="width:90px;" autocomplete="off" value="${param.receipt_end_date}" class="date_icon">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
298
WebContent/WEB-INF/view/contractMgmt/orderRegistFormPopup.jsp
Normal file
298
WebContent/WEB-INF/view/contractMgmt/orderRegistFormPopup.jsp
Normal file
@@ -0,0 +1,298 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@include file="/init_new.jsp"%>
|
||||
<%
|
||||
PersonBean person = (PersonBean) session.getAttribute(Constants.PERSON_BEAN);
|
||||
String userId = CommonUtils.checkNull(person.getUserId());
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
.fileListscrollTbody td {
|
||||
font-size: 11px !important;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
// 숫자 입력 필드에 콤마 자동 추가
|
||||
$("input:text[numberOnly]").on("keyup", function() {
|
||||
$(this).val(addComma($(this).val().replace(/[^0-9]/g, "")));
|
||||
});
|
||||
|
||||
// 페이지 로드 시 기존 값에 콤마 표시
|
||||
$("input:text[numberOnly]").each(function() {
|
||||
var val = $(this).val();
|
||||
if(val && val !== '') {
|
||||
$(this).val(addComma(val.replace(/,/g, "")));
|
||||
}
|
||||
});
|
||||
|
||||
$('.select2').select2();
|
||||
|
||||
// 날짜 선택기 초기화
|
||||
_fnc_datepick();
|
||||
|
||||
// 저장 버튼
|
||||
$("#btnSave").click(function() {
|
||||
fn_save();
|
||||
});
|
||||
|
||||
// 닫기 버튼
|
||||
$("#btnClose").click(function() {
|
||||
self.close();
|
||||
});
|
||||
|
||||
// 단가/수량 변경 시 금액 자동 계산
|
||||
$("#unit_price, #quantity").on("change keyup", function() {
|
||||
fn_calculateAmount();
|
||||
});
|
||||
|
||||
// 공급가액 변경 시 부가세/총액 자동 계산
|
||||
$("#supply_price").on("change keyup", function() {
|
||||
fn_calculateTax();
|
||||
});
|
||||
|
||||
// 환종 변경 시 환율 자동 로드
|
||||
$("#currency").change(function() {
|
||||
var selectedCurrency = $(this).val();
|
||||
if(selectedCurrency && selectedCurrency !== '') {
|
||||
fn_loadExchangeRate(selectedCurrency);
|
||||
} else {
|
||||
$("#exchange_rate").val('');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 콤마 추가 함수
|
||||
function addComma(data) {
|
||||
return data.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
// 콤마 제거 함수
|
||||
function removeComma(data) {
|
||||
return data.toString().replace(/,/g, "");
|
||||
}
|
||||
|
||||
// 금액 자동 계산 (단가 × 수량 = 공급가액)
|
||||
function fn_calculateAmount() {
|
||||
var unitPrice = removeComma($("#unit_price").val()) || 0;
|
||||
var quantity = removeComma($("#quantity").val()) || 0;
|
||||
|
||||
var supplyPrice = parseInt(unitPrice) * parseInt(quantity);
|
||||
|
||||
$("#supply_price").val(addComma(supplyPrice));
|
||||
|
||||
// 공급가액 변경 시 부가세/총액도 재계산
|
||||
fn_calculateTax();
|
||||
}
|
||||
|
||||
// 부가세/총액 자동 계산 (공급가액 × 10% = 부가세, 공급가액 + 부가세 = 총액)
|
||||
function fn_calculateTax() {
|
||||
var supplyPrice = parseInt(removeComma($("#supply_price").val())) || 0;
|
||||
|
||||
var vat = Math.round(supplyPrice * 0.1); // 부가세 10%
|
||||
var totalAmount = supplyPrice + vat;
|
||||
|
||||
$("#vat").val(addComma(vat));
|
||||
$("#total_amount").val(addComma(totalAmount));
|
||||
}
|
||||
|
||||
// 저장 함수
|
||||
function fn_save() {
|
||||
if (fnc_valitate("form1")) {
|
||||
var message = "수정";
|
||||
if ("${actionType}" == 'regist') {
|
||||
message = "등록";
|
||||
}
|
||||
if (confirm(message + "하시겠습니까?")) {
|
||||
// 콤마 제거
|
||||
$("#unit_price").val(removeComma($("#unit_price").val()));
|
||||
$("#supply_price").val(removeComma($("#supply_price").val()));
|
||||
$("#vat").val(removeComma($("#vat").val()));
|
||||
$("#total_amount").val(removeComma($("#total_amount").val()));
|
||||
$("#quantity").val(removeComma($("#quantity").val()));
|
||||
|
||||
$.ajax({
|
||||
url : "/contractMgmt/saveOrderInfo.do",
|
||||
type : "POST",
|
||||
data : $("#form1").serialize(),
|
||||
dataType : "json",
|
||||
success : function(data) {
|
||||
alert(data.msg);
|
||||
if(opener && opener.fn_search) {
|
||||
opener.fn_search();
|
||||
}
|
||||
self.close();
|
||||
},
|
||||
error : function(jqxhr, status, error) {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 날짜 선택기 초기화
|
||||
function _fnc_datepick() {
|
||||
var $dateinput = $("input.date_icon");
|
||||
for (var i = 0; i < $dateinput.length; i++) {
|
||||
$dateinput.eq(i).attr("size", "10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth : true,
|
||||
changeYear : true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 환율 자동 로드
|
||||
function fn_loadExchangeRate(currencyCode) {
|
||||
$.ajax({
|
||||
url: "/common/getExchangeRate.do",
|
||||
type: "POST",
|
||||
data: { currencyCode: currencyCode },
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
if(data && data.rate) {
|
||||
$("#exchange_rate").val(data.rate);
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
console.log("환율 조회 실패");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" id="form1" action="" method="post">
|
||||
<input type="hidden" name="contractObjId" id="contractObjId" value="${contractObjId}">
|
||||
<input type="hidden" name="objId" id="objId" value="${objId}">
|
||||
<input type="hidden" name="actionType" id="actionType" value="${actionType}">
|
||||
|
||||
<section class="business_popup_min_width">
|
||||
<div class="plm_menu_name">
|
||||
<h2>
|
||||
<span>영업관리_주문서관리_수주등록 (영업번호: ${contractInfo.CONTRACT_NO})</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="EntirePopupFormWrap">
|
||||
<div class="form_popup_title">
|
||||
<span>수주 정보입력</span>
|
||||
</div>
|
||||
<table class="">
|
||||
<colgroup>
|
||||
<col width="100%" />
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="pmsPopuptable">
|
||||
<colgroup>
|
||||
<col width="15%" />
|
||||
<col width="35%" />
|
||||
<col width="15%" />
|
||||
<col width="35%" />
|
||||
</colgroup>
|
||||
|
||||
<!-- 첫번째 행: 수주상태, 발주번호 -->
|
||||
<tr>
|
||||
<td class="input_title"><label for="">수주상태 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<select name="contract_result" id="contract_result" required reqTitle="수주상태" type="select" class="select2">
|
||||
<option value="">선택</option>
|
||||
${code_map.contract_result}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label for="">발주번호 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="po_no" id="po_no" required reqTitle="발주번호" value="${info.PO_NO}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 두번째 행: 발주일, 수량 -->
|
||||
<tr>
|
||||
<td class="input_title"><label for="">발주일 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" class="date_icon" name="order_date" id="order_date" required reqTitle="발주일" value="${info.ORDER_DATE}">
|
||||
</td>
|
||||
<td class="input_title"><label for="">수량 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="quantity" id="quantity" required reqTitle="수량" value="${info.QUANTITY}" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 세번째 행: 단가, 공급가액 -->
|
||||
<tr>
|
||||
<td class="input_title"><label for="">단가 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="unit_price" id="unit_price" required reqTitle="단가" value="${info.ORDER_UNIT_PRICE}" numberOnly />
|
||||
</td>
|
||||
<td class="input_title"><label for="">공급가액 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="supply_price" id="supply_price" required reqTitle="공급가액" value="${info.ORDER_SUPPLY_PRICE}" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 네번째 행: 부가세, 총액 -->
|
||||
<tr>
|
||||
<td class="input_title"><label for="">부가세 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="vat" id="vat" required reqTitle="부가세" value="${info.ORDER_VAT}" numberOnly />
|
||||
</td>
|
||||
<td class="input_title"><label for="">총액 <span style="color:red;">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="total_amount" id="total_amount" required reqTitle="총액" value="${info.ORDER_TOTAL_AMOUNT}" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 다섯번째 행: 환종, 환율 -->
|
||||
<tr>
|
||||
<td class="input_title"><label for="">환종</label></td>
|
||||
<td>
|
||||
<select name="contract_currency" id="contract_currency" reqTitle="환종" type="select" class="select2">
|
||||
<option value="">선택</option>
|
||||
${code_map.contract_currency}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label for="">환율</label></td>
|
||||
<td>
|
||||
<input type="text" name="exchange_rate" id="exchange_rate" reqTitle="환율" value="${info.EXCHANGE_RATE}" numberOnly />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="btn_wrap">
|
||||
<div class="plm_btn_wrap_center">
|
||||
<c:choose>
|
||||
<c:when test="${actionType eq 'view'}">
|
||||
<%-- 조회 모드: 닫기 버튼만 표시 --%>
|
||||
</c:when>
|
||||
<c:when test="${actionType eq 'regist'}">
|
||||
<input type="button" value="저장" id="btnSave" class="plm_btns">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input type="button" value="수정" id="btnSave" class="plm_btns">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -414,7 +414,12 @@ function fn_setApprovalCnt(){
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<a href="#" style="color:#fff; padding: 2px 4px; font-size:9px; background-color:#676868; border-radius:2px; text-decoration: none; display: inline-block;" class="btnLogout">Logout</a>
|
||||
<a href="#" style="color:#fff; padding: 2px 4px; font-size:9px; background-color:#676868; border-radius:2px; text-decoration: none; display: inline-block;" class="btnLogout">Logout</a>
|
||||
|
||||
<%
|
||||
if("plm_admin".equals(userId)){%>
|
||||
<a href="#" style="color:#fff; padding: 2px 4px; font-size:9px; background-color:#5897fb; border-radius:2px; text-decoration: none; display: inline-block; margin-left: 5px;" onclick="javascript:openAdminMngPop();">Admin</a>
|
||||
<%}%>
|
||||
</td>
|
||||
<%--
|
||||
<td style=""><a href="#" id="manualDownload" style="color:#fff; padding: 5px 10px; font-size:11px; background-color:#38426b; border-radius:3px;">Manual Download</a></td>
|
||||
@@ -478,17 +483,7 @@ function fn_setApprovalCnt(){
|
||||
-->
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<%
|
||||
if("plm_admin".equals(userId)){%>
|
||||
<ul id="topmenu" class="gnb clearFloat on" style="float:right; border-bottom: 0px solid #000;">
|
||||
<li class="" data-menu-id="417" data-menu-target="Current" data-menu-alias="" data-menu-alias2="" data-menu-url="" style="align:left;padding-top:0px;padding-left:6px;background:url(/images/setting.png) left center no-repeat;">
|
||||
<a href="#" class=" menu_off" style="padding-bottom:0px;top: 10px;" onclick="javascript:openAdminMngPop();" >Admin</a>
|
||||
</li>
|
||||
</ul>
|
||||
<%}%>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
@@ -1965,4 +1965,128 @@ public class ContractMgmtController {
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주문서관리 리스트
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/contractMgmt/orderMgmtList.do")
|
||||
public String orderMgmtList(HttpServletRequest request, @RequestParam Map paramMap){
|
||||
//List list = contractMgmtService.getcontractList(request,paramMap);
|
||||
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
||||
Map code_map = new HashMap();
|
||||
String returnUrl ="/contractMgmt/orderMgmtList";
|
||||
|
||||
try{
|
||||
|
||||
if("excel".equals(actionType)){
|
||||
//returnUrl = "/contractMgmt/contractListExcel";
|
||||
}
|
||||
|
||||
//구분
|
||||
code_map.put("category_cd" , commonService.bizMakeOptionList("0000167", CommonUtils.nullToEmpty((String)paramMap.get("category_cd")) , "common.getCodeselect"));
|
||||
|
||||
//고객사
|
||||
code_map.put("customer_cd",commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)paramMap.get("customer_objid")),"common.getsupplyselect"));
|
||||
|
||||
//제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", CommonUtils.nullToEmpty((String)paramMap.get("product")),"common.getCodeselect")); //공장
|
||||
|
||||
//진행상황
|
||||
code_map.put("status_cd" , commonService.bizMakeOptionList("0000932", CommonUtils.nullToEmpty((String)paramMap.get("status_cd")) , "common.getCodeselect"));
|
||||
|
||||
//결과
|
||||
code_map.put("result_cd", commonService.bizMakeOptionList("0000963", CommonUtils.nullToEmpty((String)paramMap.get("result_cd")), "common.getCodeselect"));
|
||||
|
||||
//PM
|
||||
code_map.put("pm_user_id", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)paramMap.get("pm_user_id")), "common.getUserselect")); //구매 PM
|
||||
|
||||
request.setAttribute("code_map",code_map);
|
||||
request.setAttribute("actionType",actionType);
|
||||
//request.setAttribute("LIST", list);
|
||||
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return returnUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주문서관리 - 주문서관리 목록 페이징
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/contractMgmt/orderMgmtGrodList.do")
|
||||
public Map getOrderMgmtListPaging(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
commonService.selectListPagingNew("contractMgmt.orderMgmtGrodList", request, paramMap);
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 수주등록 팝업 페이지
|
||||
* @param session
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/contractMgmt/orderRegistFormPopup.do")
|
||||
public String orderRegistFormPopup(HttpSession session, HttpServletRequest request, @RequestParam Map<String, Object> paramMap) {
|
||||
String objId = CommonUtils.checkNull(paramMap.get("contractObjId"));
|
||||
//String contractObjId = CommonUtils.checkNull(paramMap.get("contractObjId"));
|
||||
String actionType = CommonUtils.checkNull(paramMap.get("actionType"));
|
||||
|
||||
Map<String, Object> code_map = new HashMap<String, Object>();
|
||||
Map<String, Object> info = new HashMap<String, Object>();
|
||||
Map<String, Object> contractInfo = new HashMap<String, Object>();
|
||||
|
||||
try {
|
||||
// 영업정보(견적정보) 조회
|
||||
if(StringUtils.isNotBlank(objId)) {
|
||||
paramMap.put("objId", objId);
|
||||
contractInfo = CommonUtils.keyChangeUpperMap(contractMgmtService.getContractMgmtInfo(paramMap));
|
||||
// contractInfo가 곧 수주정보이기도 함 (같은 테이블)
|
||||
info = contractInfo;
|
||||
}
|
||||
|
||||
// 수주상태 코드 (CONTRACT_RESULT 코드 사용)
|
||||
code_map.put("contract_result", commonService.bizMakeOptionList("0000963", CommonUtils.nullToEmpty((String)info.get("CONTRACT_RESULT")), "common.getCodeselect"));
|
||||
|
||||
// 환종 코드
|
||||
code_map.put("contract_currency", commonService.bizMakeOptionList("0001533", CommonUtils.nullToEmpty((String)info.get("CONTRACT_CURRENCY")), "common.getCodeselect"));
|
||||
|
||||
request.setAttribute("code_map", code_map);
|
||||
request.setAttribute("info", info);
|
||||
request.setAttribute("contractInfo", contractInfo);
|
||||
request.setAttribute("contractObjId", objId);
|
||||
request.setAttribute("objId", objId);
|
||||
request.setAttribute("actionType", actionType);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return "/contractMgmt/orderRegistFormPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 수주정보 저장
|
||||
* @param session
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/contractMgmt/saveOrderInfo.do")
|
||||
public String saveOrderInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
try {
|
||||
request.setAttribute("RESULT", CommonUtils.getJsonMap(contractMgmtService.saveOrderInfo(request, paramMap)) );
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/ajax/ajaxResult";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -903,6 +903,11 @@
|
||||
,QUANTITY
|
||||
,CUSTOMER_REQUEST
|
||||
,EXCHANGE_RATE
|
||||
,ORDER_DATE
|
||||
,ORDER_UNIT_PRICE
|
||||
,ORDER_SUPPLY_PRICE
|
||||
,ORDER_VAT
|
||||
,ORDER_TOTAL_AMOUNT
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
@@ -965,6 +970,11 @@
|
||||
,#{quantity}
|
||||
,#{customer_request}
|
||||
,#{exchange_rate}
|
||||
,#{order_date}
|
||||
,#{unit_price}
|
||||
,#{supply_price}
|
||||
,#{vat}
|
||||
,#{total_amount}
|
||||
)
|
||||
ON CONFLICT (OBJID) DO
|
||||
UPDATE
|
||||
@@ -1024,6 +1034,11 @@
|
||||
,QUANTITY = #{quantity}
|
||||
,CUSTOMER_REQUEST = #{customer_request}
|
||||
,EXCHANGE_RATE = #{exchange_rate}
|
||||
,ORDER_DATE = #{order_date}
|
||||
,ORDER_UNIT_PRICE = #{unit_price}
|
||||
,ORDER_SUPPLY_PRICE = #{supply_price}
|
||||
,ORDER_VAT = #{vat}
|
||||
,ORDER_TOTAL_AMOUNT = #{total_amount}
|
||||
</update>
|
||||
|
||||
<update id="saveContractMgmtInfo_old" parameterType="map">
|
||||
@@ -1405,6 +1420,11 @@
|
||||
,QUANTITY
|
||||
,CUSTOMER_REQUEST
|
||||
,EXCHANGE_RATE
|
||||
,ORDER_DATE
|
||||
,ORDER_UNIT_PRICE
|
||||
,ORDER_SUPPLY_PRICE
|
||||
,ORDER_VAT
|
||||
,ORDER_TOTAL_AMOUNT
|
||||
,(SELECT COUNT(1) FROM ATTACH_FILE_INFO WHERE TARGET_OBJID::VARCHAR = A.OBJID AND DOC_TYPE='contractMgmt01' AND UPPER(STATUS) = 'ACTIVE') AS FILE_CNT1
|
||||
,(SELECT COUNT(1) FROM ATTACH_FILE_INFO WHERE TARGET_OBJID::VARCHAR = A.OBJID AND DOC_TYPE='contractMgmt02' AND UPPER(STATUS) = 'ACTIVE') AS FILE_CNT2
|
||||
,(SELECT COUNT(1) FROM ATTACH_FILE_INFO WHERE TARGET_OBJID::VARCHAR = A.OBJID AND DOC_TYPE='contractMgmt03' AND UPPER(STATUS) = 'ACTIVE') AS FILE_CNT3
|
||||
@@ -4035,4 +4055,151 @@ ORDER BY ASM.SUPPLY_NAME
|
||||
OBJID::VARCHAR = #{objId}
|
||||
</select>
|
||||
|
||||
<!-- //주문서관리 리스트 -->
|
||||
<select id="orderMgmtGrodList" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
T.*
|
||||
FROM
|
||||
<include refid="contractBase"/> T
|
||||
WHERE 1=1
|
||||
<if test="Year !=null and Year != '' ">
|
||||
AND SUBSTR(CONTRACT_DATE,0,5) = #{Year}
|
||||
</if>
|
||||
|
||||
<if test="category_cd !=null and category_cd != '' ">
|
||||
AND category_cd = #{category_cd}
|
||||
</if>
|
||||
|
||||
<if test="customer_objid !=null and customer_objid != '' ">
|
||||
AND customer_objid = #{customer_objid}
|
||||
</if>
|
||||
|
||||
<if test="product != null and product !='' ">
|
||||
AND product = #{product}
|
||||
</if>
|
||||
|
||||
<if test="status_cd !=null and status_cd !=''">
|
||||
AND status_cd = #{status_cd}
|
||||
</if>
|
||||
|
||||
<if test="result_cd !=null and result_cd !=''">
|
||||
AND result_cd = #{result_cd}
|
||||
</if>
|
||||
<if test="contract_result !=null and contract_result !=''">
|
||||
AND contract_result = #{contract_result}
|
||||
</if>
|
||||
|
||||
<if test="contract_start_date != null and !''.equals(contract_start_date)">
|
||||
AND TO_DATE(CONTRACT_DATE,'YYYY-MM-DD') <![CDATA[ >= ]]> TO_DATE(#{contract_start_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
<if test="contract_end_date != null and !''.equals(contract_end_date)">
|
||||
AND TO_DATE(CONTRACT_DATE,'YYYY-MM-DD') <![CDATA[ <= ]]> TO_DATE(#{contract_end_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
|
||||
<if test="pm_user_id !=null and pm_user_id !=''">
|
||||
AND pm_user_id = #{pm_user_id}
|
||||
</if>
|
||||
<if test="contract_month != null and !''.equals(contract_month)">
|
||||
AND TO_DATE(TO_CHAR(TO_DATE(CONTRACT_DATE,'YYYY-MM-DD'),'YYYY-MM-DD'),'YYYY-MM') <![CDATA[ = ]]> TO_DATE(SUBSTRING(#{contract_month} FROM 1 FOR 4) || '-' || SUBSTRING(#{contract_month} FROM 5 FOR 2), 'YYYY-MM')
|
||||
</if>
|
||||
|
||||
<!-- 견적관리 추가 검색조건 -->
|
||||
<if test="appr_status !=null and appr_status != '' ">
|
||||
AND APPR_STATUS = #{appr_status}
|
||||
</if>
|
||||
|
||||
<if test="area_cd != null and area_cd !='' ">
|
||||
AND AREA_CD = #{area_cd}
|
||||
</if>
|
||||
|
||||
<if test="paid_type != null and paid_type !='' ">
|
||||
AND PAID_TYPE = #{paid_type}
|
||||
</if>
|
||||
|
||||
<if test="search_partNo != null and search_partNo != ''">
|
||||
AND UPPER(PART_NO) LIKE UPPER('%${search_partNo}%')
|
||||
</if>
|
||||
|
||||
<if test="search_partName != null and search_partName != ''">
|
||||
AND UPPER(PART_NAME) LIKE UPPER('%${search_partName}%')
|
||||
</if>
|
||||
|
||||
<if test="search_serialNo != null and search_serialNo != ''">
|
||||
AND UPPER(SERIAL_NO) LIKE UPPER('%${search_serialNo}%')
|
||||
</if>
|
||||
|
||||
<if test="receipt_start_date != null and !''.equals(receipt_start_date)">
|
||||
AND TO_DATE(RECEIPT_DATE,'YYYY-MM-DD') <![CDATA[ >= ]]> TO_DATE(#{receipt_start_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
<if test="receipt_end_date != null and !''.equals(receipt_end_date)">
|
||||
AND TO_DATE(RECEIPT_DATE,'YYYY-MM-DD') <![CDATA[ <= ]]> TO_DATE(#{receipt_end_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
|
||||
<if test="due_start_date != null and !''.equals(due_start_date)">
|
||||
AND TO_DATE(RECEIPT_DATE,'YYYY-MM-DD') <![CDATA[ >= ]]> TO_DATE(#{due_start_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
<if test="due_end_date != null and !''.equals(due_end_date)">
|
||||
AND TO_DATE(DUE_DATE,'YYYY-MM-DD') <![CDATA[ <= ]]> TO_DATE(#{due_end_date}, 'YYYY-MM-DD')
|
||||
</if>
|
||||
ORDER BY REGDATE DESC
|
||||
</select>
|
||||
|
||||
<!-- 영업정보 조회 (수주등록용) -->
|
||||
<select id="getContractInfo" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
OBJID,
|
||||
CONTRACT_NO,
|
||||
CONTRACT_CURRENCY,
|
||||
(SELECT CODE_NAME FROM TB_CODE WHERE CODE_ID = CONTRACT_CURRENCY) AS CONTRACT_CURRENCY_NAME,
|
||||
EXCHANGE_RATE,
|
||||
QUANTITY,
|
||||
PART_NO,
|
||||
PART_NAME,
|
||||
-- 수주정보 (기존 컬럼 활용)
|
||||
CONTRACT_RESULT,
|
||||
PO_NO,
|
||||
ORDER_DATE,
|
||||
ORDER_UNIT_PRICE,
|
||||
ORDER_SUPPLY_PRICE,
|
||||
ORDER_VAT,
|
||||
ORDER_TOTAL_AMOUNT
|
||||
FROM CONTRACT_MGMT
|
||||
WHERE OBJID = #{objId}
|
||||
</select>
|
||||
|
||||
<!-- 수주정보 조회 -->
|
||||
<select id="getOrderInfo" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
OBJID,
|
||||
CONTRACT_NO,
|
||||
CONTRACT_RESULT,
|
||||
PO_NO,
|
||||
ORDER_DATE,
|
||||
QUANTITY,
|
||||
ORDER_UNIT_PRICE AS UNIT_PRICE,
|
||||
ORDER_SUPPLY_PRICE AS SUPPLY_PRICE,
|
||||
ORDER_VAT AS VAT,
|
||||
ORDER_TOTAL_AMOUNT AS TOTAL_AMOUNT,
|
||||
CONTRACT_CURRENCY AS CURRENCY,
|
||||
EXCHANGE_RATE
|
||||
FROM CONTRACT_MGMT
|
||||
WHERE OBJID = #{objId}
|
||||
</select>
|
||||
|
||||
<!-- 수주정보 업데이트 -->
|
||||
<update id="updateOrderInfo" parameterType="map">
|
||||
UPDATE CONTRACT_MGMT
|
||||
SET
|
||||
CONTRACT_RESULT = #{contract_result},
|
||||
PO_NO = #{po_no},
|
||||
ORDER_DATE = #{order_date},
|
||||
QUANTITY = #{quantity},
|
||||
ORDER_UNIT_PRICE = #{unit_price},
|
||||
ORDER_SUPPLY_PRICE = #{supply_price},
|
||||
ORDER_VAT = #{vat},
|
||||
ORDER_TOTAL_AMOUNT = #{total_amount},
|
||||
CONTRACT_CURRENCY = #{contract_currency},
|
||||
EXCHANGE_RATE = #{exchange_rate}
|
||||
WHERE OBJID = #{contractObjId}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1732,4 +1732,160 @@ private String makeEstimateMailContents(Map contractInfo, Map estimateTemplate,
|
||||
|
||||
return contents.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 영업정보 조회 (수주등록용)
|
||||
* @param contractObjId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getContractInfo(String contractObjId) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
paramMap.put("objId", contractObjId);
|
||||
|
||||
resultMap = (Map<String, Object>) sqlSession.selectOne("contractMgmt.getContractInfo", paramMap);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap != null ? resultMap : new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 수주정보 조회 (영업정보와 동일)
|
||||
* @param objId
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> getOrderInfo(String objId) {
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
paramMap.put("objId", objId);
|
||||
|
||||
// TB_CONTRACT_MGMT 테이블에서 조회
|
||||
resultMap = (Map<String, Object>) sqlSession.selectOne("contractMgmt.getOrderInfo", paramMap);
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap != null ? resultMap : new HashMap<String, Object>();
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public Map saveOrderInfo(HttpServletRequest request, Map paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
Map resultList = null;
|
||||
try{
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
PersonBean person = (PersonBean)request.getSession().getAttribute(Constants.PERSON_BEAN);
|
||||
paramMap.put("writer", person.getUserId());
|
||||
|
||||
String contract_objid= CommonUtils.checkNull(paramMap.get("objId"));
|
||||
paramMap.put("objId", contract_objid);
|
||||
int cnt = sqlSession.update("contractMgmt.updateOrderInfo", paramMap);
|
||||
|
||||
//영업 수주 완료시 자동 프로젝트 등록 로직
|
||||
String result_cd= CommonUtils.checkNull(paramMap.get("contract_result"));
|
||||
|
||||
String category_cd= CommonUtils.checkNull(paramMap.get("category_cd"));
|
||||
String target_project_no= CommonUtils.checkNull(paramMap.get("target_project_no_direct"));
|
||||
//int overhaul_order = Integer.parseInt(CommonUtils.checkNull(paramMap.get("overhaul_order"),"1"));
|
||||
//int project_cnt= Integer.parseInt(CommonUtils.checkNull(paramMap.get("facility_qty"), "1"));
|
||||
//long contract_price_currency= Long.parseLong(CommonUtils.checkNull(paramMap.get("contract_price_currency"), "0"));
|
||||
//long contract_price= Long.parseLong(CommonUtils.checkNull(paramMap.get("contract_price"), "0"));
|
||||
|
||||
//수주가와 금액은 대수로 나누어서 등록
|
||||
//paramMap.put("contract_price_currency", contract_price_currency/project_cnt + "");
|
||||
//paramMap.put("contract_price", contract_price/project_cnt + "");
|
||||
|
||||
if("0000964".equals(result_cd) || "0000968".equals(result_cd)){
|
||||
resultList = sqlSession.selectOne("contractMgmt.getProjectListBycontractObjid", paramMap);
|
||||
System.out.println("resultList:::"+resultList);
|
||||
//resultList = sqlSession.selectOne("contractMgmt.getProjectCnt", paramMap);
|
||||
if(null==resultList){
|
||||
|
||||
// for (int i=0; i<project_cnt; i++){
|
||||
|
||||
paramMap.put("OBJID", CommonUtils.createObjId());
|
||||
paramMap.put("is_temp", '1');
|
||||
//paramMap.put("facility_qty", '1');
|
||||
if("0000170".equals(category_cd) || "0000171".equals(category_cd)){
|
||||
paramMap.put("overhaul_project_no", target_project_no);
|
||||
//paramMap.put("overhaul_order", overhaul_order+i);
|
||||
}else{
|
||||
}
|
||||
//프로젝트 등록
|
||||
cnt = sqlSession.update("project.createProject", paramMap);
|
||||
//프로젝트 TASK 등록
|
||||
cnt = sqlSession.insert("contractMgmt.insertProjectTask", paramMap);
|
||||
//프로젝트 SETUP_TASK 등록
|
||||
cnt = sqlSession.insert("contractMgmt.insertProjectSetupTask", paramMap);
|
||||
|
||||
//project_no - unit 폴더 생성
|
||||
//paramMap.put("OBJID", paramMap.get("OBJID"));
|
||||
Map<String,Object> projectInfo = (Map)sqlSession.selectOne("project.getProjectMngInfo", paramMap);
|
||||
|
||||
paramMap.put("contract_objid", paramMap.get("contractObjId"));
|
||||
paramMap.put("customer_product", paramMap.get("mechanical_type"));
|
||||
List<Map<String,Object>> taskUnitList = (ArrayList)sqlSession.selectList("project.getWbsTaskListByProject", paramMap);
|
||||
if(CommonUtils.isNotEmpty(taskUnitList) && !taskUnitList.isEmpty()){
|
||||
String projectNo = (String)projectInfo.get("project_no");
|
||||
String filepath = Constants.FILE_STORAGE+"\\PART_DATA\\";
|
||||
for (Map<String, Object> map : taskUnitList) {
|
||||
File file = new File(filepath+File.separator+projectNo+File.separator+CommonUtils.checkNull((String)map.get("unit_no"))+"-"+CommonUtils.checkNull((String)map.get("task_name")));
|
||||
if(!file.exists()){
|
||||
file.mkdirs();
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
}else{
|
||||
sqlSession.update("project.ModifyProjectByContract", paramMap);
|
||||
}
|
||||
}
|
||||
// if(cnt > 0){
|
||||
//계약완료 일시 메일
|
||||
// if("0000964".equals(CommonUtils.checkNull(paramMap.get("contract_result")))){
|
||||
// commonService.SendMail(paramMap,"CONTRACT_COMP",CommonUtils.checkNull(paramMap.get("pm_user_id")));
|
||||
//그냥 등록일때 메일
|
||||
// }else{
|
||||
// if("regist".equals(CommonUtils.checkNull(paramMap.get("actionType")))){
|
||||
// commonService.SendMail(paramMap,"CONTRACT_REG",CommonUtils.checkNull(paramMap.get("")));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
resultMap.put("result", true);
|
||||
resultMap.put("msg", Message.SAVE_SUCCESS);
|
||||
sqlSession.commit();
|
||||
}catch(Exception e){
|
||||
sqlSession.rollback();
|
||||
resultMap.put("result", false);
|
||||
resultMap.put("msg", Message.SAVE_FAILED);
|
||||
e.printStackTrace();
|
||||
}finally{
|
||||
sqlSession.close();
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user