Files
wace_plm/WebContent/WEB-INF/view/salesMng/purchaseRegProposalMngList.jsp

228 lines
8.3 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.jsp" %>
<c:set var="now" value="<%=new java.util.Date() %>"/>
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
<%
// DB에서 메뉴명 조회 (공통 유틸 사용)
String menuObjId = request.getParameter("menuObjId");
String menuName = CommonUtils.getMenuName(menuObjId, "구매요청_품의서관리");
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
<style>
body, html {
overflow-x: hidden;
width: 100%;
margin: 0;
padding: 0;
}
.pmsPopupForm tr:last-child td {
border-bottom: none;
}
.select2-selection__choice {
font-size: 11px;
background-color: #fff !important;
border: none !important;
margin-right: 0px !important;
}
.select2-selection__choice__remove {
display: contents !important;
}
.select2-container .select2-selection--multiple {
min-height: 20px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
margin-top: 3.5px !important;
}
.select2-selection__rendered {
height: 18px !important;
}
/* frozen 컬럼 오른쪽 굵은 선 제거 (헤더) */
.tabulator .tabulator-header .tabulator-frozen-left {
border-right: none !important;
}
/* frozen 컬럼 기본 두꺼운 테두리 제거 */
.tabulator .tabulator-frozen-left {
border-right: none !important;
}
/* 체크박스 컬럼 오른쪽에 얇은 구분선 추가 (데이터 행만) */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell.tabulator-frozen-left {
border-right: 1px solid #ddd !important;
}
</style>
<script>
var _tabulGrid;
$(document).ready(function(){
// DOM 렌더링 완료 후 그리드 높이 계산
setTimeout(function() {
fnc_calculateContentHeight("gridDiv", 10);
}, 100);
$(window).resize(function() {
fnc_calculateContentHeight("gridDiv", 10);
});
$('.select2').select2();
$("input[type=text]").keyup(function(e){
if(e.keyCode == 13){
$("#btnSearch").trigger("click");
}
});
// 조회
$("#btnSearch").click(function(){
fn_search();
});
// 결재상신
$("#btnApproval").click(function(){
var selectedData = _tabulGrid.getSelectedData();
if(selectedData.length<1){
Swal.fire("결재상신할 행을 선택해주십시오.");
return false;
}else if(selectedData.length>1){
Swal.fire("한번에 한개의 결재만 가능합니다.");
return false;
}else{
var targetStatus = fnc_checkNull(selectedData[0].STATUS_TITLE);
var status = fnc_checkNull(selectedData[0].STATUS);
if(targetStatus == "결재완료" || targetStatus == "결재중" || status == "cancel"){
Swal.fire("작성중/결재반려인 상태만 결재상신 가능합니다.");
return false;
}else{
if(confirm("결재상신 하시겠습니까?")){
var objId = fnc_checkNull(selectedData[0].OBJID);
var title = encodeURIComponent("품의서 결재");
window.open("/approval/registApproval.do?targetType=PROPOSAL&targetObjId="+objId+"&approvalTitle="+title,"registApproval","width=700,height=700");
}
}
}
});
fn_search();
_fnc_datepick();
});
// 그리드 컬럼 정의
var columns = [
{title:'OBJID', field:'OBJID', visible: false},
{title:'STATUS', field:'STATUS', visible: false},
{headerHozAlign:'center', hozAlign:'center', title:"품의서 No", field:"PROPOSAL_NO", widthGrow:1.2, frozen:true,
formatter: fnc_createGridAnchorTag,
cellClick : function(e, cell) {
fn_openProposalFormPopUp(cell.getData().OBJID);
}
},
{headerHozAlign:'center', hozAlign:'left', title:"프로젝트번호", field:"PROJECT_NUMBER", widthGrow:1.3},
{headerHozAlign:'center', hozAlign:'center', title:"구매유형", field:"PURCHASE_TYPE_NAME", widthGrow:1.0},
{headerHozAlign:'center', hozAlign:'center', title:"주문유형", field:"ORDER_TYPE_NAME", widthGrow:1.0},
{headerHozAlign:'center', hozAlign:'center', title:"제품구분", field:"PRODUCT_NAME_TITLE", widthGrow:1.0},
{headerHozAlign:'center', hozAlign:'left', title:"품번", field:"PART_NO", widthGrow:1.5},
{headerHozAlign:'center', hozAlign:'left', title:"품명", field:"PART_NAME", widthGrow:1.8},
{headerHozAlign:'center', hozAlign:'center', title:"결재상태", field:"STATUS_TITLE", widthGrow:1.0,
formatter:fnc_createGridAnchorTag,
cellClick:function(e, cell){
var statusTitle = fnc_checkNull(cell.getData().STATUS_TITLE);
if(statusTitle == "결재중" || statusTitle == "결재완료" || statusTitle == "반려"){
fnc_approvalDetail(cell.getData().APPROVAL_OBJID, cell.getData().ROUTE_OBJID);
}
}
},
{headerHozAlign:'center', hozAlign:'center', title:"작성일", field:"REGDATE_TITLE", widthGrow:1.0}
];
// 검색 - 구매요청_품의서 전용 API 호출
function fn_search(){
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/salesMng/purchaseRegProposalMngGridList.do", columns, true);
}
// 품의서 상세 팝업
function fn_openProposalFormPopUp(objId){
var url = "/salesMng/proposalFormPopUp.do?PROPOSAL_OBJID=" + fnc_checkNull(objId);
window.open(url, "proposalFormPopUp", "width=1200,height=900,scrollbars=yes,resizable=yes");
}
function _fnc_datepick(){
var $dateinput = $("input.date_icon");
for(var i=0; i<$dateinput.length; i++){
$dateinput.eq(i).attr("size","10");
$dateinput.eq(i).datepicker({
changeMonth:true,
changeYear:true
});
}
}
</script>
</head>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="actionType" id="actionType" value="" />
<div class="min_part_enroll">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name_gdnsi">
<h2>
<span><%=menuName%></span>
</h2>
<div class="btnArea">
<input type="button" value="조회" class="plm_btns" id="btnSearch">
<input type="button" value="결재상신" class="plm_btns" id="btnApproval" style="background:#17a2b8; color:white;">
</div>
</div>
<div id="plmSearchZon">
<table>
<tbody>
<tr>
<td class="align_r"><label>품의서 No</label></td>
<td>
<input type="text" name="SEARCH_PROPOSAL_NO" id="SEARCH_PROPOSAL_NO" style="width:150px;" value="${param.SEARCH_PROPOSAL_NO}"/>
</td>
<td class="align_r"><label>프로젝트번호</label></td>
<td>
<input type="text" name="SEARCH_PROJECT_NO" id="SEARCH_PROJECT_NO" style="width:150px;" value="${param.SEARCH_PROJECT_NO}"/>
</td>
<td class="align_r"><label>결재상태</label></td>
<td>
<select name="SEARCH_STATUS" id="SEARCH_STATUS" class="select2" style="width:130px;">
<option value="">전체</option>
<option value="create">작성중</option>
<option value="inProcess">결재중</option>
<option value="approvalComplete">결재완료</option>
<option value="reject">반려</option>
</select>
</td>
<td class="align_r"><label>작성일</label></td>
<td>
<input type="text" name="regdate_start" id="regdate_start" style="width:110px;" autocomplete="off" value="${param.regdate_start}" class="date_icon">~
<input type="text" name="regdate_end" id="regdate_end" style="width:110px;" autocomplete="off" value="${param.regdate_end}" class="date_icon">
</td>
</tr>
</tbody>
</table>
</div>
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
</div>
</div>
</div>
</form>
</body>
<style>
.container::-webkit-scrollbar-thumb {background: linear-gradient(to bottom, #f5d78e, #f5d78e) !important;}
.container::-webkit-scrollbar-track {background-color: white !important;}
.container::-webkit-scrollbar-button { display: none !important;}
</style>
</html>