File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>조직도</title>
<link rel="stylesheet" href="/direct/css/font.css">
<link rel="stylesheet" href="/direct/css/reset.css">
<link rel="stylesheet" href="/direct/css/enroll_popup.css">
<link rel="stylesheet" href="/direct/css/nice-select.css">
<link href="<c:url value='/'/>css/jstree/themes/default/style.min.css" rel="stylesheet" type="text/css">
<!-- <script src="/direct/js/jquery.nice-select.js"></script> -->
<script src="<c:url value='/js/jquery.js' />"></script>
<script>
// 추가 변수
var addVar = "<c:out value='${locVO.addVar}' />";
$( document ).ready(function(){
$.ajax({
type:"POST",
url:"<c:url value='/uss/ion/sign/selectUserListAjax.do' />",
data:{"partIdx" : "DEPT" },
dataType:'json',
success : function(returnData, status) {
if (status == "success"){
$('#userList tr').remove();
var tempUserList = returnData.userList;
var num = 0;
$('#partIdx').val(partIdx);
var tmpHtml= "";
if(tempUserList.length == 0){
tmpHtml="<tr class='noSerchTr'>";
tmpHtml+="<td colspan='5' class='noSerch'> 검색된 직원이 없습니다.</td>";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}else{
for(var i=0; i < tempUserList.length; i++){
num = num +1;
tmpHtml="<tr id='"+tempUserList[i].emplyrId+"'>";
tmpHtml+="<td><input type='checkbox' name='staffChk' id='user_"+i+"' value='"+tempUserList[i].emplyrId+"'><label for='user_"+i+"'></label></td>"
tmpHtml+="<td class='orgGroup' style='width:123px;'>"+tempUserList[i].partIdxTxt+"</td>";
//tmpHtml+="<td class='orgPsi' style='width:88px;'>"+tempUserList[i].ofcpsNm+"</td>";
tmpHtml+="<td class='orgName' style='width:100px;'>"+tempUserList[i].userNm+"</td>";
tmpHtml+="<td class='orgWork' style='width:70px;'>"+tempUserList[i].authorCode+"</td>";
tmpHtml+="<input type='hidden' class='orgIdx' value="+tempUserList[i].partIdx+">";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}
}
} else {
alert("ERROR");
return;
}
},
error : function(request , status, error) {
},
complete : function () {
}
});
});
function getSearchCondition_div(chk){
var obj = document.getElementsByName("selectSearch");
for(var i = 0; i < obj.length; i++){
if(obj[i] != chk){
obj[i].checked = false;
}
}
var selectDiv = $('input[name="selectSearch"]:checked').val();
$('#searchCondition_01').val("");
$('#searchCondition_02').val("");
$('#searchCondition_03').val("");
$('#searchCondition_01').niceSelect('destroy').css('display','none') ;
$('#searchCondition_02').niceSelect('destroy').css('display','none') ;
$('#searchCondition_03').niceSelect('destroy').css('display','none') ;
$('#inputName').val("");
$('.srchorgGroup').css('display','none') ;
//리스트 값 초기화
$('#userList').find('tr').remove();
if(selectDiv == "name"){
$('.srchorgGroup').show();
}else if(selectDiv == "group"){
getSearchCondition_01("All" , 'Search');
}
}
/* 전체 셀렉트 박스 내용 첫번째 가져오기 */
function getSearchCondition_01(nextValue, search){
var nodeDepth = $('#nodeDepth').val();
var parent = $('#parent').val();
$.ajax({
type:"POST",
url:"<c:url value='/uss/itsm/orgChart/getOrgChartInitAjax_01.do' />",
data:{"nodeDepth": nodeDepth, "parent" : parent},
dataType:'jsonp',
success : function(returnData, status) {
if (status == "success"){
if(returnData.resultList != undefined){
$("select#searchCondition_01 option").remove(); //초기화
if(returnData.resultList.length == 0){
return;
}
var select_text_01 = "<option value=''>선택</option>";
for(var i=0 ; i<returnData.resultList.length; i++){
select_text_01 +="<option value='"+returnData.resultList[i].id+"'>"+returnData.resultList[i].text+"</option>" ;
}
if(nextValue == "All"){ //전체조회
$('#searchCondition_01').append(select_text_01);
$('#searchCondition_01').show();
$('#searchCondition_01').val('');
$('#searchCondition_01').niceSelect();
}else{
$('#searchCondition_01').append(select_text_01);
$('#searchCondition_01').show();
$('#searchCondition_01').val(nextValue);
$('#searchCondition_01').niceSelect();
}
}
} else { alert("ERROR"); return;}
},
error : function(request , status, error) {
},
complete : function () {
return true;
}
});
};
/* 전체 셀렉트 박스 내용 두번째 가져오기 */
function getSearchCondition_02(nextValue, search){
//리스트 값 초기화
$('#userList').find('tr').remove();
var searchConditionVal_01 = $('#searchCondition_01').val();
$('#searchCondition_02').val("");
$('#searchCondition_03').val("");
$('#searchCondition_02').niceSelect('destroy').css('display','none') ;
$('#searchCondition_03').niceSelect('destroy').css('display','none') ;
if(searchConditionVal_01 ==""){
return;
}
$.ajax({
type:"POST",
url:"<c:url value='/uss/itsm/orgChart/getOrgChartInitAjax_02.do' />",
data:{"searchCondition_01" :searchConditionVal_01 },
dataType:'jsonp',
success : function(returnData, status) {
if (status == "success"){
$("select#searchCondition_02 option").remove(); //초기화
if(returnData.resultList != undefined){
if(returnData.resultList.length == 0){
return;
}
var select_text_01 = "<option value=''>선택</option>";
for(var i=0 ; i<returnData.resultList.length; i++){
select_text_01 +="<option value='"+returnData.resultList[i].id+"'>"+returnData.resultList[i].text+"</option>" ;
}
$('#searchCondition_02').append(select_text_01);
$('#searchCondition_02').show();
$('#searchCondition_02').val(nextValue);
$('#searchCondition_02').niceSelect() ;
}
} else { alert("ERROR"); return;}
},
error : function(request , status, error) {
},
complete : function () {
}
});
};
/* 전체 셀렉트 박스 내용 두번째 가져오기 */
function getSearchCondition_03(nextValue, search){
//리스트 값 초기화
$('#userList').find('tr').remove();
var searchConditionVal_02 = $('#searchCondition_02').val();
$('#searchCondition_03').val("");
$('#searchCondition_03').niceSelect('destroy').css('display','none') ;
if(searchConditionVal_02 ==""){
return;
}
$.ajax({
type:"POST",
url:"<c:url value='/uss/itsm/orgChart/getOrgChartInitAjax_03.do' />",
data:{"searchCondition_02" :searchConditionVal_02 },
dataType:'jsonp',
success : function(returnData, status) {
if (status == "success"){
$("select#searchCondition_03 option").remove(); //초기화
if(returnData.resultList != undefined){
if(returnData.resultList.length == 0){
return;
}
var select_text_01 = "<option value=''>선택</option>";
for(var i=0 ; i<returnData.resultList.length; i++){
select_text_01 +="<option value='"+returnData.resultList[i].id+"'>"+returnData.resultList[i].text+"</option>" ;
}
$('#searchCondition_03').append(select_text_01);
$('#searchCondition_03').show();
$('#searchCondition_03').val(nextValue);
$('#searchCondition_03').niceSelect();
}
} else { alert("ERROR"); return;}
},
error : function(request , status, error) {
},
complete : function () {
}
});
};
function selectList(){
var selectSearch = $('input[name="selectSearch"]:checked').val();
if(selectSearch == "name"){
getNameList();
}else if(selectSearch == "group"){
getGrouopList();
}
}
function getNameList() {
var emplyrNm = $("#inputName").val();
if (emplyrNm == "") {
alert("이름을 입력해주세요");
return;
}
$.ajax({
type:"POST",
url:"<c:url value='/uss/ion/sign/selectUserListAjax.do' />",
data:{"emplyrNm" :emplyrNm },
dataType:'json',
success : function(returnData, status) {
if (status == "success"){
$('#userList tr').remove();
var tempUserList = returnData.userList;
var num = 0;
var tmpHtml= "";
if(tempUserList.length == 0){
tmpHtml="<tr class='noSerchTr'>";
tmpHtml+="<td colspan='5' class='noSerch'> 검색된 직원이 없습니다.</td>";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}else{
for(var i=0; i < tempUserList.length; i++){
num = num +1;
tmpHtml="<tr id='"+tempUserList[i].emplyrId+"'>";
tmpHtml+="<td><input type='checkbox' name='staffChk' id='user_"+i+"' value='"+tempUserList[i].emplyrId+"'><label for='user_"+i+"'></label></td>"
tmpHtml+="<td class='orgGroup' style='width:123px;'>"+tempUserList[i].partIdxTxt+"</td>";
//tmpHtml+="<td class='orgPsi' style='width:88px;'>"+tempUserList[i].ofcpsNm+"</td>";
tmpHtml+="<td class='orgName' style='width:100px;'>"+tempUserList[i].userNm+"</td>";
tmpHtml+="<td class='orgWork' style='width:70px;'>"+tempUserList[i].authorCode+"</td>";
tmpHtml+="<input type='hidden' class='orgIdx' value="+tempUserList[i].partIdx+">";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}
}
} else {
alert("ERROR");
return;
}
},
error : function(request , status, error) {
},
complete : function () {
}
});
};
function getGrouopList() {
var selectedDepths = $("select[id^=searchCondition_] option:selected[value!='']");
if (selectedDepths.length == 0) {
alert("부서를 선택해주세요.");
return;
}
var id = 'searchCondition_0'+selectedDepths.length ;
var partIdx = $('#'+id+' option:selected').val();
$.ajax({
type:"POST",
url:"<c:url value='/cop/itsm/selectUserListAjax.do' />",
data:{"partIdx" :partIdx },
dataType:'jsonp',
success : function(returnData, status) {
if (status == "success"){
$('#userList tr').remove();
var tempUserList = returnData.userList;
var num = 0;
$('#partIdx').val(partIdx);
var tmpHtml= "";
if(tempUserList.length == 0){
tmpHtml="<tr class='noSerchTr'>";
tmpHtml+="<td colspan='5' class='noSerch'> 검색된 직원이 없습니다.</td>";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}else{
for(var i=0; i < tempUserList.length; i++){
num = num +1;
tmpHtml="<tr id='"+tempUserList[i].emplyrId+"'>";
tmpHtml+="<td><input type='checkbox' name='staffChk' id='user_"+i+"' value='"+tempUserList[i].emplyrId+"'><label for='user_"+i+"'></label></td>"
tmpHtml+="<td class='orgGroup' style='width:123px;'>"+tempUserList[i].partIdxTxt+"</td>";
//tmpHtml+="<td class='orgPsi' style='width:88px;'>"+tempUserList[i].ofcpsNm+"</td>";
tmpHtml+="<td class='orgName' style='width:100px;'>"+tempUserList[i].userNm+"</td>";
tmpHtml+="<td class='orgWork' style='width:70px;'>"+tempUserList[i].authorCode+"</td>";
tmpHtml+="</tr>";
$("#userList").append(tmpHtml);
}
}
} else {
alert("ERROR");
return;
}
},
error : function(request , status, error) {
},
complete : function () {
}
});
};
function selectAllNum(object){
if($(object).is(':checked')){
$('#userList').find('input[type=checkbox]').prop("checked", true);
}else{
$('#userList').find('input[type=checkbox]').prop("checked", false);
}
};
function orgChartPopupSave(){
var eqRntUserCnt = opener.$("[name=eqRntlUserId]").length;
var staffChk = $("input[name=staffChk]:checked"); // 체크박스객체를 담는다
if(staffChk.length == 0){
alert("선택된 값이 없습니다.");
return;
}
{//자산의 수리내역등록 팝업의 담당자 페이지
if(opener.document.location.href.indexOf('/uss/itsm/asset/AstRepairPopup.do') > -1){ //수리내역 페이지
<c:if test="${locVO.openerInputName == 'astReMngId'}">
if((staffChk.length > 1) || (eqRntUserCnt != 0)) {
alert("담당자는 한명만 지정할수 있습니다.");
return;
}
if(opener !=null){
var tempRowId = $("input:checkbox[name='staffChk']:checked").val();
opener.$('#astReMngId').val(tempRowId);
var tempRowIdText = $('#'+tempRowId).find('td[class=orgName]').text();
opener.$('#astReMngIdText').val(tempRowIdText);
}
window.self.close() ;
return;
</c:if>
}else if(opener.document.location.href.indexOf('/uss/itsm/asset/AstRentPopup.do') > -1){ //대여내역 페이지 확인자
<c:if test="${locVO.openerInputName == 'astRtConfId'}">
if ((staffChk.length > 1) || (eqRntUserCnt != 0)) {
alert("확인자는 한명만 지정할수 있습니다.");
return;
}
if(opener !=null){
var tempRowId = $("input:checkbox[name='staffChk']:checked").val();
opener.$('#astRtConfId').val(tempRowId);
var tempRowIdText = $('#'+tempRowId).find('td[class=orgName]').text();
opener.$('#astRtConfIdText').val(tempRowIdText);
}
window.self.close() ;
return;
</c:if>
}else if(opener.document.location.href.indexOf('/uss/itsm/cvlCmplnt/selectCvlCmplntDetailWeb.do') > -1){ //헬프데스크 > 신청 등록
if((staffChk.length > 1) || (eqRntUserCnt != 0)) {
alert("신청자는 한명만 지정할수 있습니다.");
return;
}
}else if(addVar == "a1"){ //장비대여/반납 > 장비 대여 > 결재자
if ((staffChk.length > 1)) {
alert("결재자는 한명만 지정할수 있습니다.");
return;
}
}else if(opener.document.location.href.indexOf('/uss/itsm/ip/IpReceivePopup.do') > -1){ //IP결제
if ((staffChk.length > 1) || (eqRntUserCnt != 0)) {
alert("결재자는 한명만 지정할수 있습니다.");
return;
}
}else if(addVar == "u1"){ //장비대여/반납 > 장비 대여 > 사용자
//if ((staffChk.length > 1) || (eqRntUserCnt != 0)) {
if ((staffChk.length > 1)) {
alert("사용자는 한명만 지정할수 있습니다.");
return;
}
}
}
// 부서명
var locNm = $("#searchCondition_01").find(":selected").text();
var rowid = "";
var rowName = "";
var rowLocNm = "";
// 부서명은 셀렉 박스에서 구해옴. 목록에서 한개에 부서 직원들만 선택 가능함으로.
for(var i=0; i < staffChk.length; i++){
if(i == (staffChk.length-1)){
rowid += staffChk[i].value;
rowName += $("#"+staffChk[i].value).find('td[class=orgName]').text();
rowLocNm += $("#"+staffChk[i].value).find('td[class=orgGroup]').text();
if($("#"+staffChk[i].value).find('input[type=hidden]').val() != null){
$('#partIdx').val($("#"+staffChk[i].value).find('input[type=hidden]').val()) ;
}
}else{
rowid += staffChk[i].value+",";
rowName += $("#"+staffChk[i].value).find('td[class=orgName]').text() +",";
rowLocNm += locNm+",";
}
}
var selectSearch = $('input[name="selectSearch"]:checked').val();
if(selectSearch == "name"){
$('#partIdx').val();
}
var deptId = $('#partIdx').val();
window.opener.staffInfo(rowid, rowName, rowLocNm, addVar, deptId); // addVar : 추가 변수, IP경우 addVar row구분
window.self.close();
}
</script>
</head>
<body>
<div class="enroll_popup orgSelect_popup">
<input type="hidden" id="partIdx" name="partIdx"/>
<div class="enroll_popup_title">
<img src="/direct/img/enroll_popup_title_bg.png" alt="">
<c:choose>
<c:when test="${locVO.openerInputName == 'astDelive'}">납품업체 </c:when>
<c:when test="${locVO.openerInputName == 'astMainten'}">유지보수업체</c:when>
<c:when test="${locVO.openerInputName == 'astRepCom'}">수리업체</c:when>
<c:when test="${locVO.openerInputName == 'astRtConfId'}">확인자</c:when>
<c:when test="${locVO.openerInputName == 'astReMngId'}">담당자</c:when>
<c:otherwise>조직도</c:otherwise>
</c:choose>
</div>
<div class="enroll_input_left orgSelectArea">
<ul>
<li>
<div class="allAssetCheck" style="padding: 3px 1px; border:1px solid #dde6e9;width:97%;margin-top:2px;background-color:#f5f7fa;">
<div class="serchSort" style="display:inline-block">검색 옵션</div>
<input type="checkbox" name="selectSearch" id="s1" value="name" checked onclick="getSearchCondition_div(this);"> <label for="s1" style="width:15px;height:15px;margin:-1px 10px 0;"></label><label for="s1">이름</label>
<input type="checkbox" name="selectSearch" id="s2" value="group" onclick="getSearchCondition_div(this)"> <label for="s2"></label><label for="s2">부서</label>
</div>
<!--
<div class="enroll_sort">
<input type="checkbox" name="selectSearch" id="s1" value="name" checked onclick="getSearchCondition_div(this);"> <label for="s1"></label><label for="s1">이름</label>
<input type="checkbox" name="selectSearch" id="s2" value="group" onclick="getSearchCondition_div(this)"> <label for="s2"></label><label for="s2">부서</label>
</div>
-->
</li>
<li>
<div>
<!-- 이름 선택시 -->
<input name="inputName" id="inputName" class="srchorgGroup"/>
<!-- 조직 선택시-->
<select name="searchCondition_01" id="searchCondition_01" class="asset_sec_sort" style="display:none;" onchange="getSearchCondition_02();"></select>
<select name="searchCondition_02" id="searchCondition_02" class="asset_thr_sort" style="display:none;" onchange="getSearchCondition_03();"></select>
<select name="searchCondition_03" id="searchCondition_03" class="asset_four_sort" style="display:none;"></select>
<input type="button" value="검색" class="serch_btn" onclick="selectList()">
</div>
</li>
<li>
<div class="orgSelectList">
<table>
<thead>
<tr>
<th>
<input type="checkbox" id="selectAll" onclick="selectAllNum(this);" >
<label for="selectAll"></label>
</th>
<th class="orgGroup">부서</th>
<!-- <th class="orgPsi">직위</th> -->
<th class="orgName">이름</th>
<th class="orgWork">권한</th>
</tr>
</thead>
<tbody id="userList">
</tbody>
</table>
</div>
</li>
</ul>
</div>
<div class="main1_btn_div" style="padding:2px 0;">
<input type="button" class="save_btn" value="선택" onclick="javascript:orgChartPopupSave();">
<input type="button" class="close_btn" value="닫기" onclick="javascript:window.close();">
</div>
</div>
</body>
</html>