Merge pull request 'V2025101701' (#3) from V2025101701 into main

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2025-10-21 00:26:58 +00:00
14 changed files with 1793 additions and 441 deletions

View File

@@ -0,0 +1,381 @@
<%@ 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>
<script>
// Excel 버튼 이벤트 등록 함수
function fn_bindExcelButton() {
setTimeout(function() {
$('.excelBtn').off('click').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
fn_excel();
return false;
});
}, 100);
}
$(document).ready(function(){
fnc_datepick();
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
fn_search();
});
</script>
<script type="text/javascript">
var columns = [
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '프로젝트번호', field : 'PROJECT_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '주문유형', field : 'ORDER_TYPE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '제품구분', field : 'PRODUCT_TYPE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '국내/해외', field : 'NATION'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '접수일', field : 'RECEIPT_DATE'},
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사', field : 'CUSTOMER'},
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'PAYMENT_TYPE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '품번', field : 'PRODUCT_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '180', title : '품명', field : 'PRODUCT_NAME'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주수량', field : 'ORDER_QUANTITY',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '요청납기', field : 'REQUEST_DATE'},
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사요청사항', field : 'CUSTOMER_REQUEST'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '수주상태', field : 'ORDER_STATUS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '발주번호', field : 'PO_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '발주일', field : 'ORDER_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '주문서첨부', field : 'ORDER_ATTACH',
formatter: fnc_subInfoValueFormatter,
cellClick: function(e, cell){
var objid = cell.getData().PROJECT_NO || cell.getData().SALE_NO;
if(objid){
fn_FileRegist(objid, "ORDER_DOC", "주문서");
}
}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매수량', field : 'SALES_QUANTITY',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매단가', field : 'SALES_UNIT_PRICE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매공급가액', field : 'SALES_SUPPLY_PRICE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매부가세', field : 'SALES_VAT',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매총액', field : 'SALES_TOTAL_AMOUNT',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매원화총액', field : 'SALES_TOTAL_AMOUNT_KRW',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '판매환종', field : 'SALES_CURRENCY'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매환율', field : 'SALES_EXCHANGE_RATE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: 2}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출하일', field : 'SHIPPING_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출하방법', field : 'SHIPPING_METHOD'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '담당자', field : 'MANAGER'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '인도조건', field : 'INCOTERMS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '매출마감현황', field : 'SALES_STATUS'}
];
function fn_search(){
// 그리드 조회 및 Total 합계 업데이트
$.ajax({
url: "/revenueMgmt/revenueGridList.do",
type: "POST",
data: $("#form1").serializeObject(),
dataType: "json",
beforeSend: function(){
_startLoading("Loading...");
},
complete: function(){
_endLoading();
},
success: function(response) {
console.log("Response:", response); // 디버깅용
// 그리드 데이터 설정
if(_tabulGrid){
_tabulGrid.setData(response.RESULTLIST || []);
} else {
// 그리드 초기화
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/revenueMgmt/revenueGridList.do", columns, true);
// 그리드 초기화 후 Excel 버튼 이벤트 등록
fn_bindExcelButton();
}
// Total 합계 업데이트 (소문자 키 사용)
if(response && response.TOTALS){
var totals = response.TOTALS;
console.log("Totals:", totals); // 디버깅용
// PostgreSQL이 소문자로 반환하므로 소문자 키 사용
var supplyPrice = totals.total_supply_price || totals.TOTAL_SUPPLY_PRICE || 0;
var vat = totals.total_vat || totals.TOTAL_VAT || 0;
var amount = totals.total_amount || totals.TOTAL_AMOUNT || 0;
$("#totalSupplyPrice").text(Number(supplyPrice).toLocaleString());
$("#totalVat").text(Number(vat).toLocaleString());
$("#totalAmount").text(Number(amount).toLocaleString());
} else {
console.log("No TOTALS in response"); // 디버깅용
$("#totalSupplyPrice").text("0");
$("#totalVat").text("0");
$("#totalAmount").text("0");
}
// 페이징 HTML 업데이트
if(response.PAGE_HTML){
$(".table_paging_wrap").html(response.PAGE_HTML);
}
},
error: function(jqxhr, status, error){
console.error("Error:", jqxhr, status, error);
_endLoading();
}
});
}
// 엑셀 다운로드 실행 중 플래그
var isExcelDownloading = false;
function fn_excel() {
// 중복 실행 방지
if(isExcelDownloading) {
console.log("엑셀 다운로드가 이미 진행 중입니다.");
return false;
}
isExcelDownloading = true;
try {
// Total 값 가져오기
var totalSupplyPrice = $("#totalSupplyPrice").text().replace(/,/g, '');
var totalVat = $("#totalVat").text().replace(/,/g, '');
var totalAmount = $("#totalAmount").text().replace(/,/g, '');
// 현재 데이터 백업
var currentData = _tabulGrid.getData();
// Total 행 데이터 생성
var totalRow = {
PROJECT_NO: '[ Total 합계 ]',
ORDER_TYPE: '',
PRODUCT_TYPE: '',
NATION: '',
RECEIPT_DATE: '',
CUSTOMER: '',
PAYMENT_TYPE: '',
PRODUCT_NO: '',
PRODUCT_NAME: '',
SERIAL_NO: '',
ORDER_QUANTITY: '',
REQUEST_DATE: '',
CUSTOMER_REQUEST: '',
ORDER_STATUS: '',
PO_NO: '',
ORDER_DATE: '',
ORDER_ATTACH: '',
SALES_QUANTITY: '',
SALES_UNIT_PRICE: '',
SALES_SUPPLY_PRICE: parseFloat(totalSupplyPrice) || 0,
SALES_VAT: parseFloat(totalVat) || 0,
SALES_TOTAL_AMOUNT: parseFloat(totalAmount) || 0,
SALES_TOTAL_AMOUNT_KRW: '',
SALES_CURRENCY: '',
SALES_EXCHANGE_RATE: '',
SHIPPING_DATE: '',
SHIPPING_METHOD: '',
MANAGER: '',
INCOTERMS: '',
SALES_STATUS: ''
};
// 임시로 Total 행 추가
_tabulGrid.addData([totalRow]);
// 엑셀 다운로드
_tabulGrid.download("xlsx", "매출관리_" + new Date().toISOString().slice(0,10) + ".xlsx", {
sheetName: "매출관리"
});
// 다운로드 후 원래 데이터로 복원
setTimeout(function() {
_tabulGrid.setData(currentData);
isExcelDownloading = false;
}, 500);
} catch(e) {
console.error("엑셀 다운로드 오류:", e);
isExcelDownloading = false;
}
return false;
}
function fn_FileRegist(objId, docType, docTypeName){
var popup_width = 800;
var popup_height = 350;
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
var url = "/common/FileRegistPopup.do"+params;
fn_centerPopup(popup_width, popup_height, url);
}
</script>
</head>
<body>
<form name="hiddenForm" id="hiddenForm">
<input type="hidden" name="objid">
<input type="hidden" name="actionType" id="actionType">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="page" id="page" value="1">
<input type="hidden" name="COUNT_PER_PAGE" id="COUNT_PER_PAGE" value="10">
<input type="hidden" name="PAGE_START" id="PAGE_START" value="0">
<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">
<input type="button" value="매출마감" class="plm_btns" id="btnDeadline">
</div>
</div>
<div id="plmSearchZon">
<table>
<colgroup>
<col width="120px">
<col width="20%">
<col width="120px">
<col width="20%">
<col width="120px">
<col width="20%">
<col width="120px">
<col width="*">
</colgroup>
<tr>
<td class="label"><label for="">주문유형</label></td>
<td><select name="orderType" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.orderTypeList}</select></td>
<td class="label"><label for="">제품구분</label></td>
<td><select name="productType" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.productTypeList}</select></td>
<td class="label"><label for="">국내/해외</label></td>
<td>
<select name="nation" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="D">국내</option>
<option value="E">해외</option>
</select>
</td>
<td class="label"><label for="">유/무상</label></td>
<td>
<select name="paymentType" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="N">유상</option>
<option value="Y">무상</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">고객사</label></td>
<td><input type="text" name="customer" /></td>
<td class="label"><label for="">품번</label></td>
<td><input type="text" name="productNo" /></td>
<td class="label"><label for="">품명</label></td>
<td><input type="text" name="productName" /></td>
<td class="label"><label for="">S/N</label></td>
<td><input type="text" name="serialNo" /></td>
</tr>
<tr>
<td class="label"><label for="">수주상태</label></td>
<td><select name="orderStatus" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.orderStatusList}</select></td>
<td class="label"><label for="">발주번호</label></td>
<td><input type="text" name="poNo" /></td>
<td class="label"><label for="">담당자</label></td>
<td><select name="manager" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.managerList}</select></td>
<td class="label"><label for="">인도조건</label></td>
<td>
<select name="incoterms" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="EXW">EXW</option>
<option value="FOB">FOB</option>
<option value="CIF">CIF</option>
<option value="DDP">DDP</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">출하대기 상태</label></td>
<td><select name="shippingStatus" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.shippingStatusList}</select></td>
<td class="label"><label for="">출고방법</label></td>
<td>
<select name="shippingMethod" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="DIRECT">직납</option>
<option value="PARCEL">택배</option>
</select>
</td>
<td class="label"><label for="">요청납기</label></td>
<td colspan="3"><input type="date" name="requestDateFrom" /> ~ <input type="date" name="requestDateTo" /></td>
</tr>
<tr>
<td class="label"><label for="">발주일</label></td>
<td colspan="3"><input type="date" name="orderDateFrom" /> ~ <input type="date" name="orderDateTo" /></td>
<td class="label"><label for="">출고일</label></td>
<td colspan="3"><input type="date" name="shippingDateFrom" /> ~ <input type="date" name="shippingDateTo" /></td>
</tr>
</table>
</div>
<!-- Total 합계 표시 영역 -->
<div style="padding: 15px 0; background: #f5f5f5; border-radius: 4px; margin: 10px 0;">
<table style="width: 100%; max-width: 800px; margin: 0 auto;">
<tr>
<td style="text-align: center; padding: 8px; font-weight: bold; font-size: 14px;">
Total 공급가액: <span id="totalSupplyPrice" style="color: #2196F3;">0</span> 원
</td>
<td style="text-align: center; padding: 8px; font-weight: bold; font-size: 14px;">
Total 부가세: <span id="totalVat" style="color: #FF9800;">0</span> 원
</td>
<td style="text-align: center; padding: 8px; font-weight: bold; font-size: 14px;">
Total 총액: <span id="totalAmount" style="color: #4CAF50;">0</span> 원
</td>
</tr>
</table>
</div>
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
</div>
</div>
</div>
</form>
</body>
</html>

