271 lines
8.2 KiB
Plaintext
271 lines
8.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>
|
|
<script>
|
|
$(document).ready(function(){
|
|
|
|
$("#btn_close").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
//저장
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
//저장
|
|
$("#addRow").click(function(){
|
|
addRow();
|
|
});
|
|
|
|
|
|
|
|
//삭제
|
|
$("#btnDel").click(function(){
|
|
fn_delete();
|
|
});
|
|
|
|
//체크박스 전체선택/전체해제
|
|
$("#allCheck").click(function(){
|
|
if($("#allCheck").prop("checked")) {
|
|
$("input[type=checkbox]").prop("checked",true);
|
|
} else {
|
|
$("input[type=checkbox]").prop("checked",false);
|
|
}
|
|
});
|
|
|
|
fnc_datepick();
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
<script>
|
|
|
|
function fn_save(){
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
//Swal.fire($("#form1").serialize());
|
|
$.ajax({
|
|
url:"/projectConcept/saveOrderMgmtSubInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.RESULT.msg);
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
|
|
function addRow(){
|
|
var params = "";
|
|
var option="";
|
|
//var selectCnt= $("#Row").length;
|
|
|
|
var selectCnt=$('#dataRow > tr').length;
|
|
params += "codeId=SPE10000";
|
|
$.ajax({
|
|
type : "POST",
|
|
url : "/admin/makeSelect.do",
|
|
data : params,
|
|
dataType:"json",
|
|
async: false,
|
|
success: function(data){
|
|
if(data.RESULT !=""){
|
|
option += "<tr id='Row"+selectCnt+"'>";
|
|
option += "<input type='hidden' name='parentObjId' id='parentObjId' value='${param.objId}'>";
|
|
option += "<input type='hidden' name='objId' id='objId' value='${info.OBJID}'>";
|
|
option += "<td><input type='checkbox' name='chk' id='Row"+selectCnt+"' data-objId=''></td>";
|
|
option += "<td><input type='text' name='model_name' id='model_name' value=''></td>";
|
|
option += "<td>";
|
|
option += "<select name='spec_cd' id='spec_cd'>";
|
|
option += "<option>선택</option>";
|
|
option += data.RESULT;
|
|
option += "</select>";
|
|
option += " </td>";
|
|
option += "<td><input type='text' name='count' id='count' style='text-align:center;' value='' onkeyup='inputNumberFormat(this)'></td>";
|
|
option += "<td><input type='text' name='contract_amount' style='text-align:right; padding-right:5px;' id='contract_amount' value='' onkeyup='inputNumberFormat(this)'/></td>";
|
|
option += "<td><input type='text' name='delivery_date' class='date_icon' style='text-align:center;' id='delivery_date"+selectCnt+"' value='' ></td>";
|
|
option += "<td><input type='text' name='sch_date' class='date_icon' style='text-align:center;' id='sch_date"+selectCnt+"' value='' ></td>";
|
|
option += "</tr>";
|
|
$("#dataRow").append(option);
|
|
}
|
|
}
|
|
});
|
|
fnc_datepick();
|
|
}
|
|
|
|
//삭제
|
|
function fn_delete(){
|
|
|
|
var chk = $("input[name=chk]:checked");
|
|
if(chk.length == 0){
|
|
Swal.fire("선택된 영업품목이 없습니다.");
|
|
return false;
|
|
}
|
|
var value="";
|
|
var _value="";
|
|
|
|
$(chk).each(function(i){
|
|
|
|
var objId = $(this).attr("data-objId");
|
|
if(objId==""){
|
|
_value += (i==0?"":",")+$(this).attr("id");
|
|
}else{
|
|
value += (i==0?"":",")+objId;
|
|
}
|
|
});
|
|
$("#delKey").val(value);
|
|
var arrchk = _value.split(',');
|
|
if(confirm("삭제하시겠습니까?")){
|
|
for(var i=0;i<arrchk.length;i++){
|
|
$("#"+arrchk[i]).remove();
|
|
}
|
|
if(value!=""){
|
|
$.ajax({
|
|
url:"/projectConcept/delOrderMgmttSubInfo.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.RESULT.msg);
|
|
//self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function inputNumberFormat(obj) {
|
|
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, '');
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="delKey" id="delKey">
|
|
<div id="">
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>영업품목 상세</span>
|
|
</h2>
|
|
</div>
|
|
<section class="contents_page_basic_margin">
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap">
|
|
<c:if test="${param.view ne 'Y'}">
|
|
<input type="button" value="+한줄추가" class="plm_btns" id="addRow">
|
|
</c:if>
|
|
</div>
|
|
</div>
|
|
<div class="plm_table_wrap" style="">
|
|
<div style="overflow-y:scroll;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="5%">
|
|
<col width="35%">
|
|
<col width="10%">
|
|
<col width="5%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" id="allCheck"></td>
|
|
<td>모델명</td>
|
|
<td>사양</td>
|
|
<td>수량</td>
|
|
<td>계약금액</td>
|
|
<td>납기일</td>
|
|
<td>출하예정일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="width:100%; height:200px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="5%">
|
|
<col width="35%">
|
|
<col width="10%">
|
|
<col width="5%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
<col width="15%">
|
|
</colgroup>
|
|
<tbody id="dataRow">
|
|
<c:choose>
|
|
<c:when test="${!empty LIST}">
|
|
<c:forEach var="info" items="${LIST}" varStatus="status">
|
|
<tr id="Row${status.index}">
|
|
<input type="hidden" name="parentObjId" id="parentObjId" value="${param.objId}">
|
|
<input type="hidden" name="objId" id="objId" value="${info.OBJID}">
|
|
<td><input type="checkbox" name="chk" id="chk" data-objId="${info.OBJID}"></td>
|
|
<td><input type="text" name="model_name" id="model_name" value="${info.MODEL_NAME}"></td>
|
|
<td>
|
|
<select name="spec_cd" id="spec_cd">
|
|
<option>선택</option>
|
|
${info.code_name}
|
|
</select>
|
|
</td>
|
|
<td><input type="text" name="count" id="count" style="text-align:center;" value="${info.CNT}" onkeyup="inputNumberFormat(this)"></td>
|
|
<td><input type="text" name="contract_amount" style="text-align:right; padding-right:5px;" id="contract_amount" value="${info.CONTRACT_AMOUNT}" onkeyup="inputNumberFormat(this)"/></td>
|
|
<td><input type="text" class="date_icon" style="text-align:center;" id="delivery_date${info.OBJID}" name="delivery_date" value="${info.DELIVERY_DATE}" ></td>
|
|
<td><input type="text" class="date_icon" style="text-align:center;" id="sch_date${info.OBJID}" name="sch_date" value="${info.SCH_DATE}" ></td>
|
|
</tr>
|
|
</c:forEach>
|
|
</c:when>
|
|
<c:otherwise>
|
|
<tr>
|
|
<td colspan="7" align="center">조회된 데이터가 없습니다.</td>
|
|
</tr>
|
|
</c:otherwise>
|
|
</c:choose>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<div class="btn_wrap" style="clear:both;">
|
|
<div class="plm_btn_wrap_center">
|
|
|
|
<c:if test="${param.writer eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
<c:if test="${param.view ne 'Y'}">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns">
|
|
<input type="button" value="삭제" id="btnDel" class="plm_btns">
|
|
</c:if>
|
|
</c:if>
|
|
<input type="button" value="닫기" id="btn_close" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |