414 lines
12 KiB
Plaintext
414 lines
12 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>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
//첨부 파일 기능
|
|
fnc_setFileDropZone("qnaDropZone", "${qnaMap.OBJID}", "${docType}", "${docTypeName}", "qnaAreaDraw",false,null,null);
|
|
|
|
qnaAreaDraw();
|
|
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "${qnaMap.OBJID}", "${docType}", "${docTypeName}", null, "qnaAreaDraw");
|
|
//file객체 초기화
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 File이 없습니다.");
|
|
}
|
|
});
|
|
|
|
//닫기
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
//저장
|
|
$("#btnSave").click(function(){
|
|
if($("#qnaTitle").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("제목을 적어 주시기 바랍니다.");
|
|
$("#qnaTitle").focus();
|
|
return false;
|
|
}
|
|
if($("#region").val()==""||$("#region").val()==null){
|
|
Swal.fire("국내외를 선택해 주시기 바랍니다.");
|
|
$("#region").focus();
|
|
return false;
|
|
}
|
|
if($("#oem").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("고객사를 선택해 주시기 바랍니다.");
|
|
$("#oem").focus();
|
|
return false;
|
|
}
|
|
if($("#carType").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("차종을 선택해 주시기 바랍니다.");
|
|
$("#carType").focus();
|
|
return false;
|
|
}
|
|
if($("#productGroup").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("제품군을 선택해 주시기 바랍니다.");
|
|
$("#productGroup").focus();
|
|
return false;
|
|
}
|
|
if($("#productType").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("제품을 선택해 주시기 바랍니다.");
|
|
$("#productType").focus();
|
|
return false;
|
|
}
|
|
if($("#regione").val() == ""|| $("#qnaTitle").val() == null){
|
|
Swal.fire("지역을 선택해 주시기 바랍니다.");
|
|
$("#region").focus();
|
|
return false;
|
|
}
|
|
if(confirm("저장하시겠습니까?")){
|
|
fn_save();
|
|
}
|
|
});
|
|
|
|
//set oem list
|
|
fn_setOEMList();
|
|
|
|
//고객사별 차종 목록 조회
|
|
$("#oem").change(function(){
|
|
var oemObjId = $(this).val();
|
|
fn_setCarTypeList(oemObjId);
|
|
});
|
|
|
|
//fn_setProductGroupList
|
|
fn_setProductGroupList();
|
|
|
|
//제품군 제품 목록 조회
|
|
$("#productGroup").change(function(){
|
|
var productGroupObjId = $(this).val();
|
|
|
|
fn_setProductTypeList(productGroupObjId);
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<script>
|
|
function refeshAttachFileArea(){
|
|
qnaAreaDraw();
|
|
}
|
|
|
|
//형상 영역을 display 한다.
|
|
function qnaAreaDraw(){
|
|
fn_fileCallback("qna","${docType}");
|
|
}
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(areaId,fileType){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${qnaMap.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("qna" == 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='15%'>";
|
|
appendText +=" <col width='15%'>";
|
|
appendText +=" <col width='15%''>";
|
|
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></td>";
|
|
appendText+= " <td>"+data[i].DEPT_NAME+"</td>"
|
|
appendText+= " <td>"+data[i].USER_NAME+"</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, callbackFnc, confirmFlag){
|
|
if(confirmFlag){
|
|
fnc_deleteFile(fileObjId, callbackFnc);
|
|
}else{
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
eval(callbackFnc+"();");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//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>";
|
|
});
|
|
|
|
$("#oem").append(appendCode);
|
|
|
|
$("#oem > option[value=${qnaMap.OEM_OBJID}]").attr("selected", "true");
|
|
$("#oem").trigger("change");
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//car 목록 조회
|
|
function fn_setCarTypeList(oemObjId){
|
|
if(oemObjId != ""){
|
|
$.ajax({
|
|
url:"/common/getCarTypeList.do",
|
|
type:"POST",
|
|
data:{"isJson":true, "search_oemObjId":oemObjId},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
appendCode += "<option value=''>선택</option>";
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].CAR_CODE+"("+data[i].CAR_NAME+")</option>";
|
|
});
|
|
|
|
$("#carType").children().remove();
|
|
$("#carType").append(appendCode);
|
|
$("#carType > option[value=${qnaMap.CAR_OBJID}]").attr("selected", "true");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$("#carType").children().remove();
|
|
$("#carType").append("<option value=''>선택</option>");
|
|
}
|
|
|
|
}
|
|
//ProductGroup 조회
|
|
function fn_setProductGroupList(){
|
|
$.ajax({
|
|
url:"/common/getProductGroupList.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].PRODUCT_GROUP_NAME+"</option>";
|
|
});
|
|
|
|
$("#productGroup").append(appendCode);
|
|
$("#productGroup > option[value=${qnaMap.PROD_GROUP_OBJID}]").attr("selected", "true");
|
|
$("#productGroup").trigger("change");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
//Product 목록 조회
|
|
function fn_setProductTypeList(productGroupObjId){
|
|
if(productGroupObjId != ""){
|
|
$.ajax({
|
|
url:"/common/getProductList.do",
|
|
type:"POST",
|
|
data:{"isJson":true, "search_productGroupObjId":productGroupObjId},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
appendCode += "<option value=''>선택</option>";
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_NAME+"("+data[i].PRODUCT_CODE+")</option>";
|
|
});
|
|
|
|
$("#productType").children().remove();
|
|
$("#productType").append(appendCode);
|
|
$("#productType > option[value=${qnaMap.PROD_OBJID}]").attr("selected", "true");
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$("#productType").children().remove();
|
|
$("#productType").append("<option value=''>선택</option>");
|
|
}
|
|
}
|
|
|
|
//qna 등록정보 저장
|
|
function fn_save(){
|
|
$.ajax({
|
|
url:"/projectConcept/saveQnaProjectConceptInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
var objId = $("#objId").val();
|
|
Swal.fire(data.result);
|
|
document.form1.action = "/projectConcept/projectConceptQnaDetailViewPopup.do?objId="+ objId;
|
|
document.form1.submit();
|
|
if("fail" == data.result){
|
|
Swal.fire("오류가 발생하였습니다.");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
opener.location.reload();
|
|
}
|
|
</script>
|
|
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${qnaMap.OBJID}" />
|
|
<section class="business_popup_min_width">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>QnA 활동</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<div class="form_popup_title"> QnA 활동</div>
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="13%" />
|
|
<col width="18%" />
|
|
<col width="18%" />
|
|
<col width="15%" />
|
|
<col width="20%" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title"><label for="">제목</label></td>
|
|
<td colspan="5"><input id="qnaTitle" name="qnaTitle"
|
|
type="text" class="textbox" style="width: 96%;"
|
|
value="${qnaMap.TITLE}"></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">지역</label></td>
|
|
<td colspan="2"><select name="region" id="region">
|
|
<option value="">선택</option>
|
|
<option value="D" ${qnaMap.FOREIGN_TYPE eq '국내' ? 'selected':''}>국내</option>
|
|
<option value="F" ${qnaMap.FOREIGN_TYPE eq '해외' ? 'selected':''}>해외</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">고객사</label></td>
|
|
<td colspan="2"><select name="oem" id="oem">
|
|
<option value="">선택</option>
|
|
</select></td>
|
|
<td class="input_title"><label for="">차종</label></td>
|
|
<td colspan="2"><select name="carType" id="carType">
|
|
<option value="">선택</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">제품군</label></td>
|
|
<td colspan="2"><select name="productGroup" id="productGroup">
|
|
<option value="">선택</option>
|
|
</select></td>
|
|
<td class="input_title"><label for="">제품</label></td>
|
|
<td colspan="2"><select name="productType" id="productType">
|
|
<option value="">선택</option>
|
|
</select></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">내용</label></td>
|
|
<td colspan="5"><textarea id="qnaContents" name="qnaContents" style="resize: none; width: 96%;">${qnaMap.CONTENTS}</textarea>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td rowspan="2" class="input_title align_c">파일첨부</td>
|
|
<td colspan="5">
|
|
<div id="qnaDropZone" class="dropzone">Drag & Drop Files Here</div>
|
|
<input type="file" name="file1" id="file1" multiple>
|
|
<input type="button" id="btnUpload" value="Upload" class="upload_btns">
|
|
<div id="qnaAreaTable" class="spec_data_in_table">
|
|
<div style="overflow-y:scroll;">
|
|
<table id="" class="fileListscrollThead" style="width: 100% !important;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>파일명</td>
|
|
<td>팀명</td>
|
|
<td>등록자</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div style="width:100%; height: 90px; overflow-y: scroll; border-bottom: 2px solid #cacaca;">
|
|
<table id="qnaFileArea" class="fileListscrollTbody">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<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>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |