1567 lines
53 KiB
Plaintext
1567 lines
53 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>
|
|
|
|
<c:set var="oemObjId" value="${projectMap.oem_objid}" />
|
|
<c:set var="carObjId" value="${projectMap.car_objid}" />
|
|
<c:set var="factoryObjId" value="${projectMap.OEM_FACTORY}" />
|
|
|
|
</head>
|
|
<style>
|
|
::-webkit-scrollbar-thumb {
|
|
background: linear-gradient(to bottom, #f5d78e, #f5d78e);
|
|
}
|
|
</style>
|
|
<script>
|
|
$(document).ready(function(){
|
|
material_pricesum();
|
|
expense_cost_sum();
|
|
labor_costsum();
|
|
sum_sum();
|
|
|
|
$("#btn_close").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
if('${projectMap.CFT_TEAM_CD}'!=''){
|
|
optionJobGroup('${projectMap.CFT_TEAM_CD}');
|
|
$("#cft_userid").val('${projectMap.CFT_USERID}');
|
|
}
|
|
|
|
//취소
|
|
$("#btnCancel").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var params = "?objId="+objId;
|
|
document.form1.action ="/project/projectDetailPopUp.do"+params;
|
|
document.form1.submit();
|
|
});
|
|
|
|
|
|
//SR자료등록 팝업
|
|
$(".File1").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
Swal.fire(objId);
|
|
/* var docType =$(this).attr("data-docType");
|
|
var docTypeName = $(this).attr("data-docTypeName");
|
|
var params = "?targetObjId="+objId+"&docType="+docType+"&docTypeName="+docTypeName;
|
|
window.open("/projectConcept/FileRegistPopup.do"+params, "", "width=800, height=335"); */
|
|
});
|
|
|
|
//추가
|
|
$("#btnAdd").click(function(){
|
|
var length = $(".expensetable tr").length;
|
|
length = length;
|
|
var addText ="";
|
|
addText +="<tr id='row"+Number(length)+"' class='inner-table-row'>"
|
|
addText +="<td><input type='text' id='add_part_name"+Number(length)+"' name='add_part_name' required reqTitle='add_part_name' class='input'></td>"
|
|
addText +="<td><input type='text' id='add_inj_cav"+Number(length)+"' name='add_inj_cav' required reqTitle='add_inj_cav' class='input'></td>"
|
|
addText +="<td><input type='text' id='add_machine_type"+Number(length)+"' name='add_machine_type' required reqTitle='add_machine_type' class='input'></td>"
|
|
addText +="<td><input type='text' id='add_inj_ton"+Number(length)+"' name='add_inj_ton' required reqTitle='add_inj_ton' class='input'></td>"
|
|
addText +="<td><input type='text' id='add_expense_total_cooling_time"+Number(length)+"' name='add_expense_total_cooling_time' required reqTitle='total_cooling_time' class='input' onkeyup='javascript:expense_costkeyup("+Number(length)+");'></td>"
|
|
addText +="<td><input type='text' id='add_expense"+Number(length)+"' name='add_expense' required reqTitle='add_expense' class='input' onkeyup='javascript:expense_costkeyup("+Number(length)+");'></td>"
|
|
addText +="<td><input type='text' id='add_expense_cost"+Number(length)+"' name='add_expense_cost' required reqTitle='add_expense_cost' class='auto-calculated' readonly></td>"
|
|
addText +="<td><input type='button' class='blue_btn' value='삭제' onclick='fn_delete_expensetable("+Number(length)+");' style='float:none;'></td>"
|
|
addText +="</tr>";
|
|
|
|
$(".expensetable").append(addText);
|
|
expense_cost_sum();
|
|
});
|
|
|
|
//추가
|
|
$("#btnAddM").click(function(){
|
|
var length = $(".materialtable tr").length;
|
|
length = length +1;
|
|
var addText ="";
|
|
addText +="<tr id='row_m"+Number(length)+"' class='inner-table-row'>"
|
|
addText +="<td><input type='text' id='sub_part_name"+Number(length)+"' name='sub_part_name' required reqTitle='sub_part_name' class='input'/></td>"
|
|
addText +="<td> </td>"
|
|
addText +="<td><input type='text' id='sub_us"+Number(length)+"' name='sub_us' required reqTitle='sub_us' class='input' onkeyup='javascript:sub_material_price_keyup("+Number(length)+");'/></td>"
|
|
addText +="<td>EA</td>"
|
|
addText +="<td><input type='text' id='sub_weight"+Number(length)+"' name='sub_weight' required reqTitle='소요량' class='input' onkeyup='javascript:sub_material_price_keyup("+Number(length)+");'/></td>"
|
|
addText +="<td><input type='text' id='sub_part_price"+Number(length)+"' name='sub_part_price' required reqTitle='단가' class='input' onkeyup='javascript:sub_material_price_keyup("+Number(length)+");'/></td>"
|
|
addText +="<td><input type='text' id='sub_material_price"+Number(length)+"' name='sub_material_price' required reqTitle='sub_material_price' class='auto-calculated' readonly></td>"
|
|
addText +="<td><input type='button' class='blue_btn' value='삭제' onclick='fn_delete_materialtable("+Number(length)+");' style='float:none;'/></td>"
|
|
addText +="</tr>";
|
|
|
|
|
|
$(".materialtable").append(addText);
|
|
material_pricesum();
|
|
});
|
|
|
|
});
|
|
|
|
function expense_cost_sum(){
|
|
|
|
var expense_cost_length = $("input[name=expense_cost]").length;
|
|
|
|
var expense_cost = 0;
|
|
var expense_cost_sum = 0;
|
|
|
|
|
|
for(var i=0; i<expense_cost_length; i++){
|
|
|
|
|
|
if(isNaN($("input[name=expense_cost]").eq(i).val())){
|
|
expense_cost_sum=0;
|
|
}else{
|
|
expense_cost_sum = $("input[name=expense_cost]").eq(i).val();
|
|
}
|
|
|
|
expense_cost = expense_cost + parseFloat(expense_cost_sum)*100;
|
|
}
|
|
|
|
|
|
var add_expense_cost_length = $("input[name=add_expense_cost]").length;
|
|
var add_expense_cost = 0;
|
|
var add_expense_cost_sum = 0;
|
|
|
|
|
|
for(var i=0; i<add_expense_cost_length; i++){
|
|
|
|
|
|
if(isNaN($("input[name=add_expense_cost]").eq(i).val())){
|
|
add_expense_cost_sum=0;
|
|
}else{
|
|
add_expense_cost_sum = $("input[name=add_expense_cost]").eq(i).val();
|
|
}
|
|
|
|
add_expense_cost = add_expense_cost + parseFloat(add_expense_cost_sum)*100;
|
|
}
|
|
|
|
if(isNaN(expense_cost + add_expense_cost)){
|
|
$("#expense_cost_sum").val('0');
|
|
|
|
}else{
|
|
$("#expense_cost_sum").val((expense_cost+add_expense_cost)/100);
|
|
}
|
|
|
|
|
|
|
|
|
|
sum_sum()
|
|
}
|
|
|
|
function expense_costkeyup(num){
|
|
var expense_total_cooling_time = parseFloat($("#add_expense_total_cooling_time"+num).val());
|
|
var expense = parseFloat($("#add_expense"+num).val());
|
|
|
|
var expense_cost = Math.floor(((expense_total_cooling_time*expense)/3600*(1.6))*100)/100
|
|
|
|
if(isNaN(expense_cost)){
|
|
expense_cost=0
|
|
}
|
|
$("#add_expense_cost"+num).val(expense_cost);
|
|
|
|
expense_cost_sum();
|
|
}
|
|
|
|
|
|
function fn_delete_expensetable(num){
|
|
$("#row"+num).remove();
|
|
expense_cost_sum();
|
|
}
|
|
|
|
|
|
function fn_delete_materialtable(num){
|
|
$("#row_m"+num).remove();
|
|
material_pricesum();
|
|
}
|
|
|
|
function sum_sum(){
|
|
|
|
var material_cost = parseFloat($("#material_cost").val());
|
|
var labor_cost_sum = parseFloat($("#labor_cost_sum").val());
|
|
var expense_cost_sum = parseFloat($("#expense_cost_sum").val());
|
|
|
|
var pro_cost = ((labor_cost_sum*100)+(expense_cost_sum*100))/100;
|
|
|
|
$("#pro_cost").val(pro_cost);
|
|
|
|
var manufacturing_cost =((material_cost*100)+(pro_cost*100))/100;
|
|
if(isNaN(manufacturing_cost)){
|
|
manufacturing_cost=0;
|
|
}
|
|
$("#manufacturing_cost").val(manufacturing_cost);
|
|
|
|
var normal_cost_per = $("#normal_cost_per").val();
|
|
var pro_cost = $("#pro_cost").val();
|
|
var normal_cost = Math.floor(pro_cost * (normal_cost_per/100)*100)/100;
|
|
if(isNaN(normal_cost)){
|
|
normal_cost=0
|
|
}
|
|
$("#normal_cost").val(normal_cost);
|
|
|
|
var profit_per = $("#profit_per").val();
|
|
var pro_cost = $("#pro_cost").val();
|
|
var normal_cost = $("#normal_cost").val()
|
|
var profit = Math.floor((((pro_cost*100) + (normal_cost*100))/100)*(profit_per/100)*100)/100;
|
|
if(isNaN(profit)){
|
|
profit=0
|
|
}
|
|
$("#profit").val(profit);
|
|
|
|
var management_fee_per = $("#management_fee_per").val();
|
|
var material_cost_part = parseFloat($("#material_cost_part").val());
|
|
var management_fee = Math.floor(material_cost_part*(management_fee_per/100)*100)/100;
|
|
if(isNaN(management_fee)){
|
|
management_fee=0
|
|
}
|
|
$("#management_fee").val(management_fee);
|
|
|
|
var out_cost_per = $("#out_cost_per").val();
|
|
var material_cost_sub = parseFloat($("#material_cost_sub").val());
|
|
var out_cost = Math.floor(material_cost_sub*(out_cost_per/100)*100)/100;
|
|
if(isNaN(out_cost)){
|
|
out_cost=0
|
|
}
|
|
$("#out_cost").val(out_cost);
|
|
|
|
var rd_cost_per = $("#rd_cost_per").val();
|
|
var rd_cost = Math.floor((pro_cost*100 + manufacturing_cost*100 + normal_cost*100 + profit*100 + management_fee*100 + out_cost*100)*(rd_cost_per/100))/100;
|
|
$("#rd_cost").val(rd_cost);
|
|
|
|
|
|
var transport_cost = Math.floor(normal_cost*0.25*100)/100;
|
|
$("#transport_cost").val(transport_cost);
|
|
var transport_cost_custom = $("#transport_cost_custom").val()
|
|
var transport_cost_result =0;
|
|
if(transport_cost < transport_cost_custom){
|
|
|
|
transport_cost_result = Math.floor((transport_cost_custom*100 - transport_cost*100))/100;
|
|
}else{
|
|
transport_cost_result = 0;
|
|
}
|
|
$("#transport_cost_result").val(transport_cost_result);
|
|
|
|
var palette_cost = Math.floor((pro_cost*100 + manufacturing_cost*100 + normal_cost*100 + profit*100 + management_fee*100)*(0.01))/100;
|
|
$("#palette_cost").val(palette_cost);
|
|
var palette_cost_custom = $("#palette_cost_custom").val()
|
|
var palette_cost_result =0;
|
|
if(palette_cost < palette_cost_custom){
|
|
|
|
palette_cost_result = Math.floor((palette_cost_custom*100 - palette_cost*100))/100;
|
|
}else{
|
|
palette_cost_result = 0;
|
|
}
|
|
$("#palette_cost_result").val(palette_cost_result);
|
|
|
|
|
|
var mold_cost = $("#mold_cost").val()
|
|
if(mold_cost == ""){
|
|
mold_cost = 0;
|
|
}
|
|
|
|
var total_cost = Math.floor((manufacturing_cost*100 + normal_cost*100 + profit*100 + management_fee*100+out_cost*100+mold_cost*100+rd_cost*100 +transport_cost_result*100 +palette_cost_result*100))/100;
|
|
$("#total_cost").val(total_cost);
|
|
|
|
|
|
var add_cost = $("#add_cost").val()
|
|
if(add_cost == ""){
|
|
add_cost = 0;
|
|
}
|
|
var final_cost = (total_cost*100 + add_cost*100)/100;
|
|
$("#final_cost").val(final_cost);
|
|
|
|
}
|
|
|
|
|
|
function ASSYlabor_cost(num){
|
|
var inj_cav = parseFloat($("#inj_cav"+num).val());
|
|
var total_cooling_time = parseFloat($("#total_cooling_time"+num).val());
|
|
var inj_setup_time = parseFloat($("#inj_setup_time"+num).val());
|
|
var inj_labor_wage_rate = parseFloat($("#inj_labor_wage_rate"+num).val());
|
|
var labor_cost = Math.floor(((inj_setup_time*inj_labor_wage_rate)/3600*total_cooling_time)*100)/100
|
|
|
|
if(isNaN(labor_cost)){
|
|
labor_cost=0
|
|
}
|
|
$("#labor_cost"+num).val(labor_cost);
|
|
|
|
labor_costsum();
|
|
}
|
|
|
|
function sub_material_price_keyup(num){
|
|
var sub_us = parseFloat($("#sub_us"+num).val());
|
|
var sub_weight = parseFloat($("#sub_weight"+num).val());
|
|
var sub_part_price = parseFloat($("#sub_part_price"+num).val());
|
|
var sub_material_price = Math.floor(sub_us*sub_weight*sub_part_price*100)/100
|
|
|
|
if(isNaN(sub_material_price)){
|
|
sub_material_price=0
|
|
}
|
|
$("#sub_material_price"+num).val(sub_material_price);
|
|
|
|
material_pricesum();
|
|
}
|
|
|
|
function material_price_1keyup(num){
|
|
var US_1 = parseFloat($("#US_1"+num).val());
|
|
|
|
var part_price = parseFloat($("#part_price"+num).val());
|
|
material_price_1 = Math.floor(US_1*part_price*100)/100
|
|
|
|
if(isNaN(material_price_1)){
|
|
material_price_1=0
|
|
}
|
|
$("#material_price_1"+num).val(material_price_1);
|
|
material_pricesum();
|
|
}
|
|
|
|
function material_price_2keyup(num){
|
|
var US_2 = parseFloat($("#US_2"+num).val());
|
|
|
|
var sr_price = parseFloat($("#sr_price"+num).val());
|
|
|
|
var material_price_2 = Math.floor(US_2*sr_price*100)/100
|
|
|
|
if(isNaN(material_price_2)){
|
|
material_price_2=0
|
|
}
|
|
$("#material_price_2"+num).val(material_price_2);
|
|
material_pricesum();
|
|
}
|
|
|
|
function material_pricesum(){
|
|
var material_price_1_length = $("input[name=material_price_1]").length;
|
|
|
|
|
|
var material_price_1 = 0;
|
|
var PARTmaterial_price_1 = 0;
|
|
|
|
|
|
var material_price_2 = 0;
|
|
var material_price_1_sum = 0;
|
|
var PARTmaterial_price_1_sum = 0;
|
|
|
|
|
|
var material_price_2_sum = 0;
|
|
for(var i=0; i<material_price_1_length; i++){
|
|
|
|
|
|
if(isNaN($("input[name=material_price_1]").eq(i).val())){
|
|
material_price_1_sum=0
|
|
}else{
|
|
material_price_1_sum = $("input[name=material_price_1]").eq(i).val();
|
|
}
|
|
|
|
if(isNaN($("#PARTmaterial_price_1"+(i+1)).val())){
|
|
PARTmaterial_price_1_sum=0
|
|
}else{
|
|
PARTmaterial_price_1_sum = $("#PARTmaterial_price_1"+(i+1)).val();
|
|
}
|
|
|
|
|
|
if(isNaN($("input[name=material_price_2]").eq(i).val())){
|
|
material_price_2_sum=0
|
|
}else{
|
|
material_price_2_sum = $("input[name=material_price_2]").eq(i).val();
|
|
}
|
|
|
|
material_price_1 = material_price_1 + parseFloat(material_price_1_sum)*100;
|
|
PARTmaterial_price_1 = PARTmaterial_price_1 + parseFloat(PARTmaterial_price_1_sum)*100;
|
|
|
|
|
|
material_price_2 = material_price_2 + parseFloat(material_price_2_sum)*100;
|
|
}
|
|
|
|
|
|
var sub_material_price_length = $("input[name=sub_material_price]").length;
|
|
var sub_material_price = 0;
|
|
var sub_material_price_sum = 0;
|
|
|
|
for(var i=0; i<sub_material_price_length; i++){
|
|
|
|
if(isNaN($("input[name=sub_material_price]").eq(i).val())){
|
|
sub_material_price_sum=0
|
|
}else{
|
|
sub_material_price_sum = $("input[name=sub_material_price]").eq(i).val();
|
|
}
|
|
|
|
sub_material_price = sub_material_price + parseFloat(sub_material_price_sum)*100;
|
|
}
|
|
|
|
|
|
if(isNaN(material_price_1) || isNaN(material_price_2) || isNaN(PARTmaterial_price_1) || isNaN(sub_material_price)){
|
|
$("#material_cost").val('0');
|
|
$("#material_cost_part").val('0');
|
|
$("#material_cost_sub").val('0');
|
|
|
|
}else{
|
|
$("#material_cost").val((material_price_1+material_price_2 + sub_material_price)/100);
|
|
$("#material_cost_part").val((material_price_1 + material_price_2)/100);
|
|
$("#material_cost_sub").val(sub_material_price/100);
|
|
}
|
|
|
|
sum_sum()
|
|
}
|
|
|
|
function labor_costsum(){
|
|
|
|
var injection_labor_length = $("input[name=injection_labor]").length;
|
|
|
|
var partlabor_cost = 0;
|
|
var partlabor_cost_sum = 0;
|
|
|
|
for(var i=0; i<injection_labor_length; i++){
|
|
|
|
|
|
if(isNaN($("input[name=injection_labor]").eq(i).val())){
|
|
partlabor_cost_sum=0
|
|
}else{
|
|
partlabor_cost_sum = $("input[name=injection_labor]").eq(i).val();
|
|
}
|
|
|
|
partlabor_cost = partlabor_cost + parseFloat(partlabor_cost_sum)*100;
|
|
}
|
|
|
|
/* Swal.fire("partlabor_cost :: " + partlabor_cost); */
|
|
|
|
|
|
|
|
var assy_labor_price_length = $("input[name=assy_labor_price]").length;
|
|
|
|
var assylabor_cost = 0;
|
|
var assylabor_cost_sum = 0;
|
|
|
|
for(var i=0; i<injection_labor_length; i++){
|
|
|
|
|
|
if(isNaN($("input[name=assy_labor_price]").eq(i).val())){
|
|
assylabor_cost_sum=0
|
|
}else{
|
|
assylabor_cost_sum = $("input[name=assy_labor_price]").eq(i).val();
|
|
}
|
|
|
|
assylabor_cost = assylabor_cost + parseFloat(assylabor_cost_sum)*100;
|
|
}
|
|
|
|
/* Swal.fire("assylabor_cost :: " + assylabor_cost); */
|
|
|
|
var labor_cost = partlabor_cost + assylabor_cost;
|
|
|
|
|
|
|
|
if(isNaN(labor_cost)){
|
|
$("#labor_cost_sum").val('0');
|
|
|
|
}else{
|
|
$("#labor_cost_sum").val(labor_cost/100);
|
|
}
|
|
|
|
sum_sum()
|
|
}
|
|
|
|
//수주활동 등록정보 수정
|
|
function fn_save(){
|
|
|
|
var us_1 = $("input[name=us_1]").length
|
|
for(var i=0; i<us_1; i++){
|
|
var cheak = $("input[name=us_1]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("사양기재 U/S 을/를 입력해주세요");
|
|
$("input[name=us_1]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var us_2 = $("input[name=us_2]").length
|
|
for(var i=0; i<us_2; i++){
|
|
var cheak = $("input[name=us_2]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("분쇄비 U/S 을/를 입력해주세요");
|
|
$("input[name=us_2]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var sub_part_name = $("input[name=sub_part_name]").length
|
|
for(var i=0; i<sub_part_name; i++){
|
|
var cheak = $("input[name=sub_part_name]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("sub part name 을/를 입력해주세요");
|
|
$("input[name=sub_part_name]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var sub_us = $("input[name=sub_us]").length
|
|
for(var i=0; i<sub_us; i++){
|
|
var cheak = $("input[name=sub_us]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("sub part U/S 을/를 입력해주세요");
|
|
$("input[name=sub_us]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var sub_weight = $("input[name=sub_weight]").length
|
|
for(var i=0; i<sub_weight; i++){
|
|
var cheak = $("input[name=sub_weight]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("sub part 소요량 을/를 입력해주세요");
|
|
$("input[name=sub_weight]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var sub_part_price = $("input[name=sub_part_price]").length
|
|
for(var i=0; i<sub_part_price; i++){
|
|
var cheak = $("input[name=sub_part_price]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("sub part 단가 을/를 입력해주세요");
|
|
$("input[name=sub_part_price]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_part_name = $("input[name=add_part_name]").length
|
|
for(var i=0; i<add_part_name; i++){
|
|
var cheak = $("input[name=add_part_name]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("경비 part name 을/를 입력해주세요");
|
|
$("input[name=add_part_name]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_inj_cav = $("input[name=add_inj_cav]").length
|
|
for(var i=0; i<add_inj_cav; i++){
|
|
var cheak = $("input[name=add_inj_cav]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("경비 C/V 을/를 입력해주세요. 또는 0을 입력해주세요");
|
|
$("input[name=add_inj_cav]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_machine_type = $("input[name=add_machine_type]").length
|
|
for(var i=0; i<add_machine_type; i++){
|
|
var cheak = $("input[name=add_machine_type]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("기종 을/를 입력해주세요");
|
|
$("input[name=add_machine_type]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_inj_ton = $("input[name=add_inj_ton]").length
|
|
for(var i=0; i<add_inj_ton; i++){
|
|
var cheak = $("input[name=add_inj_ton]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("INJ Ton 을/를 입력해주세요. 또는 0을 입력해주세요");
|
|
$("input[name=add_inj_ton]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_expense_total_cooling_time = $("input[name=add_expense_total_cooling_time]").length
|
|
for(var i=0; i<add_expense_total_cooling_time; i++){
|
|
var cheak = $("input[name=add_expense_total_cooling_time]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("경비 C/T 을/를 입력해주세요");
|
|
$("input[name=add_expense_total_cooling_time]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var add_expense = $("input[name=add_expense]").length
|
|
for(var i=0; i<add_expense; i++){
|
|
var cheak = $("input[name=add_expense]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("경비 을/를 입력해주세요");
|
|
$("input[name=add_expense]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var normal_cost_per = $("input[name=normal_cost_per]").length
|
|
for(var i=0; i<normal_cost_per; i++){
|
|
var cheak = $("input[name=normal_cost_per]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("일반관리비 을/를 입력해주세요");
|
|
$("input[name=normal_cost_per]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var profit_per = $("input[name=profit_per]").length
|
|
for(var i=0; i<profit_per; i++){
|
|
var cheak = $("input[name=profit_per]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("이윤 을/를 입력해주세요");
|
|
$("input[name=profit_per]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var management_fee_per = $("input[name=management_fee_per]").length
|
|
for(var i=0; i<management_fee_per; i++){
|
|
var cheak = $("input[name=management_fee_per]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("재료관리비 을/를 입력해주세요");
|
|
$("input[name=management_fee_per]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var out_cost_per = $("input[name=out_cost_per]").length
|
|
for(var i=0; i<out_cost_per; i++){
|
|
var cheak = $("input[name=out_cost_per]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("외주재료관리비 을/를 입력해주세요");
|
|
$("input[name=out_cost_per]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var mold_cost = $("input[name=mold_cost]").length
|
|
for(var i=0; i<mold_cost; i++){
|
|
var cheak = $("input[name=mold_cost]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("금형비 을/를 입력해주세요");
|
|
$("input[name=mold_cost]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var rd_cost_per = $("input[name=rd_cost_per]").length
|
|
for(var i=0; i<rd_cost_per; i++){
|
|
var cheak = $("input[name=rd_cost_per]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("R&D비용 을/를 입력해주세요");
|
|
$("input[name=rd_cost_per]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var transport_cost_custom = $("input[name=transport_cost_custom]").length
|
|
for(var i=0; i<transport_cost_custom; i++){
|
|
var cheak = $("input[name=transport_cost_custom]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("운반비 을/를 입력해주세요");
|
|
$("input[name=transport_cost_custom]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
var palette_cost_custom = $("input[name=palette_cost_custom]").length
|
|
for(var i=0; i<palette_cost_custom; i++){
|
|
var cheak = $("input[name=palette_cost_custom]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("파렛트비 을/를 입력해주세요");
|
|
$("input[name=palette_cost_custom]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
add_cost
|
|
var add_cost = $("input[name=add_cost]").length
|
|
for(var i=0; i<add_cost; i++){
|
|
var cheak = $("input[name=add_cost]").eq(i).val()
|
|
if(cheak == ""){
|
|
Swal.fire("조정가 을/를 입력해주세요");
|
|
$("input[name=add_cost]").eq(i).focus();
|
|
return false;
|
|
}
|
|
}
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
saveProcess();
|
|
}
|
|
|
|
}
|
|
|
|
function saveProcess(){
|
|
|
|
$.ajax({
|
|
url:"/project/updateProfit_loss.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
/* Swal.fire(data.RESULT.result); */
|
|
if(data.RESULT.result){
|
|
/* Swal.fire("data.RESULT.result :: " +data.RESULT.result); */
|
|
|
|
saveProcess2();
|
|
/* saveprofitlossTotal(); */
|
|
}else{
|
|
Swal.fire("저장에 실패했습니다.")
|
|
document.location.reload();
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
function saveProcess2(){
|
|
|
|
|
|
var sub_material_price_length = $("input[name=sub_material_price]").length;
|
|
//배열 생성
|
|
var sub_part_namearr = new Array();
|
|
var sub_usarr = new Array();
|
|
var sub_weightarr = new Array();
|
|
var sub_part_pricearr = new Array();
|
|
var sub_material_pricearr = new Array();
|
|
|
|
|
|
//배열에 값 주입
|
|
|
|
for(var i=0; i<sub_material_price_length; i++){
|
|
if($("input[name=sub_material_price]").eq(i).val()!=""){
|
|
sub_part_namearr.push($("input[name=sub_part_name]").eq(i).val());
|
|
sub_usarr.push($("input[name=sub_us]").eq(i).val());
|
|
sub_weightarr.push($("input[name=sub_weight]").eq(i).val());
|
|
sub_part_pricearr.push($("input[name=sub_part_price]").eq(i).val());
|
|
sub_material_pricearr.push($("input[name=sub_material_price]").eq(i).val());
|
|
}
|
|
}
|
|
|
|
$("#sub_part_namearr").val(sub_part_namearr);
|
|
$("#sub_usarr").val(sub_usarr);
|
|
$("#sub_weightarr").val(sub_weightarr);
|
|
$("#sub_part_pricearr").val(sub_part_pricearr);
|
|
$("#sub_material_pricearr").val(sub_material_pricearr);
|
|
|
|
|
|
|
|
var sub_material_price_length = $("input[name=sub_material_price]").length
|
|
if(sub_material_price_length == '0'){
|
|
$.ajax({
|
|
url:"/project/delete_add_list2.do",
|
|
type:"POST",
|
|
data:$("#form2").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.RESULT.result){
|
|
saveProcess3();
|
|
}else{
|
|
Swal.fire("저장에 실패했습니다.")
|
|
document.location.reload();
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$.ajax({
|
|
url:"/project/saveProfit_loss_add_list2.do",
|
|
type:"POST",
|
|
data:$("#form2").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.RESULT.result){
|
|
saveProcess3();
|
|
}else{
|
|
Swal.fire("저장에 실패했습니다.")
|
|
document.location.reload();
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
}
|
|
function saveProcess3(){
|
|
var add_expense_cost_length = $("input[name=add_expense_cost]").length
|
|
if(add_expense_cost_length == '0'){
|
|
$.ajax({
|
|
url:"/project/delete_add_list.do",
|
|
type:"POST",
|
|
data:$("#form3").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.RESULT.result){
|
|
saveprofitlossTotal();
|
|
}else{
|
|
Swal.fire("저장에 실패했습니다.")
|
|
document.location.reload();
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$.ajax({
|
|
url:"/project/saveProfit_loss_add_list.do",
|
|
type:"POST",
|
|
data:$("#form3").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.RESULT.result){
|
|
saveprofitlossTotal();
|
|
}else{
|
|
Swal.fire("저장에 실패했습니다.")
|
|
document.location.reload();
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function saveprofitlossTotal(){
|
|
|
|
var param = {"objId": $("#RELobjId").val(),
|
|
"target_objid":$("#RELtarget_objid").val(),
|
|
"material_cost":$("#material_cost").val(),
|
|
"labor_cost_sum":$("#labor_cost_sum").val(),
|
|
"expense_cost_sum":$("#expense_cost_sum").val(),
|
|
"pro_cost":$("#pro_cost").val(),
|
|
"manufacturing_cost":$("#manufacturing_cost").val(),
|
|
"normal_cost_per":$("#normal_cost_per").val(),
|
|
"normal_cost":$("#normal_cost").val(),
|
|
"profit_per":$("#profit_per").val(),
|
|
"profit":$("#profit").val(),
|
|
"management_fee_per":$("#management_fee_per").val(),
|
|
"management_fee":$("#management_fee").val(),
|
|
"out_cost_per":$("#out_cost_per").val(),
|
|
"out_cost":$("#out_cost").val(),
|
|
"mold_cost":$("#mold_cost").val(),
|
|
"rd_cost_per":$("#rd_cost_per").val(),
|
|
"rd_cost":$("#rd_cost").val(),
|
|
"transport_cost":$("#transport_cost").val(),
|
|
"transport_cost_custom":$("#transport_cost_custom").val(),
|
|
"transport_cost_result":$("#transport_cost_result").val(),
|
|
"palette_cost":$("#palette_cost").val(),
|
|
"palette_cost_custom":$("#palette_cost_custom").val(),
|
|
"palette_cost_result":$("#palette_cost_result").val(),
|
|
"total_cost":$("#total_cost").val(),
|
|
"add_cost":$("#add_cost").val(),
|
|
"final_cost":$("#final_cost").val()}
|
|
$.ajax({
|
|
url:"/project/saveprofitlossTotal.do",
|
|
type:"POST",
|
|
data:param,
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.RESULT.msg);
|
|
opener.location.reload();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<body>
|
|
<form name="form2" id="form2" action="" method="post">
|
|
<input type="hidden" name="target_objid2" id="target_objid2"
|
|
value="${param.objId}"> <input type="hidden"
|
|
name="sub_part_namearr" id="sub_part_namearr" required
|
|
reqTitle="sub_part_namearr"> <input type="hidden"
|
|
name="sub_usarr" id="sub_usarr" required reqTitle="sub_part_namearr">
|
|
<input type="hidden" name="sub_weightarr" id="sub_weightarr" required
|
|
reqTitle="sub_part_namearr"> <input type="hidden"
|
|
name="sub_part_pricearr" id="sub_part_pricearr" required
|
|
reqTitle="sub_part_namearr"> <input type="hidden"
|
|
name="sub_material_pricearr" id="sub_material_pricearr" required
|
|
reqTitle="sub_part_namearr">
|
|
|
|
</form>
|
|
|
|
<input type="hidden" name="objId" id="RELobjId" value="${info.OBJID}">
|
|
<input type="hidden" name="target_objid" id="RELtarget_objid" value="${param.objId}">
|
|
<section class="business_popup_min_width" style="overflow-y:hidden; height:100%;">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>손익산출 등록</span>
|
|
</h2>
|
|
</div>
|
|
<div class="plm_table_wrap" id="profitloss-total-popup">
|
|
<div class='container'>
|
|
<div class='title-wrapper'>
|
|
<div class='vertical-divider'></div>
|
|
<div class='title'>比較原價計算書</div>
|
|
</div>
|
|
<div class='category-card-container'>
|
|
<div class='row'>
|
|
<span class='label'>품번</span>
|
|
<span class='value'>A245B - 32984</span>
|
|
</div>
|
|
<div class='row'>
|
|
<span class='label'>차종</span>
|
|
<span class='value'>${info.CAR_CODE}(${info.CAR_NAME})</span>
|
|
</div>
|
|
<div class='row'>
|
|
<span class='label'>품명</span>
|
|
<span class='value'>품명 출력 ${info.CODE_NAME}</span>
|
|
</div>
|
|
<div class='row'>
|
|
<span class='label'>업체/CODE</span>
|
|
<span class='value'>업체명 (#CODE) ${info.OEM_NAME}(${info.OEM_CODE})</span>
|
|
</div>
|
|
<div class='row'>
|
|
<span class='label'>E.O No</span>
|
|
<span class='value'>A245B - 32984</span>
|
|
</div>
|
|
<div class='row'>
|
|
<span class='label'>작성일자</span>
|
|
<span class='value'>${info.REGDATE}2021-07-27</span>
|
|
</div>
|
|
</div>
|
|
<div class='profitloss-total-table'>
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="3%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="22%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2">구분</td>
|
|
<td colspan="4">업체</td>
|
|
<td>비고</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>①</td>
|
|
<td>재료비 </td>
|
|
<td colspan="4" style="padding: 0">
|
|
<!-- 테이블 -->
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2"> - </td>
|
|
<td>U/S</td>
|
|
<td>단위</td>
|
|
<td>소요량</td>
|
|
<td>단가</td>
|
|
<td>금액</td>
|
|
<td>action</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="scroll-view">
|
|
<table class="inner-table materialtable">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="8%" />
|
|
</colgroup>
|
|
<tbody id="dataList" >
|
|
<c:choose>
|
|
<c:when test="${!empty List}">
|
|
<c:forEach var="info" items="${List}" varStatus="status">
|
|
<c:if test="${info.TYPE eq 'part'}">
|
|
<input type="hidden" name="profit_loss_objId" id="objId"
|
|
value="${info.OBJID}">
|
|
<tr class="inner-table-row">
|
|
<td>
|
|
<input type="text"
|
|
id="part_name${status.count}" name="part_name"
|
|
value="${info.PART_NAME}" readonly>
|
|
</td>
|
|
<td>사양기재</td>
|
|
<td>
|
|
<input type="text" id="US_1${status.count}"
|
|
name="us_1" value="${info.US_1}" class='input'
|
|
onkeyup="javascript:material_price_1keyup(${status.count});">
|
|
</td>
|
|
<td>Kg</td>
|
|
<td>
|
|
<input type="text"
|
|
id="part_weight${status.count}" name="part_weight"
|
|
value="${info.PART_WEIGHT}" class='auto-calculated'
|
|
readonly>
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
id="resin_price${status.count}"
|
|
name="resin_price"
|
|
value="${info.RESIN_PRICE}" class='auto-calculated'
|
|
readonly>
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
id="material_price_1${status.count}"
|
|
name="material_price_1"
|
|
value="${info.MATERIAL_PRICE_1}"
|
|
class='auto-calculated' readonly>
|
|
</td>
|
|
<td></td>
|
|
</tr>
|
|
<tr class="inner-table-row">
|
|
<td></td>
|
|
<td>분쇄비</td>
|
|
<td>
|
|
<input type="text" id="US_2${status.count}"
|
|
name="us_2" value="${info.US_2}" class='input'
|
|
onkeyup="javascript:material_price_2keyup(${status.count});">
|
|
</td>
|
|
<td>Kg</td>
|
|
<td>
|
|
<input type="text"
|
|
id="sr_weight${status.count}" name="sr_weight"
|
|
value="${info.SR_WEIGHT}" class='auto-calculated'
|
|
readonly>
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
id="custom_price${status.count}"
|
|
name="custom_price"
|
|
value="${info.CUSTOM_PRICE}" class='auto-calculated'
|
|
readonly>
|
|
</td>
|
|
<td>
|
|
<input type="text"
|
|
id="material_price_2${status.count}"
|
|
name="material_price_2"
|
|
value="${info.MATERIAL_PRICE_2}"
|
|
class='auto-calculated' readonly>
|
|
</td>
|
|
<td><input type="hidden"
|
|
id="sr_price${status.count}"
|
|
value="${info.SR_PRICE}"></td>
|
|
</tr>
|
|
</c:if>
|
|
|
|
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="8" align="cencter" style="border:none">등록된 재료비가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
|
|
<c:choose>
|
|
<c:when test="${!empty addList2}">
|
|
<c:forEach var="info" items="${addList2}"
|
|
varStatus="status">
|
|
<tr id="row_m${status.count}" class="inner-table-row">
|
|
<td><input type="text"
|
|
id="sub_part_name${status.count}"
|
|
name="sub_part_name" required
|
|
reqTitle="sub_part_name"
|
|
value="${info.SUB_PART_NAME}"
|
|
class='input'></td>
|
|
<td></td>
|
|
<td><input type="text" id="sub_us${status.count}"
|
|
name="sub_us" required reqTitle="sub_us"
|
|
value="${info.SUB_US}"
|
|
class='input'
|
|
onkeyup="javascript:sub_material_price_keyup(${status.count});"></td>
|
|
<td>EA</td>
|
|
<td><input type="text"
|
|
id="sub_weight${status.count}" name="sub_weight"
|
|
required reqTitle="소요량" value="${info.SUB_WEIGHT}"
|
|
class='input'
|
|
onkeyup="javascript:sub_material_price_keyup(${status.count});"></td>
|
|
<td><input type="text"
|
|
id="sub_part_price${status.count}"
|
|
name="sub_part_price" value="${info.SUB_PART_PRICE}"
|
|
required reqTitle="단가"
|
|
class='input'
|
|
onkeyup="javascript:sub_material_price_keyup(${status.count});"></td>
|
|
<td><input type="text"
|
|
id="sub_material_price${status.count}"
|
|
name="sub_material_price"
|
|
value="${info.SUB_MATERIAL_PRICE}"
|
|
class='auto-calculated' readonly></td>
|
|
<td><input type="button" class="blue_btn"
|
|
value="삭제"
|
|
onclick="fn_delete_materialtable(${status.count});"
|
|
style="float: none;"></td>
|
|
</tr>
|
|
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<tfoot>
|
|
<tr class="total-row">
|
|
<td colspan="6">소계</td>
|
|
<td>
|
|
<input type="text" id="material_cost" name="material_cost" value="" class='auto-calculated' readonly>
|
|
</td>
|
|
<td>
|
|
<input type="button" value="추가" class="plm_btns" id="btnAddM">
|
|
</td>
|
|
<input type="hidden" id="material_cost_part" name="material_cost_part" value="" class='auto-calculated' readonly>
|
|
<input type="hidden" id="material_cost_sub" name="material_cost_sub" value="" class='auto-calculated' readonly>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</form>
|
|
</td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>②</td>
|
|
<td>노무비</td>
|
|
<td colspan="4" style="padding: 0">
|
|
<!-- 테이블 -->
|
|
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td colspan="2"> - </td>
|
|
<td>C/V</td>
|
|
<td>C/T</td>
|
|
<td>준비시간</td>
|
|
<td>임율</td>
|
|
<td>금액</td>
|
|
<td>action</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="scroll-view">
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="8%" />
|
|
</colgroup>
|
|
<tbody id="dataList">
|
|
<c:choose>
|
|
<c:when test="${!empty List}">
|
|
<c:forEach var="info" items="${List}" varStatus="status">
|
|
<c:if test="${info.TYPE eq 'part'}">
|
|
<input type="hidden" name="profit_loss_objId" id="objId" value="${info.OBJID}">
|
|
<tr class="inner-table-row">
|
|
<td><input type="text" id="part_name${status.count}" name="part_name" value="${info.PART_NAME}" readonly></td>
|
|
<td></td>
|
|
<td><input type="text"
|
|
id="inj_cav${status.count}"
|
|
name="inj_cav"
|
|
value="${info.INJ_CAV}" readonly></td>
|
|
<td><input type="text"
|
|
id="total_cooling_time${status.count}"
|
|
name="total_cooling_time" value="${info.TOTAL_COOLING_TIME}" readonly></td>
|
|
<td><input type="text"
|
|
id="inj_setup_time${status.count}"
|
|
name="inj_setup_time" value="${info.INJ_SETUP_TIME}" readonly></td>
|
|
<td><input type="text"
|
|
id="inj_labor_wage_rate${status.count}"
|
|
name="inj_labor_wage_rate" value="${info.INJ_LABOR_WAGE_RATE}" readonly></td>
|
|
<td><input type="text"
|
|
id="injection_labor${status.count}"
|
|
name="injection_labor" value="${info.INJECTION_LABOR}"
|
|
class='auto-calculated' readonly></td>
|
|
<td></td>
|
|
</tr>
|
|
</c:if>
|
|
<c:if test="${info.TYPE eq 'assy'}">
|
|
<input type="hidden" name="profit_loss_objId" id="objId" value="${info.OBJID}">
|
|
<tr class='inner-table-row'>
|
|
<td><input type="text" id="part_name${status.count}" name="part_name" value="${info.PART_NAME}" readonly></td>
|
|
<td></td>
|
|
<td><input type="text" id="assy_cav${status.count}" name="assy_cav" value="${info.ASSY_CAV}" readonly></td>
|
|
<td><input type="text" id="assy_labor_ct${status.count}" name="assy_labor_ct" value="${info.ASSY_LABOR_CT}" readonly></td>
|
|
<td><input type="text" id="setup_time${status.count}" name="setup_time" value="${info.SETUP_TIME}" readonly></td>
|
|
<td><input type="text" id="labor_wage_rate${status.count}" name="labor_wage_rate" value="${info.LABOR_WAGE_RATE}" readonly></td>
|
|
<td><input type="text" id="assy_labor_price${status.count}" name="assy_labor_price" value="${info.ASSY_LABOR_PRICE}" class='auto-calculated' readonly></td>
|
|
<td></td>
|
|
</tr>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="8" align="cencter" style="border:none">등록된 재료비가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<tfoot>
|
|
<tr class="total-row">
|
|
<td colspan="6">소계</td>
|
|
<td colspan="2"><input type="text" id="labor_cost_sum" name="labor_cost_sum" value="" class='auto-calculated' readonly></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
|
|
</td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>③</td>
|
|
<td>
|
|
<div style="display:flex;flex-direction:column; justify-content:center; align-items:center">
|
|
<p>경비</p>
|
|
<!-- <input type="button" value="추가" class="plm_btns" id="btnAdd" style="margin-top:16px"> -->
|
|
</div>
|
|
</td>
|
|
<td colspan="4" style="padding:0">
|
|
<!-- 테이블 -->
|
|
<form name="form3" id="form3" action="" method="post">
|
|
<input type="hidden" name="target_objid" id="target_objid" value="${param.objId}">
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td colspan="1"> - </td>
|
|
<td>C/V</td>
|
|
<td>기종(모델)</td>
|
|
<td colspan="1">INJ_TON</td>
|
|
<td>C/T</td>
|
|
<td>경비</td>
|
|
<td>금액</td>
|
|
<td>action</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
<div class="scroll-view">
|
|
<table class="inner-table expensetable">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="8%" />
|
|
</colgroup>
|
|
<tbody id="dataList">
|
|
<c:choose>
|
|
<c:when test="${!empty List}">
|
|
<c:forEach var="info" items="${List}" varStatus="status">
|
|
<input type="hidden" name="profit_loss_objId" id="objId" value="${info.OBJID}">
|
|
<c:if test="${info.TYPE eq 'part'}">
|
|
<tr class="inner-table-row">
|
|
<td><input type="text" id="Epart_name${status.count}" name="Epart_name" value="${info.PART_NAME}" readonly></td>
|
|
<td><input type="text" id="Einj_cav${status.count}" name="Einj_cav" value="${info.INJ_CAV}" readonly></td>
|
|
<td>사출기</td>
|
|
<td><input type="text" id="inj_ton${status.count}" name="inj_ton" value="${info.INJ_TON}" readonly></td>
|
|
<td><input type="text" id="expense_total_cooling_time${status.count}" name="expense_total_cooling_time" value="${info.TOTAL_COOLING_TIME}" readonly></td>
|
|
<td><input type="text" id="expense${status.count}" name="expense" value="${info.EXPENSE}" readonly></td>
|
|
<td><input type="text" id="expense_cost${status.count}" name="expense_cost" value="${info.INJECTION_EXPENSE}" class='auto-calculated' readonly></td>
|
|
<td></td>
|
|
</tr>
|
|
</c:if>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="8" align="center" class="total-row">등록된 재료비가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<c:choose>
|
|
<c:when test="${!empty addList}">
|
|
<c:forEach var="info" items="${addList}" varStatus="status">
|
|
<tr id="row${status.count}" class="inner-table-row">
|
|
<td><input type="text" id="add_part_name${status.count}" name="add_part_name" required reqTitle="add_part_name" value="${info.PART_NAME}" class='input'></td>
|
|
<td><input type="text" id="add_inj_cav${status.count}" name="add_inj_cav" value="${info.INJ_CAV}" required reqTitle="add_inj_cav" class='input'></td>
|
|
<td><input type="text" id="add_machine_type${status.count}" name="add_machine_type" required reqTitle="add_machine_type" value="${info.MACHINE_TYPE}" class='input'></td>
|
|
<td><input type="text" id="add_inj_ton${status.count}" name="add_inj_ton" value="${info.INJ_TON}" required reqTitle="add_inj_ton" class='input'></td>
|
|
<td><input type="text" id="add_expense_total_cooling_time${status.count}" name="add_expense_total_cooling_time" required reqTitle="add_expense_total_cooling_time" value="${info.EXPENSE_TOTAL_COOLING_TIME}" class='input'></td>
|
|
<td><input type="text" id="add_expense${status.count}" name="add_expense" value="${info.EXPENSE}" required reqTitle="add_expense" class='input'></td>
|
|
<td><input type="text" id="add_expense_cost${status.count}" name="add_expense_cost" value="${info.EXPENSE_COST}" class='auto-calculated' readonly></td>
|
|
<td><input type="button" class="blue_btn" value="삭제" onclick="fn_delete_expensetable(${status.count});" style="float:none;"></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<table class="inner-table">
|
|
<colgroup>
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="12.5%" />
|
|
<col width="16%" />
|
|
<col width="9%" />
|
|
</colgroup>
|
|
<tfoot>
|
|
<tr class="total-row">
|
|
<td colspan="6">소계</td>
|
|
<td><input type="text" id="expense_cost_sum" name="expense_cost_sum" value="" class='auto-calculated' readonly></td>
|
|
<td><input type="button" value="추가" class="plm_btns" id="btnAdd"></td>
|
|
</tr>
|
|
</tfoot>
|
|
</table>
|
|
</form>
|
|
</td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>④</td>
|
|
<td>가공비</td>
|
|
<td colspan="3">② + ③</td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="pro_cost" name="pro_cost" value="${info.PRO_COST}" readonly>
|
|
</td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑤</td>
|
|
<td>제조원가</td>
|
|
<td colspan="3">① + ④</td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="manufacturing_cost" name="manufacturing_cost"
|
|
value="${info.MANUFACTURING_COST}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑥</td>
|
|
<td>일반관리비</td>
|
|
<td colspan="2">④ * (%값을 입력해주세요) :</td>
|
|
<td><input type="text" class='input' id="normal_cost_per"
|
|
name="normal_cost_per" value="${info.NORMAL_COST_PER}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="normal_cost" name="normal_cost" value="${info.NORMAL_COST}"
|
|
readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑦</td>
|
|
<td>이 윤</td>
|
|
<td colspan="2">(④ + ⑥) * (%값을 입력해주세요) :</td>
|
|
<td><input type="text" class='input' id="profit_per"
|
|
name="profit_per" value="${info.PROFIT_PER}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated' id="profit"
|
|
name="profit" value="${info.PROFIT}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑧</td>
|
|
<td>재료관리비</td>
|
|
<td colspan="2">① * (%값을 입력해주세요) :</td>
|
|
<td><input type="text" class='input'
|
|
id="management_fee_per" name="management_fee_per"
|
|
value="${info.MANAGEMENT_FEE_PER}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="management_fee" name="management_fee"
|
|
value="${info.MANAGEMENT_FEE}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑨</td>
|
|
<td>외주재료관리비</td>
|
|
<td colspan="2">외주재료비 * (%값을 입력해주세요) :</td>
|
|
<td><input type="text" class='input' id="out_cost_per"
|
|
name="out_cost_per" value="${info.OUT_COST_PER}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="out_cost" name="out_cost" value="${info.OUT_COST}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑩</td>
|
|
<td>금형비</td>
|
|
<td colspan="3"></td>
|
|
<td><input type="text" class='input' id="mold_cost"
|
|
name="mold_cost" value="${info.MOLD_COST}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑪</td>
|
|
<td>R&D비용</td>
|
|
<td colspan="2">(%값을 입력해주세요) :</td>
|
|
<td><input type="text" class='input' id="rd_cost_per"
|
|
name="rd_cost_per" value="${info.RD_COST_PER}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated' id="rd_cost"
|
|
name="rd_cost" value="${info.RD_COST}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑫</td>
|
|
<td>운반비</td>
|
|
<td></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="transport_cost" name="transport_cost"
|
|
value="${info.TRANSPORT_COST}" readonly></td>
|
|
<td><input type="text" class='input'
|
|
id="transport_cost_custom" name="transport_cost_custom"
|
|
value="${info.TRANSPORT_COST_CUSTOM}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="transport_cost_result" name="transport_cost_result"
|
|
value="${info.TRANSPORT_COST_RESULT}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑬</td>
|
|
<td>파렛트비(대차/단프라 박스 등)</td>
|
|
<td></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="palette_cost" name="palette_cost"
|
|
value="${info.PALETTE_COST}" readonly></td>
|
|
<td><input type="text" class='input'
|
|
id="palette_cost_custom" name="palette_cost_custom"
|
|
value="${info.PALETTE_COST_CUSTOM}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="palette_cost_result" name="palette_cost_result"
|
|
value="${info.PALETTE_COST_RESULT}" readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑭</td>
|
|
<td>견적금액</td>
|
|
<td colspan="3"></td>
|
|
<td><input type="text" class='auto-calculated'
|
|
id="total_cost" name="total_cost" value="${info.TOTAL_COST}"
|
|
readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>⑮</td>
|
|
<td>조정가(추가비용)</td>
|
|
<td colspan="3"></td>
|
|
<td><input type="text" class='input' id="add_cost"
|
|
name="add_cost" value="${info.ADD_COST}"
|
|
onkeyup="javascript:sum_sum()"></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>결정가격</td>
|
|
<td colspan="3"></td>
|
|
<td>
|
|
<input type="text"
|
|
class='auto-calculated'
|
|
id="final_cost" name="final_cost" value="${info.FINAL_COST}"
|
|
readonly></td>
|
|
<td>
|
|
<!-- 비고 -->
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="btn_wrappper">
|
|
<input type="button" value="저장" class="plm_btns" onclick="javascript:fn_save();">
|
|
<input type="button" value="닫기" class="plm_btns" onclick="javascript:self.close(0);">
|
|
</div>
|
|
|
|
</div>
|
|
</section>
|
|
</body>
|
|
</html> |