422 lines
12 KiB
Plaintext
422 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>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(){
|
|
getTransSpecDataList("from");
|
|
getTransSpecDataList("to");
|
|
|
|
$("input").keyup(function(e){
|
|
if(e.keyCode == 13){
|
|
searchSpecDataInfo();
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
function openSpecDataPopUp(objid){
|
|
var hiddenForm = document.hiddenForm;
|
|
var target = objid;
|
|
window.open("",target,"width=900 height=780 menubar=no status=no");
|
|
|
|
hiddenForm.objid.value = objid;
|
|
hiddenForm.target = target;
|
|
hiddenForm.action = "/specData/specDataDetailViewPopup.do";
|
|
hiddenForm.submit();
|
|
}
|
|
|
|
function searchSpecDataInfo(){
|
|
|
|
var paramForm = $("#form1").serialize();
|
|
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/specData/getSpecDataTransInfoList.do",
|
|
data: paramForm,
|
|
dataType: "json",
|
|
async:false,
|
|
error: function(){
|
|
|
|
},
|
|
success: function(result){
|
|
|
|
$(".searchSpecArea").empty();
|
|
|
|
if(null != result){
|
|
|
|
if(0 < result.length){
|
|
$(".noResultRow").hide();
|
|
}else{
|
|
$(".noResultRow").show();
|
|
}
|
|
|
|
for(var i=0;i<result.length;i++){
|
|
|
|
var appendText = "";
|
|
appendText+= "<tr style='text-align: center;' class='"+result[i].OBJID+"'>";
|
|
appendText+= " <td><input type='checkbox' name='specObjid' value='"+result[i].OBJID+"'></td>";
|
|
appendText+= " <td>"+result[i].DOC_NO+"</td>";
|
|
appendText+= " <input type='hidden' name='specDocNo_"+result[i].OBJID+"' id='specDocNo_"+result[i].OBJID+"' value='"+result[i].DOC_NO+"'>";
|
|
appendText+= " <td>"+result[i].CATEGORY_NAME+"</td>";
|
|
appendText+= " <input type='hidden' name='specCategoryName_"+result[i].OBJID+"' id='specCategoryName_"+result[i].OBJID+"' value='"+result[i].CATEGORY_NAME+"'>";
|
|
appendText+= " <td>"+result[i].SPEC_NO+"</td>";
|
|
appendText+= " <input type='hidden' name='specNo_"+result[i].OBJID+"' id='specNo_"+result[i].OBJID+"' value='"+result[i].SPEC_NO+"'>";
|
|
appendText+= "</tr>";
|
|
|
|
$("#specList").append(appendText);
|
|
}
|
|
}else{
|
|
$(".noResultRow").show();
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//조회된 SPEC을 치환대상(From,To) 영역에 추가한다.
|
|
function addSelectedSpec(){
|
|
if(0 < $("input[name=specObjid]").length){
|
|
|
|
var drawTargetId = "";
|
|
|
|
if("from" == $("#addType").val()){
|
|
$(".noResultFromRow").remove();
|
|
drawTargetId = "specFromList";
|
|
}else if("to" == $("#addType").val()){
|
|
$(".noResultToRow").remove();
|
|
drawTargetId = "specToList";
|
|
}else{
|
|
return false;
|
|
}
|
|
|
|
var transSpecObject = document.getElementsByName("spec_"+$("#addType").val());
|
|
|
|
var transedSpecLength = $("input[name='spec_"+$("#addType").val()+"']").length;
|
|
|
|
if(transedSpecLength > 0){
|
|
Swal.fire("이미 치환대상 SPEC이 있습니다.");
|
|
return false;
|
|
}else{
|
|
var specObj = $("input[name=specObjid]");
|
|
for(var i=0;i < specObj.length;i++){
|
|
if(specObj[i].checked){
|
|
var specObjid = fnc_checkNull(specObj[i].value);
|
|
if("" != specObjid){
|
|
if(0 < $("#"+specObjid).length){
|
|
Swal.fire("이미 추가된 데이터 입니다.");
|
|
return false;
|
|
}
|
|
var appendText = "";
|
|
appendText+= "<tr style='text-align: center;' id = '"+specObjid+"'>";
|
|
appendText+= " <td><input type='checkbox' name='spec_"+$("#addType").val()+"' value='"+specObjid+"'></td>";
|
|
appendText+= " <input type='hidden' name='spec_"+$("#addType").val()+"Objid' value='"+specObjid+"'>";
|
|
appendText+= " <td>"+$("#specDocNo_"+specObjid).val();+"</td>";
|
|
appendText+= " <td>"+$("#specCategoryName_"+specObjid).val();+"</td>";
|
|
appendText+= " <td>"+$("#specNo_"+specObjid).val();+"</td>";
|
|
appendText+= "</tr>";
|
|
$("#"+drawTargetId).append(appendText);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(0 == transSpecObject.length){
|
|
$("."+$("#addType").val()+"NoResultRow").show();
|
|
}else{
|
|
$("."+$("#addType").val()+"NoResultRow").hide();
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
//치환대상의 From, To를 삭제한다.
|
|
function deleteSelectedSpec(){
|
|
var type = $("#addType").val();
|
|
var transSpecObject = document.getElementsByName("spec_"+type);
|
|
if(1 == transSpecObject.length){
|
|
if(transSpecObject[0].checked){
|
|
$("#"+transSpecObject[0].value).remove();
|
|
}
|
|
}else if(1 < transSpecObject.length){
|
|
for(var i=0;i<transSpecObject.length;i++){
|
|
if(transSpecObject[i].checked){
|
|
$("#"+transSpecObject[i].value).remove();
|
|
}
|
|
}
|
|
}
|
|
|
|
if(0 == transSpecObject.length){
|
|
$("."+type+"NoResultRow").show();
|
|
}else{
|
|
$("."+type+"NoResultRow").hide();
|
|
}
|
|
|
|
}
|
|
|
|
function saveSpecDataTransInfo(){
|
|
|
|
var paramForm = $("#form1").serialize();
|
|
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/specData/mergeSpecDataTrans.do",
|
|
data: paramForm,
|
|
dataType: "json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(null != result){
|
|
Swal.fire(result.message);
|
|
opener.getTransSpecDataList("from");
|
|
opener.getTransSpecDataList("to");
|
|
self.close();
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//영역별(From, To)스펙 치환문서 목록을 가져온다.
|
|
function getTransSpecDataList(type){
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/specData/getTransSpecDataList.do",
|
|
data:{"objid":"${param.objid}","type":type,"categoryObjId":"${categoryInfoMap.CATEGORY_OBJID}"},
|
|
dataType: "json",
|
|
async:false,
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
},
|
|
success: function(result){
|
|
if(0 < result.length){
|
|
|
|
$("."+type+"NoResultRow").hide();
|
|
|
|
var targetArea = "";
|
|
|
|
if("from" == type){
|
|
targetArea = "transSpecDataFrom";
|
|
}else if("to" == type){
|
|
targetArea = "transSpecDataTo";
|
|
}
|
|
$("#"+targetArea).empty();
|
|
|
|
for(var i=0;i<result.length;i++){
|
|
var appendText = "";
|
|
appendText+= "<tr id = '"+result[i].DOC_OBJID+"'>";
|
|
appendText+= " <td><input type='checkbox' name='spec_"+type+"' value='"+result[i].DOC_OBJID+"'></td>";
|
|
appendText+= " <input type='hidden' name='spec_"+type+"Objid' value='"+result[i].DOC_OBJID+"'>";
|
|
appendText+= " <td>"+result[i].CATEGORY_NAME+"</td>";
|
|
appendText+= " <td>"+result[i].SPEC_NO+"</td>";
|
|
appendText+= " <td>"+result[i].DOC_NO+"</td>";
|
|
appendText+= "</tr>";
|
|
$("#"+targetArea).append(appendText);
|
|
}
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//전체 체크 기능
|
|
function allCheck(base,name){
|
|
var checkObj = document.getElementsByName(name);
|
|
var checkFlag = base.checked;
|
|
|
|
if(0 < checkObj.length){
|
|
for(var i=0;i<checkObj.length;i++){
|
|
checkObj[i].checked = checkFlag;
|
|
}
|
|
}else{
|
|
checkObj.checked = checkFlag;
|
|
}
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="targetObjid" id="targetObjid" value="${param.objid}">
|
|
<input type="hidden" name="specNo" id="specNo" value="${categoryInfoMap.SPEC_NO}">
|
|
<input type="hidden" name="categoryObjId" id="categoryObjId" value="${param.categoryObjId}">
|
|
<input type="hidden" name="listType" id="listType" value="SPEC">
|
|
<section class="">
|
|
<div class="pdm_menu_name">
|
|
<h2>
|
|
<span>기술자료관리</span>
|
|
</h2>
|
|
</div>
|
|
<div id="pdmFormWrap">
|
|
<div class="pdm_commonSection">
|
|
<table id="pdmForm">
|
|
<tbody>
|
|
<tr>
|
|
<td class="">
|
|
<label for="" class="">문서번호</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_docNo" id="search_docNo">
|
|
</td>
|
|
<td class="">
|
|
<label for="" class="">SPEC No</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_specNo" id="search_specNo">
|
|
</td>
|
|
<td class="">
|
|
<label for="" class="">표준명</label>
|
|
</td>
|
|
<td>
|
|
<input type="text" name="search_standardName" id="search_standardName">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div style="width:96%; margin: 0 auto;">
|
|
<div id="pdmSearchBtnWrap">
|
|
<input type="button" value="조회" class="pdm_btns" onclick="searchSpecDataInfo();">
|
|
</div>
|
|
<section id="searchResultList">
|
|
<table class="pdm_table_noImg" style="border-bottom:0;">
|
|
<caption style="width: 100px;">조회내역</caption>
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="pdm_thead">
|
|
<td><input type="checkbox" name="" value="" id="" class="checkBox"></td>
|
|
<td>문서번호</td>
|
|
<td>SPEC 구분</td>
|
|
<td>SPEC No</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="pdm_scroll_table_wrap" style="width:101.8%;height:130px; border-bottom:2px solid #000;">
|
|
<table id="specList">
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<tbody class="searchSpecArea">
|
|
<c:choose>
|
|
<c:when test="${empty LIST}">
|
|
<tr style="text-align: center;" class="noResultRow">
|
|
<td align="center" colspan="4">조회된 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:when>
|
|
<c:otherwise>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<div id="pdmSearchBtnWrap">
|
|
<input type="button" value="삭제" class="pdm_btns" onclick="deleteSelectedSpec();">
|
|
<input type="button" value="추가" class="pdm_btns" onclick="addSelectedSpec();">
|
|
<select name="addType" id="addType">
|
|
<option value="from">FROM</option>
|
|
<option value="to">TO</option>
|
|
</select>
|
|
</div>
|
|
<div id="popSectionWrap">
|
|
<section id="popLeftSection">
|
|
<table class="pdm_table_noImg" style="border-bottom:0;">
|
|
<caption>FROM</caption>
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="pdm_thead">
|
|
<td><input type="checkbox" name="" value="" id="" class="checkBox" onclick="javascript:allCheck(this,'spec_from')"></td>
|
|
<td>문서번호</td>
|
|
<td>SPEC 구분</td>
|
|
<td>SPEC No</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="pdm_scroll_table_wrap" >
|
|
<table id="specFromList">
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<tbody id="transSpecDataFrom">
|
|
</tbody>
|
|
<tbody class="fromNoResultRow">
|
|
<tr style="text-align: center;">
|
|
<td align="center" colspan="4">연결된 치환 데이터가 없습니다.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<section id="popRightSection">
|
|
<table class="pdm_table_noImg" style="border-bottom:0;">
|
|
<caption>TO</caption>
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="pdm_thead">
|
|
<td><input type="checkbox" name="" value="" id="" class="checkBox" onclick="javascript:allCheck(this,'spec_to')"></td>
|
|
<td>문서번호</td>
|
|
<td>SPEC 구분</td>
|
|
<td>SPEC No</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="pdm_scroll_table_wrap" >
|
|
<table id="specToList">
|
|
<colgroup>
|
|
<col width="4%" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
<col width="*" />
|
|
</colgroup>
|
|
<tbody id="transSpecDataTo">
|
|
</tbody>
|
|
<tbody class="toNoResultRow">
|
|
<tr style="text-align: center;">
|
|
<td align="center" colspan="4">연결된 치환 데이터가 없습니다.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<div class="btnCenterWrap" style="clear:both;">
|
|
<center class="center_btns_wrap">
|
|
<input type="button" value="저장" class="pdm_btns" onclick="saveSpecDataTransInfo();">
|
|
<input type="button" value="닫기" class="pdm_btns" onclick="javascript:self.close();">
|
|
</center>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |