414 lines
13 KiB
Plaintext
414 lines
13 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init_new.jsp" %>
|
|
<%
|
|
String menuObjId = request.getParameter("menuObjId");
|
|
String actionType = CommonUtils.checkNull(request.getParameter("actionType"));
|
|
// 뷰 모드인지 판단
|
|
boolean isViewMode = "view".equals(actionType);
|
|
String menuName = isViewMode ? "조치결과 조회" : CommonUtils.getMenuName(menuObjId, "조치결과 등록");
|
|
|
|
Map info = (Map)request.getAttribute("info");
|
|
if(info == null) info = new HashMap();
|
|
|
|
String objId = CommonUtils.checkNull(info.get("objid"));
|
|
|
|
// 오늘 날짜
|
|
String today = new java.text.SimpleDateFormat("yyyy-MM-dd").format(new java.util.Date());
|
|
String actionDate = CommonUtils.checkNull(info.get("action_date"));
|
|
if(actionDate.isEmpty()) actionDate = today;
|
|
|
|
// 조치자
|
|
String actionUserName = CommonUtils.checkNull(info.get("action_user_name"));
|
|
if(actionUserName.isEmpty()) actionUserName = connectUserName;
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
<style>
|
|
body { min-height: auto !important; }
|
|
.two_column_container {
|
|
display: flex;
|
|
gap: 15px;
|
|
padding: 10px;
|
|
}
|
|
.two_column_container > div {
|
|
flex: 1;
|
|
}
|
|
.two_column_container .pmsPopuptable tr {
|
|
height: 38px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<script type="text/javascript">
|
|
var isViewMode = <%=isViewMode%>;
|
|
|
|
$(document).ready(function(){
|
|
fnc_datepick();
|
|
$('.select2').select2();
|
|
|
|
// 기존 값 선택
|
|
var savedBlameDecision = "${info.blame_decision}";
|
|
var savedStatus = "${info.status}";
|
|
if(savedBlameDecision) $("#BLAME_DECISION").val(savedBlameDecision).trigger('change');
|
|
if(savedStatus) $("#STATUS").val(savedStatus).trigger('change');
|
|
|
|
// 뷰 모드일 경우 입력 필드 비활성화
|
|
if(isViewMode){
|
|
$("#form1 input, #form1 textarea, #form1 select").prop("disabled", true);
|
|
$("#btnSave, #btnUpload, #file1").hide();
|
|
// 파일 삭제 버튼 숨기기
|
|
$(".delete_btn").parent().hide();
|
|
} else {
|
|
// 첨부파일 드래그앤드랍 설정 (뷰 모드가 아닐 때만)
|
|
fnc_setFileDropZone("srDropZone", "<%=objId%>", "CUSTOMER_CS_ACTION", "조치첨부", "srAreaDraw", false, null, null, null, "");
|
|
}
|
|
srAreaDraw();
|
|
|
|
// 파일 업로드 버튼
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "<%=objId%>", "CUSTOMER_CS_ACTION", "조치첨부", null, "srAreaDraw", null, "");
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 파일이 없습니다.");
|
|
}
|
|
});
|
|
|
|
// 저장
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
// 닫기
|
|
$("#btnClose").click(function(){
|
|
window.close();
|
|
});
|
|
});
|
|
|
|
// 첨부파일 목록 새로고침
|
|
function srAreaDraw(){
|
|
fn_fileCallback("sr", "CUSTOMER_CS_ACTION");
|
|
}
|
|
|
|
// 첨부파일 목록 조회
|
|
function fn_fileCallback(areaId, fileType){
|
|
$.ajax({
|
|
url: "/common/getFileList.do",
|
|
type: "POST",
|
|
data: {"targetObjId": "<%=objId%>", "docType": fileType},
|
|
dataType: "json",
|
|
async: false,
|
|
success: function(data){
|
|
$("#" + areaId + "FileArea").empty();
|
|
if(data.length > 0){
|
|
$.each(data, function(i){
|
|
var appendText = "";
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
appendText += "<tr>";
|
|
appendText += "<td>" + (i + 1) + "</td>";
|
|
if(fileExt == 'PDF'){
|
|
appendText += "<td class='align_l'><a href='javascript:fnc_viewPdfFile(\"" + data[i].OBJID + "\")'> " + data[i].REAL_FILE_NAME + "</a>";
|
|
}else{
|
|
appendText += "<td class='align_l'><a href='javascript:fnc_downloadFile(\"" + data[i].OBJID + "\")'> " + data[i].REAL_FILE_NAME + "</a>";
|
|
}
|
|
// 뷰 모드가 아닐 때만 삭제 버튼 표시
|
|
if(!isViewMode){
|
|
appendText += "<a href='javascript:fn_fileDelete(\"" + data[i].OBJID + "\")'><div class='delete_btn'></div></a>";
|
|
}
|
|
appendText += "</td>";
|
|
appendText += "<td>" + data[i].REGDATE + "</td>";
|
|
appendText += "<td>" + data[i].FILE_SIZE + "</td>";
|
|
appendText += "</tr>";
|
|
$("#" + areaId + "FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
var appendText = "<tr><td colspan='4'>첨부 파일이 없습니다.</td></tr>";
|
|
$("#" + areaId + "FileArea").append(appendText);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
// PDF 미리보기
|
|
function fnc_viewPdfFile(fileObjId){
|
|
window.open("/common/downloadFile.do?objId=" + fileObjId, "_blank");
|
|
}
|
|
|
|
// 첨부파일 삭제
|
|
function fn_fileDelete(fileObjId){
|
|
// 뷰 모드에서는 삭제 불가
|
|
if(isViewMode) return;
|
|
|
|
if(confirm("파일을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url: "/common/deleteFileInfo.do",
|
|
type: "POST",
|
|
data: {"objId": fileObjId},
|
|
dataType: "json",
|
|
async: false,
|
|
success: function(data){
|
|
srAreaDraw();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function fn_save(){
|
|
// 유효성 검사
|
|
if(!fnc_valitate("form1")){
|
|
return;
|
|
}
|
|
|
|
Swal.fire({
|
|
title: '저장하시겠습니까?',
|
|
icon: 'question',
|
|
showCancelButton: true,
|
|
confirmButtonText: '저장',
|
|
cancelButtonText: '취소'
|
|
}).then((result) => {
|
|
if(result.isConfirmed){
|
|
$.ajax({
|
|
url: "/quality/saveCustomerCsAction.do",
|
|
type: "POST",
|
|
data: $("#form1").serialize(),
|
|
dataType: "json",
|
|
success: function(result){
|
|
if(result.RESULT == "SUCCESS"){
|
|
Swal.fire({
|
|
title: '저장되었습니다.',
|
|
icon: 'success'
|
|
}).then(() => {
|
|
if(window.opener && window.opener.fn_search){
|
|
window.opener.fn_search();
|
|
}
|
|
window.close();
|
|
});
|
|
} else {
|
|
Swal.fire({
|
|
title: '저장 실패',
|
|
text: result.MESSAGE || '저장 중 오류가 발생했습니다.',
|
|
icon: 'error'
|
|
});
|
|
}
|
|
},
|
|
error: function(xhr, status, error){
|
|
Swal.fire({
|
|
title: '저장 실패',
|
|
text: '서버 통신 오류가 발생했습니다.',
|
|
icon: 'error'
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<body>
|
|
<form name="form1" id="form1" method="post">
|
|
<input type="hidden" name="OBJID" id="OBJID" value="${info.objid}">
|
|
|
|
<section class="business_staff_popup_min_width">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span><%=menuName%></span>
|
|
</h2>
|
|
</div>
|
|
|
|
<div id="EntirePopupFormWrap">
|
|
<div class="two_column_container">
|
|
<!-- 왼쪽: 접수 정보 -->
|
|
<div>
|
|
<div class="form_popup_title">
|
|
<span>접수 정보</span>
|
|
</div>
|
|
<table class="">
|
|
<colgroup>
|
|
<col width="90%" />
|
|
</colgroup>
|
|
<tr>
|
|
<td>
|
|
<table class="pmsPopuptable">
|
|
<colgroup>
|
|
<col width="20%" />
|
|
<col width="30%" />
|
|
<col width="20%" />
|
|
<col width="30%" />
|
|
</colgroup>
|
|
<tr>
|
|
<!-- <td class="input_title"><label>접수번호</label></td>
|
|
<td>${info.receipt_no}</td> -->
|
|
<td class="input_title"><label>접수일</label></td>
|
|
<td>${info.receipt_date}</td>
|
|
<td class="input_title"><label>수량</label></td>
|
|
<td>${info.qty}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>고객사</label></td>
|
|
<td>${info.customer_name}</td>
|
|
</tr>
|
|
<tr>
|
|
<!-- <td class="input_title"><label>모델명</label></td>
|
|
<td>${info.model_name}</td> -->
|
|
<td class="input_title"><label>품명</label></td>
|
|
<td>${info.product_name}</td>
|
|
<td class="input_title"><label>품번</label></td>
|
|
<td>${info.product_no}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>부품품명</label></td>
|
|
<td>${info.part_name}</td>
|
|
<td class="input_title"><label>부품품번</label></td>
|
|
<td>${info.part_no}</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label>생산일</label></td>
|
|
<td>${info.production_date}</td>
|
|
<td class="input_title"><label>판매일</label></td>
|
|
<td>${info.sales_date}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>S/N</label></td>
|
|
<td>${info.serial_no}</td>
|
|
<td class="input_title"><label>제조사</label></td>
|
|
<td colspan="3">${info.manufacturer}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>불만내용</label></td>
|
|
<td colspan="3">
|
|
<textarea rows="4" style="width:100%;" readonly>${info.complaint_content}</textarea>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 오른쪽: 조치결과 등록 -->
|
|
<div>
|
|
<div class="form_popup_title">
|
|
<span>조치결과 등록</span>
|
|
</div>
|
|
<table class="">
|
|
<colgroup>
|
|
<col width="110%" />
|
|
</colgroup>
|
|
<tr>
|
|
<td>
|
|
<table class="pmsPopuptable">
|
|
<colgroup>
|
|
<col width="20%" />
|
|
<col width="30%" />
|
|
<col width="20%" />
|
|
<col width="30%" />
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title"><label>귀책판정 <span style="color:red;">*</span></label></td>
|
|
<td>
|
|
<select name="BLAME_DECISION" id="BLAME_DECISION" class="select2" required reqTitle="귀책판정" type="select">
|
|
<option value="">선택</option>
|
|
<option value="R">R</option>
|
|
<option value="C">C</option>
|
|
<option value="O">O</option>
|
|
</select>
|
|
</td>
|
|
<td class="input_title"><label>상태 <span style="color:red;">*</span></label></td>
|
|
<td>
|
|
<select name="STATUS" id="STATUS" class="select2" required reqTitle="상태" type="select">
|
|
<option value="">선택</option>
|
|
<option value="Open">Open</option>
|
|
<option value="Closed">Closed</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>조치일 <span style="color:red;">*</span></label></td>
|
|
<td>
|
|
<input type="text" name="ACTION_DATE" id="ACTION_DATE" class="date_icon" value="<%=actionDate%>" required reqTitle="조치일">
|
|
</td>
|
|
<td class="input_title"><label>조치자 <span style="color:red;">*</span></label></td>
|
|
<td>
|
|
<input type="text" name="ACTION_USER_NAME" id="ACTION_USER_NAME" value="<%=actionUserName%>" readonly>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>조치내용 <span style="color:red;">*</span></label></td>
|
|
<td colspan="3">
|
|
<textarea name="ACTION_CONTENT" id="ACTION_CONTENT" rows="3" style="width:100%;" required reqTitle="조치내용" type="text">${info.action_content}</textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>비고</label></td>
|
|
<td colspan="3">
|
|
<textarea name="REMARK" id="REMARK" rows="2" style="width:100%;">${info.remark}</textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label>첨부파일</label></td>
|
|
<td colspan="3">
|
|
<div style="margin-bottom: 5px;">
|
|
<input type="file" name="file1" id="file1" multiple style="width:80%;">
|
|
<input type="button" id="btnUpload" value="업로드" class="plm_btns">
|
|
</div>
|
|
<div id="srFileAreaTable" class="spec_data_in_table">
|
|
<div style="overflow-y:auto;">
|
|
<table class="fileListscrollThead" style="width:100% !important;">
|
|
<colgroup>
|
|
<col width="30px">
|
|
<col width="*">
|
|
<col width="80px">
|
|
<col width="60px">
|
|
</colgroup>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>파일명</td>
|
|
<td>등록일</td>
|
|
<td>Size</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div style="max-height: 80px; overflow-y: auto; border-bottom: 1px solid #cacaca;">
|
|
<table class="fileListscrollTbody">
|
|
<colgroup>
|
|
<col width="30px">
|
|
<col width="*">
|
|
<col width="80px">
|
|
<col width="60px">
|
|
</colgroup>
|
|
<tbody id="srFileArea">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns">
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html>
|