Files
wace_plm/WebContent/WEB-INF/view/admin/warehouseList/warehouseMngList.jsp
2026-02-09 17:07:28 +09:00

218 lines
7.1 KiB
Plaintext

<%@ 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" %>
<%
String searchLocationCode = CommonUtils.checkNull(request.getParameter("searchLocationCode"));
String searchLocationName = CommonUtils.checkNull(request.getParameter("searchLocationName"));
%>
<!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();
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
$("#page").val("1");
fn_search();
}
});
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
//삭제
$("#btnDelete").click(function(){
fn_delete();
});
//ERP 창고 동기화
$("#btnSyncErp").click(function(){
fn_syncErp();
});
fn_search();
});
</script>
<script type="text/javascript">
var columns = [
{title:'OBJID', field:'OBJID', visible:false},
{headerHozAlign:'center', hozAlign:'center', width:'50', title:'NO', field:'RNUM'},
{headerHozAlign:'center', hozAlign:'center', width:'120', title:'위치코드', field:'LOCATION_CODE',
formatter: fnc_createGridAnchorTag,
cellClick: function(e, cell) {
var objid = fnc_checkNull(cell.getData().OBJID);
openwarehouseListInfoPopUp(objid);
}
},
{headerHozAlign:'center', hozAlign:'left', width:'150', title:'위치명', field:'LOCATION_NAME'},
{headerHozAlign:'center', hozAlign:'left', width:'200', title:'위치설명', field:'LOCATION_DESCRIPTION'},
{headerHozAlign:'center', hozAlign:'center', width:'120', title:'가출고코드', field:'OUT_CODE'},
{headerHozAlign:'center', hozAlign:'left', width:'150', title:'가출고거래처명', field:'OUT_CO_NAME'},
{headerHozAlign:'center', hozAlign:'center', width:'80', title:'적합여부', field:'FIT_STATUS'},
{headerHozAlign:'center', hozAlign:'center', width:'100', title:'가용재고여부', field:'AVAILABLE_STATUS'},
{headerHozAlign:'center', hozAlign:'center', width:'80', title:'사용여부', field:'USE_STATUS'},
{headerHozAlign:'center', hozAlign:'center', width:'100', title:'BASELOC_CD', field:'BASE_LOC_CD'},
{headerHozAlign:'center', hozAlign:'center', width:'80', title:'CO_CD', field:'CO_CD'},
{headerHozAlign:'center', hozAlign:'left', width:'150', title:'LOC_NMK', field:'LOC_NMK'},
{headerHozAlign:'center', hozAlign:'center', width:'100', title:'INSERT_ID', field:'INSERT_ID'},
{headerHozAlign:'center', hozAlign:'center', width:'120', title:'INSERT_IP', field:'INSERT_IP'},
{headerHozAlign:'center', hozAlign:'center', width:'150', title:'INSERT_DT', field:'INSERT_DT'},
{headerHozAlign:'center', hozAlign:'center', width:'100', title:'MODIFY_ID', field:'MODIFY_ID'},
{headerHozAlign:'center', hozAlign:'center', width:'120', title:'MODIFY_IP', field:'MODIFY_IP'},
{headerHozAlign:'center', hozAlign:'center', width:'150', title:'MODIFY_DT', field:'MODIFY_DT'},
{headerHozAlign:'center', hozAlign:'left', width:'150', title:'ATTR_NMK', field:'ATTR_NMK'}
];
function fn_search(){
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/admin/warehouseListPagingGridList.do", columns, true);
}
function fn_delete(){
var checkedObj = _tabulGrid.getSelectedData();
if(0 < checkedObj.length){
var objId = fnc_checkNull(checkedObj[0].OBJID);
Swal.fire({
title: '선택한 창고정보를 삭제하시겠습니까?',
text: '',
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: '확인',
cancelButtonText: '취소',
reverseButtons: false
}).then(result => {
if (result.isConfirmed) {
$.ajax({
type: "POST",
url: "/admin/deleteWarehouse.do",
data: {"OBJID":objId},
dataType:"json",
success:function(data){
if(data.result == 'true'){
Swal.fire("삭제되었습니다.");
fn_search();
}
},
error: function(jqxhr, status, error){
}
});
}
});
}else{
Swal.fire("선택한 항목이 없습니다.");
}
}
function openwarehouseListInfoPopUp(objid){
var popup_width = 400;
var popup_height = 800;
var target = "openwarehouseListInfoPopUp";
var url = "/admin/warehouseListFormPopUp.do";
fn_centerPopup(popup_width, popup_height, url, target);
var hiddenForm = document.hiddenForm;
hiddenForm.objid.value = objid;
hiddenForm.target = "openwarehouseListInfoPopUp";
hiddenForm.action = "/admin/warehouseListFormPopUp.do";
hiddenForm.submit();
}
function fn_syncErp(){
if(confirm("ERP 시스템의 창고 정보를 동기화하시겠습니까?")){
// 로딩 표시
Swal.fire({
title: '동기화 중...',
text: 'ERP 창고 데이터를 가져오는 중입니다. 잠시만 기다려주세요.',
allowOutsideClick: false,
didOpen: () => {
Swal.showLoading();
}
});
$.ajax({
type : "POST",
url : "/admin/syncWarehouseDataManual.do",
dataType:"json",
success:function(data){
Swal.close();
if(data.success){
Swal.fire({
icon: 'success',
title: '동기화 완료',
text: data.message
}).then(function(){
fn_search(); // 목록 새로고침
});
} else {
Swal.fire({
icon: 'error',
title: '동기화 실패',
text: data.message
});
}
},
error: function(jqxhr, status, error){
Swal.close();
Swal.fire({
icon: 'error',
title: '오류 발생',
text: '배치 실행 중 오류가 발생했습니다.'
});
}
});
}
}
</script>
</head>
<body style="overflow-y: hidden;">
<form name="hiddenForm" id="hiddenForm">
<input type="hidden" name="objid">
</form>
<form name="form1" id="form1" method="post">
<input type="hidden" name="status" id="status">
<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" onclick="javascript:openwarehouseListInfoPopUp('');"> -->
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
<input type="button" value="ERP 창고 동기화" class="plm_btns" id="btnSyncErp" style="background-color:#4CAF50;color:white;">
</div>
</div>
<div id="plmSearchZon">
<table>
<tbody>
<tr>
<td class="label"><label>위치코드</label></td>
<td><input type="text" name="searchLocationCode" id="searchLocationCode" value="<%=searchLocationCode%>"></td>
<td class="label"><label>위치명</label></td>
<td><input type="text" name="searchLocationName" id="searchLocationName" value="<%=searchLocationName%>"></td>
</tr>
</tbody>
</table>
</div>
<%@include file="/WEB-INF/view/common/common_gridArea.jsp" %>
</div>
</div>
</form>
</body>
</html>