521 lines
16 KiB
Plaintext
521 lines
16 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(){
|
|
$("#btn_close").click(function(){
|
|
self.close(0);
|
|
});
|
|
$(".searchEmployee").click(function(){
|
|
var params = "";
|
|
params += "?title=수주활동 등록";
|
|
params += "&callback=fn_searchEmployeeCallback";
|
|
window.open("/common/searchEmployeePopup.do"+params, "", "width=480, height=367");
|
|
|
|
});
|
|
$(".team_search").click(function(){
|
|
var targetObjId = $("#objId").val();
|
|
window.open("/projectConcept/searchDeptPopup.do?targetObjId="+targetObjId, "", "width=480, height=370");
|
|
});
|
|
|
|
//set productGroup
|
|
fn_setProductGroupList();
|
|
|
|
//set product
|
|
$("#productGroupObjId").change(function(){
|
|
fn_setProductList();
|
|
});
|
|
|
|
//set calendar
|
|
fnc_datepick();
|
|
|
|
//협조부서 조회
|
|
fn_refreshDeptList();
|
|
|
|
$(document).on("click", ".btnDeleteDate", function(){
|
|
$(this).prev().val("");
|
|
});
|
|
|
|
//협조부서 삭제
|
|
$(document).on("click", ".btnDeleteDept", function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
|
|
fn_deleteDept(objId);
|
|
});
|
|
|
|
//저장
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
//취소
|
|
$("#btnCancel").click(function(){
|
|
var objId = $(this).attr("data-OBJID");
|
|
var params = "?objId="+objId;
|
|
document.projectConceptProductForm.action ="/projectConcept/projectConceptProductDetailPopup.do"+params;
|
|
document.projectConceptProductForm.submit();
|
|
});
|
|
|
|
//첨부 파일 기능
|
|
fnc_setFileDropZone("finalDropZone", "${objId}", "${docType}", "${docTypeName}", "finalAreaDraw",false,null,null);
|
|
|
|
finalAreaDraw();
|
|
|
|
$("#btnUpload").click(function(){
|
|
var files = $("#file1")[0].files;
|
|
if(files.length > 0){
|
|
fnc_fileMultiUpload(files, null, "${objId}", "${docType}", "${docTypeName}", null, "finalAreaDraw");
|
|
//file객체 초기화
|
|
$("#file1").val("");
|
|
}else{
|
|
Swal.fire("선택된 File이 없습니다.");
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
<script>
|
|
function fn_searchEmployeeCallback(userId, userName, deptName){
|
|
//Swal.fire("parent "+"userId : "+userId+", userName : "+userName+", deptName : "+deptName);
|
|
$("#estimatePICUserName").val("["+deptName+"] "+userName);
|
|
$("#estimatePICUserId").val(userId);
|
|
}
|
|
|
|
//제품군 조회
|
|
function fn_setProductGroupList(){
|
|
$.ajax({
|
|
url:"/common/getProductGroupList.do",
|
|
type:"POST",
|
|
data:{"isJson":true},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].objid+"'>"+data[i].product_group_name+"</option>";
|
|
});
|
|
|
|
$("#productGroupObjId").append(appendCode);
|
|
|
|
var dbVal = "${info.PROD_GROUP_OBJID}";
|
|
if(dbVal != ""){
|
|
$("#productGroupObjId > option[value="+dbVal+"]").attr("selected", "true");
|
|
$("#productGroupObjId").trigger("change");
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//제품 조회
|
|
function fn_setProductList(){
|
|
var productGroupObjId = $("#productGroupObjId").val();
|
|
|
|
$.ajax({
|
|
url:"/common/getProductList.do",
|
|
type:"POST",
|
|
data:{"isJson":true, "search_productGroupObjId":productGroupObjId},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
appendCode += "<option value=''>선택("+data.length+"개)</option>";
|
|
|
|
$.each(data, function(i){
|
|
appendCode += "<option value='"+data[i].objid+"'>"+data[i].product_name+"</option>";
|
|
});
|
|
|
|
$("#productObjId").children().remove();
|
|
$("#productObjId").append(appendCode);
|
|
|
|
var dbVal = "${info.PROD_OBJID}";
|
|
if(dbVal != ""){
|
|
$("#productObjId > option[value="+dbVal+"]").attr("selected", "true");
|
|
}
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
//협조부서 목록 새로고침
|
|
function fn_refreshDeptList(){
|
|
var targetObjId = $("#objId").val();
|
|
|
|
$.ajax({
|
|
url:"/projectConcept/getProjectConceptProductDeptList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":targetObjId},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var appendCode = "";
|
|
|
|
if(data.length > 0){
|
|
$.each(data, function(i){
|
|
appendCode += "<tr>";
|
|
appendCode += "<td>"+(i+1)+"</td>";
|
|
appendCode += "<td>"+data[i].LOCATION_NAME+" "+data[i].DEPT_NAME+"</td>";
|
|
appendCode += "<td><input type='text' name='replyReqDate_"+data[i].DEPT_CODE+"' id='replyReqDate_"+data[i].DEPT_CODE+"' value='"+fnc_checkNull(data[i].REPLY_REQ_DATE)+"' style='width:75%' readonly><span class='delete_btn btnDeleteDate' style='display:inline-block;'></span></td>";
|
|
appendCode += "<td><a href='#' data-OBJID='"+data[i].OBJID+"' style='cursor:pointer;' class='btnDeleteDept'>삭제</a></td>";
|
|
appendCode += "</tr>";
|
|
});
|
|
}else{
|
|
appendCode += "<tr>";
|
|
appendCode += "<td colspan='4' align='center'>등록된 협조부서가 없습니다.</td>";
|
|
appendCode += "</tr>";
|
|
}
|
|
|
|
$("#dataList").children().remove();
|
|
$("#dataList").append(appendCode);
|
|
fnc_datepick();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
//저장
|
|
function fn_save(){
|
|
if(fn_validate()){
|
|
$.ajax({
|
|
url:"/projectConcept/saveProjectConceptProductInfo.do",
|
|
type:"POST",
|
|
data:$("#projectConceptProductForm").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
if(data.result){
|
|
if("edit" != "${param.mode}"){
|
|
opener.fn_refreshProductList();
|
|
self.close(0);
|
|
}else if("edit" == "${param.mode}"){
|
|
document.projectConceptProductForm.action = "/projectConcept/projectConceptProductDetailPopup.do";
|
|
document.projectConceptProductForm.submit();
|
|
}
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
//정합성 체크
|
|
function fn_validate(){
|
|
var result = false;
|
|
|
|
if($("#productObjId").val() == null || $("#productObjId").val() == ""){
|
|
Swal.fire("제품을 선택해 주시기 바랍니다.");
|
|
$("#productObjId").focus();
|
|
return result;
|
|
}
|
|
if($("#estimateNo").val() == null || $("#estimateNo").val() == ""){
|
|
Swal.fire("견적번호를 입력해 주시기 바랍니다.");
|
|
$("#estimateNo").focus();
|
|
return result;
|
|
}
|
|
if($("#estimateReqDate").val() == null || $("#estimateReqDate").val() == ""){
|
|
Swal.fire("견적요청 접수일을 입력해 주시기 바랍니다.");
|
|
$("#estimateReqDate").focus();
|
|
return result;
|
|
}
|
|
if($("#estimateSubmitDate").val() == null || $("#estimateSubmitDate").val() == ""){
|
|
Swal.fire("견적제출일을 입력해 주시기 바랍니다.");
|
|
$("#estimateSubmitDate").focus();
|
|
return result;
|
|
}
|
|
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
result = true;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
//협조부서 삭제
|
|
function fn_deleteDept(objId){
|
|
if(fnc_checkNull(objId) != ""){
|
|
if(confirm("삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/projectConcept/deleteProjectConceptProductDeptInfo_byEach.do",
|
|
type:"POST",
|
|
data:{"objId":objId},
|
|
dataType:"json",
|
|
success:function(data){
|
|
if(data.result){
|
|
fn_refreshDeptList();
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
//형상 영역을 display 한다.
|
|
function finalAreaDraw(){
|
|
fn_fileCallback("final","${docType}");
|
|
}
|
|
|
|
//첨부파일 목록을 가져온다.
|
|
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("final" == areaId){
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
|
|
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></td>";
|
|
appendText+= " <td>"+data[i].DEPT_NAME +" " +data[i].USER_NAME+"</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 colspan=\"5\">첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
</script>
|
|
<body>
|
|
<form name="projectConceptProductForm" id="projectConceptProductForm" action="" method="post">
|
|
<input type="hidden" name="estimatePICUserId" id="estimatePICUserId" value="${empty info.ESTIMATE_PIC?loginInfo.userId:info.ESTIMATE_PIC}" />
|
|
<input type="hidden" name="objId" id="objId" value="${objId}" />
|
|
<input type="hidden" name="targetObjId" id="targetObjId" value="${param.targetObjId}" />
|
|
<section class="business_popup_min_width">
|
|
<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="*"/>
|
|
<col width="*"/>
|
|
<col width="15%"/>
|
|
<col width="*"/>
|
|
<col width="*"/>
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">제품군</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="productGroupObjId" id="productGroupObjId">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">제품</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<select name="productObjId" id="productObjId">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">견적번호</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="text" name="estimateNo" id="estimateNo" value="${info.ESTIMATE_NO}" maxlength="20" class="textbox" />
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">견적제출일</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="text" class="textbox" name="estimateSubmitDate" id="estimateSubmitDate" value="${info.ESTIMATE_SUBMIT_DATE}" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">견적요청 접수일</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="text" class="textbox" name="estimateReqDate" id="estimateReqDate" value="${info.ESTIMATE_REQ_DATE}" />
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">생산총수량</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="number" name="productionAllCnt" id="productionAllCnt" class="textbox" value="${info.TOTAL_PRODUCTION_CNT}" />
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">연평균생산수량</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="number" name="productionAvgCnt" id="productionAvgCnt" class="textbox" value="${info.YEARLY_AVG_PRODUCTION_CNT}" />
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">입찰담당자</label>
|
|
</td>
|
|
<td colspan="2">
|
|
<input type="text" name="estimatePICUserName" id="estimatePICUserName" value="[${empty info.ESTIMATE_PIC_DEPT_NAME?loginInfo.deptName:info.ESTIMATE_PIC_DEPT_NAME}] ${empty info.ESTIMATE_PIC_USER_NAME?loginInfo.userName:info.ESTIMATE_PIC_USER_NAME}" class="textbox" style="width:85%;" readonly/>
|
|
<input type="button" value="변경" class="searchEmployee blue_btn">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="6">
|
|
<input type="button" value="협조팀 조회" class="team_search blue_btn float_r">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">협조 팀명</label>
|
|
</td>
|
|
<td colspan="5">
|
|
<div style="overflow-y:scroll;">
|
|
<table class="project_form_in_table" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%"/>
|
|
<col width="*"/>
|
|
<col width="20%"/>
|
|
<col width="10%"/>
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>협조 팀명</td>
|
|
<td>자료회신요청일</td>
|
|
<td>삭제</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="in_table_scroll_wrap" style="width:100%;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%"/>
|
|
<col width="*"/>
|
|
<col width="20%"/>
|
|
<col width="10%"/>
|
|
</colgroup>
|
|
<tbody id="dataList">
|
|
<tr>
|
|
<td colspan="4" align="cencter">등록된 협조부서가 없습니다.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table class="pmsPopupForm" style="margin-top:0;">
|
|
<colgroup>
|
|
<col width="13%;">
|
|
<col width="10%;">
|
|
<col width="*;">
|
|
<col width="*;">
|
|
<col width="*;">
|
|
<col width="10%;">
|
|
</colgroup>
|
|
<tr>
|
|
<td rowspan="3" class="input_title">
|
|
<label for="">최종 산출물</label>
|
|
</td>
|
|
<td colspan="5">
|
|
<div id="finalDropZone" class="dropzone">Drag & Drop Files Here</div>
|
|
<input type="file" name="file1" id="file1" multiple>
|
|
<input type="button" id="btnUpload" value="Upload" class="upload_btns">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="5">
|
|
<div style="overflow-y:scroll;">
|
|
<table class="project_form_in_table" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
<col width="20%;">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>첨부파일명</td>
|
|
<td>첨부인원</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="in_table_scroll_wrap" style="width:100%;height:130px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
<col width="20%;">
|
|
</colgroup>
|
|
<tbody id="finalFileArea">
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="저장" class="plm_btns" id="btnSave">
|
|
<c:choose>
|
|
<c:when test="${param.actionType eq 'regist'}">
|
|
</c:when>
|
|
<c:otherwise>
|
|
<input type="button" id="btnCancel" value="취소" class="plm_btns" data-OBJID="${objId}">
|
|
</c:otherwise>
|
|
</c:choose>
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |