|
|
|
|
@@ -11,9 +11,8 @@
|
|
|
|
|
body, html {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
overflow-x: hidden;
|
|
|
|
|
height: 100%;
|
|
|
|
|
overflow: visible;
|
|
|
|
|
height: auto;
|
|
|
|
|
}
|
|
|
|
|
.plm_menu_name {
|
|
|
|
|
margin: 5px 15px 0 15px !important;
|
|
|
|
|
@@ -22,140 +21,67 @@ body, html {
|
|
|
|
|
margin: 5px 0 !important;
|
|
|
|
|
padding: 5px 0;
|
|
|
|
|
}
|
|
|
|
|
/* global CSS에서 #plmSearchZon 스타일을 가져오므로 추가 스타일만 정의 */
|
|
|
|
|
#csvImportList {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
#plmSearchZon {
|
|
|
|
|
margin-bottom: 0 !important;
|
|
|
|
|
padding-bottom: 5px !important;
|
|
|
|
|
overflow: visible !important;
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
}
|
|
|
|
|
#csvImportTable {
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
.select2-container {
|
|
|
|
|
z-index: 9999 !important;
|
|
|
|
|
}
|
|
|
|
|
#csvImportTable thead td {
|
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
|
}
|
|
|
|
|
#csvImportTable tbody td {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
border: 1px solid #ddd;
|
|
|
|
|
}
|
|
|
|
|
#excelUploadPopupForm .dropzone {
|
|
|
|
|
width: 99.8% !important;
|
|
|
|
|
.select2-dropdown {
|
|
|
|
|
z-index: 9999 !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<script>
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
|
var objId = '<%=request.getParameter("objId")%>';
|
|
|
|
|
|
|
|
|
|
// CSV 파일 업로드 영역 초기화
|
|
|
|
|
fnc_setFileDropZone("csvUploadDropZone", objId, "BOM_CSV_IMPORT", "BOM CSV Import", "setCsvFileArea", true, "csvFileDelete", "/partMng/csvImportFileProc.do");
|
|
|
|
|
|
|
|
|
|
// CSV 파일 업로드 목록 초기화
|
|
|
|
|
$("#csvImportList").hide();
|
|
|
|
|
|
|
|
|
|
// Template Download 클릭 이벤트
|
|
|
|
|
$("#templateDownload").click(function(){
|
|
|
|
|
location.href="/template/BOM_REPORT_CSV_IMPORT_TEMPLATE.xlsx";
|
|
|
|
|
// 엔터키 이벤트 바인딩
|
|
|
|
|
$("#filterPartNo, #filterPartName, #filterVersion").on('keypress', function(e){
|
|
|
|
|
if(e.keyCode == 13 || e.which == 13){
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
fn_applyFilter();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// CSV 파일 업로드 후 처리
|
|
|
|
|
function setCsvFileArea(){
|
|
|
|
|
setUploadCsvFile();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CSV 업로드 파일 목록 표시
|
|
|
|
|
function setUploadCsvFile(){
|
|
|
|
|
var objId = '<%=request.getParameter("objId")%>';
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/common/getFileList.do",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: {"targetObjId": objId, "docType": "BOM_CSV_IMPORT"},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
async: false,
|
|
|
|
|
success: function(data){
|
|
|
|
|
if(null != data && 0 < data.length){
|
|
|
|
|
$("#csvImportList").show();
|
|
|
|
|
$("#csvImportArea").empty();
|
|
|
|
|
|
|
|
|
|
$.each(data, function(i){
|
|
|
|
|
var s = "<tr>";
|
|
|
|
|
s += "<td colspan='2'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
|
|
|
|
|
s += "<td><div class='delete_btn' onclick='javascript:fnc_deleteFile(\""+data[i].OBJID+"\", \"csvFileDelete\")'></div></td>";
|
|
|
|
|
s += "</tr>";
|
|
|
|
|
$("#csvImportArea").append(s);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// CSV 파싱 처리
|
|
|
|
|
parsingCsvFile();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function(jqxhr, status, error){
|
|
|
|
|
Swal.fire('파일 목록을 가져오는데 실패했습니다.');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CSV 파일 삭제 후 처리
|
|
|
|
|
function csvFileDelete(){
|
|
|
|
|
$("#csvImportArea").empty();
|
|
|
|
|
$("#csvImportList").hide();
|
|
|
|
|
Swal.fire('CSV 파일이 삭제되었습니다.');
|
|
|
|
|
parent.frames['leftFrame'].location.reload();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CSV 파싱 처리
|
|
|
|
|
function parsingCsvFile(){
|
|
|
|
|
var objId = '<%=request.getParameter("objId")%>';
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/partMng/parsingCsvFile.do",
|
|
|
|
|
type: "POST",
|
|
|
|
|
data: {"targetObjId": objId, "docType": "BOM_CSV_IMPORT"},
|
|
|
|
|
dataType: "json",
|
|
|
|
|
success: function(data){
|
|
|
|
|
if(data && data.result === 'success'){
|
|
|
|
|
Swal.fire('CSV 파일이 정상적으로 처리되었습니다.');
|
|
|
|
|
parent.frames['leftFrame'].location.reload();
|
|
|
|
|
} else {
|
|
|
|
|
Swal.fire('CSV 파일 처리 중 오류가 발생했습니다.');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error: function(jqxhr, status, error){
|
|
|
|
|
Swal.fire('CSV 파일 처리에 실패했습니다.');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 필터 적용 함수
|
|
|
|
|
function fn_applyFilter() {
|
|
|
|
|
var partType = $("#filterPartType").val();
|
|
|
|
|
var partNo = $("#filterPartNo").val().trim();
|
|
|
|
|
var partName = $("#filterPartName").val().trim();
|
|
|
|
|
var version = $("#filterVersion").val().trim();
|
|
|
|
|
|
|
|
|
|
// leftFrame의 필터 적용 함수 호출
|
|
|
|
|
if(parent.frames['leftFrame'] && parent.frames['leftFrame'].fn_applyFilter) {
|
|
|
|
|
parent.frames['leftFrame'].$("#filterPartType").val(partType);
|
|
|
|
|
parent.frames['leftFrame'].$("#filterPartNo").val(partNo);
|
|
|
|
|
parent.frames['leftFrame'].$("#filterPartName").val(partName);
|
|
|
|
|
parent.frames['leftFrame'].$("#filterVersion").val(version);
|
|
|
|
|
parent.frames['leftFrame'].fn_applyFilter();
|
|
|
|
|
try {
|
|
|
|
|
// 프레임 구조: parent(headerFs) -> parent(main) -> frames[1](bottomFs) -> frames[0](leftFrame)
|
|
|
|
|
var leftFrame = parent.parent.frames[1].frames['leftFrame'];
|
|
|
|
|
|
|
|
|
|
if(leftFrame && leftFrame.fn_applyFilter) {
|
|
|
|
|
leftFrame.$("#filterPartNo").val(partNo);
|
|
|
|
|
leftFrame.$("#filterPartName").val(partName);
|
|
|
|
|
leftFrame.fn_applyFilter();
|
|
|
|
|
} else {
|
|
|
|
|
console.error("leftFrame not found or fn_applyFilter not available");
|
|
|
|
|
}
|
|
|
|
|
} catch(e) {
|
|
|
|
|
console.error("Error accessing leftFrame:", e);
|
|
|
|
|
alert("필터를 적용할 수 없습니다. 프레임 구조를 확인해주세요.");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 필터 초기화 함수
|
|
|
|
|
function fn_resetFilter() {
|
|
|
|
|
$("#filterPartType").val("");
|
|
|
|
|
$("#filterPartNo").val("");
|
|
|
|
|
$("#filterPartName").val("");
|
|
|
|
|
$("#filterVersion").val("");
|
|
|
|
|
|
|
|
|
|
// leftFrame의 필터 초기화 함수 호출
|
|
|
|
|
if(parent.frames['leftFrame'] && parent.frames['leftFrame'].fn_resetFilter) {
|
|
|
|
|
parent.frames['leftFrame'].fn_resetFilter();
|
|
|
|
|
try {
|
|
|
|
|
// 프레임 구조: parent(headerFs) -> parent(main) -> frames[1](bottomFs) -> frames[0](leftFrame)
|
|
|
|
|
var leftFrame = parent.parent.frames[1].frames['leftFrame'];
|
|
|
|
|
|
|
|
|
|
if(leftFrame && leftFrame.fn_resetFilter) {
|
|
|
|
|
leftFrame.fn_resetFilter();
|
|
|
|
|
}
|
|
|
|
|
} catch(e) {
|
|
|
|
|
console.error("Error accessing leftFrame:", e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
@@ -172,17 +98,6 @@ function fn_resetFilter() {
|
|
|
|
|
<div id="plmSearchZon">
|
|
|
|
|
<table>
|
|
|
|
|
<tr>
|
|
|
|
|
<td><label for="filterPartType">제품구분</label></td>
|
|
|
|
|
<td>
|
|
|
|
|
<select id="filterPartType" name="filterPartType" style="width:170px">
|
|
|
|
|
<option value="">선택</option>
|
|
|
|
|
<option value="완제품">완제품</option>
|
|
|
|
|
<option value="반제품">반제품</option>
|
|
|
|
|
<option value="구매품">구매품</option>
|
|
|
|
|
<option value="자재">자재</option>
|
|
|
|
|
</select>
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td class="label"><label for="filterPartNo">품번</label></td>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="filterPartNo" name="filterPartNo">
|
|
|
|
|
@@ -193,11 +108,6 @@ function fn_resetFilter() {
|
|
|
|
|
<input type="text" id="filterPartName" name="filterPartName">
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td class="label"><label for="filterVersion">Version</label></td>
|
|
|
|
|
<td>
|
|
|
|
|
<input type="text" id="filterVersion" name="filterVersion">
|
|
|
|
|
</td>
|
|
|
|
|
|
|
|
|
|
<td>
|
|
|
|
|
<button type="button" class="plm_btns" onclick="fn_applyFilter()">검색</button>
|
|
|
|
|
<button type="button" class="plm_btns" onclick="fn_resetFilter()">초기화</button>
|
|
|
|
|
@@ -205,27 +115,6 @@ function fn_resetFilter() {
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- CSV Upload Section -->
|
|
|
|
|
<div style="margin: 0 8px; max-width: 800px;">
|
|
|
|
|
<div id="partExcelPopupFormWrap">
|
|
|
|
|
<div class="form_popup_title" style="position:relative;"> CSV upload<img src="/images/btnExcel.png" style="position:absolute; top:9px; right:135px;"/><span style="position:absolute; top:0px; right:10px; cursor:pointer;" id="templateDownload">Template Download</span></div>
|
|
|
|
|
<div id="excelUploadPopupForm">
|
|
|
|
|
<div class="fileDnDWrap">
|
|
|
|
|
<div id="csvUploadDropZone" class="dropzone" style="height:50px;">Drag & Drop 엑셀 템플릿</div>
|
|
|
|
|
<div id="csvImportList">
|
|
|
|
|
<table id="csvImportTable" class="excelUploadPopupForm">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr><td colspan="3">CSV 첨부파일</td></tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody id="csvImportArea">
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|