398 lines
12 KiB
Plaintext
398 lines
12 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"%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
|
|
<script type="text/javascript">
|
|
var grid;
|
|
$(document).ready(function(){
|
|
|
|
|
|
fnc_setFileDropZone("projectDropZone", "${objId}", "MATERREC", "입고파일", "projectAreaDraw",false,null,null);
|
|
|
|
projectAreaDraw();
|
|
|
|
var gridresult = $.parseJSON($("#gridresult").val()); //jqGrid 입고결과
|
|
var locationCd = $.parseJSON($("#locationCd").val()); //jqGrid 계정과목
|
|
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
$(".select2").select2();
|
|
|
|
fnc_datepick(); //달력
|
|
|
|
grid = $("#expenseDetailGrid").jqGrid({
|
|
url: ""
|
|
,datatype: "local"
|
|
,colNames: ["OBJID","detailOBJID","과거입고수량","품명","규격","Unit","발주수량","입고수량","결과","Location","입고일"]
|
|
,colModel: [
|
|
{name:"RESOURCE_OBJID",index:"RESOURCE_OBJID", width: 0, align:"center", hidden: true, sortable:false, editable:true}
|
|
,{name:"MATERIAL_DETAIL_OBJID",index:"MATERIAL_DETAIL_OBJID", width: 0, align:"center", hidden: true, sortable:false, editable:false}
|
|
,{name:"ORI_WARE_QTY",index:"ORI_WARE_QTY", width: 0, align:"center", hidden: true, sortable:false, editable:false}
|
|
,{name:"PRODUCT_TITLE_NAME",index:"PRODUCT_TITLE_NAME", width: 200, align:"center", hidden: false, sortable:false, editable:false
|
|
,editoptions:{
|
|
dataInit : function(e){
|
|
e.style.fontSize = 13;
|
|
}
|
|
}
|
|
}
|
|
,{name:"STANDARD_NAME",index:"STANDARD_NAME", width: 200, align:"center", hidden: false, sortable:false, editable:false
|
|
,editoptions:{
|
|
dataInit : function(e){
|
|
e.style.fontSize = 13;
|
|
}
|
|
}
|
|
}
|
|
,{name:"UNIT",index:"UNIT", width: 80, align:"center", hidden: false, sortable:false, editable:false
|
|
,editoptions:{
|
|
dataInit : function(e){
|
|
e.style.fontSize = 13;
|
|
}
|
|
}
|
|
}
|
|
,{name:"QTY",index:"QTY", width: 60, align:"right", hidden: false, sortable:false, editable:false ,formatter: "integer", formatoptions:{thousandsSeparator:","}}
|
|
,{name:"WARE_QTY",index:"WARE_QTY", width: 60, align:"right", hidden: false, sortable:false, editable:true ,formatter: "integer", formatoptions:{thousandsSeparator:","}}
|
|
,{name:"RESULT" ,index:"RESULT" , width:80, align:"center", hidden:false, sortable:false, editable: true
|
|
,edittype :"select"
|
|
,formatter :"select"
|
|
,editoptions:{
|
|
value: gridresult
|
|
,dataInit: function(e){
|
|
e.style.width = "92%";
|
|
e.style.fontSize = 12;
|
|
|
|
}
|
|
}
|
|
}
|
|
,{name:"LOCATION" ,index:"LOCATION" , width:80, align:"center", hidden:false, sortable:false, editable: true
|
|
,edittype :"select"
|
|
,formatter :"select"
|
|
,editoptions:{
|
|
value: locationCd
|
|
,dataInit: function(e){
|
|
e.style.width = "92%";
|
|
e.style.fontSize = 12;
|
|
|
|
}
|
|
}
|
|
}
|
|
,{name:"WARE_DATE" ,index:"WARE_DATE" , width:80, align: "center", hidden:false, sortable:false, editable: true,
|
|
editoptions : { dataInit : function(e)
|
|
{
|
|
$(e).datepicker();
|
|
e.style.fontSize = 12;
|
|
e.style.textAlign = "center";
|
|
}
|
|
}
|
|
}
|
|
|
|
]
|
|
,rownumbers : true
|
|
,viewrecords : true
|
|
,height : 230
|
|
,multiselect : false
|
|
,shrinkToFit : false
|
|
,autowidth : true
|
|
,sortable : false
|
|
,rowNum : 10000
|
|
,forceFit : false //컬럼의 width를 변화시킬때 그리드의 width를 고정 여부
|
|
,jsonReader : {repeatitems: false}
|
|
,mtype :"POST"
|
|
,footerrow : false //바닥합계
|
|
,userDataOnFooter: true //바닥합계
|
|
,loadComplete: function(){
|
|
//footer 커스텀..
|
|
|
|
}
|
|
});
|
|
gridFn.modify_search();
|
|
});
|
|
|
|
|
|
function imageFormatter(cellvalue, options, rowObject)
|
|
{
|
|
var url='<img src="/images/file_empty.png" width="15px" height="15px" />'
|
|
if(cellvalue != 0){
|
|
url='<img src="/images/folder_blue.png" width="15px" height="15px" />'
|
|
}
|
|
return url;
|
|
}
|
|
|
|
function fn_appr_status(){
|
|
$("#status_cd").val("PURSTCD00200");
|
|
gridFn.closeEdit();
|
|
$.ajax({
|
|
url:"/materMgmt/materMgmtSave.do"
|
|
,type:"POST"
|
|
,data: $("#form1").serialize() + "&jqGrid="+ encodeURIComponent(JSON.stringify(grid.getRowData()))
|
|
,dataType:"json"
|
|
,success:function(data){
|
|
/* if(data =="SUCCESS"){
|
|
Swal.fire("저장되었습니다.");
|
|
};
|
|
if(typeof opener.fn_search =="function"){ opener.fn_search() }; */
|
|
self.close();
|
|
}
|
|
,error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
|
|
}
|
|
var gridFn = {
|
|
opennEdit : function() { //수정가능
|
|
var ids = grid.jqGrid("getDataIDs");
|
|
for (var i = 0; i < ids.length; i++) {
|
|
grid.jqGrid("editRow",ids[i]);
|
|
}
|
|
}
|
|
,closeEdit : function() { //수정불가
|
|
var ids = grid.jqGrid("getDataIDs");
|
|
for (var i = 0; i < ids.length; i++) {
|
|
grid.jqGrid("saveRow", ids[i], /*successFunction*/null, /*url*/"clientArray"/*, extraparam, aftersavefunc,errorfunc, afterrestorefunc*/);
|
|
}
|
|
}
|
|
,modify_search : function() {
|
|
grid.setGridParam({
|
|
url: "/materMgmt/modifysearchPartMgmt.do"
|
|
,datatype : "json"
|
|
,postData : $("#form1").serialize()
|
|
,loadComplete : function(data) {
|
|
gridFn.footerSummary();
|
|
}
|
|
,gridComplete : function() {
|
|
gridFn.opennEdit(); //수정가능
|
|
}
|
|
}).trigger("reloadGrid");
|
|
grid.setGridParam({url: "", datatype : "local"});
|
|
}
|
|
,footerSummary: function(){ //자동합계
|
|
|
|
}
|
|
}
|
|
|
|
function fn_save(){
|
|
if(fnc_valitate("form1")){
|
|
|
|
if(confirm("저장 하시겠습니까?")){
|
|
|
|
gridFn.closeEdit();
|
|
$.ajax({
|
|
url:"/materMgmt/materRecSaveDetail.do"
|
|
,type:"POST"
|
|
,data: $("#form1").serialize() + "&jqGrid="+ encodeURIComponent(JSON.stringify(grid.getRowData()))
|
|
,dataType:"json"
|
|
,success:function(data){
|
|
if(data =="SUCCESS"){
|
|
Swal.fire("저장되었습니다.");
|
|
};
|
|
if(typeof opener.fn_search =="function"){ opener.fn_search() };
|
|
gridFn.modify_search();
|
|
self.close();
|
|
}
|
|
,error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
//형상 영역을 display 한다.
|
|
function projectAreaDraw(){
|
|
fn_fileCallback("project","MATERREC");
|
|
}
|
|
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
function fn_fileCallback(areaId,fileType){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${objId}", "docType":fileType},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
|
|
//첨부파일 목록 영역 show
|
|
$("#"+areaId+"FileArea").empty();
|
|
|
|
if(0 < $("#"+areaId+"DefaultRow").length){
|
|
$("#"+areaId+"DefaultRow").hide();
|
|
}
|
|
|
|
$.each(data, function(i){
|
|
|
|
var appendText = "";
|
|
if("project" == areaId || "project1" == areaId || "project2" == areaId){
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
appendText += "<colgroup>";
|
|
appendText +=" <col width='10%''>";
|
|
appendText +=" <col width='*'>";
|
|
appendText +=" <col width='20%'>";
|
|
appendText +=" </colgroup>";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>"+[i+1]+"</td>";
|
|
appendText+= " <td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
<c:if test="${param.actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
|
|
</c:if>
|
|
appendText+= "</td>";
|
|
appendText+= " <td>"+data[i].REGDATE+"</td>";
|
|
appendText+= "</tr>";
|
|
}
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#"+areaId+"DropZone").show();
|
|
$("#"+areaId+"AttachFileList").hide();
|
|
$("#"+areaId+"FileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
|
|
|
|
/*첨부 파일 삭제 */
|
|
function fileDelete(fileObjId,areaId){
|
|
var type =areaId;
|
|
if(confirm("파일을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
if(type=="project"){
|
|
fn_fileCallback("project","MATERREC");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="material_master_objid" id="material_master_objid" value="${info.MATERIAL_MASTER_OBJID}">
|
|
<section>
|
|
<div class="plm_menu_name">
|
|
<h2><span>자재관리_입고결과등록</span></h2>
|
|
</div>
|
|
<div style="clear:both"></div>
|
|
<div id="plm_table_wrap1" style="padding:0 8 0 8;margin-top:15px">
|
|
<div style="">
|
|
<div style="height: 250px;">
|
|
<table id="expenseDetailGrid""></table>
|
|
<!-- <div id="jqGridPager"></div> -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<br>
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="20%">
|
|
<col width="25%">
|
|
<col width="25%">
|
|
<col width="25%">
|
|
</colgroup>
|
|
<tr>
|
|
<td rowspan="3" class="input_title">
|
|
<label for="req_date">파일첨부</label>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4">
|
|
<div id="projectDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
|
|
<!-- <input type="file" name="file1" id="file1" multiple style="width:90%;"> -->
|
|
<!-- <input type="button" id="btnUpload" value="Upload" class="upload_btns"> -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4">
|
|
<div class="project_form_in_table"style="width:100%" id="projectFileAreaTable" >
|
|
<div style="overflow-y:scroll;">
|
|
<table class=""fileListscrollThead"" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>첨부파일명</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="height:75px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
</table>
|
|
<table id="projectFileArea" class="fileListscrollTbody">
|
|
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
<div class="btn_wrap" style="margin-right:8px">
|
|
<div class="plm_btn_wrap">
|
|
<!-- <input type="button" value="조회" class="plm_btns" id="btnsearch" name="btnsearch" style="background:#dfeffc"> -->
|
|
|
|
|
|
<%-- <c:if test="${info.RECV_USERID eq connectUserId or 'plm_admin' eq connectUserId}"> --%>
|
|
<input type="button" value="저장" class="plm_btns" id="btnSave" name="btnSave" style="background:#dfeffc">
|
|
<%-- </c:if> --%>
|
|
<!-- <input type="button" value="삭제" class="plm_btns" id="btnDel" name="btnDel" style="background:#dfeffc"> -->
|
|
<input type="button" value="닫기" class="plm_btns" style="background:#dfeffc" onclick="window.close();" >
|
|
<!-- <input type="button" value="결재상신" class="plm_btns" id="btnAppr" name="btnAppr" style="background:#dfeffc"> -->
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<textarea style="width:0px; height:0px; visibility: hidden;" id="gridresult">${code_map.gridresult}</textarea>
|
|
<textarea style="width:0px; height:0px; visibility: hidden;" id="locationCd">${code_map.locationCd}</textarea>
|
|
<!-- 코드동적설정 -->
|
|
|
|
<%-- <textarea style="width:0px; height:0px; visibility: hidden;" id="gridExpSortCd">${code_map.gridExpSortCd}</textarea>
|
|
<textarea style="width:0px; height:0px; visibility: hidden;" id="gridExpSubmCd">${code_map.gridExpSubmCd}</textarea><!-- 코드동적설정 -->
|
|
<textarea style="width:0px; height:0px; visibility: hidden;" id="gridExpSubdCd">${code_map.gridExpSubdCd}</textarea><!-- 코드동적설정 --> --%>
|
|
|
|
</form>
|
|
</body>
|
|
</html> |