263 lines
9.2 KiB
Plaintext
263 lines
9.2 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="targetObjId" value="${investMap.targetObjId}" />
|
||
|
|
</head>
|
||
|
|
<script>
|
||
|
|
$(document).ready(function(){
|
||
|
|
$("#btn_close").click(function(){
|
||
|
|
//opener.fn_search();
|
||
|
|
opener.location.href="/project/getProjectProductList.do";
|
||
|
|
self.close(0);
|
||
|
|
});
|
||
|
|
$("#btn_save").click(function(){
|
||
|
|
fn_add_save();
|
||
|
|
});
|
||
|
|
$("#btn_delete").click(function(){
|
||
|
|
fn_add_delete();
|
||
|
|
});
|
||
|
|
fnc_datepick();
|
||
|
|
|
||
|
|
//견적서 자료등록 팝업
|
||
|
|
$(".investFile").click(function(){
|
||
|
|
var objId = $(this).attr("data-OBJID");
|
||
|
|
var params = "?targetObjId="+objId;
|
||
|
|
window.open("/project/investFileRegistPopup.do"+params, "", "width=600, height=285");
|
||
|
|
});
|
||
|
|
//첨부 파일 기능
|
||
|
|
//fnc_setFileDropZone("srDropZone", "${param.targetObjId}", "${docType}", "${docTypeName}", "srAreaDraw",false,null,null);
|
||
|
|
|
||
|
|
//srAreaDraw();
|
||
|
|
});
|
||
|
|
|
||
|
|
function fn_search(){
|
||
|
|
location.reload();
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_add_save(){
|
||
|
|
//한줄추가 내역이 있을 경우
|
||
|
|
if($("#addCkBox").length != 0){
|
||
|
|
var form = $("#form1").serialize();
|
||
|
|
console.log("form :" + form);
|
||
|
|
$.ajax({
|
||
|
|
url:"/project/addSaveInvestCostMng.do",
|
||
|
|
type:"POST",
|
||
|
|
data:$("#form1").serialize(),
|
||
|
|
dataType:"json",
|
||
|
|
success:function(data){
|
||
|
|
Swal.fire(data.msg);
|
||
|
|
location.reload();
|
||
|
|
},
|
||
|
|
error: function(jqxhr, status, error){
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}else{
|
||
|
|
fn_save();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_save(){
|
||
|
|
//한줄추가 내역이 있을 경우
|
||
|
|
var param = $("#form1").serialize();
|
||
|
|
var checkArr = new Array();
|
||
|
|
$("input[name=ckBox]").each(function(i){
|
||
|
|
checkArr.push($(this).val());
|
||
|
|
});
|
||
|
|
console.log("param:" + param + "&checkArr="+checkArr);
|
||
|
|
$.ajax({
|
||
|
|
url:"/project/saveInvestCostMng.do",
|
||
|
|
type:"POST",
|
||
|
|
data: param + "&checkArr="+checkArr,
|
||
|
|
dataType:"json",
|
||
|
|
success:function(data){
|
||
|
|
Swal.fire(data.msg);
|
||
|
|
location.reload();
|
||
|
|
},
|
||
|
|
error: function(jqxhr, status, error){
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_add_delete(){
|
||
|
|
var checkArr = new Array();
|
||
|
|
$("input[name=ckBox]:checked").each(function(i){
|
||
|
|
checkArr.push($(this).val());
|
||
|
|
});
|
||
|
|
if (confirm("선택한 내역을 삭제하시겠습니까?")) {
|
||
|
|
var param = $("#form1").serialize();
|
||
|
|
console.log(checkArr);
|
||
|
|
param = param + "&checkArr="+checkArr;
|
||
|
|
$.ajax({
|
||
|
|
type : "POST",
|
||
|
|
url : "/project/deleteInvestCostMng.do",
|
||
|
|
data : param,
|
||
|
|
dataType : "json",
|
||
|
|
success : function(data) {
|
||
|
|
Swal.fire(data.msg);
|
||
|
|
location.reload();
|
||
|
|
},
|
||
|
|
error : function(jqxhr, status, error) {
|
||
|
|
}
|
||
|
|
});
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function fnc_datepick(){
|
||
|
|
var $dateinput = $("input");
|
||
|
|
|
||
|
|
for(var i=0; i<$dateinput.length; i++){
|
||
|
|
var id = $dateinput.eq(i).attr("id");
|
||
|
|
|
||
|
|
if(id != null){
|
||
|
|
if(id.indexOf("Date")>-1){
|
||
|
|
$dateinput.eq(i).attr("size","10");
|
||
|
|
$dateinput.eq(i).datepicker({
|
||
|
|
changeMonth:true,
|
||
|
|
changeYear:true
|
||
|
|
});
|
||
|
|
}else{
|
||
|
|
$dateinput.eq(i).attr("size","10");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_addline(){
|
||
|
|
|
||
|
|
if($("#addCkBox").length != 0){
|
||
|
|
Swal.fire("추가 중 인 내역이 있습니다.\n저장 후 추가 해 주세요.");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
var idex = $("input[name=ckBox]").length;
|
||
|
|
var appendCode = "";
|
||
|
|
appendCode += "<tr>";
|
||
|
|
appendCode += "<td><input type='checkbox' value='' name='addCkBox' id='addCkBox'></td>";
|
||
|
|
appendCode += "<td>"+(idex+1)+"</td>";
|
||
|
|
appendCode += "<td><input type='text' class='textbox' name='addTitle' id='addTitle' value='' maxlength='24'></td>";
|
||
|
|
appendCode += "<td><input type='text' name='addDrafterUserName' id='addDrafterUserName' value='' class='textbox' style='width:60%;' readonly='' size='10'><input type='button' value='찾기' onclick='fn_searchEmployee_add();' class='searchEmployee blue_btn'></td>";
|
||
|
|
appendCode += "<td><input type='text' class='textbox' name='addDueDate' id='addDueDate' value='' /></td>";
|
||
|
|
appendCode += "<td><input type='text' class='textbox' name='addAmount' id='addAmount' value='' onkeyup=\"fnc_checkDataType('number',this.value);\" maxlength='24'></td>";
|
||
|
|
appendCode += "<td><select id='addStatus' name='addStatus'><option value='01'>대기</option><option value='03'>완료</option><option value='02'>취소</option></select></td>";
|
||
|
|
appendCode += "<td></td>";
|
||
|
|
appendCode += "<input type='hidden' value='"+(idex+1)+"' name='addSeq' id='addSeq'>";
|
||
|
|
appendCode += "<input type='hidden' value='' name='addDrafter' id='addDrafter'>";
|
||
|
|
appendCode += "</tr>";
|
||
|
|
$("#orderInvest").append(appendCode);
|
||
|
|
fnc_datepick();
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_searchEmployee(objid){
|
||
|
|
var params = "";
|
||
|
|
params += "?title=수주활동 등록";
|
||
|
|
params += "&callback=fn_searchEmployeeCallback";
|
||
|
|
window.open("/common/searchEmployeePopup.do"+params, "", "width=480, height=367");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_searchEmployeeCallback(userId, userName, deptName){
|
||
|
|
$("#drafterUserName").val(userName);
|
||
|
|
$("#drafter").val(userId);
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_searchEmployee_add(){
|
||
|
|
var params = "";
|
||
|
|
params += "?title=수주활동 등록";
|
||
|
|
params += "&callback=fn_searchEmployeeCallback_add";
|
||
|
|
window.open("/common/searchEmployeePopup.do"+params, "", "width=480, height=367");
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
function fn_searchEmployeeCallback_add(userId, userName, deptName){
|
||
|
|
$("#addDrafterUserName").val(userName);
|
||
|
|
$("#addDrafter").val(userId);
|
||
|
|
//$("#addform > input[name='drafterUserName']").val(userName);
|
||
|
|
|
||
|
|
//Swal.fire("val : "+$("#addform [name=drafterUserName]").val());
|
||
|
|
//$('#addform [name="drafterUserName"]').val(userName);
|
||
|
|
//$("#addform #drafterUserName").val(userName);
|
||
|
|
//$("#addform #drafter").val(userId);
|
||
|
|
}
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<body>
|
||
|
|
<form name="form1" id="form1" action="" method="post">
|
||
|
|
<input type="hidden" value="${targetObjId}" name="targetObjId" id = "targetObjId" />
|
||
|
|
<section class="business_staff_popup_min_width">
|
||
|
|
<div class="plm_menu_name">
|
||
|
|
<h2>
|
||
|
|
<span>투자비 관리</span>
|
||
|
|
</h2>
|
||
|
|
</div>
|
||
|
|
<div id="businessPopupFormWrap">
|
||
|
|
|
||
|
|
<div class="plm_btn_wrap">
|
||
|
|
<input type="button" value="+한줄추가" id="btn_add" class="plm_btns" onclick="fn_addline();">
|
||
|
|
<input type="button" value="삭제" id="btn_delete" class="plm_btns">
|
||
|
|
<input type="button" value="저장" id="btn_save" class="plm_btns">
|
||
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
||
|
|
</div>
|
||
|
|
<div class="plm_table_wrap">
|
||
|
|
<table class="plm_table">
|
||
|
|
<colgroup>
|
||
|
|
<col width="5%">
|
||
|
|
<col width="5%">
|
||
|
|
<col width="35%">
|
||
|
|
<col width="18%">
|
||
|
|
<col width="12%">
|
||
|
|
<col width="12%">
|
||
|
|
<col width="8%">
|
||
|
|
<col width="*">
|
||
|
|
</colgroup>
|
||
|
|
<thead>
|
||
|
|
<tr class="plm_thead">
|
||
|
|
<td>선택</td>
|
||
|
|
<td>순번</td>
|
||
|
|
<td>제목</td>
|
||
|
|
<td>기안자</td>
|
||
|
|
<td>기안일</td>
|
||
|
|
<td>품의금액</td>
|
||
|
|
<td>집행유무</td>
|
||
|
|
<td>파일</td>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody id="orderInvest">
|
||
|
|
<c:choose>
|
||
|
|
<c:when test="${!empty LIST}">
|
||
|
|
<c:forEach var="info" items="${LIST}" varStatus="status">
|
||
|
|
<tr>
|
||
|
|
<td title="${info.objid}"><input type="checkbox" value="${info.objid}" name="ckBox" id="ckBox" data-objId="${info.objid}"></td>
|
||
|
|
<td title="${info.seq}">${info.seq}</td>
|
||
|
|
<td title="${info.title}">${info.title}</td>
|
||
|
|
<!-- <td title="${info.drafter_name}"><input type='text' name='drafterUserName_${info.objid}' id='drafterUserName_${info.objid}' value='${info.drafter_name}' class='textbox' style='width:60%;' readonly='' size='10'><input type='button' value='변경' onclick="fn_searchEmployee('${info.objid}');" class='searchEmployee blue_btn'></td> -->
|
||
|
|
<td>${info.drafter_name}</td>
|
||
|
|
<td title="${info.duedate}">${info.duedate}</td>
|
||
|
|
<td title="${info.amount}" align='right' style="padding-right:3px;"><script>document.write(numberWithCommas('${info.amount}'));</script></td>
|
||
|
|
<td title="${info.status}">
|
||
|
|
<select id='status_${info.objid}' name='status_${info.objid}'>
|
||
|
|
<option value="01" ${'01' eq info.status ? 'selected':''}>대기</option>
|
||
|
|
<option value="03" ${'03' eq info.status ? 'selected':''}>완료</option>
|
||
|
|
<option value="02" ${'02' eq info.status ? 'selected':''}>취소</option>
|
||
|
|
</select>
|
||
|
|
</td>
|
||
|
|
<td><a href="#" class="investFile file_${info.invest_file_cnt eq 0?'empty_':''}icon" data-OBJID="${info.objid}"></a></td>
|
||
|
|
<input type="hidden" value="${info.objid}" name="objid_${info.objid}" id = "objid_${info.objid}" />
|
||
|
|
<input type="hidden" value="${info.drafter}" name="drafter_${info.objid}" id = "drafter_${info.objid}" />
|
||
|
|
</tr>
|
||
|
|
</c:forEach>
|
||
|
|
</c:when>
|
||
|
|
</c:choose>
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
</section>
|
||
|
|
</form>
|
||
|
|
</body>
|
||
|
|
</html>
|