896 lines
30 KiB
Plaintext
896 lines
30 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"%>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*"%>
|
|
<%@include file="/init.jsp"%>
|
|
<%
|
|
// 결재 정보 매핑
|
|
List approvalList = (List)request.getAttribute("approvalList");
|
|
Map<Integer, Map> approvalMap = new HashMap<Integer, Map>();
|
|
Map<Integer, Map> referenceMap = new HashMap<Integer, Map>();
|
|
|
|
if(approvalList != null) {
|
|
for(Object obj : approvalList) {
|
|
Map item = (Map)obj;
|
|
Integer seq = null;
|
|
Object seqObj = item.get("SEQ");
|
|
if(seqObj != null) {
|
|
if(seqObj instanceof Number) {
|
|
seq = ((Number)seqObj).intValue();
|
|
} else {
|
|
seq = Integer.parseInt(seqObj.toString());
|
|
}
|
|
}
|
|
if(seq != null) {
|
|
approvalMap.put(seq, item);
|
|
}
|
|
}
|
|
}
|
|
|
|
// 결재자 정보 (직급별)
|
|
String[] approvalNames = new String[10];
|
|
String[] approvalDates = new String[10];
|
|
String[] approvalStatus = new String[10];
|
|
|
|
for(int i = 1; i <= 9; i++) {
|
|
Map approver = approvalMap.get(i);
|
|
if(approver != null) {
|
|
approvalNames[i] = CommonUtils.checkNull(approver.get("TARGET_USER_NAME"));
|
|
approvalDates[i] = CommonUtils.checkNull(approver.get("PROC_DATE"));
|
|
approvalStatus[i] = CommonUtils.checkNull(approver.get("STATUS"));
|
|
} else {
|
|
approvalNames[i] = "";
|
|
approvalDates[i] = "";
|
|
approvalStatus[i] = "";
|
|
}
|
|
}
|
|
%>
|
|
<!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>
|
|
<style>
|
|
@page {
|
|
size: A4;
|
|
margin: 10mm;
|
|
}
|
|
|
|
@media print {
|
|
body {
|
|
-webkit-print-color-adjust: exact !important;
|
|
print-color-adjust: exact !important;
|
|
}
|
|
.no-print {
|
|
display: none !important;
|
|
}
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
|
|
font-size: 12px;
|
|
margin: 0;
|
|
padding: 10px;
|
|
background: #fff;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
.proposal-container {
|
|
width: 100%;
|
|
max-width: 100%;
|
|
margin: 0 auto;
|
|
border: none;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.proposal-title {
|
|
text-align: center;
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
letter-spacing: 20px;
|
|
padding: 15px 0;
|
|
border-bottom: 2px solid #000;
|
|
}
|
|
|
|
.header-section {
|
|
display: flex;
|
|
border-bottom: 1px solid #000;
|
|
border-inline: 2px solid #000;
|
|
}
|
|
|
|
.header-left {
|
|
flex: 1;
|
|
width: 100%;
|
|
min-width: 200px;
|
|
/* border-right: 1px solid #000; */ /* 결재란 주석 처리로 인해 비활성화 */
|
|
}
|
|
|
|
.header-right {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
/* 하단 기본정보 섹션 (수신및참조 ~ 제목) */
|
|
.sub-info-section {
|
|
border-bottom: 1px solid #000;
|
|
border-inline: 2px solid #000;
|
|
}
|
|
|
|
.sub-info-section .info-table {
|
|
width: 100%;
|
|
}
|
|
|
|
.sub-info-section .info-table td.label {
|
|
width: 90px;
|
|
min-width: 90px;
|
|
}
|
|
|
|
.sub-info-section .info-table td.value {
|
|
width: auto;
|
|
}
|
|
|
|
.info-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.info-table td {
|
|
border: 1px solid #999;
|
|
padding: 2px 4px;
|
|
height: 26px;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.info-table .label {
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
width: 90px;
|
|
min-width: 90px;
|
|
text-align: center;
|
|
}
|
|
|
|
.info-table .value {
|
|
text-align: left;
|
|
}
|
|
|
|
/* 결재란 스타일 */
|
|
.approval-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.approval-table td, .approval-table th {
|
|
border: 1px solid #999;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
padding: 2px;
|
|
}
|
|
|
|
.approval-table .header-row td {
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
height: 22px;
|
|
font-size: 11px;
|
|
}
|
|
|
|
.approval-table .sign-cell {
|
|
height: 50px;
|
|
min-width: 45px;
|
|
position: relative;
|
|
}
|
|
|
|
.approval-table .sign-cell .sign-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
height: 100%;
|
|
}
|
|
|
|
.approval-table .sign-cell .sign-number {
|
|
position: absolute;
|
|
top: 2px;
|
|
left: 4px;
|
|
font-size: 10px;
|
|
color: #ff0066;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.approval-table .sign-cell .sign-name {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.approval-table .sign-cell .sign-image {
|
|
width: 35px;
|
|
height: 35px;
|
|
border: 2px solid #ff0066;
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 2px auto;
|
|
}
|
|
|
|
.approval-table .date-cell {
|
|
height: 40px;
|
|
font-size: 10px;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.approval-table .type-cell {
|
|
width: 25px;
|
|
min-width: 25px;
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
writing-mode: vertical-rl;
|
|
text-orientation: mixed;
|
|
}
|
|
|
|
.approval-table .position-cell {
|
|
width: 30px;
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
}
|
|
|
|
/* 중간 정보 섹션 */
|
|
.middle-section {
|
|
border-bottom: 1px solid #000;
|
|
border-inline: 2px solid #000;
|
|
}
|
|
|
|
.middle-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.middle-table td, .middle-table th {
|
|
border: 1px solid #999;
|
|
padding: 5px 8px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.middle-table .header-cell {
|
|
background-color: #ebf1de;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.middle-table .date-header {
|
|
background-color: #ffff99;
|
|
}
|
|
|
|
.middle-table .total-header {
|
|
background-color: #dce6f1;
|
|
}
|
|
|
|
.middle-table .total-value {
|
|
background-color: #ffffcc;
|
|
font-weight: bold;
|
|
text-align: right;
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* 품목 테이블 */
|
|
.item-section {
|
|
border-bottom: 1px solid #000;
|
|
border-inline: 2px solid #000;
|
|
}
|
|
|
|
.item-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.item-table th, .item-table td {
|
|
border: 1px solid #999;
|
|
padding: 1px 2px;
|
|
text-align: center;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.item-table th {
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
height: 30px;
|
|
}
|
|
|
|
.item-table td {
|
|
height: 35px;
|
|
}
|
|
|
|
.item-table .text-left {
|
|
text-align: left;
|
|
}
|
|
|
|
.item-table .text-right {
|
|
text-align: right;
|
|
}
|
|
|
|
.item-table .total-row td {
|
|
background-color: #fff;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.reference-table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
}
|
|
|
|
.reference-table td {
|
|
border: 1px solid #999;
|
|
padding: 8px;
|
|
}
|
|
|
|
.reference-table .label {
|
|
background-color: #f5f5f5;
|
|
font-weight: bold;
|
|
width: 80px;
|
|
text-align: center;
|
|
}
|
|
|
|
/* 버튼 영역 */
|
|
.btn-area {
|
|
text-align: center;
|
|
padding: 15px;
|
|
background: #f5f5f5;
|
|
height: 50px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: right;
|
|
}
|
|
|
|
.btn-area .plm_btns {
|
|
margin: 0 5px;
|
|
}
|
|
|
|
/* 개정 정보 */
|
|
.revision-info {
|
|
text-align: right;
|
|
font-size: 11px;
|
|
color: #ff0000;
|
|
padding: 5px 10px;
|
|
border-bottom: 1px solid #000;
|
|
}
|
|
|
|
/* 수신및참조 버튼 */
|
|
.edit-btn {
|
|
background: #e0e0e0;
|
|
border: 1px solid #999;
|
|
padding: 2px 8px;
|
|
font-size: 11px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* 입력 필드 스타일 */
|
|
.no-print-border {
|
|
border: 1px solid #ccc;
|
|
font-size: 12px;
|
|
}
|
|
|
|
@media print {
|
|
.no-print-border {
|
|
border: none !important;
|
|
background: transparent !important;
|
|
}
|
|
select.no-print-border {
|
|
-webkit-appearance: none;
|
|
-moz-appearance: none;
|
|
appearance: none;
|
|
}
|
|
}
|
|
|
|
.text-center {
|
|
text-align: center;
|
|
}
|
|
</style>
|
|
<script>
|
|
$(document).ready(function(){
|
|
// 닫기 버튼
|
|
$("#btnClose").click(function(){
|
|
self.close();
|
|
});
|
|
|
|
// 인쇄 버튼
|
|
$("#btnPrint").click(function(){
|
|
window.print();
|
|
});
|
|
|
|
// 저장 버튼
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
// 날짜 피커 초기화
|
|
$(".date_icon").datepicker({
|
|
dateFormat: 'yy-mm-dd',
|
|
changeMonth: true,
|
|
changeYear: true
|
|
});
|
|
});
|
|
|
|
// 숫자 포맷팅
|
|
function formatNumber(num) {
|
|
if(num == null || num == '') return '0';
|
|
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
}
|
|
|
|
// 저장 함수
|
|
function fn_save(){
|
|
// 품목 정보 수집
|
|
var partList = [];
|
|
$(".part-row").each(function(){
|
|
// data-part-objid를 문자열로 가져옴 (attr 사용)
|
|
var partObjId = $(this).attr("data-part-objid");
|
|
var remark = $(this).find(".part-remark").val();
|
|
var deliveryDate = $(this).find(".part-delivery-date").val();
|
|
var unit = $(this).find(".part-unit").val();
|
|
|
|
partList.push({
|
|
PART_OBJID: String(partObjId),
|
|
REMARK: remark,
|
|
DELIVERY_REQUEST_DATE: deliveryDate,
|
|
UNIT: unit
|
|
});
|
|
});
|
|
|
|
$.ajax({
|
|
url: "/salesMng/saveProposal.do",
|
|
type: "POST",
|
|
data: {
|
|
PROPOSAL_OBJID: $("#OBJID").val(),
|
|
RECIPIENT_REF: $("#RECIPIENT_REF").val(),
|
|
EXECUTOR: $("#EXECUTOR").val(),
|
|
EXECUTION_DATE: $("#EXECUTION_DATE").val(),
|
|
TITLE: $("#TITLE").val(),
|
|
PART_LIST: JSON.stringify(partList)
|
|
},
|
|
dataType: "json",
|
|
success: function(data){
|
|
if(data.resultFlag == "S"){
|
|
Swal.fire({
|
|
icon: 'success',
|
|
title: '저장 완료',
|
|
text: data.message
|
|
});
|
|
} else {
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: '저장 실패',
|
|
text: data.message
|
|
});
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: '오류',
|
|
text: '저장 중 오류가 발생했습니다.'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form name="form1" id="form1" method="post">
|
|
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}" />
|
|
|
|
<div class="proposal-container">
|
|
<!-- 제목 -->
|
|
<div class="proposal-title">구 매 품 의 서</div>
|
|
|
|
<!-- 상단 섹션: 기본정보 + 결재란 (품의번호~기안자까지만) -->
|
|
<div class="header-section">
|
|
<!-- 왼쪽: 기본 정보 (품의번호, 작성일자, 기안부서, 기안자) -->
|
|
<div class="header-left">
|
|
<table class="info-table" style="height:100%">
|
|
<tr>
|
|
<td class="label">품 의 번 호</td>
|
|
<td class="value" colspan="3">${resultMap.PROPOSAL_NO}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">작 성 일 자</td>
|
|
<td class="value" colspan="3">${resultMap.REGDATE_TITLE} <c:if test="${not empty resultMap.REGDATE}"><fmt:formatDate value="${resultMap.REGDATE}" pattern="HH:mm"/></c:if></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">기 안 부 서</td>
|
|
<td class="value" colspan="3">
|
|
<c:choose>
|
|
<c:when test="${not empty resultMap.WRITER_NAME}">
|
|
<%
|
|
String writerDeptName = (String)((Map)request.getAttribute("resultMap")).get("WRITER_NAME");
|
|
if(writerDeptName != null && writerDeptName.contains(" ")) {
|
|
out.print(writerDeptName.substring(0, writerDeptName.indexOf(" ")));
|
|
} else {
|
|
out.print(writerDeptName != null ? writerDeptName : "-");
|
|
}
|
|
%>
|
|
</c:when>
|
|
<c:otherwise>-</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">기 안 자</td>
|
|
<td class="value" colspan="3">
|
|
<c:choose>
|
|
<c:when test="${not empty resultMap.WRITER_NAME}">
|
|
<%
|
|
String writerName = (String)((Map)request.getAttribute("resultMap")).get("WRITER_NAME");
|
|
if(writerName != null && writerName.contains(" ")) {
|
|
out.print(writerName.substring(writerName.lastIndexOf(" ") + 1));
|
|
} else {
|
|
out.print(writerName != null ? writerName : "-");
|
|
}
|
|
%>
|
|
</c:when>
|
|
<c:otherwise>-</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 오른쪽: 결재란 (TODO: 결재 기능 구현 후 주석 해제) -->
|
|
<%--
|
|
<div class="header-right">
|
|
<table class="approval-table">
|
|
<!-- 결재 헤더 -->
|
|
<tr class="header-row">
|
|
<td rowspan="3" class="type-cell">결재</td>
|
|
<td>직장</td>
|
|
<td>대리</td>
|
|
<td>팀장</td>
|
|
<td>이사</td>
|
|
<td>상무이<br/>사</td>
|
|
<td>부사장</td>
|
|
<td>대표이<br/>사</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[0]}">
|
|
<span class="sign-number">1</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[0].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[1]}">
|
|
<span class="sign-number">2</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[1].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[2]}">
|
|
<span class="sign-number">3</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[2].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[3]}">
|
|
<span class="sign-number">4</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[3].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[4]}">
|
|
<span class="sign-number">5</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[4].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[5]}">
|
|
<span class="sign-number">6</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[5].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${not empty approvalList[6]}">
|
|
<span class="sign-number">7</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[6].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[0].PROC_DATE}">
|
|
${approvalList[0].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[1].PROC_DATE}">
|
|
${approvalList[1].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[2].PROC_DATE}">
|
|
${approvalList[2].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[3].PROC_DATE}">
|
|
${approvalList[3].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[4].PROC_DATE}">
|
|
${approvalList[4].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[5].PROC_DATE}">
|
|
${approvalList[5].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${not empty approvalList[6].PROC_DATE}">
|
|
${approvalList[6].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
</tr>
|
|
<!-- 합의 헤더 -->
|
|
<tr class="header-row">
|
|
<td rowspan="3" class="type-cell">합의</td>
|
|
<td>주임</td>
|
|
<td>팀장</td>
|
|
<td colspan="5"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="sign-cell">
|
|
<c:if test="${fn:length(approvalList) > 7 and not empty approvalList[7]}">
|
|
<span class="sign-number">8</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[7].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td class="sign-cell">
|
|
<c:if test="${fn:length(approvalList) > 8 and not empty approvalList[8]}">
|
|
<span class="sign-number">9</span>
|
|
<div class="sign-image">
|
|
<span class="sign-name">${approvalList[8].TARGET_USER_NAME}</span>
|
|
</div>
|
|
</c:if>
|
|
</td>
|
|
<td colspan="5"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="date-cell">
|
|
<c:if test="${fn:length(approvalList) > 7 and not empty approvalList[7].PROC_DATE}">
|
|
${approvalList[7].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td class="date-cell">
|
|
<c:if test="${fn:length(approvalList) > 8 and not empty approvalList[8].PROC_DATE}">
|
|
${approvalList[8].PROC_DATE}
|
|
</c:if>
|
|
</td>
|
|
<td colspan="5"></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
--%>
|
|
</div>
|
|
|
|
<!-- 하단 기본정보 (수신및참조, 시행자, 시행일자, 제목) - 입력 가능 -->
|
|
<div class="sub-info-section">
|
|
<table class="info-table" style="border-top: none;">
|
|
<tr>
|
|
<td class="label">수신및참조</td>
|
|
<td class="value" colspan="3">
|
|
<input type="text" name="RECIPIENT_REF" id="RECIPIENT_REF" value="${resultMap.RECIPIENT_REF}" style="width:100%; box-sizing:border-box;" placeholder="구매자재팀,제조관리팀" class="no-print-border"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">시 행 자</td>
|
|
<td class="value" colspan="3">
|
|
<input type="text" name="EXECUTOR" id="EXECUTOR" value="${resultMap.EXECUTOR}" style="width:100%; box-sizing:border-box;" class="no-print-border"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">시행일자</td>
|
|
<td class="value" colspan="3">
|
|
<input type="text" name="EXECUTION_DATE" id="EXECUTION_DATE" value="${resultMap.EXECUTION_DATE_TITLE}" style="width:120px;" class="date_icon no-print-border" autocomplete="off"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="label">제 목</td>
|
|
<td class="value" colspan="3">
|
|
<input type="text" name="TITLE" id="TITLE" value="${resultMap.TITLE}" style="width:100%; box-sizing:border-box;" placeholder="[일반] 구매품의서(${resultMap.WRITER_DEPT})" class="no-print-border"/>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 개정 정보 -->
|
|
<div class="revision-info">[구매품의서 개정 : 22.05.17]</div>
|
|
|
|
<!-- 중간 정보 섹션 -->
|
|
<div class="middle-section">
|
|
<table class="middle-table">
|
|
<tr>
|
|
<th rowspan="2" class="header-cell" style="width:50px;">구<br/>분</th>
|
|
<th class="header-cell" style="width:100px;">부 서</th>
|
|
<th class="header-cell" style="width:100px;">소속팀</th>
|
|
<th class="header-cell" style="width:100px;">날 짜</th>
|
|
<th class="" style="width:150px;">${resultMap.REGDATE_TITLE}</th>
|
|
<th class="total-header" style="width:100px;">총 합 계</th>
|
|
</tr>
|
|
<tr style="height: 50px;">
|
|
<td>
|
|
<c:choose>
|
|
<c:when test="${not empty resultMap.WRITER_NAME}">
|
|
<%
|
|
String writerDept = (String)((Map)request.getAttribute("resultMap")).get("WRITER_NAME");
|
|
if(writerDept != null && writerDept.contains(" ")) {
|
|
out.print(writerDept.substring(0, writerDept.indexOf(" ")));
|
|
} else {
|
|
out.print("-");
|
|
}
|
|
%>
|
|
</c:when>
|
|
<c:otherwise>-</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
<td>
|
|
<c:choose>
|
|
<c:when test="${not empty resultMap.WRITER_NAME}">
|
|
<%
|
|
String writerTeam = (String)((Map)request.getAttribute("resultMap")).get("WRITER_NAME");
|
|
if(writerTeam != null && writerTeam.contains(" ")) {
|
|
out.print(writerTeam.substring(0, writerTeam.indexOf(" ")));
|
|
} else {
|
|
out.print("-");
|
|
}
|
|
%>
|
|
</c:when>
|
|
<c:otherwise>-</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
<td class="header-cell">기 안 자</td>
|
|
<td>
|
|
<c:choose>
|
|
<c:when test="${not empty resultMap.WRITER_NAME}">
|
|
<%
|
|
String writerOnly = (String)((Map)request.getAttribute("resultMap")).get("WRITER_NAME");
|
|
if(writerOnly != null && writerOnly.contains(" ")) {
|
|
out.print(writerOnly.substring(writerOnly.lastIndexOf(" ") + 1));
|
|
} else {
|
|
out.print(writerOnly != null ? writerOnly : "-");
|
|
}
|
|
%>
|
|
</c:when>
|
|
<c:otherwise>-</c:otherwise>
|
|
</c:choose>
|
|
</td>
|
|
<td class="total-value">
|
|
<c:set var="totalAmount" value="0"/>
|
|
<c:forEach var="item" items="${partList}">
|
|
<c:set var="totalAmount" value="${totalAmount + (empty item.TOTAL_PRICE ? 0 : item.TOTAL_PRICE)}"/>
|
|
</c:forEach>
|
|
<fmt:formatNumber value="${totalAmount}" pattern="#,###"/>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 품목 테이블 -->
|
|
<div class="item-section">
|
|
<table class="item-table">
|
|
<thead>
|
|
<tr>
|
|
<th style="width:40px;">No.</th>
|
|
<th style="width:150px;">목 적</th>
|
|
<th style="width:250px;">품명 / 규격</th>
|
|
<th style="width:100px;">납 기 일</th>
|
|
<th style="width:100px;">업 체 명</th>
|
|
<th style="width:60px;">수량</th>
|
|
<th style="width:50px;">단위</th>
|
|
<th style="width:80px;">단가</th>
|
|
<th style="width:100px;">합 계</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<c:choose>
|
|
<c:when test="${not empty partList}">
|
|
<c:forEach var="item" items="${partList}" varStatus="status">
|
|
<tr class="part-row" data-part-objid="${item.OBJID}">
|
|
<td>${status.count}</td>
|
|
<td class="text-left">
|
|
<input type="text" name="REMARK_${item.OBJID}" class="part-remark no-print-border" value="${item.REMARK}" style="width:100%; box-sizing:border-box;"/>
|
|
</td>
|
|
<td class="text-left">
|
|
${item.PART_NAME}
|
|
<c:if test="${not empty item.SPEC}">
|
|
<br/>(${item.SPEC})
|
|
</c:if>
|
|
</td>
|
|
<td class="text-center">
|
|
<input type="text" name="DELIVERY_DATE_${item.OBJID}" class="part-delivery-date date_icon no-print-border" value="${item.DELIVERY_REQUEST_DATE_TITLE}" style="width:100%; box-sizing:border-box;" autocomplete="off"/>
|
|
</td>
|
|
<td class="text-left">${item.VENDOR_NAME}</td>
|
|
<td class="text-right"><fmt:formatNumber value="${item.QTY}" pattern="#,###"/></td>
|
|
<td>
|
|
<select name="UNIT_${item.OBJID}" class="part-unit no-print-border" style="width:100%; box-sizing:border-box;">
|
|
<option value="">선택</option>
|
|
${code_map.unit_list}
|
|
</select>
|
|
<script>
|
|
$(function(){ $("select[name='UNIT_${item.OBJID}']").val("${item.UNIT}"); });
|
|
</script>
|
|
</td>
|
|
<td class="text-right"><fmt:formatNumber value="${item.UNIT_PRICE}" pattern="#,###"/></td>
|
|
<td class="text-right"><fmt:formatNumber value="${item.TOTAL_PRICE}" pattern="#,###"/></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="9" style="height:100px;">등록된 품목이 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<!-- 빈 행 추가 (최소 4행 유지) -->
|
|
<c:if test="${fn:length(partList) < 4}">
|
|
<c:forEach begin="${fn:length(partList) + 1}" end="4">
|
|
<tr>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
<td> </td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:if>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 참조문서 섹션 -->
|
|
<div class="reference-section">
|
|
<table class="reference-table">
|
|
<tr style="height: 50px;">
|
|
<td class="label" style="vertical-align: middle; width: 150px;">참 조 문 서</td>
|
|
<td style="vertical-align: top; padding: 10px;">선택된 문서가 없습니다.</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 버튼 영역 -->
|
|
<div class="btn-area no-print">
|
|
<input type="button" value="저장" class="plm_btns" id="btnSave" style="background:#28a745; color:white;">
|
|
<input type="button" value="인쇄" class="plm_btns" id="btnPrint" style="background:#17a2b8; color:white;">
|
|
<input type="button" value="닫기" class="plm_btns" id="btnClose">
|
|
</div>
|
|
|
|
</form>
|
|
</body>
|
|
</html>
|
|
|