424 lines
13 KiB
Plaintext
424 lines
13 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@include file="/init.jsp"%>
|
|
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
|
|
<c:set var="search_oem" value="${empty param.search_oem ? '' : param.search_oem}" />
|
|
<c:set var="search_car" value="${empty param.search_car ? '' : param.search_car}" />
|
|
|
|
<script>
|
|
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
fnc_datepick();
|
|
|
|
getCarList("${search_oem}","${search_car}");
|
|
getChangeProductList("search_product","${param.search_productFamily}","${param.search_product}");
|
|
|
|
$("input[type=text]").keyup(function(e){
|
|
if(e.keyCode == 13) search();
|
|
});
|
|
|
|
//image src encoding
|
|
$("img").each(function(i){
|
|
var imgSrc = $(this).attr("data-SRC");
|
|
$(this).attr("src", encodeURI(imgSrc));
|
|
});
|
|
|
|
$("input[name=partCheckBox]").click(function(){
|
|
var partChk = $("input[name=partCheckBox]");
|
|
if(partChk.not(":checked")) {
|
|
$("#allCheck").attr('checked',false);
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
function search(){
|
|
var form = document.form1;
|
|
form.action = "/part/getStartDevPartList.do";
|
|
form.submit();
|
|
}
|
|
|
|
function excelExport(){
|
|
var form = document.form1;
|
|
form.actionType.value = "excel";
|
|
search();
|
|
}
|
|
|
|
//파트 상세 또는 입력 화면을 출력한다.
|
|
function openPartFormPopup(actionType,objid,writer){
|
|
var hiddenForm = document.hiddenForm;
|
|
var url = "/part/openStartDevPartFormPopUp.do";
|
|
var target = "tempPartListPopup";
|
|
if("" != objid){
|
|
url = "/part/openStartDevPartDetailPopUp.do";
|
|
target = objid;
|
|
}
|
|
if("${userId}" == writer){
|
|
url = "/part/openStartDevPartFormPopUp.do";
|
|
}
|
|
|
|
window.open(url,target,"width=750, height=930");
|
|
|
|
hiddenForm.action = url;
|
|
hiddenForm.actionType.value = actionType;
|
|
hiddenForm.objid.value = objid;
|
|
hiddenForm.target = target;
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
|
|
//전체 체크
|
|
function fn_allChk(obj){
|
|
var checked = $(obj).is(":checked");
|
|
|
|
$("input[name=partCheckBox]").each(function(){
|
|
if(checked) this.checked = true;
|
|
else this.checked = false;
|
|
});
|
|
}
|
|
|
|
//작성중에 해당하는 파트를 삭제한다.
|
|
function deletePart(){
|
|
var partLength = $("input[name=partCheckBox]:checked").length;
|
|
|
|
if(0 < partLength){
|
|
var checkCnt = 0;
|
|
$("input[name=partCheckBox]:checked").each(function(){
|
|
var partObjId = this.value;
|
|
var status = $("input[name="+partObjId+"_status]").val();
|
|
if(status != "create"){
|
|
checkCnt++;
|
|
Swal.fire("작성중인 Part만 삭제 가능합니다.");
|
|
return false;
|
|
}
|
|
});
|
|
|
|
if(checkCnt == 0){
|
|
|
|
var param = $("#form1").serialize();
|
|
|
|
if(confirm("선택된 파트를 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/part/deletePart.do",
|
|
data: param,
|
|
dataType:"json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(null != result){
|
|
Swal.fire(result.message);
|
|
search();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}else{
|
|
Swal.fire("선택된 파트가 없습니다.");
|
|
}
|
|
}
|
|
|
|
function openImagePopUp(url){
|
|
var img=new Image();
|
|
img.src=url;
|
|
var img_width=img.width;
|
|
var img_height=img.height;
|
|
var win_width=img.width+25;
|
|
var height=img.height+30;
|
|
|
|
window.open(url,"partListShapeImgPopUp","width="+img_width+",height="+height+", menubars=no, scrollbars=yes, resizable=yes'");
|
|
}
|
|
|
|
function getCarList(oemObjid,carObjid){
|
|
var carSelectObj = $("#search_car");
|
|
$(carSelectObj).find("option").remove();
|
|
$(carSelectObj).append("<option value=''>선택</option>");
|
|
|
|
if("" == oemObjid || null == oemObjid){
|
|
return false;
|
|
}else{
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/admin/getOEMsCarList.do",
|
|
data:{ "status" : "active" , "oemObjId" : oemObjid},
|
|
dataType:"json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(null != result){
|
|
for(var i=0;i<result.length;i++){
|
|
var objid = result[i].OBJID;
|
|
var carName = result[i].CAR_NAME;
|
|
var carCode = result[i].CAR_CODE;
|
|
$(carSelectObj).append("<option value='"+objid+"'>"+carCode+"</option>");
|
|
}
|
|
if("" != carObjid){
|
|
$(carSelectObj).val(carObjid);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function getChangeProductList(areaObjId,productGroupObjId,targetProductObjId){
|
|
$("#"+areaObjId).find("option").remove();
|
|
$("#"+areaObjId).append("<option value=''>선택</option>");
|
|
|
|
if("" != productGroupObjId && null != productGroupObjId){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/common/getProductList_combo.do",
|
|
data:{"search_productGroupObjId" : productGroupObjId, "isJson":true},
|
|
dataType:"json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(null != result){
|
|
for(var i=0;i<result.length;i++){
|
|
var resultAppendText = "";
|
|
var productName = result[i].PRODUCT_NAME;
|
|
var selectedFlag = "";
|
|
if(targetProductObjId == result[i].OBJID){
|
|
selectedFlag = "selected";
|
|
}
|
|
resultAppendText="<option value='"+result[i].OBJID+"' "+selectedFlag+">"+productName+"</option>";
|
|
$("#"+areaObjId).append(resultAppendText);
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="hiddenForm" id="hiddenForm" method="post">
|
|
<input type="hidden" name="actionType" id="actionType">
|
|
<input type="hidden" name="objid" id="objid">
|
|
</form>
|
|
<form name="form1" id="form1" method="post">
|
|
<input type="hidden" name="actionType" id="actionType">
|
|
<input type="hidden" name="status" id="status">
|
|
<section class="min_part_enroll" style="min-width:1640px;">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>시작 Part 관리</span>
|
|
</h2>
|
|
</div>
|
|
<div id="plmSearchZon">
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td class="align_r">
|
|
<label for="" class="">고객사</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_oem" id="search_oem" onchange="getCarList(this.value,'${param.search_car}')">
|
|
<c:choose>
|
|
<c:when test="${empty oemList}">
|
|
<option value="">선택</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${oemList}" varStatus="varStatus">
|
|
<option value="${item.OBJID}" ${item.OBJID eq param.search_oem ? 'selected':''}>${item.OEM_NAME}(${item.OEM_CODE})</option>
|
|
</c:forEach>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">차종</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_car" id="search_car"></select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">제품군</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_productFamily" id="search_productFamily" onchange="getChangeProductList('search_product',this.value,'${param.search_product}')">
|
|
<c:choose>
|
|
<c:when test="${empty productGroupList}">
|
|
<option value="">선택</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${productGroupList}" varStatus="varStatus">
|
|
<option value="${item.OBJID}" ${item.OBJID eq param.search_productFamily ? 'selected':''}>${item.PRODUCT_GROUP_NAME}</option>
|
|
</c:forEach>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">제품</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_product" id="search_product">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">품번</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_partNo" id="search_partNo" value="${param.search_partNo}"/>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">품명</label>
|
|
</td>
|
|
<td colspan="3">
|
|
<input type="text" name="search_partName" id="search_partName" value="${param.search_partName}"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="align_r">
|
|
<label for="" class="">재질</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_material" id="search_material">
|
|
<c:choose>
|
|
<c:when test="${empty materialList}">
|
|
<option value="">선택</option>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${materialList}" varStatus="varStatus">
|
|
<option value="${item.OBJID}" ${item.OBJID eq param.search_material ? 'selected':''}>${item.MATERIAL_NAME}</option>
|
|
</c:forEach>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</select>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">두께</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" id="search_thickness" name="search_thickness" value="${param.search_thickness}">
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">도면번호</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_drawingNo" id="search_drawingNo" value="${param.search_drawingNo}"/>
|
|
</td>
|
|
<td class="align_r">
|
|
<label for="" class="">출도구분</label>
|
|
</td>
|
|
<td>
|
|
<select name="search_drawReleaseType" id="search_drawReleaseType">
|
|
<option value="" ${'' eq param.search_drawReleaseType ? 'selected':''}>전체</option>
|
|
<option value="dev" ${'dev' eq param.search_drawReleaseType ? 'selected':''}>개발</option>
|
|
<option value="product" ${'product' eq param.search_drawReleaseType ? 'selected':''}>양산</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="contents_page_basic_margin">
|
|
<div style="float:left; line-height:49px;">총 <span>${fn:length(partList)}</span>건</div>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap">
|
|
<input type="button" value="조회" class="plm_btns" onclick="search();">
|
|
<input type="button" value="시작 Part 등록" name="" id="" class="plm_btns" onclick="javascript:openPartFormPopup('regist','','')">
|
|
<input type="button" value="시작 Part 삭제" name="" id="" class="plm_btns" onclick="javascript:deletePart()">
|
|
<input type="button" value="Excel Download" name="" id="" class="plm_btns" onclick="excelExport();">
|
|
</div>
|
|
</div>
|
|
<div class="plm_table_wrap">
|
|
<div style="overflow-y:scroll;">
|
|
<table class="plm_table" style="width:100%;">
|
|
<colgroup>
|
|
<col width="2%" />
|
|
<col width="3%" />
|
|
<col width="10%" />
|
|
<col width="*%" />
|
|
<col width="10%" />
|
|
<col width="7%" />
|
|
<col width="7%" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" name="" value="" id="allCheck" class="checkBox" onclick="fn_allChk(this);"></td>
|
|
<td>No</td>
|
|
<td>품번</td>
|
|
<td>품명</td>
|
|
<td>형상</td>
|
|
<td>도면구분</td>
|
|
<td>등록일</td>
|
|
<td>상태</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="width:100%; height:660px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2%" />
|
|
<col width="3%" />
|
|
<col width="10%" />
|
|
<col width="*%" />
|
|
<col width="10%" />
|
|
<col width="7%" />
|
|
<col width="7%" />
|
|
<col width="10%" />
|
|
</colgroup>
|
|
<c:choose>
|
|
<c:when test="${empty partList}">
|
|
<tr style="text-align:center;">
|
|
<td align="center" colspan="8">조회된 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<c:forEach var="item" items="${partList}" varStatus="varStatus">
|
|
<tr>
|
|
<input type="hidden" name="${item.OBJID}_status" value="${item.STATUS}">
|
|
<td><input type="checkbox" name="partCheckBox" value="${item.OBJID}"></td>
|
|
<td>${item.RNUM}</td>
|
|
<td><a href="#" onclick="openPartFormPopup('','${item.OBJID}','${item.WRITER}')">${item.PART_NO}</a></td>
|
|
<td><a href="#" onclick="openPartFormPopup('','${item.OBJID}','${item.WRITER}')">${item.PART_NAME}</a></td>
|
|
<td>
|
|
<c:if test="${!empty item.SAVED_FILE_NAME and !empty item.REAL_FILE_NAME and !empty item.FILE_PATH}">
|
|
<img src="#" height='100' width='100' onclick="openImagePopUp(this.src)" data-SRC="/common/viewImage.do?realFileName=${item.REAL_FILE_NAME}&savedFileName=${item.SAVED_FILE_NAME}&attDir=${item.FILE_PATH}"/>
|
|
</c:if>
|
|
</td>
|
|
<td>${item.DRAWING_TYPE_TITLE}</td>
|
|
<td>${item.REGDATE}</td>
|
|
<td>${item.STATUS_STR}</td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |