ERP-node/WebContent/WEB-INF/view/part/structurePopupRight.jsp

247 lines
7.7 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"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<script>
$(function(){
//저장
$("#btnSave").click(function(){
Swal.fire("save");
});
//end of 저장
//닫기
$("#btnClose").click(function(){
top.opener.window.location.reload();
top.self.close(0);
});
//end of 닫기
//제품군 변경시 제품 조회
$("#productGroup").change(function(){
var search_productGroupObjId = $("#productGroup option:checked").val();
fn_setProductCombo(search_productGroupObjId);
});
//end of 제품군 변경시 제품 조회
//고객사 변경시 차종 조회
$("#oem").change(function(){
var search_oemObjId = $("#oem option:checked").val();
fn_setCarTypeCombo(search_oemObjId);
});
//end of 고객사 변경시 차종 조회
//파트넘버 엔터키 event
$("#search_partNo").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
}
});
//end of 파트넘버 엔터키 event
//파트명 엔터키 event
$("#search_partName").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
}
});
//end of 파트명 엔터키 event
//파트조회
$("#btnSearch").click(function(){
var oemObjId = $("#oem option:checked").val();
var carTypeObjId = $("#carType option:checked").val();
var productGroupObjId = $("#productGroup option:checked").val();
var productObjId = $("#product option:checked").val();
var partNo = $("#search_partNo").val();
var partName = $("#search_partName").val();
$(".partListTr").remove();
$.ajax({
url: "/part/getPartList_ajax.do",
method: 'post',
data: {"search_oem":oemObjId, "search_car":carTypeObjId, "search_productGroup":productGroupObjId, "search_product":productObjId, "search_partNo":partNo, "search_partName":partName, "isLast":1},
dataType: 'json',
success: function(data) {
//Swal.fire(data.length);
var trHtml = "";
if(data.length > 0){
$.each(data, function(i){
trHtml += "<tr class=\"partListTr\">";
trHtml += "<td><input type=\"checkbox\" name=\"partChks\" class=\"partChks\" value=\""+data[i].PART_NO+"\"></td>";
trHtml += "<td>"+data[i].PART_NO+"</td>";
trHtml += "<td>"+data[i].PART_NAME+"</td>";
trHtml += "</tr>";
});
}else{
trHtml += "<tr class=\"partListTr\">";
trHtml += "<td colspan=\"3\" align=\"center\">조회된 Part가 없습니다.</td>";
trHtml += "</tr>";
}
$("#structurePopupTable2").append(trHtml);
},
error: function(jqxhr, status, error){
/* Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText); */
}
});
});
//end of 파트조회
//전체선택
$("#allChk").click(function(){
var isChecked = $(this).prop("checked");
if(isChecked){
$(".partChks").prop("checked", true);
}else{
$(".partChks").prop("checked", false);
}
});
//end of 전체선택
});
function fn_setCarTypeCombo(search_oemObjId){
$.ajax({
/* url: "/common/getCarTypetList_combo.do", */
url:"/admin/getOEMsCarList.do",
method: 'post',
/* data: {"search_oemObjId":search_oemObjId, "isJson":true}, */
data:{"oemObjId": search_oemObjId, "status" : "active"},
dataType: 'json',
success: function(data) {
$("#carType>option").remove();
$("#carType").append("<option value=''>전체</option>");
$.each(data, function(i){
$("#carType").append("<option value='"+data[i].OBJID+"'>"+data[i].CAR_NAME+"("+data[i].CAR_CODE+")</option>");
});
}
, error: function(jqxhr, status, error){
/* Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText); */
}
});
}
function fn_setProductCombo(search_productGroupObjId){
$.ajax({
/* url: "/common/getProductList_combo.do", */
url : "/specData/getProductList.do",
method: 'post',
/* data: {"search_productGroupObjId":search_productGroupObjId, "isJson":true}, */
data:{"productGroupObjid" : search_productGroupObjId, "status" : "active"},
dataType: 'json',
success: function(data) {
$("#product>option").remove();
$("#product").append("<option value=''>전체</option>");
$.each(data, function(i){
$("#product").append("<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_NAME+"</option>");
});
}
, error: function(jqxhr, status, error){
/* Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText); */
}
});
}
function fn_setPartList(){
}
</script>
</head>
<body class="backcolor">
<form name="form1" action="" method="post">
<div id="structureTableWrap2">
<div class="searchIdName">
<table>
<tr>
<td><label for="">고객사</label></td>
<td>
<select name="oem" id="oem">
<option value="">전체</option>
<c:forEach var="item" items="${oemList}" varStatus="status">
<option value="${item.OBJID}">${item.OEM_NAME} (${item.OEM_CODE})</option>
</c:forEach>
</select>
</td>
<td><label for="">차종</label></td>
<td>
<select name="carType" id="carType" style="width:150px;">
<option value="">전체</option>
</select>
</td>
</tr>
<tr>
<td><label for="">제품군</label></td>
<td>
<select name="productGroup" id="productGroup">
<option value="">전체</option>
<c:forEach var="item" items="${productGroupList}" varStatus="status">
<option value="${item.OBJID}">${item.PRODUCT_GROUP_NAME}</option>
</c:forEach>
</select>
</td>
<td><label for="">제품</label></td>
<td>
<select name="product" id="product" style="width:150px;">
<option value="">전체</option>
</select>
</td>
</tr>
<tr>
<td><label for="">Part No</label></td>
<td>
<input type="text" name="search_partNo" id="search_partNo" style="width:177px; height:18px;">
</td>
<td><label for="">Part Name</label></td>
<td>
<input type="text" name="search_partName" id="search_partName" style="width:150px; height:18px;">
</td>
</tr>
</table>
</div>
<input type="button" value="조회" class="plm_btns structure_btn" id="btnSearch" style="float:right">
<div class="plm_table_wrap">
<table id="structurePopupTableHead" class="plm_table">
<colgroup>
<col width="5%" />
<col width="25%" />
<col width="70%" />
</colgroup>
<tr class="plm_thead">
<td><input type="checkbox" name="" value="" id="allChk" class="checkBox"></td>
<td>Part No.</td>
<td>Part Name</td>
</tr>
</table>
<div class=plm_table_wrap style="width:100%; height:555px;">
<table id="structurePopupTable2" class="plm_table">
<colgroup>
<col width="5%" />
<col width="25%" />
<col width="70%" />
</colgroup>
<tr class="partListTr">
<td colspan="3" align="center">조회된 Part가 없습니다.</td>
</tr>
</table>
</div>
</div>
</div>
</form>
</body>
</html>