ERP-node/WebContent/WEB-INF/view/usedMng/usedMngDetailPopUp.jsp

494 lines
15 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ 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(){
$("#btnClose").click(function(){
self.close(0);
});
$("#btnEdit").click(function(){
openUsedMngPopup("${resultMap.OBJID}");
});
fnc_datepick();
fn_getApprovalLine();
fnc_getCodeListAppend("<%=Constants.DIVISION_CD%>","DIVISION","${resultMap.DIVISION}");
fnc_getCodeListAppend("<%=Constants.USED_MNG_STATUS_CD%>","STATUS","${resultMap.STATUS}");
fnc_getCodeListAppend("<%=Constants.INVENTORY_LOCATION_CD%>","LOCATION","${resultMap.LOCATION}");
fn_getProjectNoList("SALES_TARGET","${resultMap.SALES_TARGET}");
$("#USE_YN").val("${resultMap.USE_YN}");
});
</script>
<script>
function fn_getProjectNoList(selectboxId,selectedVal){
$.ajax({
url:"/common/getProjectNoList.do",
type:"POST",
data:{},
dataType:"json",
async:false,
success:function(data){
var resultList = data;
console.log("data:"+data);
if(0 < resultList.length){
$("#"+selectboxId).empty();
$("#"+selectboxId).append("<option value=''>선택</option>");
for (var i = 0; i < resultList.length; i++) {
var projectNoObjId = resultList[i].ORDER_MGMT_OBJID;
var projectNo = resultList[i].PROJECT_NO;
$("#"+selectboxId).append("<option value='"+projectNoObjId+"'>"+projectNo+"</option>");
}
$("#"+selectboxId).val(selectedVal);
}
},
error: function(jqxhr, status, error){
}
});
}
//해당 금형관리의 결재정보를 가져온다.
function fn_getApprovalLine(){
var scheduleList = new Array();
<c:forEach items="${approvalList}" var="approvalItem">
var seq = "${approvalItem.SEQ}";
var targetUserName = "${approvalItem.TARGET_USER_NAME}";
var procDate = "${approvalItem.PROC_DATE}";
if(1 == seq){
$("#reviewerName").append(targetUserName);
$("#reviewerDate").append(procDate);
}
if(2 == seq){
$("#confirmName").append(targetUserName);
$("#confirmDate").append(procDate);
}
</c:forEach>
}
function fn_save(){
if(fnc_valitate("form1")){
if(confirm("저장하시겠습니까?")){
$.ajax({
url:"/usedMng/saveUsedMng.do",
type:"POST",
data:$("#form1").serialize(),
dataType:"json",
success:function(data){
Swal.fire(data.message);
opener.fn_search();
self.close();
},
error: function(jqxhr, status, error){
}
});
}
}
}
function openUsedMngPopup(objId){
if(confirm("수정하시겠습니까?")){
var form = document.form1;
var url = "/usedMng/usedMngFormPopUp.do";
form.action = url;
form.OBJID.value = objId;
form.submit();
}
}
function openUsedMngFilePopup(objId,title,docType){
var hiddenForm = document.hiddenForm;
var url = "/usedMng/usedMngFilePopUp.do";
var popUpSize = "width=600, height=250";
if(docType == "USED_MNG_IMAGE"){
url = "/usedMng/usedMngImageFilePopUp.do";
popUpSize = "width=600, height=520";
}
var target = "usedMngFilePopUp";
window.open(url,target,popUpSize+", menubars=no, scrollbars=yes, resizable=yes");
hiddenForm.action = url;
hiddenForm.DOC_TYPE.value = docType;
hiddenForm.TITLE.value = title;
hiddenForm.OBJID.value = objId;
hiddenForm.target = target;
hiddenForm.submit();
}
</script>
<style>
.input_title {border-left:1px solid #ccc;}
.input_sub_title {border-left:1px solid #ccc;}
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
</style>
<body>
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="OBJID" id="OBJID">
<input type="hidden" name="TITLE" id="TITLE">
<input type="hidden" name="DOC_TYPE" id="DOC_TYPE">
<input type="hidden" name="actionType" id="actionType">
<input type="hidden" name="division" id="division">
<input type="hidden" name="status" id="status">
</form>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
<input type="hidden" name="actionType" id="actionType" value="${param.actionType}">
<section>
<div class="plm_menu_name" style="display:flex;">
<h2 style="width:50%;text-align:center;margin-top:15px;">
<span style="font-size:30px;">중고장비매입</span>
</h2>
<table class="pmsPopupForm" style="width:50%;background:white;">
<colgroup>
<col width="20%">
<col width="20%">
<col width="20%">
<col width="20%">
</colgroup>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;border-left:1px solid #ccc;">
<td class="input_title" rowspan="3" style="text-align:center;">
<label>결재</label>
</td>
<td class="input_title" style="text-align:center;">
<label>작성자</label>
</td>
<td class="input_title" style="text-align:center;">
<label>검토</label>
</td>
<td class="input_title" style="text-align:center;">
<label>승인</label>
</td>
</tr>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;">
<td class="input_sub_title" style="text-align:center;">
${resultMap.WRITER_TITLE}<!-- 작성자이름 -->
</td>
<td class="input_sub_title" style="text-align:center;" id="reviewerName"></td>
<td class="input_sub_title" style="text-align:center;" id="confirmName"></td>
</tr>
<tr style="border-spacing: 0;border-bottom:1px solid #ccc;border-left:1px solid #ccc;">
<td class="input_sub_title" style="text-align:center;">
${resultMap.REGDATE_TITLE}<!-- 작성일자 -->
</td>
<td class="input_sub_title" style="text-align:center;" id="reviewerDate"></td>
<td class="input_sub_title" style="text-align:center;" id="confirmDate"></td>
</tr>
</table>
</div>
<div id="businessPopupFormWrap">
<!-- <div class="form_popup_title">&nbsp;&nbsp;&nbsp;영업활동 등록</div> -->
<table class="pmsPopupForm">
<colgroup>
<col width="10.5%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="*%">
</colgroup>
<tr>
<td class="input_sub_title" rowspan="4">매입정보</td>
<td class="input_title">
<label for="">장비번호</label>
</td>
<td class="input_sub_title" colspan="5">
${null eq resultMap.EQUIPMENT_NUMBER ? '저장 시 자동체번됩니다.':resultMap.EQUIPMENT_NUMBER}
</td>
</tr>
<tr>
<td class="input_title">
<label for="">구분</label>
</td>
<td class="input_sub_title">
<select name="DIVISION" id="DIVISION" disabled>
<c:choose>
<c:when test="${empty divisionList}">
<option value="">선택</option>
</c:when>
<c:otherwise>
<option value="">선택</option>
<c:forEach var="item" items="${divisionList}" varStatus="varStatus">
<option value="${item.CODE_ID}">${item.CODE_NAME}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</select>
</td>
<td class="input_title">
<label for="">매입처</label>
</td>
<td class="input_sub_title">${resultMap.BUYER}</td>
<td class="input_title">
<label for="">이미지</label>
</td>
<td class="input_sub_title" style="text-align:center;">
<a href="#" onclick="openUsedMngFilePopup('${resultMap.OBJID}','중고관리 이미지','USED_MNG_IMAGE');">${0 < resultMap.USED_MNG_IMAGE_CNT ? '■':'□'}</a>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">매입금액</label>
</td>
<td class="input_sub_title"><fmt:formatNumber value="${resultMap.PURCHASE_AMOUNT}"/></td>
<td class="input_title">
<label for="">매입일</label>
</td>
<td class="input_sub_title">${resultMap.PURCHASE_DATE_TITLE}</td>
<td class="input_title">
<label for="">Location</label>
</td>
<td class="input_sub_title">
<select name="LOCATION" id="LOCATION" disabled>
<option>선택</option>
</select>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">특이사항</label>
</td>
<td class="input_sub_title" colspan="5">
<textarea id="UNIQUENESS" name="UNIQUENESS" style="width:99.9%;resize:none;height:100%;" placeholder="특이사항을 입력하세요." readonly>${resultMap.UNIQUENESS}</textarea>
</td>
</tr>
</table>
<table class="pmsPopupForm" style="margin-top:10px;height:200px;">
<colgroup>
<col width="10.5%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="*%">
</colgroup>
<tr>
<td class="input_sub_title" rowspan="7">장비상세</td>
<td class="input_title">
<label for="">중량</label>
</td>
<td class="input_sub_title">${resultMap.WEIGHT}</td>
<td class="input_title">
<label for="">SPAN</label>
</td>
<td class="input_sub_title">${resultMap.SPAN}</td>
<td class="input_title">
<label for="">길이</label>
</td>
<td class="input_sub_title">${resultMap.LENGTH}</td>
</tr>
<tr>
<td class="input_title">
<label for="">양정</label>
</td>
<td class="input_sub_title">${resultMap.HEAD}</td>
<td class="input_title">
<label for="">목높이</label>
</td>
<td class="input_sub_title">${resultMap.NECK_HEIGHT}</td>
<td class="input_title">
<label for="">휠베이스</label>
</td>
<td class="input_sub_title">${resultMap.WHEEL_BASE}</td>
</tr>
<tr>
<td class="input_title">
<label for="">권상</label>
</td>
<td class="input_sub_title">${resultMap.WINDING}</td>
<td class="input_title">
<label for="">RAIL</label>
</td>
<td class="input_sub_title">${resultMap.RAIL}</td>
<td class="input_title">
<label for="">휠사이즈</label>
</td>
<td class="input_sub_title">${resultMap.WHEEL_SIZE}</td>
</tr>
<tr>
<td class="input_title">
<label for="">횡행</label>
</td>
<td class="input_sub_title">${resultMap.TRANSVERSE}</td>
<td class="input_title">
<label for="">베이스철판</label>
</td>
<td class="input_sub_title">${resultMap.BASE_PLATE}</td>
<td class="input_title">
<label for="">피니언기어</label>
</td>
<td class="input_sub_title">${resultMap.PINION_GEAR}</td>
</tr>
<tr>
<td class="input_title">
<label for="">전기</label>
</td>
<td class="input_sub_title">${resultMap.ELECTRIC}</td>
<td class="input_title">
<label for=""></label>
</td>
<td class="input_sub_title"></td>
<td class="input_title">
<label for="">프레임</label>
</td>
<td class="input_sub_title">${resultMap.FRAME}</td>
</tr>
<tr>
<td class="input_title">
<label for="">상하판</label>
</td>
<td class="input_sub_title">${resultMap.UPPER_LOWER_PLATE}</td>
<td class="input_title">
<label for=""></label>
</td>
<td class="input_sub_title"></td>
<td class="input_title">
<label for="">내폭</label>
</td>
<td class="input_sub_title">${resultMap.INNER_WIDTH}</td>
</tr>
<tr>
<td class="input_title">
<label for="">측면판</label>
</td>
<td class="input_sub_title">${resultMap.SIDE_PLATE}</td>
<td class="input_title">
<label for=""></label>
</td>
<td class="input_sub_title"></td>
<td class="input_title">
<label for="">외폭</label>
</td>
<td class="input_sub_title">${resultMap.OUTER_WIDTH}</td>
</tr>
</table>
<table class="pmsPopupForm" style="margin-top:10px;">
<colgroup>
<col width="10.5%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="*%">
</colgroup>
<tr>
<td class="input_sub_title">수리정보</td>
<td class="input_title">
<label for="">수리내역</label>
</td>
<td class="input_sub_title" style="text-align:center;">
<a href="#" onclick="openUsedMngFilePopup('${resultMap.OBJID}','중고관리 수리내역','USED_MNG_REPAIR');">${0 < resultMap.USED_MNG_REPAIR_CNT ? '■':'□'}</a>
</td>
<td class="input_title">
<label for="">수리금액</label>
</td>
<td class="input_sub_title"><fmt:formatNumber value="${resultMap.REPAIR_AMOUNT}"/></td>
<td class="input_title">
<label for="">사용유무</label>
</td>
<td class="input_sub_title">
<select name="USE_YN" id="USE_YN" disabled>
<option value="">선택</option>
<option value="Y">Y</option>
<option value="N">N</option>
</select>
</td>
</tr>
</table>
<table class="pmsPopupForm" style="margin-top:10px;">
<colgroup>
<col width="10.5%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="*%">
</colgroup>
<tr>
<td class="input_sub_title">판매정보</td>
<td class="input_title">
<label for="">판매대상</label>
</td>
<td class="input_sub_title">
<select name="SALES_TARGET" id="SALES_TARGET" disabled></select>
</td>
<td class="input_title">
<label for="">판매금액</label>
</td>
<td class="input_sub_title"><fmt:formatNumber value="${resultMap.SALES_AMOUNT}"/></td>
<td class="input_title">
<label for="">투입금액</label>
</td>
<td class="input_sub_title"><fmt:formatNumber value="${resultMap.INPUT_AMOUNT}"/></td>
</tr>
</table>
<table class="pmsPopupForm" style="margin-top:10px;">
<colgroup>
<col width="10.5%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="20%">
<col width="10.5%">
<col width="*%">
</colgroup>
<tr>
<td class="input_title" style="border:none;">
<label for="">상태</label>
</td>
<td class="input_sub_title" colspan="6" >
<select name="STATUS" id="STATUS" disabled></select>
</td>
</tr>
</table>
</div>
<div class="btn_wrap">
<div class="plm_btn_wrap_center">
<c:if test="${(resultMap.WRITER eq connectUserId or 'plm_admin' eq connectUserId) and (resultMap.STATUS_TITLE ne '결재중' and resultMap.STATUS_TITLE ne '결재완료')}">
<input type="button" value="수정" id="btnEdit" class="plm_btns">
</c:if>
<input type="button" value="닫기" id="btnClose" class="plm_btns">
</div>
</div>
</section>
</form>
</body>
</html>