ERP-node/WebContent/WEB-INF/view/salesMng/salesPartChgList_back.jsp

289 lines
15 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"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*" %>
<%@include file="/init_jqGrid.jsp"%><%--Expression Language ::: ${fn:escapeXml(str1)} --%>
<c:set var="now" value="<%=new java.util.Date() %>"/>
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=Constants.SYSTEM_NAME%></title>
</head>
<script type="text/javascript">
$(document).ready(function(){
fnc_changePaginationAndTotalCountArea();
$('.select2').select2();
fnc_datepick();
//조회
$("#btnSearch").click(function(){
$("#page").val("1");
fn_search();
});
//접수
$("#btnRec").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow(grid1);
if(selectedRowIds.length==0){
Swal.fire("접수할 행을 선택해주십시오.");
return false;
}
let partIds = selectedRowIds.map(function(o,i){
return grid1.getRowData(o).OBJID;
});
$.ajax({
url:"/salesMng/receiptSalesPartChgInfo.do"
,type:"POST"
,data: "partIds="+partIds.join(",")
,dataType:"json"
,async:false
,success:function(data){
Swal.fire(data.message);
fn_search();
self.close();
}
,error: function(jqxhr, status, error){
}
});
});
//조치내역등록
$("#btnActReg").click(function(){
var selectedRowIds = fn_jqGrid_selarrrow(grid1);
if(selectedRowIds.length==0){
Swal.fire("등록할 행을 선택해주십시오.");
return false;
}else if(selectedRowIds.length>1){
Swal.fire("한번에 한개의 등록만 가능합니다.");
return false;
}else{
var objid = grid1.getRowData(selectedRowIds[0]).SPC_OBJID;
var part_objid = grid1.getRowData(selectedRowIds[0]).OBJID;
var eo_no = grid1.getRowData(selectedRowIds[0]).EO_NO;
var part_no = grid1.getRowData(selectedRowIds[0]).PART_NO;
var project_no = grid1.getRowData(selectedRowIds[0]).PROJECT_NO;
if(fnc_checkNull(objid)=="" || fnc_checkNull(grid1.getRowData(selectedRowIds[0]).CONFIRM_DATE)==""){
Swal.fire("접수되지 않은 건입니다.");
return false;
}
fn_formPopUp(600,300,"/salesMng/salesPartChgFormPopup.do", "salesPartChgFormPopup", objid, part_objid, eo_no, part_no, project_no);
}
});
grid1 = $("#grid1").jqGrid({
url: ""
,datatype: "local"
,data : $.parseJSON($("#grid1Data").val())
,colNames: ["OBJID","SPC_OBJID","EO No","POM_OBJID"
,"년도","프로젝트명","당사프로젝트번호","품번","품명","EO구분","설변사유","Revision","EO Date","PART구분","설계담당자"
,"구매확인","구매담당자","조치내역","발주서NO","조치결과"
]
,colModel: [
{name:"OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"SPC_OBJID" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"EO_NO" , index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"PURCHASE_ORDER_MASTER_OBJID", index:"", width: 0, align:"center", hidden: true, sortable:false, editable:false}
,{name:"CM_YEAR" , index:"", width:70, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CUSTOMER_PROJECT_NAME", index:"", width:130, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PROJECT_NO" , index:"", width:130, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PART_NO" , index:"", width:140, align:"center", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"PART_NAME" , index:"", width:150, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CHANGE_TYPE_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CHANGE_OPTION_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"REVISION" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"EO_DATE" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PART_TYPE_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"WRITER_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"CONFIRM_DATE" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"WRITER1_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"ACT_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
,{name:"PURCHASE_ORDER_NO", index:"", width:100, align:"center", hidden:false, sortable:false, editable:false, formatter: col_custom_fmt, unformat:col_custom_fmt_un}
,{name:"ACT_STATUS_NAME" , index:"", width:100, align:"center", hidden:false, sortable:false, editable:false}
]
,ignoreCase : true //로컬 검색 및 정렬이 대,소문자를 구분하지 않도록 하려면true
,rownumbers : false //row번호 표시
,viewrecords : true //pager가 있을경우 표시되는 record number
,autowidth : true //그리드 너비가 자동으로 부모 요소의 너비로 다시 계산
,sortable : false //마우스로 열을 끌어다 놓아 열을 재정렬
,shrinkToFit : true //모든 열은 너비에 비례하여 크기가 조정
,forceFit : true //컬럼의 width를 변화시킬때 그리드의 width를 고정 여부
,multiselect : true //선택가능. 체크박스표시
,height : 540
,rowNum : "${countPerPage}"
,jsonReader : {repeatitems: false}
,mtype :"POST"
,footerrow : false //바닥합계
,userDataOnFooter: true //바닥합계
//,caption :"제목"
//,pager :"#grid1Pager"
,loadComplete: function(data){ //모든 서버 요청 직후에 실행
var gid = $(this).attr("id");
var grid_wrap_div = $("#gbox_"+gid);
setTimeout("fn_jqGrid_init($('#"+gid+"'), true);", 50); //윈도우크기 비례 자동조절
//footer 커스텀..
}
});
});
function fn_search(){
document.form1.action = "/salesMng/salesPartChgList.do";
document.form1.submit();
}
/*
Custom Formatter Parameters Description
◆ cellvalue: value to be formatted
◆ options : { rowId: rid, colModel: {name: , index, width, align, ...}}
◆ rowObject : row data
*/
function col_custom_fmt(cellvalue, options, rowObject) {
//console.log("rid : "+ options.rowId + " colModel["+JSON.stringify(options.colModel)+"]");
var return_fmt = "";
cellvalue = fnc_checkNull(cellvalue);
if(options.colModel.name == "PURCHASE_ORDER_NO" ){ //발주서NO
var url = "/purchaseOrder/purchaseOrderFormPopup_new.do?PURCHASE_ORDER_MASTER_OBJID="+rowObject.PURCHASE_ORDER_MASTER_OBJID;
return_fmt = '<a href="#" onclick="javascript:fn_centerPopup(950, 765, \''+url+'\', \'purchaseOrderFormPopup_new\');">'+cellvalue+'</a>';
}else if(options.colModel.name == "PART_NO" ){ //첨부파일
var url = "/partMng/partMngHisDetailPopUp.do?OBJID="+rowObject.OBJID;
var empty = ($.isNumeric(cellvalue) && Number(cellvalue) > 0) ? "" : "empty_";
return_fmt = '<a href="#" onclick="javascript:fn_centerPopup(550, 250, \''+url+'\', \'fileAS_DOC_01\');">'+cellvalue+'</a>';
}else{
return_fmt = cellvalue;
}
return return_fmt;
}
/**
unFormatter : grid1.getRowData(), getCell(n,colname) 에서 값만 나오게하는 함수
*/
function col_custom_fmt_un(cellvalue, options, cell) {
return cellvalue;
}
function fn_formPopUp(width, heigth, url, target, objId, part_objid, eo_no, part_no, project_no){
var hiddenForm = document.hiddenForm;
fn_centerPopup(width, heigth, "", target);
hiddenForm.objId.value = objId;
hiddenForm.part_objid.value = part_objid;
hiddenForm.eo_no.value = eo_no;
hiddenForm.part_no.value = part_no;
hiddenForm.project_no.value = project_no;
hiddenForm.action = url;
hiddenForm.target = target;
hiddenForm.submit();
}
</script>
<body>
<form name="hiddenForm" id="hiddenForm" method="post">
<input type="hidden" name="objId" />
<input type="hidden" name="part_objid" />
<input type="hidden" name="eo_no" />
<input type="hidden" name="part_no" />
<input type="hidden" name="project_no" />
</form>
<form name="form1" id="form1" action="" method="post">
<div class="content-box">
<div class="content-box-s">
<div class="plm_menu_name">
<h2>
<span>구매관리_설계변경리스트</span>
</h2>
</div>
<div id="plmSearchZon">
<table>
<tr>
<td><label for="Year">년도</label></td>
<td>
<select name="Year" id="Year" class="select2" autocomplete="off" style="width:110px;">
<option value="">선택</option>
<c:forEach begin="${sysYear-4}" end="${sysYear}" var="req_year">
<option value="${req_year}"${param.Year eq req_year ? 'selected':'' }>${req_year}</option>
</c:forEach>
</select>
</td>
<td><label for="">당사프로젝트번호</label></td>
<td><select name="contract_objid" id="contract_objid" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.contract_objid}</select></td>
<td><label for="">PART No</label></td>
<td><input type="text" name="part_no" id="part_no" autocomplete="off" value="${param.part_no }" style="width:120px;"/></td>
<td><label for="">PART Name</label></td>
<td><input type="text" name="part_name" id="part_name" autocomplete="off" value="${param.part_name}" style="width:120px;"/></td>
<td class="align_r"><label>EO Date</label></td>
<td>
<input type="text" name="eo_date_start" id="eo_date_start" style="width:90px;" autocomplete="off" value="${param.eo_date_start}" class="date_icon">~
<input type="text" name="eo_date_end" id="eo_date_end" style="width:90px;" autocomplete="off" value="${param.eo_date_end }" class="date_icon">
</td>
<td><label for="">EO구분</label></td>
<td><select name="change_type" id="change_type" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.change_type}</select></td>
<td><label for="">설변사유</label></td>
<td><select name="change_option" id="change_option" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.change_option}</select></td>
<%-- <td><label for="">EO단계</label></td>
<td><select name="eo_step" id="eo_step" class="select2" autocomplete="off"><option value="">선택</option>${code_map.eo_step}</select></td> --%>
</tr>
<tr>
<td><label for="">PART 구분</label></td>
<td><select name="part_type" id="part_type" class="select2" autocomplete="off" style="width:110px;"><option value="">선택</option>${code_map.part_type}</select></td>
<td><label for="">설계담당자</label></td>
<td><select name="part_writer" id="part_writer" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.part_writer}</select></td>
<td><label for="">구매담당자</label></td>
<td><select name="sales_writer" id="sales_writer" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.sales_writer}</select></td>
<td><label for="">Revision</label></td>
<td><input type="text" name="revision" id="revision" autocomplete="off" value="${param.revision }" style="width:120px;"/></td>
<td class="align_r"><label>구매확인일자(접수)</label></td>
<td>
<input type="text" name="confirm_date_start" id="confirm_date_start" style="width:90px;" autocomplete="off" value="${param.confirm_date_start}" class="date_icon">~
<input type="text" name="confirm_date_end" id="confirm_date_end" style="width:90px;" autocomplete="off" value="${param.confirm_date_end }" class="date_icon">
</td>
<td><label for="">조치내역</label></td>
<td><select name="act_cd" id="act_cd" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.act_cd}</select></td>
<td><label for="">조치결과</label></td>
<td><select name="act_status" id="act_status" class="select2" autocomplete="off" style="width:120px;"><option value="">선택</option>${code_map.act_status}</select></td>
</tr>
</table>
</div>
<section class="contents_page_basic_margin">
<div class="btn_wrap">
<div class="plm_btn_wrap">
<input type="button" class="plm_btns" value="접수" id="btnRec">
<input type="button" class="plm_btns" value="조치내역등록" id="btnActReg">
<input type="button" class="plm_btns" value="조회" id="btnSearch">
</div>
</div>
<div class="plm_table_wrap" style="overflow-x: auto;">
<table id="grid1"></table>
<!-- <div id="grid1Pager"></div> -->
<textarea style="width:0px; height:0px; visibility: hidden;" id="grid1Data">${LIST}<c:if test="${empty LIST}">[]</c:if></textarea><!-- [{},{},{}] -->
</div>
<div class="pdm_page">${PAGE_HTML}</div>
</section>
</div>
</div>
</form>
</body>
</html>