421 lines
12 KiB
Plaintext
421 lines
12 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(){
|
|
|
|
$('.select2').select2();
|
|
|
|
$("#btn_close").click(function(){
|
|
self.close();
|
|
opener.fn_search();
|
|
});
|
|
|
|
//담당자 추가
|
|
$("#btnUserReg").click(function(){
|
|
fn_addCharger();
|
|
});
|
|
|
|
//담당자 삭제
|
|
$("#btnUserDelete").click(function(){
|
|
fn_deleteRow();
|
|
});
|
|
|
|
getSupplyChargerList();
|
|
|
|
});
|
|
|
|
function fn_deleteRow(){
|
|
var targetLength = $("input[name='chkObjId']:checked").length
|
|
|
|
if(0 < targetLength){
|
|
if(confirm("선택된 정보를 삭제하시겠습니까?")){
|
|
$("input[name='chkObjId']:checked").each(function(i){
|
|
|
|
var targetObjId = $(this).val();
|
|
|
|
$("#"+targetObjId).remove();
|
|
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
function fn_setCodeListAppend(codeId,selectboxId,selectedVal){
|
|
var resultList = fnc_getCodeList(codeId);
|
|
|
|
$("#"+selectboxId).empty();
|
|
|
|
$("#"+selectboxId).append("<option value=''>선택</option>");
|
|
|
|
if(resultList != null && 0 < resultList.length){
|
|
for (var i = 0; i < resultList.length; i++) {
|
|
var commonCodeId = resultList[i].CODE_ID;
|
|
var commonCodeName = resultList[i].CODE_NAME;
|
|
$("#"+selectboxId).append("<option value='"+commonCodeId+"'>"+commonCodeName+"</option>");
|
|
}
|
|
$("#"+selectboxId).val(selectedVal);
|
|
}
|
|
}
|
|
|
|
function saveOEMInfo(){
|
|
var oemForm = document.oemForm;
|
|
if(confirm("저장하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/admin/saveSupMgmtInfo.do",
|
|
type:"POST",
|
|
data:$("#oemForm").serialize(),
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
if(data.result!=''){
|
|
alert('저장되었습니다');
|
|
}
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
//전체 체크 기능
|
|
function allCheck(base,name){
|
|
var checkObj = document.getElementsByName(name);
|
|
var checkFlag = base.checked;
|
|
|
|
if(0 < checkObj.length){
|
|
for(var i=0;i<checkObj.length;i++){
|
|
checkObj[i].checked = checkFlag;
|
|
}
|
|
}else{
|
|
checkObj.checked = checkFlag;
|
|
}
|
|
}
|
|
|
|
function duplicateCheck(){
|
|
var result = false;
|
|
|
|
var url = "/admin/checkSameOEMCodeAndName.do";
|
|
var oemName = $("#oemName").val();
|
|
var oemCode = $("#oemCode").val();
|
|
|
|
$.ajax({
|
|
url:url,
|
|
type:"POST",
|
|
data:{"oemName":oemName,"oemCode":oemCode,"objId":$("#oemObjid").val()},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var codeCnt = data.SAME_OEM_CODE_CNT;
|
|
var nameCnt = data.SAME_OEM_NAME_CNT;
|
|
|
|
if(codeCnt > 0){
|
|
Swal.fire("고객사 코드가 이미 존재합니다.");
|
|
result = true;
|
|
return true;
|
|
}
|
|
if(nameCnt > 0){
|
|
Swal.fire("고객사명이 이미 존재합니다.");
|
|
result = true;
|
|
return true;
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
|
|
//milestone 정보를 수정한다.
|
|
function getSupplyChargerList(){
|
|
$.ajax({
|
|
url:"/admin/getSupplyChargerList.do",
|
|
type:"POST",
|
|
data:{"supply_objid":"${Info.OBJID}"},
|
|
dataType:"json",
|
|
success:function(data){
|
|
|
|
for(var i = 0;i<data.length;i++){
|
|
|
|
var rowObjId = data[i].OBJID;
|
|
var RNUM = data[i].RNUM;
|
|
var CHARGER_TYPE = data[i].CHARGER_TYPE;
|
|
var CHARGER_NAME = data[i].CHARGER_NAME;
|
|
var PHONE = data[i].PHONE;
|
|
var TEL = data[i].TEL;
|
|
var FAX = data[i].FAX;
|
|
var EMAIL = data[i].EMAIL;
|
|
|
|
var appendText = "<tr id='"+rowObjId+"'>";
|
|
appendText += " <input type='hidden' name='rowObjId' value='"+rowObjId+"'>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='checkbox' name='chkObjId' value='"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>"+RNUM+"</td>";
|
|
appendText += " <td>";
|
|
appendText += " <select name='charger_type_"+rowObjId+"' id='charger_type_"+rowObjId+"'></select>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='charger_name_"+rowObjId+"' id='charger_name_"+rowObjId+"' value='"+CHARGER_NAME+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='phone_"+rowObjId+"' id='phone_"+rowObjId+"' value='"+PHONE+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='tel_"+rowObjId+"' id='tel_"+rowObjId+"' value='"+TEL+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='fax_"+rowObjId+"' id='fax_"+rowObjId+"' value='"+FAX+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='email_"+rowObjId+"' id='email_"+rowObjId+"' value='"+EMAIL+"'>";
|
|
appendText += " </td>";
|
|
appendText += "</tr>";
|
|
|
|
$("#chargerArea").append(appendText);
|
|
|
|
fn_setCodeListAppend("<%=Constants.CHARGER_TYPE_CODE%>","charger_type_"+rowObjId, CHARGER_TYPE);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function fn_addCharger(){
|
|
|
|
var rowObjId = fnc_createObjId();
|
|
|
|
var appendText = "<tr>";
|
|
appendText += " <input type='hidden' name='rowObjId' value='"+rowObjId+"'>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='checkbox' name='chkObjId' value='"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>"+($("#chargerArea").find("tr").length+1)+"</td>";
|
|
appendText += " <td>";
|
|
appendText += " <select name='charger_type_"+rowObjId+"' id='charger_type_"+rowObjId+"'></select>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='charger_name_"+rowObjId+"' id='charger_name_"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='phone_"+rowObjId+"' id='phone_"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='tel_"+rowObjId+"' id='tel_"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='fax_"+rowObjId+"' id='fax_"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += " <td>";
|
|
appendText += " <input type='text' name='email_"+rowObjId+"' id='email_"+rowObjId+"'>";
|
|
appendText += " </td>";
|
|
appendText += "</tr>";
|
|
|
|
$("#chargerArea").append(appendText);
|
|
|
|
fn_setCodeListAppend("<%=Constants.CHARGER_TYPE_CODE%>","charger_type_"+rowObjId, "");
|
|
|
|
}
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<form name="oemForm" id="oemForm" action="" method="post">
|
|
<input type="hidden" name="objid" id="objid" value="${Info.OBJID}">
|
|
<div class="plm_menu_name_myungjin">
|
|
<h2>
|
|
<span>공급업체 등록/수정</span>
|
|
</h2>
|
|
</div>
|
|
<section style="float:left;width:30%;">
|
|
<div id="businessPopupFormWrap">
|
|
<h4><span>공급업체 정보</span></h4>
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="30%">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tbody>
|
|
<tr>
|
|
<td class="input_title"><label for="">구분</label></td>
|
|
<td>
|
|
<select name="supply_code" id="supply_code" style="" class="select2" autocomplete="off">
|
|
<option value="">선택</option>
|
|
${code_map.supply_code}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">고객명</label></td>
|
|
<td>
|
|
<input type="text" name="supply_name" id="supply_name" value="${Info.SUPPLY_NAME}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">지역</label></td>
|
|
<td>
|
|
<select name="area_cd" id="area_cd" style="" class="select2" autocomplete="off">
|
|
<option value="">선택</option>
|
|
${code_map.area_cd}
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">대표자명</label></td>
|
|
<td>
|
|
<input type="text" name="charge_user_name" id="charge_user_name" value="${Info.CHARGE_USER_NAME}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<!-- <tr> -->
|
|
<!-- <td class="input_title"><label for="">실사용자명</label></td> -->
|
|
<!-- <td> -->
|
|
<%-- <input type="text" name="reg_id" id="reg_id" value="${Info.REG_ID}" maxlength="100"> --%>
|
|
<!-- </td> -->
|
|
<!-- </tr> -->
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">사업자등록번호</label></td>
|
|
<td>
|
|
<input type="text" name="bus_reg_no" id="bus_reg_no" value="${Info.BUS_REG_NO}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title"><label for="">법인/주민번호</label></td>
|
|
<td>
|
|
<input type="text" name="reg_no" id="reg_no" value="${Info.REG_NO}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">업태</label></td>
|
|
<td>
|
|
<input type="text" name="supply_busname" id="supply_busname" value="${Info.SUPPLY_BUSNAME}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">업종</label></td>
|
|
<td>
|
|
<input type="text" name="supply_stockname" id="supply_stockname" value="${Info.SUPPLY_STOCKNAME}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">주소</label></td>
|
|
<td style="border: 1px solid #ccc !important;">
|
|
<textarea name="supply_address" id="supply_address" style="width:255px;">${Info.SUPPLY_ADDRESS}</textarea>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">핸드폰</label></td>
|
|
<td>
|
|
<input type="text" name="supply_tel_no" id="supply_tel_no" value="${Info.SUPPLY_TEL_NO}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">E-MAIL</label></td>
|
|
<td>
|
|
<input type="text" name="email" id="email" value="${Info.EMAIL}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">OFFICE NO</label></td>
|
|
<td>
|
|
<input type="text" name="office_no" id="office_no" value="${Info.OFFICE_NO}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td class="input_title"><label for="">FAX NO</label></td>
|
|
<td>
|
|
<input type="text" name="supply_fax_no" id="supply_fax_no" value="${Info.SUPPLY_FAX_NO}" maxlength="100">
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</section>
|
|
<aside style="float:right;width:70%;">
|
|
<div id="businessPopupFormWrap">
|
|
<div class="ascendig_text" style="float:right;width:99%;">
|
|
<h4 style="float:left;"><span>담당자 정보</span></h4>
|
|
<div class="plm_btn_wrap">
|
|
<input type="button" value="추가" class="plm_btns" id="btnUserReg">
|
|
<input type="button" value="삭제" class="plm_btns" id="btnUserDelete">
|
|
</div>
|
|
</div>
|
|
<div class="plm_table_wrap">
|
|
<div style="overflow-y:scroll;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2.5%" />
|
|
<col width="5%" /> <!-- 순 -->
|
|
<col width="8%" /> <!-- 담당 구분 -->
|
|
<col width="*" /> <!-- 담당자 -->
|
|
<col width="*" /> <!-- HP -->
|
|
<col width="*" /> <!-- Tel -->
|
|
<col width="*" /> <!-- Fax -->
|
|
<col width="*" /> <!-- email -->
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td><input type="checkbox" id="allCheck" class="checkBox"></td>
|
|
<td>No </td>
|
|
<td>담당 구분 </td>
|
|
<td>담당자 </td>
|
|
<td>HP </td>
|
|
<td>Tel </td>
|
|
<td>Fax </td>
|
|
<td>email </td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<div class="plm_scroll_table" style="height:350px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="2.5%" />
|
|
<col width="5%" /> <!-- 순 -->
|
|
<col width="8%" /> <!-- 담당 구분 -->
|
|
<col width="*" /> <!-- 담당자 -->
|
|
<col width="*" /> <!-- HP -->
|
|
<col width="*" /> <!-- Tel -->
|
|
<col width="*" /> <!-- Fax -->
|
|
<col width="*" /> <!-- email -->
|
|
</colgroup>
|
|
<tbody id="chargerArea"></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</aside>
|
|
<footer style="width:100%;height:10px;clear:both;">
|
|
<div class="btnCenterWrap">
|
|
<center class="center_btns_wrap">
|
|
<input type="button" value="저장" class="btns" onclick="javascript:saveOEMInfo();">
|
|
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
|
</center>
|
|
</div>
|
|
</footer>
|
|
</form>
|
|
</body>
|
|
</html> |