View File

@@ -1,43 +1,68 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ 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.*" %>
<%@ 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">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<script>
$(document).ready(function(){
fnc_datepick();
//엔터키로 조회
fnc_datepick(); // 날짜 선택기 초기화
$('.select2').select2(); // select2 초기화
// 엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
$("#btnExcel").click(function() {
fn_excel();
});
});
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
// 초기 데이터 조회
fn_search();
// 출하지시/판매등록 버튼
$("#btnBulkRegister").click(function(){
fn_bulkRegister();
});
// 분할출하 버튼
$("#btnSplitShipment").click(function(){
fn_splitShipment();
});
});
function fn_openSaleRegPopup(orderNo, saleNo){
var url = "/salesMgmt/salesRegForm.do?orderNo=" + orderNo + "&saleNo=" + saleNo;
window.open(url, "", "width=600, height=400, menubars=no, scrollbars=yes, resizable=yes");
}
function fn_FileRegist(objId, docType, docTypeName){
var popup_width = 800;
var popup_height = 350;
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
var url = "/common/FileRegistPopup.do"+params;
fn_centerPopup(popup_width, popup_height, url);
}
</script>
<script type="text/javascript">
// 새로운 테이블 구조에 맞게 컬럼 정의 수정
var columns = [
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '프로젝트번호', field : 'PROJECT_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '주문유형', field : 'ORDER_TYPE'},
@@ -49,58 +74,172 @@ var columns = [
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '품번', field : 'PRODUCT_NO'},
{headerHozAlign : 'center', hozAlign : 'left', width : '180', title : '품명', field : 'PRODUCT_NAME'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : 'S/N', field : 'SERIAL_NO'},
{headerHozAlign : 'center', hozAlign : 'right', width : '80', title : '수량', field : 'QUANTITY'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '수주수량', field : 'ORDER_QUANTITY',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '요청납기', field : 'REQUEST_DATE'},
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '고객사요청사항', field : 'CUSTOMER_REQUEST'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '수주상태', field : 'ORDER_STATUS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '발주번호', field : 'PO_NO'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '발주일', field : 'ORDER_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '주문서첨부', field : 'ORDER_ATTACH'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '단가', field : 'UNIT_PRICE'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '공급가액', field : 'SUPPLY_PRICE'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '부가세', field : 'VAT'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '총액', field : 'TOTAL_AMOUNT'},
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '환종', field : 'CURRENCY'},
{headerHozAlign : 'center', hozAlign : 'right', width : '80', title : '환율', field : 'EXCHANGE_RATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '130', title : '출하대기 상태', field : 'SHIPPING_STATUS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출고일', field : 'SHIPPING_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출고방법', field : 'SHIPPING_METHOD'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '주문서첨부', field : 'ORDER_ATTACH',
formatter: fnc_subInfoValueFormatter,
cellClick: function(e, cell){
var objid = cell.getData().PROJECT_NO || cell.getData().SALE_NO;
if(objid){
fn_FileRegist(objid, "ORDER_DOC", "주문서");
}
}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '생산 상태', field : 'PRODUCTION_STATUS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출하지시 상태', field : 'SHIPPING_ORDER_STATUS'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매수량', field : 'SALES_QUANTITY',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매단가', field : 'SALES_UNIT_PRICE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매공급가액', field : 'SALES_SUPPLY_PRICE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매부가세', field : 'SALES_VAT',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매총액', field : 'SALES_TOTAL_AMOUNT',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'right', width : '120', title : '판매원화총액', field : 'SALES_TOTAL_AMOUNT_KRW',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: false}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '판매환종', field : 'SALES_CURRENCY'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매환율', field : 'SALES_EXCHANGE_RATE',
formatter: "money", formatterParams: {thousand: ",", symbolAfter: "", precision: 2}
},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출하일', field : 'SHIPPING_DATE'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '출하방법', field : 'SHIPPING_METHOD'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '담당자', field : 'MANAGER'},
{headerHozAlign : 'center', hozAlign : 'right', width : '100', title : '판매수량', field : 'SALES_QUANTITY'},
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '인도조건', field : 'INCOTERMS'},
{headerHozAlign : 'center', hozAlign : 'center', width : '120', title : '매출마감현황', field : 'SALES_STATUS'}
{headerHozAlign : 'center', hozAlign : 'center', width : '100', title : '인도조건', field : 'INCOTERMS'}
];
// 데이터 조회 함수
function fn_search(){
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/salesMgmt/salesMgmtGridList.do", columns, true);
}
function fn_excel() {
document.form1.actionType.value = "excel";
var form = document.form1;
form.action="/salesMgmt/salesMgmtList.do";
form.submit();
// 일괄 출하지시/판매등록 함수
function fn_bulkRegister(){
if(!_tabulGrid){
alert("그리드가 초기화되지 않았습니다.");
return;
}
// 선택된 행 가져오기
var selectedRows = _tabulGrid.getSelectedData();
if(selectedRows.length === 0){
alert("출하지시/판매등록할 항목을 선택해주세요.");
return;
}
// 판매완료된 항목 필터링
var validRows = selectedRows.filter(function(row){
return row.SALES_STATUS != 'Y';
});
if(validRows.length === 0){
alert("선택한 항목 중 출하지시/판매등록 가능한 항목이 없습니다.\n(판매완료된 항목은 제외됩니다)");
return;
}
if(validRows.length !== selectedRows.length){
var excludedCount = selectedRows.length - validRows.length;
if(!confirm("선택한 " + selectedRows.length + "개 항목 중 " + validRows.length + "개 항목만 등록 가능합니다.\n(" + excludedCount + "개는 이미 판매완료 상태입니다)\n\n진행하시겠습니까?")){
return;
}
} else {
if(!confirm("선택한 " + validRows.length + "개 항목을 출하지시/판매등록 하시겠습니까?")){
return;
}
}
// 각 항목에 대해 판매등록 팝업 열기
var popupCount = 0;
var maxPopups = 5; // 최대 동시 팝업 개수 제한
if(validRows.length > maxPopups){
alert("한번에 최대 " + maxPopups + "개까지만 등록 가능합니다.\n선택한 " + validRows.length + "개 중 처음 " + maxPopups + "개만 팝업이 열립니다.");
}
for(var i = 0; i < Math.min(validRows.length, maxPopups); i++){
(function(index){
setTimeout(function(){
fn_openSaleRegPopup(validRows[index].PROJECT_NO, validRows[index].SALE_NO);
}, index * 300); // 0.3초 간격으로 팝업 열기
})(i);
}
}
// 분할출하 함수
function fn_splitShipment(){
if(!_tabulGrid){
alert("그리드가 초기화되지 않았습니다.");
return;
}
// 선택된 행 가져오기
var selectedRows = _tabulGrid.getSelectedData();
if(selectedRows.length === 0){
alert("분할출하할 항목을 선택해주세요.");
return;
}
if(selectedRows.length > 1){
alert("분할출하는 한 번에 하나의 항목만 선택 가능합니다.");
return;
}
var selectedRow = selectedRows[0];
// 분할출하 레코드는 다시 분할 불가
if(selectedRow.RECORD_TYPE === 'SPLIT'){
alert("이미 분할된 항목은 다시 분할할 수 없습니다.");
return;
}
// 수량 확인
var originalQty = selectedRow.ORDER_QUANTITY || 0;
if(originalQty <= 1){
alert("분할할 수 있는 수량이 부족합니다.\n(현재 수량: " + originalQty + ")");
return;
}
// 분할출하 팝업 열기
var params = "?objid=" + selectedRow.SALE_NO
+ "&projectNo=" + encodeURIComponent(selectedRow.PROJECT_NO)
+ "&originalQuantity=" + originalQty;
var url = "/salesMgmt/splitShipmentForm.do" + params;
window.open(url, "splitShipmentPopup", "width=700, height=500, scrollbars=yes, resizable=yes");
}
</script>
</head>
</head>
<body>
<form name="hiddenForm" id="hiddenForm">
<input type="hidden" name="objid">
<input type="hidden" name="actionType" id="actionType">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="page" id="page" value="1">
<input type="hidden" name="actionType" id="actionType">
<div class="min_part_enroll">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name_gdnsi">
<h2>
<span>영업관리_매관리</span>
<span>영업관리_매관리</span>
</h2>
<div class="btnArea">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="매출마감" class="plm_btns" id="btnDeadline">
<input type="button" value="출하지시/판매등록" class="plm_btns" id="btnBulkRegister" style="background-color: #4CAF50; color: white;">
<input type="button" value="분할출하" class="plm_btns" id="btnSplitShipment" style="background-color: #FF9800; color: white;">
</div>
</div>
<div id="plmSearchZon">
@@ -121,18 +260,24 @@ function fn_excel() {
<td class="label"><label for="">제품구분</label></td>
<td><select name="productType" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.productTypeList}</select></td>
<td class="label"><label for="">국내/해외</label></td>
<td><select name="nation" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.nationList}</select></td>
<td>
<select name="nation" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="D">국내</option>
<option value="E">해외</option>
</select>
</td>
<td class="label"><label for="">유/무상</label></td>
<td>
<select name="paymentType" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="N">유상</option>
<option value="Y">무상</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">고객사</label></td>
<select name="paymentType" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="N">유상</option>
<option value="Y">무상</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">고객사</label></td>
<td><input type="text" name="customer" /></td>
<td class="label"><label for="">품번</label></td>
<td><input type="text" name="productNo" /></td>
@@ -150,42 +295,42 @@ function fn_excel() {
<td><select name="manager" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.managerList}</select></td>
<td class="label"><label for="">인도조건</label></td>
<td>
<select name="incoterms" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="EXW">EXW</option>
<option value="FOB">FOB</option>
<option value="CIF">CIF</option>
<option value="DDP">DDP</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">출하대기 상태</label></td>
<td><select name="shippingStatus" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.shippingStatusList}</select></td>
<td class="label"><label for="">출고방법</label></td>
<td>
<select name="shippingMethod" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="DIRECT">직납</option>
<option value="PARCEL">택배</option>
</select>
</td>
<td class="label"><label for="">요청납기</label></td>
<td colspan="3"><input type="date" name="requestDateFrom" /> ~ <input type="date" name="requestDateTo" /></td>
</tr>
<tr>
<td class="label"><label for="">발주일</label></td>
<td colspan="3"><input type="date" name="orderDateFrom" /> ~ <input type="date" name="orderDateTo" /></td>
<td class="label"><label for="">출고일</label></td>
<td colspan="3"><input type="date" name="shippingDateFrom" /> ~ <input type="date" name="shippingDateTo" /></td>
</tr>
<select name="incoterms" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="EXW">EXW</option>
<option value="FOB">FOB</option>
<option value="CIF">CIF</option>
<option value="DDP">DDP</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="">출하대기 상태</label></td>
<td><select name="shippingStatus" class="select2" style="width:120px;"><option value="">전체</option>${codeMap.shippingStatusList}</select></td>
<td class="label"><label for="">출고방법</label></td>
<td>
<select name="shippingMethod" class="select2" style="width:120px;">
<option value="">전체</option>
<option value="DIRECT">직납</option>
<option value="PARCEL">택배</option>
</select>
</td>
<td class="label"><label for="">요청납기</label></td>
<td colspan="3"><input type="date" name="requestDateFrom" /> ~ <input type="date" name="requestDateTo" /></td>
</tr>
<tr>
<td class="label"><label for="">발주일</label></td>
<td colspan="3"><input type="date" name="orderDateFrom" /> ~ <input type="date" name="orderDateTo" /></td>
<td class="label"><label for="">출고일</label></td>
<td colspan="3"><input type="date" name="shippingDateFrom" /> ~ <input type="date" name="shippingDateTo" /></td>
</tr>
</table>
</div>
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
</div>
</div>
</div>
</form>
</body>
</form>
</body>
</html>

View File

@@ -0,0 +1,137 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/init.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>판매 등록</title>
<link rel="stylesheet" href="/css/ions-basic.css">
<script type="text/javascript" src="/js/ions-common.js" ></script>
<script>
$(document).ready(function() {
// select2 초기화
$('.select2').select2();
// 달력 초기화
fnc_makeDatepick();
// 닫기 버튼
$("#btnClose").click(function() {
window.close();
});
// 저장 버튼
$("#btnSave").click(function() {
fn_save();
});
});
function fn_save() {
if(confirm("저장하시겠습니까?")) {
$.ajax({
url: "/salesMgmt/saveSales.do",
type: "POST",
data: $("#form1").serialize(),
dataType: "json",
success: function(data) {
alert(data.msg);
if (data.result) {
opener.fn_search(); // 부모창 그리드 새로고침
window.close(); // 팝업 닫기
}
},
error: function(jqxhr, status, error) {
console.error("Error:", error);
alert("저장에 실패했습니다.");
}
});
}
}
</script>
</head>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="orderNo" value="${param.orderNo}">
<input type="hidden" name="saleNo" value="${param.saleNo}">
<section>
<div class="plm_menu_name">
<h2>
<span>판매 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="15%"/>
<col width="35%"/>
<col width="15%"/>
<col width="35%"/>
</colgroup>
<tbody>
<tr>
<td colspan="4" style="height:15px;"></td>
</tr>
<tr>
<td class="input_title"><label for="serialNo">S/N</label></td>
<td class="input_sub_title">
<input type="text" name="serialNo" id="serialNo" style="width:100%;" />
</td>
<td class="input_title"><label for="shippingDate">* 출고일</label></td>
<td class="input_sub_title">
<input type="text" id="shippingDate" name="shippingDate" required reqTitle="출고일" class="date_icon" style="width: 100px !important;background-color:#fff;" autocomplete="off" />
</td>
</tr>
<tr>
<td class="input_title"><label for="shippingMethod">출고방법</label></td>
<td class="input_sub_title">
<select name="shippingMethod" id="shippingMethod" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
<option value="D_D">내수/직납</option>
<option value="D_P">내수/택배</option>
<option value="D_E">내수/기타</option>
<option value="E">수출</option>
</select>
</td>
<td class="input_title"><label for="manager">담당자</label></td>
<td class="input_sub_title">
<select name="manager" id="manager" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
${codeMap.managerList}
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="salesQuantity">판매수량</label></td>
<td class="input_sub_title">
<input type="number" name="salesQuantity" id="salesQuantity" style="width:100%;" />
</td>
<td class="input_title"><label for="incoterms">인도조건</label></td>
<td class="input_sub_title">
<select name="incoterms" id="incoterms" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
<option value="FOB">FOB</option>
<option value="EXW">EXW</option>
<option value="CIF">CIF</option>
<option value="DDP">DDP</option>
<option value="DAP">DAP</option>
</select>
</td>
</tr>
<tr>
<td colspan="4" style="height:15px;"></td>
</tr>
</tbody>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<input type="button" value="저장" id="btnSave" class="plm_btns">
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>

