- deliveryMngAcceptanceList: 발주/입고/미입고 금액 및 합계 소수점 2자리 적용 - purchaseCloseList: 입고금액/환율/관세/수입부가세 그리드 포맷 적용 - purchaseCloseList: 마감정보입력 팝업 금액 입력/표시/저장 포맷 처리 Made-with: Cursor
594 lines
25 KiB
Plaintext
594 lines
25 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<c:set var="now" value="<%=new java.util.Date() %>"/>
|
|
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
|
|
<%
|
|
String menuObjId = request.getParameter("menuObjId");
|
|
String menuName = CommonUtils.getMenuName(menuObjId, "매입마감 관리");
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
|
|
<style>
|
|
.select2-selection__choice {
|
|
font-size: 11px;
|
|
background-color: #fff !important;
|
|
border: none !important;
|
|
margin-right: 0px !important;
|
|
}
|
|
.select2-selection__choice__remove {
|
|
display: contents !important;
|
|
}
|
|
.select2-container .select2-selection--multiple {
|
|
min-height: 20px !important;
|
|
}
|
|
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
|
margin-top: 3.5px !important;
|
|
}
|
|
.select2-selection__rendered {
|
|
height: 18px !important;
|
|
}
|
|
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
|
overflow: auto !important;
|
|
}
|
|
</style>
|
|
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
fnc_changePaginationAndTotalCountArea();
|
|
$('.select2').select2();
|
|
fnc_datepick();
|
|
|
|
initPartSelect2Ajax("#SEARCH_PART_NO", "#SEARCH_PART_NAME", "#SEARCH_PART_OBJID");
|
|
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
}
|
|
});
|
|
|
|
// 조회
|
|
$("#btnSearch").click(function(){
|
|
$("#page").val("1");
|
|
fn_search();
|
|
});
|
|
|
|
// 매입마감 버튼
|
|
$("#btnClose").click(function(){
|
|
fn_purchaseClose();
|
|
});
|
|
|
|
$("#project_no").change(function(){
|
|
fn_UnitCodeList(this.value, "unit_code", "");
|
|
});
|
|
|
|
|
|
// 마감정보입력 버튼
|
|
$("#btnDeadlineInfo").click(function(){
|
|
var targetObj = _tabulGrid.getSelectedData();
|
|
|
|
if(0 == targetObj.length){
|
|
Swal.fire("선택된 내용이 없습니다.");
|
|
return false;
|
|
}
|
|
|
|
// 선택된 OBJID 목록
|
|
var objIdList = [];
|
|
for(var i = 0; i < targetObj.length; i++){
|
|
objIdList.push(fnc_checkNull(targetObj[i].ARRIVAL_PLAN_OBJID));
|
|
}
|
|
|
|
// 단건 선택 시 기존 마감정보 불러오기
|
|
var loadExisting = (targetObj.length === 1);
|
|
|
|
function openDeadlineInfoPopup(existingInfo) {
|
|
var taxType = (existingInfo && existingInfo.TAX_TYPE) ? existingInfo.TAX_TYPE : '';
|
|
var taxInvoiceDate = (existingInfo && existingInfo.TAX_INVOICE_DATE) ? existingInfo.TAX_INVOICE_DATE : '';
|
|
var exportDeclNo = (existingInfo && existingInfo.EXPORT_DECL_NO) ? existingInfo.EXPORT_DECL_NO : '';
|
|
var loadingDate = (existingInfo && existingInfo.LOADING_DATE) ? existingInfo.LOADING_DATE : '';
|
|
var foreignType = (existingInfo && existingInfo.FOREIGN_TYPE) ? existingInfo.FOREIGN_TYPE : '';
|
|
var duty = (existingInfo && existingInfo.DUTY) ? existingInfo.DUTY : '';
|
|
var importVat = (existingInfo && existingInfo.IMPORT_VAT) ? existingInfo.IMPORT_VAT : '';
|
|
var exchangeRate = (existingInfo && existingInfo.EXCHANGE_RATE) ? existingInfo.EXCHANGE_RATE : '';
|
|
|
|
// hidden select에서 과세구분 옵션 HTML 가져오기
|
|
var taxTypeOptionsHtml = $('#hiddenTaxTypeList').html();
|
|
|
|
// hidden select에서 국내/해외 옵션 HTML 가져오기
|
|
var foreignTypeOptionsHtml = $('#hiddenForeignTypeList').html();
|
|
|
|
Swal.fire({
|
|
title: '마감정보입력',
|
|
width: '600px',
|
|
html:
|
|
'<div style="padding:10px;">' +
|
|
'<table style="width:100%; border-collapse:collapse;">' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">국내/해외</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;">' +
|
|
' <select id="swal_foreignType" style="width:100%; padding:5px;">' +
|
|
foreignTypeOptionsHtml +
|
|
' </select>' +
|
|
' </td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">환율</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exchangeRate" style="width:95%; padding:5px;"></td>' +
|
|
'</tr>' +
|
|
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">과세구분</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;">' +
|
|
' <select id="swal_taxType" style="width:100%; padding:5px;">' +
|
|
taxTypeOptionsHtml +
|
|
' </select>' +
|
|
' </td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">세금계산서발행일</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_taxInvoiceDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수출신고필증신고번호</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_exportDeclNo" style="width:95%; padding:5px;"></td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">선적일자</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_loadingDate" style="width:95%; padding:5px;" placeholder="YYYY-MM-DD" readonly></td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">관세</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_duty" style="width:95%; padding:5px;"></td>' +
|
|
'</tr>' +
|
|
'<tr>' +
|
|
' <td style="padding:8px; text-align:right; width:40%; font-weight:bold; border:1px solid #ddd; background:#f5f5f5;">수입부가세</td>' +
|
|
' <td style="padding:8px; border:1px solid #ddd;"><input type="text" id="swal_importVat" style="width:95%; padding:5px;"></td>' +
|
|
'</tr>' +
|
|
'</table>' +
|
|
'<div style="margin-top:10px; color:#666; font-size:12px;">선택된 ' + targetObj.length + '건의 데이터에 마감정보를 입력합니다.</div>' +
|
|
'</div>',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#2196F3',
|
|
cancelButtonColor: '#666',
|
|
confirmButtonText: '저장',
|
|
cancelButtonText: '닫기',
|
|
onOpen: function() {
|
|
// 날짜 필드 datepicker 초기화
|
|
$('#swal_taxInvoiceDate').datepicker({
|
|
dateFormat: 'yy-mm-dd',
|
|
changeMonth: true,
|
|
changeYear: true
|
|
});
|
|
$('#swal_loadingDate').datepicker({
|
|
dateFormat: 'yy-mm-dd',
|
|
changeMonth: true,
|
|
changeYear: true
|
|
});
|
|
// 기존 데이터 세팅
|
|
if(taxType) $('#swal_taxType').val(taxType);
|
|
if(taxInvoiceDate) $('#swal_taxInvoiceDate').val(taxInvoiceDate);
|
|
if(exportDeclNo) $('#swal_exportDeclNo').val(exportDeclNo);
|
|
if(loadingDate) $('#swal_loadingDate').val(loadingDate);
|
|
if(foreignType) $('#swal_foreignType').val(foreignType);
|
|
if(duty) $('#swal_duty').val(formatMoney(duty));
|
|
if(importVat) $('#swal_importVat').val(formatMoney(importVat));
|
|
if(exchangeRate) $('#swal_exchangeRate').val(formatMoney(exchangeRate));
|
|
|
|
// 금액 입력 필드 포맷 (keyup: 천단위 콤마, blur: 소수점 2자리)
|
|
$('#swal_exchangeRate, #swal_duty, #swal_importVat').on('keyup', function(){
|
|
var val = this.value.replace(/[^0-9.]/g, '');
|
|
var parts = val.split('.');
|
|
if(parts.length > 2) val = parts[0] + '.' + parts.slice(1).join('');
|
|
if(parts[0]) parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
this.value = parts.join('.');
|
|
}).on('blur', function(){
|
|
var v = this.value.replace(/,/g, '');
|
|
if(v && !isNaN(v)) this.value = formatMoney(v);
|
|
});
|
|
},
|
|
preConfirm: function() {
|
|
return {
|
|
taxType: $('#swal_taxType').val(),
|
|
taxInvoiceDate: $('#swal_taxInvoiceDate').val(),
|
|
exportDeclNo: $('#swal_exportDeclNo').val(),
|
|
loadingDate: $('#swal_loadingDate').val(),
|
|
foreignType: $('#swal_foreignType').val(),
|
|
duty: removeComma($('#swal_duty').val()),
|
|
importVat: removeComma($('#swal_importVat').val()),
|
|
exchangeRate: removeComma($('#swal_exchangeRate').val())
|
|
};
|
|
}
|
|
}).then(function(result) {
|
|
if (result.isConfirmed) {
|
|
var formData = result.value;
|
|
|
|
$.ajax({
|
|
url: "/purchaseOrder/saveArrivalPlanDeadlineInfo.do",
|
|
type: "POST",
|
|
data: {
|
|
"objIdList": objIdList.join(','),
|
|
"taxType": formData.taxType,
|
|
"taxInvoiceDate": formData.taxInvoiceDate,
|
|
"exportDeclNo": formData.exportDeclNo,
|
|
"loadingDate": formData.loadingDate,
|
|
"foreignType": formData.foreignType,
|
|
"duty": formData.duty,
|
|
"importVat": formData.importVat,
|
|
"exchangeRate": formData.exchangeRate
|
|
},
|
|
dataType: "json",
|
|
success: function(data){
|
|
Swal.fire({
|
|
title: data.msg || '처리되었습니다.',
|
|
icon: data.result ? 'success' : 'error'
|
|
}).then(function() {
|
|
if(data.result) fn_search();
|
|
});
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire({
|
|
title: '마감정보 저장 중 오류가 발생했습니다.',
|
|
text: error || jqxhr.statusText || '서버 오류',
|
|
icon: 'error'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
// 단건 선택 시 그리드 데이터에서 기존 마감정보 가져오기
|
|
if(loadExisting) {
|
|
var row = targetObj[0];
|
|
openDeadlineInfoPopup({
|
|
TAX_TYPE: fnc_checkNull(row.TAX_TYPE),
|
|
TAX_INVOICE_DATE: fnc_checkNull(row.TAX_INVOICE_DATE),
|
|
EXPORT_DECL_NO: fnc_checkNull(row.EXPORT_DECL_NO),
|
|
LOADING_DATE: fnc_checkNull(row.LOADING_DATE),
|
|
FOREIGN_TYPE: fnc_checkNull(row.FOREIGN_TYPE),
|
|
DUTY: fnc_checkNull(row.DUTY),
|
|
EXCHANGE_RATE: fnc_checkNull(row.EXCHANGE_RATE),
|
|
IMPORT_VAT: fnc_checkNull(row.IMPORT_VAT)
|
|
});
|
|
} else {
|
|
openDeadlineInfoPopup(null);
|
|
}
|
|
});
|
|
|
|
fn_search();
|
|
});
|
|
|
|
var columns = [
|
|
{title:'STATUS', field:'STATUS', visible:false, frozen:true},
|
|
{title:'PURCHASE_ORDER_MASTER_OBJID', field:'PURCHASE_ORDER_MASTER_OBJID', visible:false, frozen:true},
|
|
{title:'PURCHASE_ORDER_PART_OBJID', field:'PURCHASE_ORDER_PART_OBJID', visible:false, frozen:true},
|
|
{title:'FORM_TYPE', field:'FORM_TYPE', visible:false, frozen:true},
|
|
{title:'ARRIVAL_PLAN_OBJID', field:'ARRIVAL_PLAN_OBJID', visible:false, frozen:true},
|
|
{title:'SUB_LOCATION', field:'SUB_LOCATION', visible:false, frozen:true},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:110, widthGrow:0.9, title:'품의서 No', field:'PROPOSAL_NO', frozen:true,
|
|
formatter: fnc_createGridAnchorTag,
|
|
cellClick: function(e, cell){
|
|
fn_openProposalFormPopUp(cell.getData().SALES_REQUEST_OBJID);
|
|
}
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:110, widthGrow:0.9, title:'발주서 No', field:'PURCHASE_ORDER_NO', frozen:true,
|
|
formatter: fnc_createGridAnchorTag,
|
|
cellClick: function(e, cell){
|
|
var objId = fnc_checkNull(cell.getData().PURCHASE_ORDER_MASTER_OBJID);
|
|
var formType = fnc_checkNull(cell.getData().FORM_TYPE, 'general');
|
|
fn_formPopUp(objId, formType);
|
|
}
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:120, widthGrow:0.9, title:'프로젝트번호', field:'PROJECT_NO', frozen:true},
|
|
{headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.5, title:'부품품번', field:'COMPONENT_PART_NO', frozen:true},
|
|
{headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.5, title:'품번', field:'PART_NO', frozen:true},
|
|
{headerHozAlign:'center', hozAlign:'left', minWidth:150, widthGrow:2, title:'품명', field:'PART_NAME', frozen:true},
|
|
{headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:1.2, title:'공급업체', field:'PARTNER_NAME'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:60, widthGrow:0.6, title:'환종', field:'CURRENCY_NAME'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:0.7, title:'입고일', field:'RECEIPT_DATE'},
|
|
//{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:0.8, title:'입고요청일', field:'DELIVERY_REQUEST_DATE'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1, title:'구매담당자', field:'WRITER_NAME'},
|
|
// {headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:0.8, title:'발주수량', field:'ORDER_QTY',
|
|
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
// },
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:0.8, title:'입고수량', field:'RECEIPT_QTY',
|
|
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
},
|
|
// {headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:0.8, title:'미입고수량', field:'NON_DELIVERY_QTY',
|
|
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
// },
|
|
// {headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'발주금액', field:'TOTAL_SUPPLY_PRICE',
|
|
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
// },
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'입고금액', field:'TOTAL_DELIVERY_PRICE',
|
|
formatter: function(cell) {
|
|
var value = cell.getValue();
|
|
if(!value || value === '' || value === '0') return '';
|
|
var cn = cell.getRow().getData().CURRENCY_NAME || '';
|
|
var s = '';
|
|
if(cn.includes('원') || cn === 'KRW') s = '₩';
|
|
else if(cn.includes('달러') || cn === 'USD') s = '$';
|
|
else if(cn.includes('유로') || cn === 'EUR') s = '€';
|
|
else if(cn.includes('엔') || cn === 'JPY') s = '¥';
|
|
else if(cn.includes('위안') || cn === 'CNY') s = '¥';
|
|
return s + Number(value).toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
|
|
}
|
|
},
|
|
// {headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1, title:'미입고금액', field:'TOTAL_NOT_DELIVERY_PRICE',
|
|
// formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
// },
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.1, title:'수입검사 검사현황', field:'INSPECTION_STATUS'},
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:90, widthGrow:1.1, title:'처리결과 폐기수량', field:'DEFECT_QTY',
|
|
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:0.9, title:'확정입고수량', field:'CONFIRMED_QTY',
|
|
formatter:"money", formatterParams:{thousand:",", symbolAfter:"p", precision:false}
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'계정과목', field:'SUB_LOCATION_NAME'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'국내/해외', field:'FOREIGN_TYPE_NAME'},
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'환율', field:'EXCHANGE_RATE',
|
|
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'과세구분', field:'TAX_TYPE_NAME'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'세금계산서발행일', field:'TAX_INVOICE_DATE'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'수출신고필증신고번호', field:'EXPORT_DECL_NO'},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:100, widthGrow:1.2, title:'선적일자', field:'LOADING_DATE'},
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'관세', field:'DUTY',
|
|
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'right', minWidth:100, widthGrow:1.2, title:'수입부가세', field:'IMPORT_VAT',
|
|
formatter: function(cell){ var v = cell.getValue(); if(!v || v === '') return ''; return formatMoney(v); }
|
|
},
|
|
{headerHozAlign:'center', hozAlign:'center', minWidth:85, widthGrow:0.6, title:'매입마감', field:'PURCHASE_CLOSE_DATE'}
|
|
];
|
|
|
|
function fn_search(){
|
|
var selectedValues = $("#project_no").val();
|
|
$('<input>').attr({
|
|
type: 'hidden',
|
|
name: 'project_nos',
|
|
value: selectedValues
|
|
}).appendTo('#form1');
|
|
|
|
var selectedIdValues = $("#sales_mng_user_id").val();
|
|
$('input[name="sales_mng_user_ids"]').remove();
|
|
$('<input>').attr({
|
|
type: 'hidden',
|
|
name: 'sales_mng_user_ids',
|
|
value: selectedIdValues
|
|
}).appendTo('#form1');
|
|
|
|
_tabulGrid = fnc_tabul_search(_tabul_layout_fitDataStretch, _tabulGrid, "/purchaseOrder/purchaseCloseGridList.do", columns, true);
|
|
|
|
if(_tabulGrid) {
|
|
_tabulGrid.off("renderComplete");
|
|
_tabulGrid.on("renderComplete", function(){
|
|
fnc_calculateContentHeight("gridDiv", 30);
|
|
});
|
|
}
|
|
|
|
$(window).off("resize.gridHeight").on("resize.gridHeight", function() {
|
|
fnc_calculateContentHeight("gridDiv", 30);
|
|
});
|
|
}
|
|
|
|
// 품의서 상세 팝업
|
|
function fn_openProposalFormPopUp(objId){
|
|
var url = "/salesMng/proposalFormPopUp.do?PROPOSAL_OBJID=" + fnc_checkNull(objId);
|
|
window.open(url, "proposalFormPopUp", "width=1200,height=900,scrollbars=yes,resizable=yes");
|
|
}
|
|
|
|
// 발주서 팝업
|
|
function fn_formPopUp(objId, formType){
|
|
var popup_width = 1460;
|
|
var popup_height = 1050;
|
|
|
|
formType = fnc_checkNull(formType, 'general');
|
|
|
|
var hiddenForm = document.hiddenForm;
|
|
var target = "";
|
|
var url = "";
|
|
|
|
if(formType == 'outsourcing'){
|
|
target = "purchaseOrderFormPopup_outsourcing";
|
|
url = "/purchaseOrder/purchaseOrderFormPopup_outsourcing.do";
|
|
popup_width = 1200;
|
|
popup_height = 900;
|
|
} else if(formType == 'english'){
|
|
target = "purchaseOrderFormPopup_english";
|
|
url = "/purchaseOrder/purchaseOrderFormPopup_english.do";
|
|
popup_width = 1100;
|
|
popup_height = 900;
|
|
} else if(formType == 'general'){
|
|
target = "purchaseOrderFormPopup_general";
|
|
url = "/purchaseOrder/purchaseOrderFormPopup_general.do";
|
|
popup_width = 1000;
|
|
popup_height = 900;
|
|
} else {
|
|
target = "purchaseOrderFormPopup_new";
|
|
url = "/purchaseOrder/purchaseOrderFormPopup_new.do";
|
|
}
|
|
|
|
fn_centerPopup(popup_width, popup_height, "", target);
|
|
|
|
hiddenForm.PURCHASE_ORDER_MASTER_OBJID.value = objId;
|
|
hiddenForm.action = url;
|
|
hiddenForm.target = target;
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
// 매입마감 처리 (입고건 단위)
|
|
function fn_purchaseClose(){
|
|
var selected = _tabulGrid.getSelectedData();
|
|
if(selected.length == 0){
|
|
Swal.fire("선택된 데이터가 없습니다.");
|
|
return;
|
|
}
|
|
|
|
var alreadyClosed = selected.filter(function(item){
|
|
return fnc_checkNull(item.PURCHASE_CLOSE_DATE) != '';
|
|
});
|
|
if(alreadyClosed.length > 0){
|
|
Swal.fire("이미 매입마감 처리된 건이 포함되어 있습니다.");
|
|
return;
|
|
}
|
|
|
|
var objIds = selected.map(function(item){
|
|
return item.ARRIVAL_PLAN_OBJID;
|
|
});
|
|
|
|
Swal.fire({
|
|
title: '매입마감',
|
|
text: '선택한 ' + selected.length + '건을 매입마감 처리하시겠습니까?',
|
|
icon: 'question',
|
|
showCancelButton: true,
|
|
confirmButtonText: '확인',
|
|
cancelButtonText: '취소'
|
|
}).then((result) => {
|
|
if(result.isConfirmed){
|
|
$.ajax({
|
|
url: '/purchaseOrder/purchaseCloseByArrival.do',
|
|
type: 'POST',
|
|
data: { objIds: objIds.join(',') },
|
|
dataType: 'json',
|
|
success: function(response){
|
|
if(response.result == 'SUCCESS'){
|
|
Swal.fire('매입마감 처리가 완료되었습니다.').then(function(){
|
|
fn_search();
|
|
});
|
|
} else {
|
|
Swal.fire('매입마감 처리 중 오류가 발생했습니다.');
|
|
}
|
|
},
|
|
error: function(){
|
|
Swal.fire('서버 통신 중 오류가 발생했습니다.');
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<body class="bodyNoScroll">
|
|
<form name="hiddenForm" id="hiddenForm" method="post">
|
|
<input type="hidden" name="checkArr" id="checkArr">
|
|
<input type="hidden" name="PURCHASE_ORDER_MASTER_OBJID" id="PURCHASE_ORDER_MASTER_OBJID">
|
|
<input type="hidden" name="PURCHASE_ORDER_NO" id="PURCHASE_ORDER_NO">
|
|
<input type="hidden" name="actionType" id="actionType">
|
|
</form>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<textarea style="width:0px; height:0px; visibility: hidden;" id="jsonLevel3_csmCategory">${code_map.jsonLevel3_csmCategory}</textarea>
|
|
<select id="hiddenTaxTypeList" style="display:none;">
|
|
<option value="">선택</option>
|
|
<option value="0900218">과세매입</option>
|
|
<option value="0900219">영세매입</option>
|
|
<option value="0900220">수입</option>
|
|
</select>
|
|
<select id="hiddenForeignTypeList" style="display:none;">
|
|
<option value="">선택</option>
|
|
<option value="0001220">국내</option>
|
|
<option value="0001221">해외</option>
|
|
</select>
|
|
<div class="content-box" style="height: 99.3%;">
|
|
<div class="content-box-s">
|
|
<div class="plm_menu_name_gdnsi">
|
|
<h2>
|
|
<span><%=menuName%></span>
|
|
</h2>
|
|
<div class="btnArea">
|
|
<input type="button" class="plm_btns" value="조회" id="btnSearch">
|
|
<input type="button" class="plm_btns"value="마감정보입력" id="btnDeadlineInfo" style="background-color: #2196F3; color: white;">
|
|
<input type="button" class="plm_btns" value="매입마감" id="btnClose">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="plmSearchZon">
|
|
<table>
|
|
<tr>
|
|
<td><label for="Year">년도</label></td>
|
|
<td>
|
|
<select name="Year" id="Year" class="select2" autocomplete="off" style="width:170px;">
|
|
<option value="">선택</option>
|
|
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
|
|
<option value="${req_year}"${param.Year eq req_year ? 'selected':''}>${req_year}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
|
|
<td><label for="">고객사</label></td>
|
|
<td><select name="customer_cd" id="customer_cd" class="select2" autocomplete="off" style="width:170px;"><option value="">선택</option>${code_map.customer_cd}</select></td>
|
|
|
|
<td><label for="project_no">프로젝트번호</label></td>
|
|
<td>
|
|
<select name="project_no" id="project_no" style="width:253px;" class="select2" autocomplete="off" multiple="multiple">
|
|
<option value="">선택</option>
|
|
${code_map.project_no}
|
|
</select>
|
|
</td>
|
|
|
|
<td><label for="">발주No.</label></td>
|
|
<td><input type="text" name="purchase_order_no" id="purchase_order_no" autocomplete="off" value="${param.purchase_order_no}" style="width:185px;"/></td>
|
|
|
|
<td><label for="">규격</label></td>
|
|
<td><input type="text" name="SEARCH_PART_SPEC" id="SEARCH_PART_SPEC" autocomplete="off" value="${param.SEARCH_PART_SPEC}" style=""/></td>
|
|
|
|
<td><label for="">품명</label></td>
|
|
<td>
|
|
<select name="SEARCH_PART_NAME" id="SEARCH_PART_NAME" class="select2-part" style="width:200px;">
|
|
<option value="">품명 선택</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><label for="">공급업체</label></td>
|
|
<td><select name="partner_objid" id="partner_objid" class="select2" autocomplete="off" style="width:170px;"><option value="">선택</option>${code_map.partner_objid}</select></td>
|
|
|
|
<td><label for="">구매담당자</label></td>
|
|
<td><select name="sales_mng_user_id" id="sales_mng_user_id" class="select2" autocomplete="off" style="width:170px;" multiple="multiple"><option value="">선택</option>${code_map.sales_mng_user_id}</select></td>
|
|
|
|
<td class=""><label>입고일</label></td>
|
|
<td>
|
|
<input type="text" name="receipt_start_date" id="receipt_start_date" style="width:120px;" autocomplete="off" value="${param.receipt_start_date}" class="date_icon">~
|
|
<input type="text" name="receipt_end_date" id="receipt_end_date" style="width:120px;" autocomplete="off" value="${param.receipt_end_date}" class="date_icon">
|
|
</td>
|
|
|
|
<!-- <td class=""><label>발주일</label></td>
|
|
<td>
|
|
<input type="text" name="reg_start_date" id="reg_start_date" style="width:87px;" autocomplete="off" value="${param.reg_start_date}" class="date_icon">~
|
|
<input type="text" name="reg_end_date" id="reg_end_date" style="width:87px;" autocomplete="off" value="${param.reg_end_date}" class="date_icon">
|
|
</td> -->
|
|
|
|
<td><label for="">매입마감</label></td>
|
|
<td>
|
|
<select name="close_status" id="close_status" class="select2" autocomplete="off" style="width:185px;">
|
|
<option value="">선택</option>
|
|
<option value="Y">마감</option>
|
|
<option value="N">미마감</option>
|
|
</select>
|
|
</td>
|
|
<td><label for="">품번</label></td>
|
|
<td>
|
|
<select name="SEARCH_PART_NO" id="SEARCH_PART_NO" class="select2-part" style="width:120px;">
|
|
<option value="">품번 선택</option>
|
|
</select>
|
|
<input type="hidden" name="SEARCH_PART_OBJID" id="SEARCH_PART_OBJID" value="">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html>
|