품목 API 업데이트
This commit is contained in:
@@ -49,11 +49,16 @@ String connector = person.getUserId();
|
||||
fn_deletePartMng();
|
||||
});
|
||||
|
||||
$("#btnDeploy").click(function(){
|
||||
fn_partMngDeploy();
|
||||
});
|
||||
|
||||
//image src encoding
|
||||
$("#btnDeploy").click(function(){
|
||||
fn_partMngDeploy();
|
||||
});
|
||||
|
||||
//ERP 전송
|
||||
$("#btnSendErp").click(function(){
|
||||
fn_sendErp();
|
||||
});
|
||||
|
||||
//image src encoding
|
||||
$("img").each(function(i) {
|
||||
var imgSrc = $(this).attr("data-SRC");
|
||||
$(this).attr("src", encodeURI(imgSrc));
|
||||
@@ -473,6 +478,56 @@ String connector = person.getUserId();
|
||||
});
|
||||
}
|
||||
|
||||
// ERP 전송 함수
|
||||
function fn_sendErp(){
|
||||
if(confirm("전체 PART 정보를 ERP로 전송하시겠습니까?\n(시간이 다소 소요될 수 있습니다)")){
|
||||
// 로딩 표시
|
||||
Swal.fire({
|
||||
title: '전송 중...',
|
||||
text: 'PART 정보를 ERP로 전송하는 중입니다. 잠시만 기다려주세요.',
|
||||
allowOutsideClick: false,
|
||||
didOpen: () => {
|
||||
Swal.showLoading();
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/admin/sendAllPartsToErp.do",
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
Swal.close();
|
||||
if(data.success){
|
||||
var message = data.message;
|
||||
if(data.errors){
|
||||
message += "\n\n에러 상세:\n" + data.errors;
|
||||
}
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: '전송 완료',
|
||||
text: message,
|
||||
width: '600px'
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '전송 실패',
|
||||
text: data.message
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.close();
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: '오류 발생',
|
||||
text: 'PART 전송 중 오류가 발생했습니다.'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="backcolor">
|
||||
@@ -498,6 +553,7 @@ String connector = person.getUserId();
|
||||
<input type="button" value="도면 다중 업로드" class="plm_btns" id="btnDrawingUpload">
|
||||
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
||||
<input type="button" value="Excel Download" class="plm_btns excelIcon" id="btnExcel">
|
||||
<input type="button" value="ERP 전송" class="plm_btns" id="btnSendErp" style="background-color:#4CAF50;color:white;">
|
||||
<input type="file" id="drawingFiles" multiple style="display:none;" accept=".stp,.step,.dwg,.dxf,.pdf">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -286,18 +286,27 @@ ui-jqgrid tr.jqgrow td {
|
||||
param.dataListJson = JSON.stringify(_tabulGrid.getSelectedData());
|
||||
|
||||
$.ajax({
|
||||
url:"/partMng/partMngDeploy.do",
|
||||
type:"POST",
|
||||
data: param,
|
||||
//data:{"OBJID":OBJID},
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
Swal.fire(data.msg);
|
||||
fn_search();
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
url:"/partMng/partMngDeploy.do",
|
||||
type:"POST",
|
||||
data: param,
|
||||
//data:{"OBJID":OBJID},
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
Swal.fire(data.msg);
|
||||
fn_search();
|
||||
|
||||
// 확정 성공 시 ERP로 전송
|
||||
if(data.result == true || data.result == 'true'){
|
||||
var selectedData = _tabulGrid.getSelectedData();
|
||||
if(selectedData && selectedData.length > 0){
|
||||
var partObjid = selectedData[0].OBJID;
|
||||
fn_sendSinglePartToErp(partObjid);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -577,6 +586,26 @@ ui-jqgrid tr.jqgrow td {
|
||||
window.open(url, target,"width=1520, height=860, menubars=no, scrollbars=yes, resizable=yes");
|
||||
}
|
||||
|
||||
// 단일 PART ERP 전송
|
||||
function fn_sendSinglePartToErp(partObjid){
|
||||
$.ajax({
|
||||
type : "POST",
|
||||
url : "/admin/sendSinglePartToErp.do",
|
||||
data : {partObjid: partObjid},
|
||||
dataType:"json",
|
||||
success:function(data){
|
||||
if(data.success){
|
||||
console.log("ERP 전송 성공: " + data.message);
|
||||
} else {
|
||||
console.log("ERP 전송 실패: " + data.message);
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
console.log("ERP 전송 오류");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="backcolor">
|
||||
|
||||
Reference in New Issue
Block a user