358 lines
10 KiB
Plaintext
358 lines
10 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" %>
|
|
<%
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String userId = CommonUtils.checkNull(person.getUserId());
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
/* $('.select2').select2(); */
|
|
|
|
//$("#projectno").select2().val("${info.PROJECT_NO}");
|
|
|
|
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
//수정
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
fnc_datepick();
|
|
});
|
|
|
|
function inputNumberFormat(obj) {
|
|
|
|
var sub_p_sum ="";
|
|
var sub_r_sum ="";
|
|
var sub_ps_sum ="";
|
|
var avr="";
|
|
var average="";
|
|
var avr1="";
|
|
var average1="";
|
|
|
|
if(obj.id=="dev_p_product" || obj.id=="sale_p_product"){
|
|
sub_p_sum = Number($("#dev_p_product").val().replace(/,/gi,"")) + Number($("#sale_p_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_p_sum").val(sub_p_sum);
|
|
|
|
avr = Number($("#dev_p_product").val().replace(/,/gi,"")) / Number($("#sub_p_sum").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_p_product").val().replace(/,/gi,"")) / Number($("#sub_p_sum").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#dev_p").val(average+"%");
|
|
}
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#sale_p").val(average1+"%");
|
|
}
|
|
|
|
$("#sub_p_sum").val(comma(uncomma(sub_p_sum)));
|
|
|
|
}
|
|
|
|
if(obj.id=="dev_r_product" || obj.id=="sale_r_product"){
|
|
sub_r_sum = Number($("#dev_r_product").val().replace(/,/gi,"")) + Number($("#sale_r_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_r_sum").val(sub_r_sum);
|
|
|
|
avr = Number($("#dev_r_product").val().replace(/,/gi,"")) / Number($("#dev_p_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_r_product").val().replace(/,/gi,"")) / Number($("#sale_p_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#dev_r").val(average1+"%");
|
|
}
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#sale_r").val(average+"%");
|
|
}
|
|
|
|
$("#sub_r_sum").val(comma(uncomma(sub_r_sum)));
|
|
|
|
}
|
|
|
|
|
|
if(obj.id=="dev_ps_product" || obj.id=="sale_ps_product"){
|
|
sub_ps_sum = Number($("#dev_ps_product").val().replace(/,/gi,"")) + Number($("#sale_ps_product").val().replace(/,/gi,""));
|
|
|
|
$("#sub_ps_sum").val(sub_ps_sum);
|
|
|
|
avr = Number($("#dev_p_product").val().replace(/,/gi,"")) / Number($("#dev_ps_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
avr1 = Number($("#sale_p_product").val().replace(/,/gi,"")) / Number($("#sale_ps_product").val().replace(/,/gi,"")) * 100 ;
|
|
|
|
average = avr.toPrecision(3);
|
|
average1 = avr1.toPrecision(3);
|
|
if(average1!="NaN" && average1!="Infinity"){
|
|
$("#dev_ps").val(average1+"%");
|
|
}
|
|
if(average!="NaN" && average!="Infinity"){
|
|
$("#sale_ps").val(average+"%");
|
|
}
|
|
|
|
$("#sub_ps_sum").val(comma(uncomma(sub_ps_sum)));
|
|
|
|
}
|
|
|
|
|
|
obj.value = comma(uncomma(obj.value));
|
|
|
|
}
|
|
|
|
function comma(str) {
|
|
str = String(str);
|
|
return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
|
|
}
|
|
|
|
function uncomma(str) {
|
|
str = String(str);
|
|
return str.replace(/[^\d]+/g, '');
|
|
}
|
|
|
|
|
|
|
|
//수주활동 등록정보 수정
|
|
function fn_save(){
|
|
|
|
if(fnc_valitate("form1")){
|
|
|
|
var message="수정";
|
|
if("${actionType}"=='regist'){
|
|
message="등록";
|
|
}
|
|
if(confirm(message+"하시겠습니까?")){
|
|
saveProcess();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function saveProcess(){
|
|
// 날짜 - 제거
|
|
/* $("#del_date").val($("#del_date").val().replace(/-/gi,""))
|
|
$("#req_date").val($("#req_date").val().replace(/-/gi,"")) */
|
|
$.ajax({
|
|
url:"/materMgmt/savematerMgmtInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.RESULT.msg);
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${objId}">
|
|
<section>
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>자재관리_재고등록/수정</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap" style="overflow-y:scroll; height:350px;">
|
|
<!-- <div class="form_popup_title"> 영업활동 등록</div> -->
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="35%"/>
|
|
<col width="*"/>
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">Project No.</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="projectno" id="projectno" class="select2" autocomplete="off" required reqTitle="projectno" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.projectno}
|
|
|
|
<c:if test="${info.projectno eq '1'}">
|
|
<option value="1" selected>00000</option>
|
|
</c:if>
|
|
|
|
<c:if test="${info.projectno ne '1'}">
|
|
<option value="1" >00000</option>
|
|
</c:if>
|
|
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="part_name">품명</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="part_name" id="part_name" value="${info.PART_NAME}" maxlength="30">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">규격(재질)</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<%-- <select name="spec_cd" id="spec_cd" class="select2" autocomplete="off" required reqTitle="규격(재질)" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.spec_cd}
|
|
</select> --%>
|
|
<input type="text" name="spec_cd" id="spec_cd" value="${info.SPEC_CD}" maxlength="100">
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">제조사</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="mfa_cd" id="mfa_cd" value="${info.MFA_CD}" maxlength="100">
|
|
<%-- <select name="mfa_cd" id="mfa_cd" class="select2" autocomplete="off" required reqTitle="제조사" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.mfa_cd}
|
|
</select> --%>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="qty">수량</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="qty" id="qty" value="${info.QTY}" maxlength="30">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="unit_price">단가</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="unit_price" id="unit_price" value="${info.UNIT_PRICE}" maxlength="30">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">팀명</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="dept_cd" id="dept_cd" class="select2" autocomplete="off" required reqTitle="팀명" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.dept_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="reg_date" style="color:red">등록일</label>
|
|
</td>
|
|
<td >
|
|
<input type="text" name="reg_date" id="reg_date" value="${info.REG_DATE}" class="date_icon" required reqTitle="등록일">
|
|
</td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="sort_cd">구분</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="sort_cd" id="sort_cd" class="select2" autocomplete="off" required reqTitle="구분" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.sort_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="reason_cd">사유</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="reason_cd" id="reason_cd" class="select2" autocomplete="off" required reqTitle="사유" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.reason_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="pur_cd">구매구분</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="pur_cd" id="pur_cd" class="select2" autocomplete="off" required reqTitle="구매구분" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.pur_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="local_cd">위치</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<select name="local_cd" id="local_cd" class="select2" autocomplete="off" required reqTitle="위치" type="select">
|
|
<option value="">선택</option>
|
|
${code_map.local_cd}
|
|
</select>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<!-- <input type="button" value="Edit" class="plm_btns" onclick=""> -->
|
|
<div class="plm_btn_wrap_center">
|
|
<c:choose>
|
|
<%-- <c:when test="${actionType eq 'regist' and (info.WRITER eq connectUserId or 'plm_admin' eq connectUserId)}"> --%>
|
|
<c:when test="${actionType eq 'regist'}">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns">
|
|
</c:when>
|
|
<c:otherwise>
|
|
<c:if test="${'plm_admin' eq connectUserId or 'KM2721' eq connectUserId }">
|
|
<input type="button" value="수정" id="btnSave" class="plm_btns">
|
|
</c:if>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<%--
|
|
<c:if test="${actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
<input type="button" value="수정" id="btnSave" class="plm_btns">
|
|
</c:if> --%>
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |