- Add Docker Compose configurations for dev, prod, and standalone environments - Add database initialization scripts (init-db.sh, init-db-docker.sh) - Add enhanced start-docker-linux.sh with DB init support - Add comprehensive database initialization guide - Support for automatic dbexport.pgsql import on first run - Include safety checks for production environment
434 lines
16 KiB
Plaintext
434 lines
16 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">
|
|
var normalArr = new Array();
|
|
var normalViewArr = new Array();
|
|
var helpArr = new Array();
|
|
var helpViewArr = new Array();
|
|
var refArr = new Array();
|
|
var refViewArr = new Array();
|
|
|
|
$(function(){
|
|
|
|
var callbackFnc = "${param.callbackFnc}";
|
|
|
|
//창 닫기
|
|
$('#btn_close').click(function(){
|
|
self.close();
|
|
});
|
|
|
|
//결재 상신
|
|
$("#btnApproval").click(function(){
|
|
if(fnc_valitate("form1")){
|
|
if(normalArr.length > 0){
|
|
if(confirm("결재 상신 하시겠습니까?")){
|
|
$.ajax({
|
|
url: "/approval/approvalProc.do",
|
|
method: 'post',
|
|
data: {
|
|
"approvalTitle":$("#approvalTitle").val()
|
|
, "approvalDescription":$("#approvalDescription").val()
|
|
, "targetObjId":$("#targetObjId").val()
|
|
, "targetObjIds":$("#targetObjIds").val()
|
|
, "targetType":$("#targetType").val()
|
|
, "normalArr":normalArr
|
|
, "helpArr":helpArr
|
|
, "refArr":refArr
|
|
},
|
|
dataType: 'json',
|
|
success: function(data) {
|
|
Swal.fire(data.msg);
|
|
if(fnc_checkNull(callbackFnc) != ""){
|
|
opener.eval(callbackFnc+"();");
|
|
}else if(typeof(opener.fn_search) == "function"){
|
|
opener.fn_search();
|
|
}else{
|
|
top.opener.location.href = top.opener.location.href;
|
|
}
|
|
top.self.close(0);
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}else{
|
|
Swal.fire("일반 결재선이 비어있습니다.");
|
|
}
|
|
}
|
|
});
|
|
|
|
//사원 조회 버튼
|
|
$(document).on("click", "#btnUserSearch", function(){
|
|
$(".userListTr").remove();
|
|
fn_searchUserList();
|
|
});
|
|
|
|
//사원조회용 검색조건에서 엔터로 검색 기능 활성화
|
|
$(document).on("keyup", ".searchType", function(e){
|
|
var keyCode = e.keyCode;
|
|
if(keyCode == 13){
|
|
$(".userListTr").remove();
|
|
fn_searchUserList();
|
|
}
|
|
});
|
|
|
|
//결재선 삭제
|
|
$(document).on("click", ".btnApprovalDelete", function(){
|
|
var userId = $(this).attr("data-USER_ID");
|
|
var approvalType = $(this).attr("data-APPROVAL_TYPE");
|
|
fn_removeArray(approvalType, userId);
|
|
//Swal.fire("userId : "+userId+", approvalType : "+approvalType);
|
|
|
|
fn_refreshApprovalUser();
|
|
});
|
|
|
|
//사원목록에서 사원 선택시 event
|
|
$(document).on("click", ".btnUserChoose", function(){
|
|
var userId = $(this).attr("data-USER_ID");
|
|
var approvalType = $("input[name=approvalType]:checked").val();
|
|
|
|
if(approvalType == "normal"){
|
|
|
|
var validateFlag = true;
|
|
|
|
if("${param.targetType}" == "EXPENSE_APPLY"){
|
|
if(2 <= normalArr.length){
|
|
Swal.fire("이미 팀장,결제 인원이 지정되있습니다.");
|
|
validateFlag = false;
|
|
}
|
|
}
|
|
|
|
if(!fn_duplicateCheck(normalArr, userId) && validateFlag){
|
|
//서버 전송용 USER ID
|
|
normalArr.push(userId);
|
|
|
|
//결재선 VIEW용 기타정보
|
|
var deptName = $(this).attr("data-DEPT_NAME");
|
|
var userName = $(this).attr("data-USER_NAME");
|
|
var positionName = $(this).attr("data-POSITION_NAME");
|
|
|
|
var map = new Map();
|
|
map.put("deptName", deptName);
|
|
map.put("userId", userId);
|
|
map.put("userName", userName);
|
|
map.put("positionName", positionName);
|
|
|
|
normalViewArr.push(map);
|
|
}
|
|
|
|
}else if(approvalType == "help"){
|
|
if(!fn_duplicateCheck(helpArr, userId)){
|
|
//서버 전송용 userId
|
|
helpArr.push(userId);
|
|
|
|
//결재선 VIEW용 기타정보
|
|
var deptName = $(this).attr("data-DEPT_NAME");
|
|
var userName = $(this).attr("data-USER_NAME");
|
|
var positionName = $(this).attr("data-POSITION_NAME");
|
|
|
|
var map = new Map();
|
|
map.put("deptName", deptName);
|
|
map.put("userId", userId);
|
|
map.put("userName", userName);
|
|
map.put("positionName", positionName);
|
|
|
|
helpViewArr.push(map);
|
|
}
|
|
}else if(approvalType == "ref"){
|
|
if(!fn_duplicateCheck(refArr, userId)){
|
|
//서버 전송용 userId
|
|
refArr.push(userId);
|
|
|
|
//결재선 VIEW용 기타정보
|
|
var deptName = $(this).attr("data-DEPT_NAME");
|
|
var userName = $(this).attr("data-USER_NAME");
|
|
var positionName = $(this).attr("data-POSITION_NAME");
|
|
|
|
var map = new Map();
|
|
map.put("deptName", deptName);
|
|
map.put("userId", userId);
|
|
map.put("userName", userName);
|
|
map.put("positionName", positionName);
|
|
|
|
refViewArr.push(map);
|
|
}
|
|
}
|
|
fn_refreshApprovalUser();
|
|
});
|
|
});
|
|
|
|
//결재선 새로고침
|
|
function fn_refreshApprovalUser(){
|
|
//일반결재
|
|
$(".normalApproval").remove();
|
|
var htmlStr1 = "";
|
|
for(var i = 0 ; i < normalViewArr.length ; i++){
|
|
var map = normalViewArr[i];
|
|
//Swal.fire(map.get("deptName")+" "+map.get("userName")+" "+map.get("positionName"));
|
|
htmlStr1 += "<tr class=\"normalApproval\">";
|
|
htmlStr1 += "<td>"+map.get("deptName")+"</td>";
|
|
htmlStr1 += "<td>"+map.get("userName")+"</td>";
|
|
htmlStr1 += "<td>"+map.get("positionName")+"</td>";
|
|
htmlStr1 += "<td><span class=\"btnApprovalDelete\" data-USER_ID=\""+map.get("userId")+"\" data-APPROVAL_TYPE=\"normal\">x</span></td>";
|
|
htmlStr1 += "</tr>";
|
|
|
|
}
|
|
$("#approvalFormRight1").append(htmlStr1);
|
|
|
|
//협조결재
|
|
$(".helpApproval").remove();
|
|
var htmlStr2 = "";
|
|
for(var i = 0 ; i < helpViewArr.length ; i++){
|
|
var map = helpViewArr[i];
|
|
//Swal.fire(map.get("deptName")+" "+map.get("userName")+" "+map.get("positionName"));
|
|
htmlStr2 += "<tr class=\"helpApproval\">";
|
|
htmlStr2 += "<td>"+map.get("deptName")+"</td>";
|
|
htmlStr2 += "<td>"+map.get("userName")+"</td>";
|
|
htmlStr2 += "<td>"+map.get("positionName")+"</td>";
|
|
htmlStr2 += "<td><span class=\"btnApprovalDelete\" data-USER_ID=\""+map.get("userId")+"\" data-APPROVAL_TYPE=\"help\">x</span></td>";
|
|
htmlStr2 += "</tr>";
|
|
|
|
}
|
|
$("#approvalFormRight2").append(htmlStr2);
|
|
|
|
//참조결재
|
|
$(".refApproval").remove();
|
|
var htmlStr3 = "";
|
|
for(var i = 0 ; i < refViewArr.length ; i++){
|
|
var map = refViewArr[i];
|
|
//Swal.fire(map.get("deptName")+" "+map.get("userName")+" "+map.get("positionName"));
|
|
htmlStr3 += "<tr class=\"refApproval\">";
|
|
htmlStr3 += "<td>"+map.get("deptName")+"</td>";
|
|
htmlStr3 += "<td>"+map.get("userName")+"</td>";
|
|
htmlStr3 += "<td>"+map.get("positionName")+"</td>";
|
|
htmlStr3 += "<td><span class=\"btnApprovalDelete\" data-USER_ID=\""+map.get("userId")+"\" data-APPROVAL_TYPE=\"ref\">x</span></td>";
|
|
htmlStr3 += "</tr>";
|
|
|
|
}
|
|
$("#approvalFormRight3").append(htmlStr3);
|
|
}
|
|
|
|
//사원조회
|
|
function fn_searchUserList(){
|
|
$.ajax({
|
|
url: "/common/searchUserList.do",
|
|
method: 'post',
|
|
data: {"search_deptName":$("#search_deptName").val(), "search_userName":$("#search_userName").val(), "isJson":true},
|
|
dataType: 'json',
|
|
async:false,
|
|
success: function(data) {
|
|
$("#userListAreaCover").scrollTop();
|
|
|
|
var htmlStr = "";
|
|
|
|
if(data.length > 0){
|
|
$.each(data, function(i){
|
|
htmlStr += "<tr style=\"cursor:pointer;\" class=\"btnUserChoose userListTr\" data-USER_ID=\""+fnc_checkNull(data[i].USER_ID)+"\" data-DEPT_NAME=\""+fnc_checkNull(data[i].DEPT_NAME)+"\" data-USER_NAME=\""+fnc_checkNull(data[i].USER_NAME)+"\" data-POSITION_NAME=\""+fnc_checkNull(data[i].POSITION_NAME)+"\">";
|
|
htmlStr += "<td>"+fnc_checkNull(data[i].DEPT_NAME)+"</td>";
|
|
htmlStr += "<td>"+fnc_checkNull(data[i].USER_NAME)+"</td>";
|
|
htmlStr += "<td>"+fnc_checkNull(data[i].POSITION_NAME)+"</td>";
|
|
htmlStr += "</tr>";
|
|
|
|
//htmlStr += "<label style=\"cursor:pointer; width:100%; height:100%;\" data-USER_ID=\""+fnc_checkNull(data[i].USER_ID)+"\" class=\"btnUserChoose\" data-DEPT_NAME=\""+fnc_checkNull(data[i].DEPT_NAME)+"\" data-USER_NAME=\""+fnc_checkNull(data[i].USER_NAME)+"\" data-POSITION_NAME=\""+fnc_checkNull(data[i].POSITION_NAME)+"\">"+fnc_checkNull(data[i].DEPT_NAME)+" "+fnc_checkNull(data[i].USER_NAME)+" "+fnc_checkNull(data[i].POSITION_NAME)+"</label><br>";
|
|
});
|
|
}else{
|
|
htmlStr += "<tr class=\"userListTr\"><td colspan=\"3\" align=\"center\">조회된 정보가 없습니다.</td></tr>";
|
|
}
|
|
|
|
$("#companyMapTable").append(htmlStr);
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//배열에 존재하는지 체크한다. 동일한게 있으면 true, 없다면 false.
|
|
function fn_duplicateCheck(arr, userId){
|
|
for(var i = 0 ; i < arr.length ; i++){
|
|
var val = arr[i];
|
|
if(val == userId){
|
|
Swal.fire("동일한 사원이 이미 결재선에 있습니다.");
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//배열 삭제
|
|
function fn_removeArray(approvalType, targetValue){
|
|
var targetArr = null;
|
|
var targetViewArr = null;
|
|
|
|
if(approvalType == "normal"){
|
|
targetArr = normalArr;
|
|
targetViewArr = normalViewArr;
|
|
}else if(approvalType == "help"){
|
|
targetArr = helpArr;
|
|
targetViewArr = helpViewArr;
|
|
}else if(approvalType == "ref"){
|
|
targetArr = refArr;
|
|
targetViewArr = refViewArr;
|
|
}
|
|
|
|
var targetIdx = 0;
|
|
for(var i = 0 ; i < targetArr.length ; i++){
|
|
var str = targetArr[i];
|
|
if(str == targetValue) targetIdx = i;
|
|
}
|
|
targetArr.splice(targetIdx,1);
|
|
targetViewArr.splice(targetIdx,1);
|
|
}
|
|
</script>
|
|
</head>
|
|
<body class="backcolor_light_blue">
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="targetObjId" id="targetObjId" value="${param.targetObjId}" />
|
|
<input type="hidden" name="targetObjIds" id="targetObjIds" value="${param.targetObjIds}" />
|
|
<input type="hidden" name="targetType" id="targetType" value="${param.targetType}" />
|
|
<section>
|
|
<!--가로 730px 세로 670px-->
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>결재 상신</span>
|
|
</h2>
|
|
</div></section>
|
|
<section id="approvalLeftSection">
|
|
<div class="approvalFormWrap" style="overflow:inherit">
|
|
<div class="form_popup_title"> 결재 내용</div>
|
|
<div id="approvalFromLeftWrap">
|
|
<table id="approvalFromLeft">
|
|
<colgroup>
|
|
<col width="*">
|
|
<col width="*">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tr>
|
|
<td colspan="3">
|
|
<label for="">결재 번호</label><br>
|
|
<input type="text" name="approvalNo" id="approvalNo" value="결재 상신 후 자동생성됩니다." class="short_text_area" readonly disabled/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3">
|
|
<label for="">제목</label><br>
|
|
<input type="text" name="approvalTitle" id="approvalTitle" value="${param.approvalTitle}" class="short_text_area" maxlength="50" title="제목" required/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="3">
|
|
<label for="">내용</label><br>
|
|
<input type="text" name="approvalDescription" id="approvalDescription" value="" class="short_text_area" maxlength="50"/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<label for="">결재 Type</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="radio" name="approvalType" id="approvalType" value="normal" checked> 일반
|
|
<!-- <input type="radio" name="approvalType" id="approvalType" value="help"> 협조
|
|
<input type="radio" name="approvalType" id="approvalType" value="ref"> 참조 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<label for="">부서</label><br>
|
|
<input type="text" name="search_deptName" id="search_deptName" class="short_text_area searchType">
|
|
</td>
|
|
<td>
|
|
<label for="">성명</label><br>
|
|
<input type="text" name="search_userName" id="search_userName" class="short_text_area searchType">
|
|
</td>
|
|
<td>
|
|
<br>
|
|
<input type="button" value="조회" class="plm_btns" id="btnUserSearch">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="nothing_td"></td>
|
|
</tr>
|
|
<tr class="blue_tr">
|
|
<td colspan="3"> 사원조회</td>
|
|
</tr>
|
|
<tr id="company_map">
|
|
<td colspan="3" valign="top">
|
|
<div style="overflow-y:scroll;width:100%;height:188px;" id="userListAreaCover">
|
|
<div id="userListArea">
|
|
<table id="companyMapTable">
|
|
<colgroup>
|
|
<col width="60px">
|
|
<col width="40px">
|
|
<col width="30px">
|
|
</colgroup>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="상신" class="plm_btns" id="btnApproval">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section id="approvalRightSection">
|
|
<div class="approvalFormWrap" style="overflow:inherit">
|
|
<div class="form_popup_title"> 결재 Type</div>
|
|
<div id="approvalFormRight">
|
|
<div id="approvalArea">
|
|
<!-- <p>일반 결재</p> -->
|
|
<p>결재</p>
|
|
<div class="approvalFormRight1Wrap" style="height:484px;">
|
|
<table id="approvalFormRight1">
|
|
<colgroup>
|
|
<col width="90px">
|
|
<col width="40px">
|
|
<col width="30px">
|
|
<col width="10px">
|
|
</colgroup>
|
|
</table>
|
|
</div>
|
|
<!-- <p>협조 결재</p>
|
|
<div class="approvalFormRight2Wrap">
|
|
<table id="approvalFormRight2">
|
|
<colgroup>
|
|
<col width="90px">
|
|
<col width="40px">
|
|
<col width="30px">
|
|
<col width="10px">
|
|
</colgroup>
|
|
</table>
|
|
</div>
|
|
<p>참조 결재</p>
|
|
<div class="approvalFormRight3Wrap">
|
|
<table id="approvalFormRight3">
|
|
<colgroup>
|
|
<col width="90px">
|
|
<col width="40px">
|
|
<col width="30px">
|
|
<col width="10px">
|
|
</colgroup>
|
|
</table>
|
|
</div> -->
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |