2022-09-05 07:47:25 +00:00
|
|
|
$(document).on('click', '.userInfoTr', function (){
|
2022-09-08 05:29:50 +00:00
|
|
|
document.getElementById('accessTab').classList.add('active');
|
|
|
|
|
document.getElementById('approvalTab').classList.remove('active');
|
|
|
|
|
const trKey = (Number($(this).find(".trKey").val()));
|
|
|
|
|
const verNo = (Number($(this).find(".verNo").val()));
|
|
|
|
|
const url = '/translator/translatorEditModal';
|
|
|
|
|
revisionHistory(trKey,verNo,url);
|
|
|
|
|
var html="";
|
|
|
|
|
html += '<input type="hidden" class="tapTrKey" value="'+trKey+'">';
|
|
|
|
|
html += '<input type="hidden" class="tapVerNo" value="'+verNo+'">';
|
|
|
|
|
$("#KeyValue").empty().html(html)
|
2022-09-05 07:47:25 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#updateBtn', function (){
|
|
|
|
|
if(confirm("수정하시겠습니까?")){
|
|
|
|
|
contentFade("in");
|
|
|
|
|
const formData = new FormData($("#trInfoUpdate")[0]);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'POST',
|
|
|
|
|
data : formData,
|
|
|
|
|
url : "/translator/updatetranslatorInfo",
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
success : function() {
|
|
|
|
|
alert("수정되었습니다.");
|
|
|
|
|
contentFade("out");
|
2022-09-06 08:40:44 +00:00
|
|
|
location.reload();
|
2022-09-05 07:47:25 +00:00
|
|
|
},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert("수정에 실패하였습니다.");
|
|
|
|
|
contentFade("out");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
2022-09-05 04:53:49 +00:00
|
|
|
|
|
|
|
|
$(document).on('click', '#saveBtn', function (){
|
|
|
|
|
if(confirm("저장하시겠습니까?")){
|
|
|
|
|
contentFade("in");
|
|
|
|
|
const formData = new FormData($("#translatorInsert")[0]);
|
|
|
|
|
$.ajax({
|
|
|
|
|
type : 'POST',
|
|
|
|
|
data : formData,
|
|
|
|
|
url : "/translator/insertTranslatorInfo",
|
|
|
|
|
processData: false,
|
|
|
|
|
contentType: false,
|
|
|
|
|
success : function(result) {
|
2022-09-06 08:40:44 +00:00
|
|
|
alert("저장되었습니다.")
|
2022-09-05 04:53:49 +00:00
|
|
|
contentFade("out");
|
2022-09-06 08:40:44 +00:00
|
|
|
location.reload();
|
2022-09-05 04:53:49 +00:00
|
|
|
},
|
|
|
|
|
error : function(xhr, status) {
|
|
|
|
|
alert("저장에 실패하였습니다.")
|
|
|
|
|
contentFade("out");
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function valueCheck(form){
|
|
|
|
|
const targetForm = $("#"+form);
|
|
|
|
|
const userId = targetForm.find("#userId").val();
|
|
|
|
|
const password = targetForm.find("#modalPassword");
|
|
|
|
|
const passwordConfirm = targetForm.find("#passwordConfirm");
|
|
|
|
|
const userNm = targetForm.find("#userNm").val();
|
|
|
|
|
const ogCd = targetForm.find("#ogCd").val();
|
|
|
|
|
const ofcCd = targetForm.find("#ofcCd").val();
|
|
|
|
|
let returnFlag = true;
|
|
|
|
|
|
|
|
|
|
if(!userId){
|
|
|
|
|
alert("아이디를 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}else{
|
|
|
|
|
const idReg = /^[a-z]+[a-z0-9]{5,19}$/g;
|
|
|
|
|
if(!idReg.test(userId)){
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
alert("아이디 조건이 맞지 않습니다.")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!password[0].disabled && !password.val()){
|
|
|
|
|
alert("비밀번호를 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!password[0].disabled && !passwordConfirm.val()){
|
|
|
|
|
alert("비밀번호 확인을 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!userNm){
|
|
|
|
|
alert("이름 입력해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(returnFlag){
|
|
|
|
|
const passwordReg = /^(?=.*[a-zA-z])(?=.*[0-9])(?=.*[$`~!@$!%*#^?&\\(\\)\-_=+]).{8,16}$/;
|
|
|
|
|
if(!password[0].disabled){
|
|
|
|
|
if(!passwordReg.test(password.val())){
|
|
|
|
|
alert("비밀번호 조건이 맞지 않습니다.")
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}else{
|
|
|
|
|
if(password.val() !== passwordConfirm.val()){
|
|
|
|
|
alert("비밀번호가 같지 않습니다.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(!ogCd){
|
|
|
|
|
alert("관서를 선택해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
if(!ofcCd){
|
|
|
|
|
alert("부서를 선택해주세요.");
|
|
|
|
|
returnFlag = false;
|
|
|
|
|
}
|
|
|
|
|
return returnFlag;
|
2022-09-08 05:29:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.historyInfoTr', function (){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: '/translator/HistoryView',
|
|
|
|
|
data: {
|
|
|
|
|
translatorKey: Number($(this).find(".trKey").val()),
|
|
|
|
|
versionNo : Number($(this).find(".verNo").val())
|
|
|
|
|
},
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType:"json",
|
|
|
|
|
success: function(data){
|
|
|
|
|
$("#ogdp1V").val(data.ogdp1);
|
|
|
|
|
$("#trLangV").val(data.trLang);
|
|
|
|
|
$("#trCareerV").val(data.trCareer);
|
|
|
|
|
$("#trNameV").val(data.trName);
|
|
|
|
|
$("#trSexV").val(data.trSex);
|
|
|
|
|
$("#trPhoneV").val(data.trPhone);
|
|
|
|
|
$("#trNnyV").val(data.trNny);
|
|
|
|
|
$("#trAgeV").val(data.trAge);
|
|
|
|
|
$("#trVisaV").val(data.trVisa);
|
|
|
|
|
$("#trEduV").val(data.trEdu);
|
|
|
|
|
$("#trCftV").val(data.trCft);
|
|
|
|
|
$("#aptDtV").val(data.aptDt);
|
|
|
|
|
$("#dmlYnV").val(data.dmlYn);
|
|
|
|
|
$("#remarkV").val(data.remark);
|
|
|
|
|
// $("#configInfo").empty().append(html)
|
|
|
|
|
// $("#translatorEditModal").modal('show');
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
$(document).ready( function() {
|
|
|
|
|
$("#aptDt").datepicker({
|
|
|
|
|
format: "yyyy-mm-dd",
|
|
|
|
|
language: "ko"
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#approvalTab', function (){
|
|
|
|
|
const trKey = (Number($('.tapTrKey').val()));
|
|
|
|
|
const verNo = (Number($('.tapVerNo').val()));
|
|
|
|
|
const url = '/translator/revisionHistory';
|
|
|
|
|
revisionHistory(trKey,verNo,url);
|
|
|
|
|
document.getElementById('accessTab').classList.remove('active');
|
|
|
|
|
document.getElementById('approvalTab').classList.add('active');
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '#accessTab', function (){
|
|
|
|
|
const trKey = (Number($('.tapTrKey').val()));
|
|
|
|
|
const verNo = (Number($('.tapVerNo').val()));
|
|
|
|
|
const url = '/translator/translatorEditModal';
|
|
|
|
|
revisionHistory(trKey,verNo,url);
|
|
|
|
|
document.getElementById('approvalTab').classList.remove('active');
|
|
|
|
|
document.getElementById('accessTab').classList.add('active');
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
function revisionHistory(trKey,verNo,url){
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: url,
|
|
|
|
|
data: {
|
|
|
|
|
translatorKey: trKey,
|
|
|
|
|
versionNo : verNo
|
|
|
|
|
},
|
|
|
|
|
type: 'GET',
|
|
|
|
|
dataType:"html",
|
|
|
|
|
success: function(html){
|
|
|
|
|
$("#configInfo").empty().append(html)
|
|
|
|
|
$("#translatorEditModal").modal('show');
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(document).on('change', '#trNny', function (){
|
|
|
|
|
if($(this).val() == "NNY001"){
|
|
|
|
|
$("#trVisa").attr("disabled",true);
|
|
|
|
|
}else{
|
|
|
|
|
$("#trVisa").removeAttr("disabled");
|
|
|
|
|
}
|
|
|
|
|
});
|