329 lines
9.0 KiB
Plaintext
329 lines
9.0 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>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
//고객사의 목록을 가져온다
|
|
fn_setOEMList();
|
|
//고객사에 해당하는 차종의 정보를 가져온다.
|
|
fn_setCarTypeList("${resultMap.OEM_OBJID}");
|
|
//제품군의 목록을 가져온다.
|
|
fn_setProductGroupList();
|
|
//제품군에 해당하는 제품을 가져온다.
|
|
fn_setProductList()
|
|
|
|
//닫기
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
//저장
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
//취소
|
|
$("#btnCancel").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var params = "?objId="+objId;
|
|
document.form1.action ="/protoDevMng/protoPlanBaseInfoDetailPopUp.do"+params;
|
|
document.form1.submit();
|
|
});
|
|
|
|
//고객사 변경 시
|
|
$("#oemObjId").change(function(){
|
|
fn_setCarTypeList(this.value)
|
|
});
|
|
|
|
//제품군 변경 시
|
|
$("#productGroupObjId").change(function(){
|
|
fn_setProductList();
|
|
});
|
|
|
|
$(".searchEmployee").click(function(){
|
|
var params = "";
|
|
params += "?title=시작업체 지정";
|
|
params += "&callback=fn_searchEmployeeCallback";
|
|
params += "&dataType=etc";
|
|
window.open("/common/searchEmployeePopup.do"+params, "", "width=480, height=400");
|
|
});
|
|
|
|
});
|
|
</script>
|
|
<script>
|
|
function fn_searchEmployeeCallback(userId, userName, deptName){
|
|
//Swal.fire("parent "+"userId : "+userId+", userName : "+userName+", deptName : "+deptName);
|
|
$("#partnerName").val(deptName+" "+userName);
|
|
$("#partnerId").val(userId);
|
|
}
|
|
|
|
//oem 목록 조회
|
|
function fn_setOEMList(){
|
|
$.ajax({
|
|
url:"/common/getOEMList.do",
|
|
type:"POST",
|
|
data:{"isJson":true},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].OEM_NAME+"("+data[i].OEM_CODE+")</option>";
|
|
});
|
|
|
|
$("#oemObjId").append(appendCode);
|
|
$("#oemObjId").trigger("change");
|
|
|
|
if("" != "${resultMap.OEM_OBJID}"){
|
|
$("#oemObjId").val("${resultMap.OEM_OBJID}");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//car 목록 조회
|
|
function fn_setCarTypeList(oemObjId){
|
|
|
|
var appendCode = "";
|
|
|
|
$("#carTypeObjId").empty();
|
|
|
|
var appendCode = "";
|
|
appendCode += "<option value=''>선택</option>";
|
|
|
|
if(null != oemObjId && "" != oemObjId){
|
|
$.ajax({
|
|
url:"/common/getCarTypeList.do",
|
|
type:"POST",
|
|
data:{"isJson":true, "search_oemObjId":oemObjId},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].CAR_CODE+"("+data[i].CAR_NAME+")</option>";
|
|
});
|
|
$("#carTypeObjId").append(appendCode);
|
|
$("#carTypeObjId").trigger("change");
|
|
|
|
if("" != "${resultMap.CAR_OBJID}"){
|
|
$("#carTypeObjId").val("${resultMap.CAR_OBJID}");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$("#carTypeObjId").append(appendCode);
|
|
}
|
|
}
|
|
|
|
//제품군 조회
|
|
function fn_setProductGroupList(){
|
|
$.ajax({
|
|
url:"/common/getProductGroupList.do",
|
|
type:"POST",
|
|
data:{"isJson":true},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_GROUP_NAME+"</option>";
|
|
});
|
|
|
|
$("#productGroupObjId").append(appendCode);
|
|
$("#productGroupObjId").trigger("change");
|
|
if("" != "${resultMap.PROD_GROUP_OBJID}"){
|
|
$("#productGroupObjId").val("${resultMap.PROD_GROUP_OBJID}");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//제품 조회
|
|
function fn_setProductList(){
|
|
var productGroupObjId = $("#productGroupObjId").val();
|
|
var appendCode = "";
|
|
|
|
$("#productObjId").empty();
|
|
appendCode += "<option value=''>선택</option>";
|
|
|
|
if(null != productGroupObjId && "" != productGroupObjId){
|
|
$.ajax({
|
|
url:"/common/getProductList.do",
|
|
type:"POST",
|
|
data:{"isJson":true, "search_productGroupObjId":productGroupObjId},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].OBJID+"'>"+data[i].PRODUCT_NAME+"</option>";
|
|
});
|
|
$("#productObjId").append(appendCode);
|
|
|
|
if("" != "${resultMap.PROD_OBJID}"){
|
|
$("#productObjId").val("${resultMap.PROD_OBJID}");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}else{
|
|
$("#productObjId").append(appendCode);
|
|
}
|
|
}
|
|
|
|
function fn_save(){
|
|
if(fnc_valitate("form1")){
|
|
if(fn_checkDuplicate()){
|
|
if(confirm("저장하시겠습니까?")){
|
|
var form = $("#form1").serialize();
|
|
$.ajax({
|
|
url:"/protoDevMng/savePlanBaseInfo.do",
|
|
type:"POST",
|
|
data:form,
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.result == "true" || data.result == true || data.result){
|
|
Swal.fire("저장되었습니다.");
|
|
opener.fn_search();
|
|
self.close();
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function fn_checkDuplicate(){
|
|
var resultFlag = true;
|
|
var form = $("#form1").serialize();
|
|
$.ajax({
|
|
url:"/protoProductDevMng/checkDuplicateStockBaseInfo.do",
|
|
type:"POST",
|
|
data:form,
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(0 < data.CNT){
|
|
Swal.fire("이미 해당 내용으로 갑지가 존재합니다.");
|
|
resultFlag = false;
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
return resultFlag;
|
|
}
|
|
</script>
|
|
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="objId" id="objId" value="${resultMap.OBJID}" />
|
|
<input type="hidden" name="status" id="status" value="${resultMap.STATUS}" />
|
|
<section style="width:500px;">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>개발일정 갑지</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<div class="form_popup_title"> 개발일정 갑지 정보입력</div>
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="13%"/>
|
|
<col width="18%"/>
|
|
<col width="18%"/>
|
|
<col width="15%"/>
|
|
<col width="20%"/>
|
|
<col width="*"/>
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">고객사</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="oemObjId" id="oemObjId" type="select" required reqTitle="고객사">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">차종</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="carTypeObjId" id="carTypeObjId" type="select" required reqTitle="차종">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">제품군</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="productGroupObjId" id="productGroupObjId" type="select" required reqTitle="제품군">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">제품</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="productObjId" id="productObjId" type="select" required reqTitle="제품">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">시작업체</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="hidden" name="partnerId" id="partnerId" value="${resultMap.PARTNER_ID}">
|
|
<input type="text" name="partnerName" id="partnerName" value="${resultMap.PARTNER_DEPT_NAME} ${resultMap.PARTNER_USER_NAME}" style="width:90%;" class="searchEmployee" readonly><span class="search_btn searchEmployee"></span>
|
|
</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td colspan="2">
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns">
|
|
<c:choose>
|
|
<c:when test="${param.actionType eq 'regist'}">
|
|
</c:when>
|
|
<c:otherwise>
|
|
<input type="button" id="btnCancel" value="취소" class="plm_btns" data-OBJID="${resultMap.OBJID}">
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |