생산계획&실적관리 중간 커밋
This commit is contained in:
377
WebContent/WEB-INF/view/productionplanning/prodPlanFormPopup.jsp
Normal file
377
WebContent/WEB-INF/view/productionplanning/prodPlanFormPopup.jsp
Normal file
@@ -0,0 +1,377 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init_new.jsp" %>
|
||||
<%
|
||||
Map info = (HashMap)(request.getAttribute("resultMap"));
|
||||
String actionType = (String)request.getAttribute("actionType");
|
||||
boolean isNew = "regist".equals(actionType);
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
.input_title {border-left:1px solid #ccc; background-color:#f5f5f5;}
|
||||
.input_sub_title {border-left:1px solid #ccc;}
|
||||
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
|
||||
.required-mark { color: red; font-weight: bold; margin-left: 2px; }
|
||||
.pmsPopupForm td { padding: 5px 8px; }
|
||||
.pmsPopupForm input[type="text"],
|
||||
.pmsPopupForm input[type="number"] {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.readonly-field {
|
||||
background-color: #eee !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<script>
|
||||
$(function(){
|
||||
fnc_datepick();
|
||||
$(".select2").select2();
|
||||
|
||||
// 저장 버튼
|
||||
$("#btnSave").click(function(){
|
||||
fn_save();
|
||||
});
|
||||
|
||||
// 프로젝트번호 변경 시 관련 정보 자동 로드 (Select2 이벤트)
|
||||
$("#PROJECT_NO").on("change select2:select", function(){
|
||||
var projectObjid = $(this).val();
|
||||
console.log("프로젝트번호 변경됨:", projectObjid);
|
||||
if(fnc_checkNull(projectObjid) != ""){
|
||||
fn_loadProjectInfo(projectObjid);
|
||||
} else {
|
||||
fn_clearProjectInfo();
|
||||
}
|
||||
});
|
||||
|
||||
// 수주수량, 추가생산수량 변경 시 총생산수량 자동 계산
|
||||
$("#ORDER_QTY, #EXTRA_PROD_QTY").on("input change", function(){
|
||||
fn_calcTotalQty();
|
||||
});
|
||||
|
||||
// 초기 데이터 로드
|
||||
<% if(!isNew && info != null) { %>
|
||||
// 수정 모드: 기존 데이터 표시
|
||||
fn_loadExistingData();
|
||||
<% } else { %>
|
||||
// 신규 등록: 프로젝트가 선택된 경우 정보 자동 로드
|
||||
var projectObjid = "${projectObjid}";
|
||||
if(fnc_checkNull(projectObjid) != ""){
|
||||
// Select2 초기화 후 값 설정 및 change 이벤트 발생
|
||||
setTimeout(function(){
|
||||
$("#PROJECT_NO").val(projectObjid).trigger("change");
|
||||
}, 100);
|
||||
}
|
||||
<% } %>
|
||||
});
|
||||
|
||||
// 날짜 선택기 초기화
|
||||
function fnc_datepick(){
|
||||
var $dateinput = $("input.date_icon");
|
||||
for(var i=0; i<$dateinput.length; i++){
|
||||
$dateinput.eq(i).attr("size","10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth:true,
|
||||
changeYear:true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 프로젝트 정보 로드
|
||||
function fn_loadProjectInfo(projectObjid){
|
||||
console.log("fn_loadProjectInfo 호출, projectObjid:", projectObjid);
|
||||
|
||||
$.ajax({
|
||||
url: "/productionplanning/getProdPlanProjectInfo.do",
|
||||
type: "POST",
|
||||
data: { "projectObjid": projectObjid },
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(data){
|
||||
console.log("프로젝트 정보 응답:", data);
|
||||
|
||||
if(data && data.result == "success" && data.info){
|
||||
var info = data.info;
|
||||
console.log("프로젝트 정보:", info);
|
||||
|
||||
// 제품구분 (소문자 키)
|
||||
if(fnc_checkNull(info.product_code) != ""){
|
||||
console.log("제품구분 설정:", info.product_code);
|
||||
$("#PRODUCT_CODE").val(info.product_code).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 주문유형
|
||||
if(fnc_checkNull(info.category_code) != ""){
|
||||
console.log("주문유형 설정:", info.category_code);
|
||||
$("#CATEGORY_CODE").val(info.category_code).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 고객사 (C_ 접두어 제거)
|
||||
if(fnc_checkNull(info.customer_objid) != ""){
|
||||
var customerObjid = info.customer_objid.replace("C_", "");
|
||||
console.log("고객사 설정:", customerObjid);
|
||||
$("#CUSTOMER_OBJID").val(customerObjid).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 품번
|
||||
$("#PART_NO").val(fnc_checkNull(info.part_no));
|
||||
|
||||
// 품명
|
||||
$("#PART_NAME").val(fnc_checkNull(info.part_name));
|
||||
|
||||
// 요청납기
|
||||
$("#REQ_DEL_DATE").val(fnc_checkNull(info.req_del_date));
|
||||
|
||||
// S/N
|
||||
$("#SERIAL_NO").val(fnc_checkNull(info.serial_no));
|
||||
|
||||
// 수주수량
|
||||
$("#ORDER_QTY").val(fnc_checkNull(info.order_qty) || 0);
|
||||
|
||||
// 고객사 요청사항
|
||||
$("#CUSTOMER_REQUEST").val(fnc_checkNull(info.customer_request));
|
||||
|
||||
// 총생산수량 계산
|
||||
fn_calcTotalQty();
|
||||
} else {
|
||||
console.log("프로젝트 정보가 없음 또는 조회 실패");
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
console.error("프로젝트 정보 로드 실패:", error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 프로젝트 정보 초기화
|
||||
function fn_clearProjectInfo(){
|
||||
$("#PRODUCT_CODE").val("").trigger("change");
|
||||
$("#CATEGORY_CODE").val("").trigger("change");
|
||||
$("#CUSTOMER_OBJID").val("").trigger("change");
|
||||
$("#PART_NO").val("");
|
||||
$("#PART_NAME").val("");
|
||||
$("#REQ_DEL_DATE").val("");
|
||||
$("#SERIAL_NO").val("");
|
||||
$("#ORDER_QTY").val("");
|
||||
$("#CUSTOMER_REQUEST").val("");
|
||||
$("#TOTAL_PROD_QTY").val("");
|
||||
}
|
||||
|
||||
// 기존 데이터 로드 (수정 모드)
|
||||
function fn_loadExistingData(){
|
||||
// JSP EL로 기존 데이터 설정
|
||||
<% if(info != null) { %>
|
||||
$("#PRODUCT_CODE").val("${resultMap.PRODUCT_CODE}").trigger("change");
|
||||
$("#CATEGORY_CODE").val("${resultMap.CATEGORY_CODE}").trigger("change");
|
||||
$("#CUSTOMER_OBJID").val("${resultMap.CUSTOMER_OBJID}").trigger("change");
|
||||
fn_calcTotalQty();
|
||||
<% } %>
|
||||
}
|
||||
|
||||
// 총생산수량 계산
|
||||
function fn_calcTotalQty(){
|
||||
var orderQty = parseInt($("#ORDER_QTY").val()) || 0;
|
||||
var extraQty = parseInt($("#EXTRA_PROD_QTY").val()) || 0;
|
||||
$("#TOTAL_PROD_QTY").val(orderQty + extraQty);
|
||||
}
|
||||
|
||||
// 저장
|
||||
function fn_save(){
|
||||
// 필수값 검증
|
||||
if(fnc_checkNull($("#PRODUCT_CODE").val()) == ""){
|
||||
Swal.fire("제품구분을 선택해주세요.");
|
||||
$("#PRODUCT_CODE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#CATEGORY_CODE").val()) == ""){
|
||||
Swal.fire("주문유형을 선택해주세요.");
|
||||
$("#CATEGORY_CODE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PRODUCTION_TYPE").val()) == ""){
|
||||
Swal.fire("생산유형을 선택해주세요.");
|
||||
$("#PRODUCTION_TYPE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#CUSTOMER_OBJID").val()) == ""){
|
||||
Swal.fire("고객사를 선택해주세요.");
|
||||
$("#CUSTOMER_OBJID").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#REQ_DEL_DATE").val()) == ""){
|
||||
Swal.fire("요청납기를 입력해주세요.");
|
||||
$("#REQ_DEL_DATE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PART_NO").val()) == ""){
|
||||
Swal.fire("품번을 입력해주세요.");
|
||||
$("#PART_NO").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PART_NAME").val()) == ""){
|
||||
Swal.fire("품명을 입력해주세요.");
|
||||
$("#PART_NAME").focus();
|
||||
return;
|
||||
}
|
||||
var orderQty = parseInt($("#ORDER_QTY").val()) || 0;
|
||||
if(orderQty <= 0){
|
||||
Swal.fire("수주수량을 입력해주세요.");
|
||||
$("#ORDER_QTY").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/productionplanning/saveProdPlan.do",
|
||||
data: $("#form1").serialize(),
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.result == "success"){
|
||||
alert(data.msg || "저장되었습니다.");
|
||||
if(typeof opener.fn_search == "function"){
|
||||
opener.fn_search();
|
||||
}
|
||||
self.close();
|
||||
} else {
|
||||
Swal.fire(data.msg || "저장에 실패했습니다.");
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.fire("저장 중 오류가 발생했습니다.");
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<form name="form1" id="form1" method="post">
|
||||
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
|
||||
<input type="hidden" name="PROJECT_OBJID" id="PROJECT_OBJID" value="${resultMap.PROJECT_OBJID}">
|
||||
<input type="hidden" name="actionType" id="actionType" value="${actionType}">
|
||||
|
||||
<section>
|
||||
<div class="plm_menu_name" style="display:flex;">
|
||||
<h2 style="width:100%;height:60px;text-align:center;margin-top:10px;">
|
||||
<span style="font-size:24px;">생산계획 생성</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="businessPopupFormWrap" style="z-index:99; padding:10px;">
|
||||
<table class="pmsPopupForm" style="z-index:99; width:100%;">
|
||||
<colgroup>
|
||||
<col width="12%">
|
||||
<col width="21%">
|
||||
<col width="12%">
|
||||
<col width="21%">
|
||||
<col width="12%">
|
||||
<col width="22%">
|
||||
</colgroup>
|
||||
|
||||
<!-- 1행: 프로젝트번호, 제품구분, 주문유형 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>프로젝트번호</label></td>
|
||||
<td>
|
||||
<select name="PROJECT_NO" id="PROJECT_NO" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.project_no}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>제품구분<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="PRODUCT_CODE" id="PRODUCT_CODE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>주문유형<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="CATEGORY_CODE" id="CATEGORY_CODE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 2행: 생산유형, 고객사, 요청납기 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>생산유형<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="PRODUCTION_TYPE" id="PRODUCTION_TYPE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.production_type_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>고객사<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="CUSTOMER_OBJID" id="CUSTOMER_OBJID" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>요청납기<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="REQ_DEL_DATE" id="REQ_DEL_DATE" class="date_icon" value="${resultMap.REQ_DEL_DATE}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 3행: 품번, 품명, S/N -->
|
||||
<tr>
|
||||
<td class="input_title"><label>품번<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="PART_NO" id="PART_NO" value="${resultMap.PART_NO}">
|
||||
</td>
|
||||
<td class="input_title"><label>품명<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="PART_NAME" id="PART_NAME" value="${resultMap.PART_NAME}">
|
||||
</td>
|
||||
<td class="input_title"><label>S/N</label></td>
|
||||
<td>
|
||||
<input type="text" name="SERIAL_NO" id="SERIAL_NO" value="${resultMap.SERIAL_NO}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 4행: 수주수량, 추가생산수량, 총생산수량 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>수주수량<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="number" name="ORDER_QTY" id="ORDER_QTY" min="0" value="${resultMap.ORDER_QTY}">
|
||||
</td>
|
||||
<td class="input_title"><label>추가생산수량</label></td>
|
||||
<td>
|
||||
<input type="number" name="EXTRA_PROD_QTY" id="EXTRA_PROD_QTY" min="0" value="${resultMap.EXTRA_PROD_QTY}" placeholder="0">
|
||||
</td>
|
||||
<td class="input_title"><label>총생산수량</label></td>
|
||||
<td>
|
||||
<input type="text" name="TOTAL_PROD_QTY" id="TOTAL_PROD_QTY" class="readonly-field" readonly value="${resultMap.TOTAL_PROD_QTY}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 5행: 고객사 요청사항 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>고객사 요청사항</label></td>
|
||||
<td colspan="5">
|
||||
<input type="text" name="CUSTOMER_REQUEST" id="CUSTOMER_REQUEST" value="${resultMap.CUSTOMER_REQUEST}" style="width:100%;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_wrap">
|
||||
<div class="plm_btn_wrap" style="padding:10px; text-align:center;">
|
||||
<input type="button" value="저장" class="plm_btns" id="btnSave">
|
||||
<input type="button" value="닫기" class="plm_btns" onclick="window.close();">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,510 @@
|
||||
<%@ 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" %>
|
||||
<c:set var="now" value="<%=new java.util.Date() %>"/>
|
||||
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
|
||||
<%
|
||||
// DB에서 메뉴명 조회 (공통 유틸 사용)
|
||||
String menuObjId = request.getParameter("menuObjId");
|
||||
String menuName = CommonUtils.getMenuName(menuObjId, "생산계획&실적 관리");
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
body, html {
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.select2-selection__choice {
|
||||
font-size: 11px;
|
||||
background-color: #fff !important;
|
||||
border: none !important;
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
.select2-selection__choice__remove {
|
||||
display: contents !important;
|
||||
}
|
||||
.select2-container .select2-selection--multiple {
|
||||
min-height: 20px !important;
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
margin-top: 3.5px !important;
|
||||
}
|
||||
.select2-selection__rendered {
|
||||
height: 18px !important;
|
||||
}
|
||||
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
||||
overflow: auto !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
// Tabulator 그리드 전역 변수
|
||||
var _tabulGrid;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
_fnc_datepick(); // 날짜 선택기 초기화
|
||||
$('.select2').select2(); // select2 초기화
|
||||
|
||||
// 품번/품명 Select2 AJAX 초기화
|
||||
initPartSelect2Ajax("#search_part_no", "#search_part_name", "#search_part_objid");
|
||||
|
||||
// Enter 키로 검색
|
||||
$("#plmSearchZon input").keyup(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
// 조회 버튼
|
||||
$("#btnSearch").click(function(){
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 생산계획 생성 버튼
|
||||
$("#btnCreateProdPlan").click(function(){
|
||||
fn_createProdPlan();
|
||||
});
|
||||
|
||||
// 작업지시 생성 버튼
|
||||
$("#btnCreateWorkOrder").click(function(){
|
||||
fn_createWorkOrder();
|
||||
});
|
||||
|
||||
// 생산실적 등록 버튼
|
||||
$("#btnRegistProdResult").click(function(){
|
||||
fn_registProdResult();
|
||||
});
|
||||
|
||||
// 초기 조회
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 날짜 선택기 초기화 함수
|
||||
function _fnc_datepick(){
|
||||
var $dateinput = $("input.date_icon");
|
||||
for(var i=0; i<$dateinput.length; i++){
|
||||
$dateinput.eq(i).attr("size","10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth:true,
|
||||
changeYear:true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 그리드 컬럼 정의
|
||||
var columns = [
|
||||
{title:'OBJID', field:'OBJID', visible: false, frozen: true},
|
||||
{title:'PROD_PLAN_OBJID', field:'PROD_PLAN_OBJID', visible: false, frozen: true},
|
||||
|
||||
// 2. 프로젝트번호
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 130,
|
||||
title: '프로젝트번호',
|
||||
field: 'PROJECT_NO',
|
||||
frozen: true,
|
||||
formatter: fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell){
|
||||
var orderNo = cell.getData().PROJECT_NO;
|
||||
// 프로젝트 번호 클릭 시: 결재 정보 조회 모드 (saleNo에 "detail" 전달)
|
||||
fn_openSaleRegPopup(orderNo, "detail");
|
||||
}
|
||||
},
|
||||
|
||||
// 3. 제품구분
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '제품구분',
|
||||
field: 'PRODUCT_NAME'
|
||||
},
|
||||
|
||||
// 4. 주문유형
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '주문유형',
|
||||
field: 'CATEGORY_CODE'
|
||||
},
|
||||
|
||||
// 5. 생산유형
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '생산유형',
|
||||
field: 'PRODUCTION_TYPE_NAME'
|
||||
},
|
||||
|
||||
// 6. 고객사
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '고객사',
|
||||
field: 'CUSTOMER_NAME'
|
||||
},
|
||||
|
||||
// 7. 요청납기
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 90,
|
||||
title: '요청납기',
|
||||
field: 'REQ_DEL_DATE'
|
||||
},
|
||||
|
||||
// 8. 고객사요청사항
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 180,
|
||||
title: '고객사요청사항',
|
||||
field: 'CUSTOMER_REQUEST'
|
||||
},
|
||||
|
||||
// 9. 품번
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '품번',
|
||||
field: 'PART_NO'
|
||||
},
|
||||
|
||||
// 10. 품명
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 180,
|
||||
title: '품명',
|
||||
field: 'PART_NAME'
|
||||
},
|
||||
|
||||
// 11. S/N
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: 'S/N',
|
||||
field: 'SERIAL_NO'
|
||||
},
|
||||
|
||||
// 12. 수주수량
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 80,
|
||||
title: '수주수량',
|
||||
field: 'QUANTITY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 13. 추가생산수량
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 100,
|
||||
title: '추가생산수량',
|
||||
field: 'EXTRA_PROD_QTY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 14. 총생산수량 (수주수량 + 추가생산수량)
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 100,
|
||||
title: '총생산수량',
|
||||
field: 'TOTAL_PROD_QTY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 15. 완조립
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 80,
|
||||
title: '완조립',
|
||||
field: 'ASSEMBLY_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'ASSEMBLY');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 16. 검사
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 70,
|
||||
title: '검사',
|
||||
field: 'INSPECTION_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'INSPECTION');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 17. 출하대기
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 90,
|
||||
title: '출하대기',
|
||||
field: 'SHIP_WAIT_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'SHIP_WAIT');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 18. 장비조립WBS
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
minWidth: 110,
|
||||
title: '장비조립WBS',
|
||||
field: 'EQUIPMENT_WBS',
|
||||
formatter:fnc_subInfoValueFormatter,
|
||||
cellClick:function(e, cell){
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_WBSRegist(objid);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
// 검색 함수
|
||||
function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/productionplanning/prodPlanResultMgmtGridList.do", columns, true);
|
||||
}
|
||||
|
||||
// 프로젝트 상세 팝업
|
||||
function fn_openProjectDetailPopup(objid) {
|
||||
var popup_width = 1000;
|
||||
var popup_height = 550;
|
||||
var url = "/salesMgmt/salesRegForm.do?orderNo=&saleNo=detail&objid=" + objid;
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
// 생산계획 생성 버튼 클릭 - 팝업 열기
|
||||
function fn_createProdPlan() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
var popup_width = 900;
|
||||
var popup_height = 500;
|
||||
var url = "/productionplanning/prodPlanFormPopup.do";
|
||||
|
||||
if(checkedRows.length === 1) {
|
||||
// 선택된 행이 있으면 프로젝트 정보 전달
|
||||
var rowData = checkedRows[0];
|
||||
url += "?projectObjid=" + rowData.OBJID;
|
||||
if(rowData.PROD_PLAN_OBJID) {
|
||||
url += "&prodPlanObjid=" + rowData.PROD_PLAN_OBJID;
|
||||
}
|
||||
} else if(checkedRows.length > 1) {
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '한 번에 하나의 프로젝트만 선택해주세요.',
|
||||
icon: 'info'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 선택 없으면 빈 폼으로 팝업 (프로젝트 없이 생성)
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url, 'prodPlanPopup');
|
||||
}
|
||||
|
||||
// 작업지시 생성
|
||||
function fn_createWorkOrder() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
if(checkedRows.length === 0) {
|
||||
Swal.fire({
|
||||
title: '선택 필요',
|
||||
text: '작업지시를 생성할 프로젝트를 선택해주세요.',
|
||||
icon: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: 작업지시 생성 팝업
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '작업지시 생성 기능은 준비 중입니다.',
|
||||
icon: 'info'
|
||||
});
|
||||
}
|
||||
|
||||
// 생산실적 등록
|
||||
function fn_registProdResult() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
if(checkedRows.length === 0) {
|
||||
Swal.fire({
|
||||
title: '선택 필요',
|
||||
text: '생산실적을 등록할 프로젝트를 선택해주세요.',
|
||||
icon: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(checkedRows.length > 1) {
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '한 번에 하나의 프로젝트만 선택해주세요.',
|
||||
icon: 'info'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var rowData = checkedRows[0];
|
||||
var popup_width = 1000;
|
||||
var popup_height = 700;
|
||||
var url = "/productionplanning/prodResultFormPopup.do?projectObjid=" + rowData.OBJID;
|
||||
fn_centerPopup(popup_width, popup_height, url, 'prodResultPopup');
|
||||
}
|
||||
|
||||
// 수량 상세 팝업 (완조립, 검사, 출하대기 클릭 시)
|
||||
function fn_openQtyDetailPopup(projectObjid, qtyType) {
|
||||
var popup_width = 800;
|
||||
var popup_height = 500;
|
||||
var url = "/productionplanning/prodQtyDetailPopup.do?projectObjid=" + projectObjid + "&qtyType=" + qtyType;
|
||||
fn_centerPopup(popup_width, popup_height, url, 'qtyDetailPopup');
|
||||
}
|
||||
|
||||
// 선택된 행 가져오기 (Tabulator 선택 기능 사용)
|
||||
function getCheckedRows() {
|
||||
if(_tabulGrid) {
|
||||
return _tabulGrid.getSelectedData();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- hiddenForm: POST 방식 팝업 전송용 -->
|
||||
<form name="hiddenForm" id="hiddenForm" method="post">
|
||||
<input type="hidden" name="OBJID" id="OBJID">
|
||||
<input type="hidden" name="actionType" id="actionType">
|
||||
</form>
|
||||
|
||||
<form name="form1" id="form1" method="post">
|
||||
<input type="hidden" name="actionType" id="actionType">
|
||||
<div class="content-box">
|
||||
<div class="content-box-s">
|
||||
<div class="plm_menu_name_gdnsi">
|
||||
<h2>
|
||||
<span><%=menuName%></span>
|
||||
</h2>
|
||||
<div class="btnArea">
|
||||
<input type="button" class="plm_btns" value="조회" id="btnSearch">
|
||||
<input type="button" class="plm_btns" value="생산계획 생성" id="btnCreateProdPlan">
|
||||
<input type="button" class="plm_btns" value="작업지시 생성" id="btnCreateWorkOrder">
|
||||
<input type="button" class="plm_btns" value="생산실적 등록" id="btnRegistProdResult">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 검색 영역 -->
|
||||
<div id="plmSearchZon">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label>프로젝트번호</label></td>
|
||||
<td>
|
||||
<select name="search_project_no" id="search_project_no" class="select2" style="width:235px;" multiple="multiple">
|
||||
<option value="">선택</option>
|
||||
${code_map.project_no}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>제품구분</label></td>
|
||||
<td>
|
||||
<select name="search_product_code" id="search_product_code" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>주문유형</label></td>
|
||||
<td>
|
||||
<select name="search_category_code" id="search_category_code" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>생산유형</label></td>
|
||||
<td>
|
||||
<select name="search_production_type" id="search_production_type" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.production_type_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>고객사</label></td>
|
||||
<td>
|
||||
<select name="search_customer_objid" id="search_customer_objid" class="select2" style="width:250px;">
|
||||
<option value="">전체</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td><label>요청납기</label></td>
|
||||
<td>
|
||||
<input type="text" name="search_req_del_date_from" id="search_req_del_date_from" class="date_icon" style="width:110px;" autocomplete="off">~
|
||||
<input type="text" name="search_req_del_date_to" id="search_req_del_date_to" class="date_icon" style="width:110px;" autocomplete="off">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>품번</label></td>
|
||||
<td>
|
||||
<select name="search_part_no" id="search_part_no" class="select2-part" style="width:130px;">
|
||||
<option value="">품번 선택</option>
|
||||
</select>
|
||||
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
|
||||
</td>
|
||||
|
||||
<td><label>품명</label></td>
|
||||
<td>
|
||||
<select name="search_part_name" id="search_part_name" class="select2-part" style="width:130px;">
|
||||
<option value="">품명 선택</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>S/N</label></td>
|
||||
<td><input type="text" name="search_serial_no" id="search_serial_no" style="" autocomplete="off"></td>
|
||||
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 그리드 영역 -->
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user