View File

@@ -0,0 +1,174 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/init.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>분할출하 등록</title>
<link rel="stylesheet" href="/css/ions-basic.css">
<script type="text/javascript" src="/js/ions-common.js" ></script>
<script>
$(document).ready(function() {
// select2 초기화
$('.select2').select2();
// 달력 초기화
fnc_makeDatepick();
// 분할수량 자동 입력
$("#splitQuantity").val("${param.splitQuantity}");
// 닫기 버튼
$("#btnClose").click(function() {
window.close();
});
// 저장 버튼
$("#btnSave").click(function() {
fn_save();
});
});
function fn_save() {
// 필수 입력 검증
if(!$("#shippingDate").val()) {
alert("출고일을 입력해주세요.");
$("#shippingDate").focus();
return;
}
if(!$("#splitQuantity").val() || $("#splitQuantity").val() <= 0) {
alert("분할수량을 입력해주세요.");
$("#splitQuantity").focus();
return;
}
if(confirm("분할출하를 등록하시겠습니까?")) {
$.ajax({
url: "/salesMgmt/saveSplitShipment.do",
type: "POST",
data: $("#form1").serialize(),
dataType: "json",
success: function(data) {
alert(data.msg);
if (data.result) {
if(opener && opener.fn_search) {
opener.fn_search(); // 부모창 그리드 새로고침
}
window.close(); // 팝업 닫기
}
},
error: function(jqxhr, status, error) {
console.error("Error:", error);
alert("저장에 실패했습니다.");
}
});
}
}
</script>
</head>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="objid" value="${param.objid}">
<input type="hidden" name="projectNo" value="${param.projectNo}">
<input type="hidden" name="originalQuantity" value="${param.originalQuantity}">
<section>
<div class="plm_menu_name">
<h2>
<span>분할출하 등록</span>
</h2>
</div>
<div id="businessPopupFormWrap" >
<table class="pmsPopupForm">
<colgroup>
<col width="15%"/>
<col width="35%"/>
<col width="15%"/>
<col width="35%"/>
</colgroup>
<tbody>
<tr>
<td colspan="4" style="height:15px;"></td>
</tr>
<tr>
<td class="input_title"><label for="projectNo">프로젝트번호</label></td>
<td class="input_sub_title">
<input type="text" value="${param.projectNo}" disabled style="width:100%; background-color:#f0f0f0;" />
</td>
<td class="input_title"><label for="originalQuantity">원본수량</label></td>
<td class="input_sub_title">
<input type="text" value="${param.originalQuantity}" disabled style="width:100%; background-color:#f0f0f0;" />
</td>
</tr>
<tr>
<td class="input_title"><label for="splitQuantity">* 분할수량</label></td>
<td class="input_sub_title">
<input type="number" name="splitQuantity" id="splitQuantity" style="width:100%;" required />
</td>
<td class="input_title"><label for="serialNo">S/N</label></td>
<td class="input_sub_title">
<input type="text" name="serialNo" id="serialNo" style="width:100%;" />
</td>
</tr>
<tr>
<td class="input_title"><label for="shippingDate">* 출고일</label></td>
<td class="input_sub_title">
<input type="text" id="shippingDate" name="shippingDate" required class="date_icon" style="width: 100px !important;background-color:#fff;" autocomplete="off" />
</td>
<td class="input_title"><label for="shippingMethod">출고방법</label></td>
<td class="input_sub_title">
<select name="shippingMethod" id="shippingMethod" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
<option value="D_D">내수/직납</option>
<option value="D_P">내수/택배</option>
<option value="D_E">내수/기타</option>
<option value="E">수출</option>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="manager">담당자</label></td>
<td class="input_sub_title">
<select name="manager" id="manager" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
${codeMap.managerList}
</select>
</td>
<td class="input_title"><label for="incoterms">인도조건</label></td>
<td class="input_sub_title">
<select name="incoterms" id="incoterms" type="select" style="width:100%;" class="select2">
<option value="">선택</option>
<option value="FOB">FOB</option>
<option value="EXW">EXW</option>
<option value="CIF">CIF</option>
<option value="DDP">DDP</option>
<option value="DAP">DAP</option>
</select>
</td>
</tr>
<tr>
<td class="input_title"><label for="remark">비고</label></td>
<td class="input_sub_title" colspan="3">
<textarea name="remark" id="remark" style="width:100%; height:60px;"></textarea>
</td>
</tr>
<tr>
<td colspan="4" style="height:15px;"></td>
</tr>
</tbody>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<input type="button" value="저장" id="btnSave" class="plm_btns">
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>