ERP-node/WebContent/WEB-INF/view/distribution/distributionDetailViewPopup...

263 lines
8.3 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>
<c:set var="isWriter" value="${empty isWriter ? false: true}" />
<script type="text/javascript">
$(function(){
$(document).ready(function(){
fnc_datepick();
fn_fileCallback();
fnc_getDistributeList();
fn_distributeConfirm();
});
$('#btn_close').click(function(){
self.close();
});
if(!"${isWriter}"){
$("#btn_release").hide();
$("#btn_modify").hide();
}
});
//배포처로 지정된 인원이 해당 상세페이지 접근 시 확인 처리한다.
function fn_distributeConfirm(){
$.ajax({
url:"/distribution/distributeConfirm.do",
type:"POST",
data: $("#form1").serialize(),
dataType:"json",
async:false,
success:function(data){
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
//입력 form으로 이동
function openDistributePopUp(){
if(confirm("수정하시겠습니까?")){
var form = document.form1;
form.action = "/distribution/distributionFormPopup.do";
form.submit();
}
}
//첨부파일 목록을 가져온다.
function fn_fileCallback(){
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${distributionInfo.OBJID}", "docType":"${DISTRIBUTE_FILE_CODE}"},
dataType:"json",
async:false,
success:function(data){
if(0 < data.length){
//파일드롭다운 영역 hide
//첨부파일 목록 영역 show
$("#distributeFileDefaultRow").hide();
$("#distributeFileList").show();
$("#distributeFileArea").empty();
$.each(data, function(i){
var appendText = "";
appendText+= "<tr>";
appendText+= " <td><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
appendText+= "</tr>";
$("#distributeFileArea").append(appendText);
});
}else{
$("#distributeFileList").show();
$("#distributeFileDefaultRow").show();
$("#distributeFileArea").hide();
}
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
//배포진행
function releaseDistribute(){
if(confirm("배포하시겠습니까?")){
$.ajax({
url:"/distribution/releaseIrregular.do",
type:"POST",
data:$('#form1').serialize(),
dataType:"json",
async:false,
success:function(data){
Swal.fire(data.message);
opener.location.reload();
self.close();
},
error: function(jqxhr, status, error){
Swal.fire(data.message);
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
}
//배포처에 해당하는 차종의 배포처에 지정된 인원의 목록을 가져온다.
function fnc_getDistributeList(){
var search_carObjid = $('#carObjId').val();
$.ajax({
url:"/distribution/getDistributeList.do",
type:"POST",
data:{"search_carObjid":search_carObjid},
dataType:"json",
async:false,
success:function(distributeList){
var distribute = "";
$.each(distributeList, function(){
distribute += this.DEPT_NAME + " " + this.USER_NAME + "/";
});
$('#distribute').val(distribute);
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
</script>
</head>
<body class="backcolor_light_blue">
<form name="form1" id="form1" method="post">
<input type="hidden" name="objId" id="objId" value="${distributionInfo.OBJID}">
<input type="hidden" name="carObjId" id="carObjId" value="${distributionInfo.CAR_OBJID}">
<section>
<div class="plm_menu_name">
<h2>
<span>비정규배포</span>
</h2>
</div>
<div id="businessPopupFormWrap">
<div class="form_popup_title">&nbsp;&nbsp;&nbsp;비정규배포 등록</div>
<table class="pmsPopupForm">
<colgroup>
<col width="10%">
<col width="20%">
<col width="8%">
<col width="20%">
<col width="18%">
<col width="8%">
<col width="13%">
<col width="*">
</colgroup>
<tr>
<td class="input_title">
<label for="" class="">차종</label>
</td>
<td><p>${distributionInfo.CAR_NAME}</p></td>
<td class="input_title">
<label for="" class="">접수처</label>
</td>
<td>
<p>
<c:choose>
<c:when test="${distributionInfo.RECEIVE_TYPE eq 'hkmc'}">HKMC</c:when>
<c:when test="${distributionInfo.RECEIVE_TYPE eq 'supporter'}">협력업체</c:when>
<c:when test="${distributionInfo.RECEIVE_TYPE eq 'etc'}">기타</c:when>
<c:otherwise></c:otherwise>
</c:choose>
</p>
</td>
<td>
<p>
<c:choose>
<c:when test="${distributionInfo.SUB_RECEIVE_TYPE eq 'structure'}">스트럭쳐설계</c:when>
<c:when test="${distributionInfo.SUB_RECEIVE_TYPE eq 'startCar'}">시작차체팀</c:when>
<c:when test="${distributionInfo.SUB_RECEIVE_TYPE eq 'chinaLab'}">중국기술연구소</c:when>
<c:when test="${distributionInfo.SUB_RECEIVE_TYPE eq 'etc'}">기타</c:when>
<c:otherwise></c:otherwise>
</c:choose>
</p>
</td>
<td class="input_title">
<label for="">접수일</label>
</td>
<td><p>${distributionInfo.RECEIVE_DATE}</p></td>
</tr>
<tr>
<td class="input_title">
<label for="">제목</label>
</td>
<td colspan="7"><p style="width:100%;">${distributionInfo.SUBJECT}</p></td>
</tr>
<tr>
<td class="input_title">
<label for="">내용</label>
</td>
<td colspan="7">
<textarea name="name" rows="6" cols="4" style="width:100%; height:50px;" disabled>${distributionInfo.CONTENTS}</textarea>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">첨부파일</label>
</td>
<td colspan="7">
<div id="distributeFileList">
<table id="distributeFileAreaTable" class="spec_data_in_table">
<tr id="distributeFileDefaultRow">
<td>첨부된 파일이 없습니다.</td>
</tr>
<tbody id="distributeFileArea">
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td class="input_title">
<label for="">배포처</label>
</td>
<td colspan="7">
<textarea type="text" id="distribute" style="width:100%; height:50px;" name="distribute" value="" readonly"></textarea>
</td>
</tr>
</table>
<div class="btn_wrap" style="clear:both;">
<div class="plm_btn_wrap_center">
<input type="button" value="배포" id="btn_release" class="plm_btns" onclick="releaseDistribute();">
<input type="button" value="수정" id="btn_modify" class="plm_btns" onclick="openDistributePopUp();">
<input type="button" value="닫기" id="btn_close" class="plm_btns">
</div>
</div>
</div>
</section>
</form>
</body>
</html>