Files
wace_plm/WebContent/WEB-INF/view/salesMng/salesLongDeliveryList_old.jsp
chpark da06c4684c Initial commit: WACE PLM with database initialization features
- Add Docker Compose configurations for dev, prod, and standalone environments
- Add database initialization scripts (init-db.sh, init-db-docker.sh)
- Add enhanced start-docker-linux.sh with DB init support
- Add comprehensive database initialization guide
- Support for automatic dbexport.pgsql import on first run
- Include safety checks for production environment
2025-08-29 15:46:08 +09:00

348 lines
15 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_jqGrid.jsp"%><%--Expression Language ::: ${fn:escapeXml(str1)} --%>
<%
//부품선택팝업
boolean isSelectPopup = (CommonUtils.checkNull(request.getParameter("actionType"))).equals("SelectPopup");
%>
<c:set var="now" value="<%=new java.util.Date() %>"/>
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
</head>
<script type="text/javascript">
$(document).ready(function(){
$("#grid1").jqGrid('setFrozenColumns');
$('.select2').select2();
fnc_datepick();
//조회
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
//삭제
$("#btnDel").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow(grid1);
if(selectedRowIds.length==0){
Swal.fire("삭제할 행을 선택해주십시오.");
return false;
}
let objIds = selectedRowIds.map(function(o,i){
return grid1.getRowData(o).OBJID;
});
$.ajax({
url:"/salesMng/deleteSalesLongDeliveryInfo.do"
,type:"POST"
,data: "objIds="+objIds.join(",")
,dataType:"json"
,async:false
,success:function(data){
Swal.fire(data.message);
fn_search();
self.close();
}
,error: function(jqxhr, status, error){
}
});
});
//등록
$("#btnReg").click(function(){
fn_popupStandard("");
});
//자제투입
$("#btnInput").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow(grid1);
if(selectedRowIds.length==0){
Swal.fire("자제투입할 행을 선택해주십시오.");
return false;
}else if(selectedRowIds.length>1){
Swal.fire("한번에 한개의 행만 가능합니다.");
return false;
}else{
var objid = grid1.getRowData(selectedRowIds[0]).OBJID;
fn_popupInput(objid);
}
});
//장납기예측수량등록
$("#btnPredict").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow(grid1);
if(selectedRowIds.length==0){
Swal.fire("장납기예측수량등록할 행을 선택해주십시오.");
return false;
}else if(selectedRowIds.length>1){
Swal.fire("한번에 한개의 행만 가능합니다.");
return false;
}else{
var objid = grid1.getRowData(selectedRowIds[0]).OBJID;
fn_popupPredict(objid, "");
}
});
//추가 : 장납기부품 선택 팝업으로 사용시
$("#btnAdd").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow($("#grid1"));
if(selectedRowIds.length==0){
Swal.fire("추가할 행을 선택해주십시오.");
return false;
}
$.each(selectedRowIds, function(i,o){
var rowData = new Map();
rowData.put("LD_PART_OBJID", $("#grid1").getRowData(o).OBJID );
rowData.put("PART_NAME" , $("#grid1").getRowData(o).LD_PART_NAME );
rowData.put("SPEC" , $("#grid1").getRowData(o).SPEC );
rowData.put("FORM_NO" , $("#grid1").getRowData(o).FORM_NO );
rowData.put("MAKER" , $("#grid1").getRowData(o).MAKER );
rowData.put("MATERIAL_CODE", $("#grid1").getRowData(o).MATERIAL_CODE);
rowData.put("SUPPLY_NAME" , $("#grid1").getRowData(o).SUPPLY_NAME );
opener.fn_addRow(rowData);
});
self.close();
});
grid1 = $("#grid1").jqGrid({
url: ""
,datatype: "local"
,data : $.parseJSON($("#grid1Data").val())
,colNames: ["OBJID"
,"품명","사양(규격)","형번","메이커","자재코드","공급업체","재고수량","자재투입이력","단가","보유금액"
,"소계","1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"
]
,colModel: [
{name:"OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"LD_PART_NAME" , index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"SPEC" , index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true}
,{name:"FORM_NO" , index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true}
,{name:"MAKER" , index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true}
,{name:"MATERIAL_CODE", index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true}
,{name:"SUPPLY_NAME" , index:"", align:"left", hidden:false, sortable:false, editable:false, frozen: true}
,{name:"INVEN_QTY" , index:"", align:"center", hidden:false, sortable:false, editable:false}
,{name:"INPUT_CNT" , index:"", align:"center", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"PRICE" , index:"", align:"center", hidden:false, sortable:false, editable:false}
,{name:"PRICE_SUM" , index:"", align:"center", hidden:false, sortable:false, editable:false}
,{name:"M_TOTAL" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M01" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M02" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M03" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M04" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M05" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M06" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M07" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M08" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M09" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M10" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M11" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"M12" , index:"", align: "right", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
]
,ignoreCase : true //로컬 검색 및 정렬이 대,소문자를 구분하지 않도록 하려면true
,rownumbers : false //row번호 표시
,viewrecords : true //pager가 있을경우 표시되는 record number
,autowidth : true //그리드 너비가 자동으로 부모 요소의 너비로 다시 계산
,sortable : true //마우스로 열을 끌어다 놓아 열을 재정렬
,shrinkToFit : false //모든 열은 너비에 비례하여 크기가 조정
,forceFit : false //컬럼의 width를 변화시킬때 그리드의 width를 고정 여부
,multiselect : true //선택가능. 체크박스표시
,height : 600
/* ,rowNum : "${countPerPage}" */
,rowNum : 10000
,jsonReader : {repeatitems: false}
,mtype :"POST"
,footerrow : false //바닥합계
,userDataOnFooter: true //바닥합계
//,caption :"제목"
//,pager :"#grid1Pager"
,loadComplete: function(data){ //모든 서버 요청 직후에 실행
var gid = $(this).attr("id");
var grid_wrap_div = $("#gbox_"+gid);
setTimeout("fn_jqGrid_init($('#"+gid+"'), true);", 50); //윈도우크기 비례 자동조절
//footer 커스텀..
//장납기품 비용 합계
var priceSumArr = $("#grid1").getRowData().map(function(o,i){
return Number(fnc_checkNullDefaultValue(o.PRICE_SUM,"0"));
})
if(priceSumArr.length > 0){
$("#TOTAL_PRICE").text(numberWithCommas( priceSumArr.reduce(function(a, b){ return a + b; }) ));
}
}
});
//그리드 헤더 그룹처리
var optJson = {
useColSpanStyle: true
,groupHeaders:[
{startColumnName: 'LD_PART_NAME', numberOfColumns: 6, titleText: '<center>자재정보</center>'}
,{startColumnName: 'INVEN_QTY' , numberOfColumns: 4, titleText: '<center>재고관리</center>'}
,{startColumnName: 'M_TOTAL' , numberOfColumns:13, titleText: '<center>소요량예측</center>'}
]
};
fn_jqGrid_setGroupHeaders(grid1, optJson);
});
function fn_search(){
document.form1.action = "/salesMng/salesLongDeliveryList.do";
document.form1.submit();
}
/*
Custom Formatter Parameters Description
◆ cellvalue: value to be formatted
◆ options : { rowId: rid, colModel: {name: , index, width, align, ...}}
◆ rowObject : row data
*/
function col_custom_fmt(cellvalue, options, rowObject) {
//console.log("rid : "+ options.rowId + " colModel["+JSON.stringify(options.colModel)+"]");
var return_fmt = "";
cellvalue = fnc_checkNull(cellvalue);
if(options.colModel.name == "LD_PART_NAME" ){ //품명
//var url = "/salesMng/salesLongDeliveryFormPopup.do";
return_fmt = '<a href="#" onclick="javascript:fn_popupStandard(\''+rowObject.OBJID+'\');">'+cellvalue+'</a>';
}else if(options.colModel.name == "INPUT_CNT" ){ //자재투입이력
//var url = "/salesMng/salesLongDeliveryFormPopup.do";
var isNotEmpty = ($.isNumeric(cellvalue) && Number(cellvalue) > 0);
var empty = isNotEmpty ? "" : "empty_";
if(isNotEmpty){
return_fmt = '<a href="#" class="File file_'+empty+'icon" onclick="javascript:fn_popupInput(\''+rowObject.OBJID+'\');"></a>';
}else{
}
}else if(options.colModel.name == "M_TOTAL"
|| options.colModel.name == "M01"
|| options.colModel.name == "M02"
|| options.colModel.name == "M03"
|| options.colModel.name == "M04"
|| options.colModel.name == "M05"
|| options.colModel.name == "M06"
|| options.colModel.name == "M07"
|| options.colModel.name == "M08"
|| options.colModel.name == "M09"
|| options.colModel.name == "M10"
|| options.colModel.name == "M11"
|| options.colModel.name == "M12"
){
//소요량
return_fmt = '<a href="#" onclick="javascript:fn_popupPredict(\''+rowObject.OBJID+'\', \'\');">'+numberWithCommas(cellvalue)+'</a>';
}else{
return_fmt = cellvalue;
}
return return_fmt;
}
/**
unFormatter : grid1.getRowData(), getCell(n,colname) 에서 값만 나오게하는 함수
*/
function col_custom_fmt_un(cellvalue, options, cell) {
return cellvalue;
}
function fn_formPopUp(width, heigth, url, target, objId, month, actionType){
var hiddenForm = document.hiddenForm;
fn_centerPopup(width, heigth, "", target);
hiddenForm.objId.value = objId;
hiddenForm.actionType.value = actionType;
hiddenForm.month.value = month;
hiddenForm.action = url;
hiddenForm.target = target;
hiddenForm.submit();
}
function fn_popupStandard(objid){
fn_formPopUp(600,270, "/salesMng/salesLongDeliveryFormPopup.do", "salesLongDeliveryFormPopup", objid, "", "STANDARD");
}
function fn_popupInput(objid){
fn_formPopUp(600,550, "/salesMng/salesLongDeliveryFormPopup.do", "salesLongDeliveryFormPopup", objid, "", "INPUT");
}
function fn_popupPredict(objid, month){
fn_formPopUp(600,550, "/salesMng/salesLongDeliveryFormPopup.do", "salesLongDeliveryFormPopup", objid, month, "PREDICT");
}
</script>
<body>
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="objId" />
<input type="hidden" name="actionType" />
<input type="hidden" name="month" />
</form>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="actionType" value="${param.actionType }"/>
<input type="hidden" name="callbackFnc" value="${param.callbackFnc }"/>
<input type="hidden" name="callType" value="${param.callType }"/>
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>구매관리_장납기 부품리스트</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tr>
<td><label for="">품명</label></td>
<td><input type="text" name="ld_part_name" id="ld_part_name" autocomplete="off" value="${param.ld_part_name}" /></td>
<td><label for="">사양</label></td>
<td><input type="text" name="spec" id="spec" autocomplete="off" value="${param.spec}" /></td>
<td><label for="">메이커</label></td>
<td><input type="text" name="maker" id="maker" autocomplete="off" value="${param.maker}" /></td>
<td><label for="">자재코드</label></td>
<td><input type="text" name="material_code" id="material_code" autocomplete="off" value="${param.material_code}" /></td>
<td><label for="">공급업체</label></td>
<td><select name="admin_supply" id="admin_supply" class="select2" autocomplete="off"><option value="">선택</option>${code_map.admin_supply}</select></td>
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<% if(!isSelectPopup){ %>
<div style="float:left; color: RED; padding-top:5px;">
<h5><span>※ 장남기품 비용(원): </span><span id="TOTAL_PRICE"></span></h2>
</div>
<% } %>
<div class="btn_wrap">
<div class="plm_btn_wrap">
<% if(isSelectPopup){ %>
<input type="button" class="plm_btns" value="추가" id="btnAdd">
<% }else{ %>
<input type="button" class="plm_btns" value="삭제" id="btnDel">
<input type="button" class="plm_btns" value="등록" id="btnReg">
<input type="button" class="plm_btns" value="자제투입" id="btnInput">
<input type="button" class="plm_btns" value="장납기예측수량등록" id="btnPredict">
<% } %>
<input type="button" class="plm_btns" value="조회" id="btnSearch">
</div>
</div>
<div class="plm_table_wrap" style="overflow-x: auto;">
<table id="grid1"></table>
<!-- <div id="grid1Pager"></div> -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="grid1Data">${LIST}<c:if test="${empty LIST}">[]</c:if></textarea><!-- [{},{},{}] -->
</div>
<%-- <div class="pdm_page">${PAGE_HTML}</div> --%>
</section>
</div>
</div>
</form>
</body>
</html>