Files
vexplor/WebContent/WEB-INF/view/part/structurePopupLeft.jsp

155 lines
5.3 KiB
Plaintext
Raw Permalink Normal View History

2025-08-21 09:41:46 +09:00
<%@ 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>
<script>
$(function(){
$(".qty").keyup(function(e){
var key = e.keyCode;
if(key == 13){
var partNo = $(this).attr("data-PART_NO");
var parentPartNo = $(this).attr("data-PARENT_PART_NO");
var qty = $(this).val();
var isNumeric = $.isNumeric(qty);
if(!isNumeric){
Swal.fire("숫자만 입력 가능합니다. 수량을 1개로 조정합니다.");
$(this).val(1);
fn_saveQty(objId, 1);
return;
}
//Swal.fire("objId : "+objId+", qty : "+qty+", isNumeric : "+isNumeric);
fn_saveQty(parentPartNo, partNo, qty);
}
});
/*
$(".qty").blur(function(){
var objId = $(this).attr("data-OBJID");
var qty = $(this).val();
fn_saveQty(objId, qty);
});
*/
$(document).ready(function(){
$(".dataTr").each(function(i){
var lev = $(this).attr("data-LEVEL");
if(lev == 1){
$(this).css("background-color", "#fde9d9");
}else if(lev == 2){
$(this).css("background-color", "#daeef3");
}else if(lev == 3){
$(this).css("background-color", "#e4dfec");
}else if(lev == 4){
$(this).css("background-color", "#ebf1de");
}else if(lev == 5){
$(this).css("background-color", "#f2f2f2");
}else if(lev == 6){
$(this).css("background-color", "#f2dcdb");
}else if(lev == 7){
$(this).css("background-color", "#eeece1");
}else if(lev == 8){
$(this).css("background-color", "#dce6f1");
}else if(lev == 9){
$(this).css("background-color", "#FFFFEB");
}else if(lev == 10){
$(this).css("background-color", "#ffffff");
}
});
});
});
function fn_saveQty(parentPartNo, partNo, qty){
var bomReportObjId = $("#objId").val();
$.ajax({
url: "/part/structureQtySave.do",
method: 'post',
data: {"parentPartNo":parentPartNo, "partNo":partNo, "qty":qty, "bomReportObjId":bomReportObjId},
dataType: 'json',
success: function(data) {
/*
if(data.result){
$(parent.frames['leftFrame'].document.location.reload());
}
*/
//document.location.reload();
}
, error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
</script>
</head>
<body class="backcolor">
<form name="form1" action="" method="post">
<input type="hidden" name="objId" id="objId" value="${info.OBJID}" />
<div id="structureTableWrap1">
<div id="structureName">${info.OEM_NAME} / ${info.CAR_NAME} / ${info.PRODUCT_NAME} / ${info.REGION_NAME}</div>
<div id="structureName2"><font size="1.7px">※수량 변경 후, 엔터치시면 저장됩니다.</font></div>
<br>
<br>
<br>
<div class="plm_table_wrap">
<table id="structurePopupTableHead" class="plm_table">
<colgroup>
<col width="5%" />
<col width="5%" />
<col width="25%" />
<col width="*" />
<col width="10%" />
</colgroup>
<tr class="plm_thead">
<td colspan="2">Level</td>
<td>Part No.</td>
<td>Part Name</td>
<td>Qt'y</td>
</tr>
</table>
<div class="plm_table_wrap" style="width:100%; height:550px;">
<table id="structurePopupTable1" class="plm_table">
<colgroup>
<col width="5%" />
<col width="5%" />
<col width="25%" />
<col width="*" />
<col width="10%" />
</colgroup>
<c:choose>
<c:when test="${!empty tree}">
<c:forEach var="item" items="${tree}" varStatus="status">
<tr class="dataTr" data-LEVEL="${item.LEVEL}">
<td><input type="radio" name="checkedPartNo" value="${item.PART_NO}" data-OBJID="${item.OBJID}" data-PART_NO="${item.PART_NO}" data-PARENT_PART_NO="${item.PARENT_PART_NO}" data-PARENT_PARTS="${item.PARENT_PARTS}"></td>
<td>${item.LEVEL}</td>
<td style="text-align:left !important;" id="lpadpartno"><pre>${item.LPAD_PART_NO}</pre></td>
<td>${item.PART_NAME}</td>
<td><input type="text" name="qty_${item.PART_NO}" id="qty_${item.PART_NO}" class="qty" style="width:30px; text-align:center;" maxlength="3" value="${empty item.QTY?'0':item.QTY}" data-PART_NO="${item.PART_NO}" data-PARENT_PART_NO="${item.PARENT_PART_NO}"></td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="5" align="center">등록된 구조정보가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</table>
</div>
</div>
</div>
</form>
</body>
</html>