640 lines
18 KiB
Plaintext
640 lines
18 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" %>
|
|
<%
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String userId = CommonUtils.checkNull(person.getUserId());
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
/* $('#design_pm').select2();
|
|
$('#production_pm').select2();
|
|
$('#electro_pm').select2();
|
|
$('#se_pm').select2();
|
|
$('#manager_pm').select2(); */
|
|
|
|
//사용자 창 숨기기 기능
|
|
if("<%=userId%>" == "plm_admin"){
|
|
|
|
}else if("<%=userId%>" == "${info.WRITER}"){
|
|
|
|
}
|
|
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
//설계변경
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
//삭제
|
|
$("#btnDel").click(function(){
|
|
fn_Del();
|
|
});
|
|
|
|
|
|
//입찰품목 등록
|
|
$("#conceptItemRegist").click(function(){
|
|
var params = "";
|
|
params += "?targetObjId=${objId}";
|
|
window.open("/projectConcept/projectConceptProductInfoFormPopup.do"+params, "", "width=760, height=700");
|
|
});
|
|
|
|
//취소
|
|
$("#btnCancel").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var params = "?objId="+objId;
|
|
document.form1.action ="/projectConcept/projectConceptDetailPopup.do"+params;
|
|
document.form1.submit();
|
|
});
|
|
|
|
fnc_setFileDropZone("projectDropZone", "${objId}", "PART_FILE", "PART_FILE", "projectAreaDraw",false,null,null);
|
|
|
|
projectAreaDraw();
|
|
//projectAreaDraw2();
|
|
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "${objId}", "PART_FILE", "PART_FILE", null, "projectAreaDraw");
|
|
//file객체 초기화
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 File이 없습니다.");
|
|
}
|
|
});
|
|
|
|
fnc_datepick();
|
|
});
|
|
</script>
|
|
<script>
|
|
//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>";
|
|
});
|
|
|
|
$("#oemObjId").append(appendCode);
|
|
|
|
$("#oemObjId > option[value=${info.OEM_OBJID}]").attr("selected", "true");
|
|
$("#oemObjId").trigger("change");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function inputNumberFormat(obj) {
|
|
|
|
var sub_p_sum ="";
|
|
var sub_r_sum ="";
|
|
var sub_ps_sum ="";
|
|
var avr="";
|
|
var average="";
|
|
var avr1="";
|
|
var average1="";
|
|
|
|
if(obj.id=="dev_p_product" || obj.id=="sale_p_product"){
|
|
sub_p_sum = Number($("#dev_p_product").val().replace(/,/gi,"")) + Number($("#sale_p_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_p_sum").val(sub_p_sum);
|
|
|
|
avr = Number($("#dev_p_product").val().replace(/,/gi,"")) / Number($("#sub_p_sum").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_p_product").val().replace(/,/gi,"")) / Number($("#sub_p_sum").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#dev_p").val(average+"%");
|
|
}
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#sale_p").val(average1+"%");
|
|
}
|
|
|
|
$("#sub_p_sum").val(comma(uncomma(sub_p_sum)));
|
|
|
|
}
|
|
|
|
if(obj.id=="dev_r_product" || obj.id=="sale_r_product"){
|
|
sub_r_sum = Number($("#dev_r_product").val().replace(/,/gi,"")) + Number($("#sale_r_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_r_sum").val(sub_r_sum);
|
|
|
|
avr = Number($("#dev_r_product").val().replace(/,/gi,"")) / Number($("#dev_p_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_r_product").val().replace(/,/gi,"")) / Number($("#sale_p_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#dev_r").val(average1+"%");
|
|
}
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#sale_r").val(average+"%");
|
|
}
|
|
|
|
$("#sub_r_sum").val(comma(uncomma(sub_r_sum)));
|
|
|
|
}
|
|
|
|
|
|
if(obj.id=="dev_ps_product" || obj.id=="sale_ps_product"){
|
|
sub_ps_sum = Number($("#dev_ps_product").val().replace(/,/gi,"")) + Number($("#sale_ps_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_ps_sum").val(sub_ps_sum);
|
|
|
|
avr = Number($("#dev_p_product").val().replace(/,/gi,"")) / Number($("#dev_ps_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_p_product").val().replace(/,/gi,"")) / Number($("#sale_ps_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#dev_ps").val(average1+"%");
|
|
}
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#sale_ps").val(average+"%");
|
|
}
|
|
|
|
$("#sub_ps_sum").val(comma(uncomma(sub_ps_sum)));
|
|
|
|
}
|
|
|
|
|
|
obj.value = comma(uncomma(obj.value));
|
|
|
|
}
|
|
|
|
function comma(str) {
|
|
str = String(str);
|
|
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
|
}
|
|
|
|
function uncomma(str) {
|
|
str = String(str);
|
|
return str.replace(/[^\d]+/g, '');
|
|
}
|
|
|
|
|
|
//형상 영역을 display 한다.
|
|
function projectAreaDraw(){
|
|
fn_fileCallback("project","PART_FILE");
|
|
}
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(areaId,fileType){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${objId}", "docType":fileType},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
|
|
//첨부파일 목록 영역 show
|
|
$("#"+areaId+"FileArea").empty();
|
|
|
|
if(0 < $("#"+areaId+"DefaultRow").length){
|
|
$("#"+areaId+"DefaultRow").hide();
|
|
}
|
|
|
|
$.each(data, function(i){
|
|
|
|
var appendText = "";
|
|
if("project" == areaId || "project1" == areaId || "project2" == areaId){
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
appendText += "<colgroup>";
|
|
appendText +=" <col width='10%''>";
|
|
appendText +=" <col width='*'>";
|
|
appendText +=" <col width='20%'>";
|
|
appendText +=" </colgroup>";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>"+[i+1]+"</td>";
|
|
appendText+= " <td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
<c:if test="${param.actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
|
|
</c:if>
|
|
appendText+= "</td>";
|
|
appendText+= " <td>"+data[i].REGDATE+"</td>";
|
|
appendText+= "</tr>";
|
|
}
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#"+areaId+"DropZone").show();
|
|
$("#"+areaId+"AttachFileList").hide();
|
|
$("#"+areaId+"FileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
|
|
|
|
/*첨부 파일 삭제 */
|
|
function fileDelete(fileObjId,areaId){
|
|
var type =areaId;
|
|
if(confirm("파일을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
fn_fileCallback("project","PART_FILE");
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
//파트 설계 변경
|
|
function fn_save(){
|
|
|
|
if(fnc_valitate("form1")){
|
|
if(confirm("설계 변경 하시겠습니까? 설계 변경 작성 화면으로 전환후 \n 내용 작성 및 첨부 배포 완료후 Revsion 갱신 됩니다.")){
|
|
saveProcess();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
//PART 삭제
|
|
function fn_Del(){
|
|
|
|
if(fnc_valitate("form1")){
|
|
if(confirm("삭제 하시겠습니까? 연결된 하위 파트 정보가 모두 삭제 됩니다 주의 하시기 바랍니다.")){
|
|
delProcess();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function fn_checkProductCnt(){
|
|
var result = false;
|
|
var objId = $("#objId").val();
|
|
|
|
$.ajax({
|
|
url:"/projectConcept/getProjectConceptProductCnt.do",
|
|
type:"POST",
|
|
data:{"targetObjId":objId},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var cnt = data.CNT;
|
|
|
|
if(cnt > 0){
|
|
result = true;
|
|
}else{
|
|
result = false;
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
return result;
|
|
}
|
|
|
|
function saveProcess(){
|
|
|
|
$.ajax({
|
|
url:"/partmgmt/changePartInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
//Swal.fire('저장되었습니다');
|
|
//Swal.fire(data.RESULT.objId);
|
|
//top.opener.location.href="/partmgmt/partmgmtTempList.do?menuObjId=-1488467295";
|
|
location.href="/partmgmt/partmgmtTempFormPopup.do?objid="+data.RESULT.objId;
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function delProcess(){
|
|
|
|
$.ajax({
|
|
url:"/partmgmt/deletePartInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire('삭제되었습니다');
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${objId}">
|
|
<section>
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>설계관리_PART 조회</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="20%"/>
|
|
<col width="*"/>
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>프로젝트번호
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="project_no" id="project_no" readonly disabled value="${info.PROJECT_NO}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>프로젝트명
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="project_title" id="project_title" readonly disabled value="${info.PROJECT_TITLE}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>품명
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="part_name" id="part_name" readonly disabled value="${info.PART_NAME}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>품번
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="part_no" id="part_no" readonly disabled value="${info.PART_NO}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>수량
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="qty" id="qty" readonly disabled value="${info.QTY}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>재질
|
|
</td>
|
|
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="material" id="material" readonly disabled value="${info.MATERIAL}" maxlength="20">
|
|
</td>
|
|
<%-- <td colspan="2" class="input_sub_title">
|
|
<select name="spec_cd" id="spec_cd" readonly disabled type="select">
|
|
<option value="">선택</option>
|
|
${code_map.spec_cd}
|
|
</select>
|
|
</td> --%>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">사이즈</label>
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="sized" id="sized" readonly disabled value="${info.SIZED}" maxlength="20">
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
<%-- <tr>
|
|
<td class="input_title">
|
|
<label for="">후처리</label>
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="process_cd" id="process_cd" readonly disabled value="${info.PROCESS_CD}" maxlength="100">
|
|
<select name="process_cd" id="process_cd" reqTitle="후처리" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.process_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">경도</label>
|
|
</td>
|
|
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="mfa_cd" id="mfa_cd" readonly disabled value="${info.MFA_CD}" maxlength="20">
|
|
</td>
|
|
|
|
<td colspan="2" class="input_sub_title">
|
|
<select name="mfa_cd" id="mfa_cd" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.mfa_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">형변(규격)</label>
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="spec_cd" id="spec_cd" readonly disabled value="${info.SPEC_CD}" maxlength="20">
|
|
</td>
|
|
|
|
</tr> --%>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>구매구분
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<select name="sort_cd" id="sort_cd" readonly disabled type="select">
|
|
<option value="">선택</option>
|
|
${code_map.sort_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">메이커</label>
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<%-- <select name="supply_cd" id="supply_cd" reqTitle="공급업체" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.supply_cd}
|
|
</select> --%>
|
|
<input type="text" name="supply_cd" id="supply_cd" readonly disabled value="${info.SUP_CD}" maxlength="100">
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td rowspan="2" class="input_title" style="font-size:13px;">
|
|
<label for=""></label>도면파일
|
|
</td>
|
|
|
|
<td colspan="2">
|
|
<div id="projectDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
|
|
<!-- <input type="file" name="file1" id="file1" multiple style="width:90%;"> -->
|
|
<!-- <input type="button" id="btnUpload" value="Upload" class="upload_btns"> -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="2">
|
|
<div class="project_form_in_table"style="width:100%" id="projectFileAreaTable" >
|
|
<div style="overflow-y:scroll;">
|
|
<table class=""fileListscrollThead"" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>첨부파일명</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="height:50px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
</table>
|
|
<table id="projectFileArea" class="fileListscrollTbody">
|
|
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>변경사유
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<select name="change_cd" id="change_cd" disabled type="select">
|
|
<option value="">선택</option>
|
|
${code_map.change_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>Rev
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="rev" id="rev" readonly value="${info.REV}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title" style="font-size:13px;">
|
|
<label for=""></label>Date
|
|
</td>
|
|
<td colspan="2" class="input_sub_title">
|
|
<input type="text" name="rel_date" id="rel_date" readonly disabled value="${info.REL_DATE}" maxlength="20">
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<!-- <input type="button" value="Edit" class="plm_btns" onclick=""> -->
|
|
<div class="plm_btn_wrap_center">
|
|
<c:choose>
|
|
<c:when test="${info.REG_USER_ID eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
<c:if test="${info.IS_LAST eq '1'}">
|
|
<input type="button" value="설계변경" id="btnSave" class="plm_btns">
|
|
<!-- <input type="button" value="삭제" id="btnDel" class="plm_btns"> -->
|
|
</c:if>
|
|
</c:when>
|
|
<c:otherwise>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<%--
|
|
<c:if test="${actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
<input type="button" value="수정" id="btnSave" class="plm_btns">
|
|
</c:if> --%>
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |