영업관리_견적관리 pdf 첨부 가능한 추가견적 컬럼 추가
This commit is contained in:
150
WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp
Normal file
150
WebContent/WEB-INF/view/contractMgmt/addEstimatePdfPopup.jsp
Normal file
@@ -0,0 +1,150 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
.pdf-only-notice { font-size:12px; color:#888; margin-bottom:6px; }
|
||||
.file-input-row { display:flex; align-items:center; gap:8px; margin-top:6px; }
|
||||
</style>
|
||||
</head>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#btn_close").click(function(){
|
||||
if(opener && opener.fn_search){ opener.fn_search(); }
|
||||
self.close();
|
||||
});
|
||||
|
||||
fnc_setFileDropZone("pdfDropZone", "${param.targetObjId}", "estimate02", "추가견적PDF", "pdfAreaDraw", false, null, null, "pdf", null);
|
||||
pdfAreaDraw();
|
||||
|
||||
$("#btnUploadPdf").click(function(){
|
||||
var files = $("#filePdf")[0].files;
|
||||
if(files.length > 0){
|
||||
var valid = true;
|
||||
for(var i = 0; i < files.length; i++){
|
||||
if(!files[i].name.toLowerCase().endsWith('.pdf')){
|
||||
Swal.fire("PDF 파일만 첨부할 수 있습니다.\n(" + files[i].name + ")");
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(valid){
|
||||
fnc_fileMultiUpload(files, null, "${param.targetObjId}", "estimate02", "추가견적PDF", null, "pdfAreaDraw", "pdf", null);
|
||||
$("#filePdf").val("");
|
||||
}
|
||||
} else {
|
||||
Swal.fire("선택된 파일이 없습니다.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function pdfAreaDraw(){
|
||||
var param = {"targetObjId":"${param.targetObjId}", "docType":"estimate02"};
|
||||
$.ajax({
|
||||
url:"/common/getFileList.do",
|
||||
type:"POST",
|
||||
data:param,
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(data){
|
||||
$("#pdfFileArea").empty();
|
||||
if(data.length > 0){
|
||||
$.each(data, function(i){
|
||||
var displayNum = data.length - i;
|
||||
var appendText = "<tr>";
|
||||
appendText += "<td style='text-align:center;'>" + displayNum + "차</td>";
|
||||
appendText += "<td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> " + data[i].REAL_FILE_NAME + "</a>";
|
||||
if(data[i].WRITER === "${connectUserId}" || 'plm_admin' === "${connectUserId}"){
|
||||
appendText += "<a href='javascript:pdfFileDelete(\""+data[i].OBJID+"\")'><div class='delete_btn'></div></a>";
|
||||
}
|
||||
appendText += "</td>";
|
||||
appendText += "<td style='text-align:center;'>" + data[i].REGDATE + "</td>";
|
||||
appendText += "<td style='text-align:center;'>" + data[i].FILE_SIZE + "</td>";
|
||||
appendText += "</tr>";
|
||||
$("#pdfFileArea").append(appendText);
|
||||
});
|
||||
} else {
|
||||
$("#pdfFileArea").append("<tr><td colspan='4' style='text-align:center;color:#999;'>첨부된 PDF 파일이 없습니다.</td></tr>");
|
||||
}
|
||||
}
|
||||
});
|
||||
// 부모 창의 그리드 새로고침 (ADD_EST_CNT 카운트 업데이트)
|
||||
if(opener && typeof opener.fn_search == "function"){
|
||||
opener.fn_search();
|
||||
}
|
||||
}
|
||||
|
||||
function pdfFileDelete(fileObjId){
|
||||
if(confirm("파일을 삭제하시겠습니까?")){
|
||||
$.ajax({
|
||||
url:"/common/deleteFileInfo.do",
|
||||
type:"POST",
|
||||
data:{"objId":fileObjId},
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(){ pdfAreaDraw(); }
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<form name="form1" action="" method="post">
|
||||
<section class="business_staff_popup_min_width">
|
||||
<div class="plm_menu_name">
|
||||
<h2><span>추가견적 PDF 첨부</span></h2>
|
||||
</div>
|
||||
<div id="businessPopupFormWrap">
|
||||
<table class="pmsPopupForm">
|
||||
<tr>
|
||||
<td class="input_title align_c">PDF 파일</td>
|
||||
<td colspan="8">
|
||||
<div style="width:100%; overflow:hidden; box-sizing:border-box;">
|
||||
<p class="pdf-only-notice">* PDF 파일만 첨부 가능합니다. (추후 메일 발송 시 견적서 PDF와 합쳐 발송될 예정입니다)</p>
|
||||
<div id="pdfDropZone" class="dropzone" style="width:100% !important; max-width:100%; box-sizing:border-box; margin-bottom:5px;">
|
||||
Drag & Drop PDF Files Here
|
||||
</div>
|
||||
<div class="file-input-row">
|
||||
<input type="file" name="filePdf" id="filePdf" accept=".pdf" multiple>
|
||||
<input type="button" id="btnUploadPdf" value="Upload" class="upload_btns">
|
||||
</div>
|
||||
<div class="spec_data_in_table" style="margin-top:8px;">
|
||||
<div style="height:180px; overflow-y:auto; border:1px solid #cacaca;">
|
||||
<table class="fileListscrollTbody" style="width:100%; table-layout:fixed;">
|
||||
<colgroup>
|
||||
<col style="width:55px;">
|
||||
<col style="width:calc(100% - 215px);">
|
||||
<col style="width:90px;">
|
||||
<col style="width:70px;">
|
||||
</colgroup>
|
||||
<thead style="position:sticky; top:0; background-color:#9e9e9e; z-index:1;">
|
||||
<tr>
|
||||
<td style="text-align:center;">No</td>
|
||||
<td style="text-align:center;">파일명</td>
|
||||
<td style="text-align:center;">등록일</td>
|
||||
<td style="text-align:center;">Size</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="pdfFileArea"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="btn_wrap">
|
||||
<div class="plm_btn_wrap_center">
|
||||
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -414,7 +414,22 @@ var columns = [
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_showEstimateList(objid);
|
||||
}
|
||||
},
|
||||
},
|
||||
// 11-1. 추가견적 PDF 첨부
|
||||
{headerHozAlign : 'center', hozAlign : 'center', minWidth: 55, widthGrow: 0.7, title : '추가견적', field : 'ADD_EST_CNT',
|
||||
formatter: function(cell, formatterParams, onRendered){
|
||||
var cnt = fnc_checkNull(cell.getValue());
|
||||
var icon = '<span style="font-size:14px; cursor:pointer;">📎</span>';
|
||||
if(cnt !== '' && parseInt(cnt) > 0){
|
||||
return icon + ' <span style="color:#1a73e8; font-weight:bold;">' + cnt + '</span>';
|
||||
}
|
||||
return icon;
|
||||
},
|
||||
cellClick:function(e, cell){
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_openAddEstimatePdf(objid);
|
||||
}
|
||||
},
|
||||
// 12. 아마란스 결재상태 (hidden)
|
||||
{title:'AMARANTH_STATUS', field:'AMARANTH_STATUS', visible: false},
|
||||
// 13. 결재상태 (아마란스 전자결재)
|
||||
@@ -556,7 +571,7 @@ function fn_search(){
|
||||
console.log("품목 검색 조건 설정됨:", partObjId);
|
||||
}
|
||||
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/contractMgmt/contractGridList.do", columns, true);
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/contractMgmt/estimateGridList.do", columns, true);
|
||||
}
|
||||
|
||||
function _fnc_datepick(){
|
||||
@@ -635,6 +650,14 @@ function fn_delete(){
|
||||
}
|
||||
|
||||
|
||||
// 추가견적 PDF 첨부 팝업
|
||||
function fn_openAddEstimatePdf(objId){
|
||||
var popup_width = 700;
|
||||
var popup_height = 400;
|
||||
var url = '/contractMgmt/addEstimatePdfPopup.do?targetObjId=' + objId;
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
function fn_FileRegist(objId, docType, docTypeName){
|
||||
var popup_width = 800;
|
||||
var popup_height = 300;
|
||||
|
||||
Reference in New Issue
Block a user