Files
vexplor/WebContent/WEB-INF/view/quality/qualityTestTempList.jsp
2025-08-21 09:41:46 +09:00

435 lines
13 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>
<!-- JSTL 페이징변수선언 -->
<c:set var="totalCount" value="${empty TOTAL_COUNT?0:TOTAL_COUNT}" />
<c:set var="maxPage" value="${empty MAX_PAGE_SIZE?1:MAX_PAGE_SIZE}" />
<c:set var="nPage" value="${empty param.page?1:param.page}" />
<c:set var="pageIndex" value="${(nPage-1)/10}" />
<c:set var="nextPage" value="${empty NEXT_PAGE?1:NEXT_PAGE}" />
<c:set var="prevPage" value="${empty PREV_PAGE?1:PREV_PAGE}" />
<script>
$(function(){
//제품군 목록 조회
fn_setProductGroupList();
//고객사 목록 조회
fn_setOEMList();
//검사명 목록 조회
fn_setTestTypeList();
// 품질검사결과 갑지Form 팝업
$("#btnRegist").click(function(){
var params = "?actionType=regist"
window.open("/quality/qualityTestFormPopup.do"+params, "", "width=500, height=250");
});
$("#btnSearch").click(function(){
fn_search();
});
// 품질검사결과 갑지 Detail Form 팝업
$(".btnDetail").click(function(){
var targetObjId = $(this).attr("data-OBJID");
var params = "?targetObjId="+targetObjId;
window.open("/quality/qualityTestDetailFormPopup.do"+params, "", "width=500, height=250");
});
// 품질검사결과 등록 팝업
$(".btnDetailList").click(function(){
var targetObjId = $(this).attr("data-OBJID");
var params = "?targetObjId="+targetObjId;
window.open("/quality/qualityTestPartListDetailPopup.do"+params, "", "width=1120, height=440");
});
//고객사별 차종 목록 조회
$("#search_oem").change(function(){
var oemObjId = $(this).val();
fn_setCarTypeList(oemObjId);
});
//제품군 제품 목록 조회
$("#search_productGroup").change(function(){
var productGroup = $(this).val();
fn_setProductTypeList(productGroup);
});
//단계 change
$("#step1").change(function(){
fnc_setStep2($(this).val(), "${param.step2}");
});
//단계1 change trigger
$("#step1").trigger("change");
//엔터키로 조회
$("input").keyup(function(e){
if(e.keyCode == 13){
fn_search();
}
});
});
</script>
<script>
function fn_search(){
document.form1.action = "/quality/qualityTestTempList.do";
document.form1.submit();
}
//oem 목록 조회
function fn_setOEMList(){
$.ajax({
url:"/common/getOEMList.do",
type:"POST",
data:{"isJson":true},
dataType:"json",
success:function(data){
var appendCode = "";
$.each(data, function(i){
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].OEM_NAME+"("+data[i].OEM_CODE+")</option>";
});
$("#search_oem").append(appendCode);
var paramValue = "${param.search_oem}";
if(paramValue != ""){
$("#search_oem > option[value="+paramValue+"]").attr("selected", "true");
$("#search_oem").trigger("change");
}
},
error: function(jqxhr, status, error){
}
});
}
//car 목록 조회
function fn_setCarTypeList(oemObjId){
if(oemObjId !=""){
$.ajax({
url:"/common/getCarTypeList.do",
type:"POST",
data:{"isJson":true, "search_oemObjId":oemObjId},
dataType:"json",
success:function(data){
var appendCode = "<option value=''>선택</option>";
$.each(data, function(i){
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].CAR_CODE+"("+data[i].CAR_NAME+")</option>";
});
$("#search_carType").children().remove();
$("#search_carType").append(appendCode);
$("#search_carType > option[value=${param.search_carType}]").attr("selected", "true");
},
error: function(jqxhr, status, error){
}
});
}else{
$("#search_carType").children().remove();
$("#search_carType").append("<option value=''>선택</option>");
}
}
//제품군 목록 조회
function fn_setProductGroupList(){
$.ajax({
url:"/common/getProductGroupList.do",
type:"POST",
data:{"isJson":true},
dataType:"json",
success:function(data){
var appendCode = "";
$.each(data, function(i){
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_GROUP_NAME+"</option>";
});
$("#search_productGroup").append(appendCode);
var paramValue = "${param.search_productGroup}";
if(paramValue != ""){
$("#search_productGroup > option[value="+paramValue+"]").attr("selected", "true");
$("#search_productGroup").trigger("change");
}
},
error: function(jqxhr, status, error){
}
});
}
//제품 목록 조회
function fn_setProductTypeList(productGroup){
if(productGroup != ""){
$.ajax({
url:"/common/getProductList.do",
type:"POST",
data:{"isJson":true, "search_productGroupObjId":productGroup},
dataType:"json",
success:function(data){
var appendCode = "<option value=''>선택</option>";
$.each(data, function(i){
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_NAME+"("+data[i].PRODUCT_CODE+")</option>";
});
$("#search_productType").children().remove();
$("#search_productType").append(appendCode);
$("#search_productType > option[value=${param.search_productType}]").attr("selected", "true");
},
error: function(jqxhr, status, error){
}
});
}else{
$("#search_productType").children().remove();
$("#search_productType").append("<option value=''>선택</option>");
}
}
//검사명 목록 조회
function fn_setTestTypeList(){
$.ajax({
url:"/common/getTestTypeList.do",
type:"POST",
data:{"isJson":true},
dataType:"json",
success:function(data){
var appendCode = "";
$.each(data, function(i){
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].TEST_TYPE_NAME+"</option>";
});
$("#search_testType").append(appendCode);
var paramValue = "${param.search_testType}";
if(paramValue != ""){
$("#search_testType > option[value=${param.search_testType}]").attr("selected", "true");
}
},
error: function(jqxhr, status, error){
}
});
}
</script>
</head>
<body>
<form name="form1" action="" method="post">
<div style="min-width:1610px;">
<div class="plm_menu_name">
<h2>
<span>합부판정 등록</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tr>
<td><label for="">고객사</label></td>
<td>
<select name="search_oem" id="search_oem">
<option value="">선택</option>
</select>
</td>
<td><label for="">차종</label></td>
<td>
<select name="search_carType" id="search_carType">
<option value="">선택</option>
</select>
</td>
<td><label for="">제품군</label></td>
<td>
<select name="search_productGroup" id="search_productGroup">
<option value="">선택</option>
</select>
</td>
<td><label for="">제품</label></td>
<td colspan="3">
<select name="search_productType" id="search_productType" style="width:200px;">
<option value="">선택</option>
</select>
</td>
<td><label for="">단계1</label></td>
<td>
<select name="step1" id="step1" >
<option value="">선택</option>
<option value="design" ${param.step1 eq 'design'?'selected':''}>설계</option>
<option value="develop" ${param.step1 eq 'develop'?'selected':''}>개발</option>
<option value="production" ${param.step1 eq 'production'?'selected':''}>양산</option>
</select>
</td>
<td><label for="">단계2</label></td>
<td>
<select name="step2" id="step2">
<option value="">선택</option>
<option value=""></option>
</select>
</td>
</tr>
<tr>
<td><label for="">검사명</label></td>
<td>
<select name="search_testType" id="search_testType">
<option value="">선택</option>
</select>
</td>
<td><label for="">담당자</label></td>
<td>
<input type="text" id="search_writer" name="search_writer" value="${param.search_writer}" >
</td>
<td><label for="">상태</label></td>
<td>
<select name="search_status" id="search_status">
<option value="">선택</option>
<option value="create"${param.search_status eq'create'?'selected':'' }>작성중</option>
<option value="complete"${param.search_status eq'complete'?'selected':'' }>완료</option>
</select>
</td>
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="등록" class="plm_btns" id="btnRegist">
</div>
</div>
<div class="plm_table_wrap">
<table class="plm_table">
<colgroup>
<col width="3%">
<col width="6%">
<col width="15%">
<col width="15%">
<col width="*">
<col width="8%">
<col width="8%">
<col width="8%">
<col width="8%">
<col width="5%">
<col width="5%">
<col width="5%">
</colgroup>
<thead>
<tr class="plm_thead">
<td>No</td>
<td>고객사</td>
<td>차종</td>
<td>제품군</td>
<td>제품</td>
<td>담당자</td>
<td>등록일</td>
<td>검사명</td>
<td>단계</td>
<td>결과상세</td>
<td>결과List</td>
<td>상태</td>
</tr>
</thead>
<tbody>
<c:choose>
<c:when test="${!empty LIST}">
<c:forEach var="info" items="${LIST}" varStatus="status">
<tr>
<td>${info.RNUM}</td>
<td title="${info.OEM_NAME}">${info.OEM_NAME}</td>
<td title="${info.CAR_CODE} (${info.CAR_NAME})">${info.CAR_CODE} (${info.CAR_NAME})</td>
<td title="${info.PROD_GROUP_NAME}">${info.PROD_GROUP_NAME}</td>
<td title="${info.PROD_NAME}">${info.PROD_NAME}</td>
<td title="${info.WRITER_DEPT_NAME} ${info.WRITER_USER_NAME}">${info.WRITER_DEPT_NAME} ${info.WRITER_USER_NAME}</td>
<td title="${info.REGDATE}">${info.REGDATE}</td>
<td title="${info.TEST_TYPE_NAME}">${info.TEST_TYPE_NAME}</td>
<td>
<c:choose>
<c:when test="${info.STEP1 eq 'design'}">
설계
</c:when>
<c:when test="${info.STEP1 eq 'develop'}">
개발
</c:when>
<c:when test="${info.STEP1 eq 'production'}">
양산
</c:when>
<c:otherwise>
${info.STEP1}
</c:otherwise>
</c:choose>
/ ${info.STEP2}
</td>
<td><a href="#" class="file_icon btnDetail" data-OBJID="${info.OBJID}"></a></td>
<td><a href="#" class="file_icon btnDetailList" data-OBJID="${info.OBJID}"></a></td>
<td>
<c:choose>
<c:when test="${info.STATUS eq 'create'}">
작성중
</c:when>
<c:when test="${info.STATUS eq 'complete'}">
완료
</c:when>
<c:otherwise>
${info.STATUS}
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr>
<td colspan="12" align="center">조회된 결과가 없습니다.</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
</div>
<div class="pdm_page">
<input type="hidden" name="page" id="page" value="${nPage}">
<c:if test="${!empty LIST}">
<div class="page_pro">
<table>
<tr>
<c:choose>
<c:when test="${nPage > 1}">
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">prev</td>
</c:otherwise>
</c:choose>
<c:forEach var="v" begin="${nPage>5?nPage-5:1}" end="${nPage>5?nPage+4:10}" step="1" varStatus="status">
<c:if test="${status.index -1 < maxPage}">
<c:choose>
<c:when test="${status.index eq nPage}">
<td><a href="#" class="now_page">${nPage}</a></td>
</c:when>
<c:otherwise>
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<c:choose>
<c:when test="${nPage < maxPage}">
<td><a href="javascript:fnc_goNext('${nextPage}');">next</a></td>
</c:when>
<c:otherwise>
<td class="no_more_page">next</td>
</c:otherwise>
</c:choose>
</tr>
</table>
<p id="adminPageCount">총 ${totalCount}건</p>
</div>
</c:if>
</div>
</section>
</div>
</form>
</body>
</html>