forked from HANYANG/HANYANG_MES
1631 lines
57 KiB
PHP
1631 lines
57 KiB
PHP
winmode = typeof(winmode) === "undefined"?'':winmode; //팝업창용
|
|
|
|
//Grid용 클래스. 블록 처리용
|
|
class Tb_class_Detail {
|
|
constructor(){
|
|
let _this = this;
|
|
_this.tblList = "";
|
|
_this.ajax_url = "./condition.ajax.php";
|
|
_this.sdata = {};
|
|
_this.sodata = {};
|
|
}
|
|
|
|
//리스트 로드
|
|
getMainList (sdata) {
|
|
let _this = this;
|
|
_this.sdata = sdata;
|
|
|
|
let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: {
|
|
mode: 'getDetailList',
|
|
BP_CD: sdata?.BP_CD||'',
|
|
SO_DT_ST: sdata?.SO_DT_ST||'',
|
|
SO_DT_ED: sdata?.SO_DT_ED||'',
|
|
MNG_NO: sdata?.MNG_NO||'',
|
|
SO_NO: sdata?.SO_NO||'',
|
|
OFLD: sdata?.OFLD||'',
|
|
OASC: sdata?.OASC||'',
|
|
LINE_NUM: sdata?.LINE_NUM||'',
|
|
NOW_PAGE: sdata?.NOW_PAGE||'',
|
|
},
|
|
success: function (data) {
|
|
if (data.code) {
|
|
_this.tblList.setData(data.data);
|
|
|
|
//page
|
|
putPagiNation({
|
|
...sdata,
|
|
TARGET: ".tabulator-footer-contents",
|
|
PREB_PAGE: data?.data[0]?.PREB_PAGE,
|
|
NEXB_PAGE: data?.data[0]?.NEXB_PAGE,
|
|
LAST_PAGE: data?.data[0]?.LAST_PAGE,
|
|
PAGE_LISTS: data?.data[0]?.PAGE_LISTS?.split('|'),
|
|
callback: (conf)=>{
|
|
_this.getMainList({
|
|
BP_CD: conf?.BP_CD||'',
|
|
SO_DT_ST: conf?.SO_DT_ST||'',
|
|
SO_DT_ED: conf?.SO_DT_ED||'',
|
|
MNG_NO: conf?.MNG_NO||'',
|
|
SO_NO: conf?.SO_NO||'',
|
|
OFLD: conf?.OFLD||'',
|
|
OASC: conf?.OASC||'',
|
|
LINE_NUM: conf?.LINE_NUM||'',
|
|
NOW_PAGE: conf?.NOW_PAGE||'',
|
|
});
|
|
}
|
|
});
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
window.clearTimeout(talert);
|
|
_this.tblList.clearAlert();
|
|
_this.setFilter();
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
//Row 클릭 콜백
|
|
rowClick (e, tgt){
|
|
let _this = this;
|
|
let rowData = tgt.getData();
|
|
if( e.target.classList.contains("btnfile") ) return; //첨부파일시 Row클릭금지
|
|
_this.sodata = rowData;
|
|
|
|
jQuery(tgt.getElement()).siblings().removeClass("user-checked");
|
|
tgt.getElement().classList.add("user-checked");
|
|
|
|
if(rowData.MNG_NO){
|
|
$("#btnPutPlan").attr("disabled", false);
|
|
|
|
Tb_funcs_Spec.getMainList(rowData.MNG_NO);
|
|
$("#btnDelSpec").attr("disabled", false);
|
|
$("#btnPutSpec").attr("disabled", false);
|
|
if( Tb_funcs_Spec.win_pt ){
|
|
Tb_funcs_Spec.win_pt.PSpecLoad(rowData.MNG_NO);
|
|
}
|
|
|
|
Tb_funcs_Route.getMainList(rowData.MNG_NO, rowData.SHAPE_TYPE);
|
|
$("#btnDelRoute").attr("disabled", false);
|
|
$("#btnPutRoute").attr("disabled", false);
|
|
if( Tb_funcs_Route.win_pt ){
|
|
Tb_funcs_Route.win_pt.PRouteLoad(rowData.MNG_NO, rowData.SHAPE_TYPE);
|
|
}
|
|
|
|
Tb_funcs_Cond.getAllList(rowData.MNG_NO);
|
|
if( Tb_funcs_Cond.win_pt ){
|
|
Tb_funcs_Cond.win_pt.PCondLoad('','',rowData.MNG_NO);
|
|
}
|
|
|
|
Tb_funcs_Insp.getAllList(rowData.MNG_NO);
|
|
if( Tb_funcs_Insp.win_pt ){
|
|
Tb_funcs_Insp.win_pt.PInspLoad('','',rowData.MNG_NO);
|
|
}
|
|
|
|
//Tb_funcs_Route.mcTime();
|
|
} else {
|
|
$("#btnDelSpec").attr("disabled", true);
|
|
$("#btnPutSpec").attr("disabled", true);
|
|
$("#btnDelRoute").attr("disabled", true);
|
|
$("#btnPutRoute").attr("disabled", true);
|
|
}
|
|
};
|
|
|
|
setFilter () {
|
|
return false;
|
|
|
|
let _this = this;
|
|
let stdate = document.getElementById("S_SO_DT_ST").value;
|
|
let endate = document.getElementById("S_SO_DT_ED").value;
|
|
|
|
_this.tblList.setFilter(function(data){ //필터링
|
|
return (
|
|
true
|
|
&& ( !document.getElementById("S_BP_NM") || ( (data.ORDR_BP_CD+"|"+data.ORDR_BP_NM).search(document.getElementById("S_BP_NM").value) !== -1 ) )
|
|
&& ( (!stdate || stdate <= data['SO_DT']) && (!endate || endate >= data['SO_DT']) )
|
|
)
|
|
}, '=', true);
|
|
};
|
|
|
|
setPrecision (val) {
|
|
let unit = val.getRow().getData().SO_UNIT;
|
|
let num = 0;
|
|
|
|
switch (unit) {
|
|
case "TN":
|
|
num = 3;
|
|
break;
|
|
case "EA":
|
|
num = 0;
|
|
break;
|
|
}
|
|
|
|
return {'precision':num};
|
|
};
|
|
|
|
//sort
|
|
columnSort(e,tgt) {
|
|
let _this = this;
|
|
let sorters = tgt.getTable().getSorters()[0];
|
|
_this.getMainList({..._this.searchData,OFLD:sorters?.field,OASC:sorters?.dir});
|
|
};
|
|
|
|
popBP () {
|
|
let _this = this;
|
|
|
|
popPartnerList({tgt_id:'#S_BP_CD',tgt_name:'#S_BP_NM'});
|
|
};
|
|
|
|
popDrawList ( cell ){
|
|
let _this = this;
|
|
//팝업 템플릿 로드 후 모달 출력
|
|
Tb_funcs_draw.init(cell.getComponent().getRow());
|
|
};
|
|
|
|
shGFormatter ( cell ) {
|
|
let _this = this;
|
|
return varsSHAPE_GRP[cell.getValue()]?.Code_Exp;
|
|
};
|
|
|
|
shFormatter ( cell ) {
|
|
let _this = this;
|
|
return varsSHAPE_TYPE[cell.getValue()];
|
|
};
|
|
|
|
winOpen (){
|
|
let _this = this;
|
|
if( winmode ) return;
|
|
_this.win_pt = window.open('./condition_win.php?winmode=detail','detail', 'width=1024,height=800');
|
|
}
|
|
|
|
// 라우팅 등록
|
|
putPlan (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'putPlanList',
|
|
'sodata': JSON.stringify(_this.sodata),
|
|
'specdata': JSON.stringify(Tb_funcs_Spec.tblList.getData()),
|
|
'routedata': JSON.stringify(Tb_funcs_Route.tblList.getData()),
|
|
'conddata': JSON.stringify(Tb_funcs_Cond.tblList.getData()),
|
|
'inspdata': JSON.stringify(Tb_funcs_Insp.tblList.getData()),
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("지시되었습니다.");
|
|
_this.getMainList(_this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
//시작 실행
|
|
init () {
|
|
let _this = this;
|
|
let currow = Object.keys(varsCurrency).reduce( (param,key) => {param[key] = `${key} (${varsCurrency[key]})`; return param;}, {});
|
|
|
|
const fields = [
|
|
//{ formatter: "rownum", title: "No", width: "4%", },
|
|
{ field: "LIST_NUM", title: "No", width: "4%", },
|
|
{ field: "MNG_NO", title: "수주번호", width: "10%", },
|
|
// { field: "SO_NO", title: "관리번호", width: "10%", },
|
|
{ field: "ITEM_CD", title: "수주품명", width: "8%", formatter:_this.shGFormatter, },
|
|
{ field: "", title: "규격", width: "25%",
|
|
columns:[
|
|
{ field:"OUT_DIA", title:"OD", width:"5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field:"IN_DIA", title:"ID", width:"5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field:"THICK", title:"TH", width:"5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field:"WIDTH", title:"W", width:"5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field:"LENGTH", title:"L", width:"5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
],
|
|
},
|
|
{ field: "MATR_TYPE", title: "재질", width: "10%", },
|
|
{ field: "", title: "도면", width: "12%",
|
|
columns:[
|
|
{ field:"ASS_DRAW", title:"도면번호", width:"10%", },
|
|
{ field:"ASS_FILE", title:"<i class='fa-solid fa-compass-drafting'></i>", width:"2%",
|
|
formatter: tb_common_funtions.formatterButton,
|
|
formatterParams:{
|
|
btnTitle:'',
|
|
btnClass:'btn btn-sm btn-nobd fa-regular fa-image btnfile',
|
|
cfunc: (cell)=> { _this.popDrawList(cell) },
|
|
event: ['click', 'keyup'],
|
|
},
|
|
},
|
|
],
|
|
},
|
|
{ field: "REQ_DLVY_DT", title: "납기요청일", width: "7%", },
|
|
{ field: "ITEM_NRULE", title: "일품번호<br>기준", width: "6%", visible:false, formatter: (tgt)=>tgt.getValue()=="Y"?"번호":"수량" },
|
|
{ field: "SO_QTY", title: "수량", width: "5%", formatter: tb_common_funtions.formatterNumber, formatterParams: function(cell) { return _this.setPrecision(cell); }, },
|
|
{ field: "SO_UNIT", title: "단위", width: "5%", formatter: tb_common_funtions.formatterSelect, formatterParams: { values: varsUNIT }, },
|
|
{ field: "CURRENCY_CD", title: "화폐", width: "6%", formatter: tb_common_funtions.formatterSelect, formatterParams: { values: currow }, },
|
|
{ field: "PWR_WGT", title: "분철단가", width: "10%", formatter:"money", },
|
|
{ field: "UNIT_WGT", title: "단중단가", width: "10%", formatter:"money", },
|
|
{ field: "", title: "가공단가", width: "10%", formatter:"money", },
|
|
{ field: "SO_NET_AMT_LOC", title: "수주금액", width: "10%", formatter: tb_common_funtions.formatterNumber, /*formatter:"money",*/ },
|
|
{ field: "SIZE_CD", title: "사이즈", width: "10%", },
|
|
{ field: "SHAPE_TYPE", title: "형태(형상)", width: "10%",formatter:_this.shFormatter, },
|
|
{ field: "TOP_TAP", title: "탑탭", width: "10%", },
|
|
{ field: "SID_TAP", title: "사이드탭", width: "10%", },
|
|
{ field: "GROV_TYPE", title: "그루브", width: "10%", },
|
|
{ field: "TILT_FLG", title: "틸트", width: "5%", formatter: tb_common_funtions.formatterCheckboxViewIcon2, },
|
|
{ field: "HOLE_SIZE", title: "홀크기", width: "10%", formatter: tb_common_funtions.formatterNumber, },
|
|
{ field: "PL_HD_TYPE", title: "접시머리", width: "10%", },
|
|
{ field: "REMK", title: "비고", width: "10%", },
|
|
];
|
|
|
|
_this.tblList = new Tabulator("#tblDetailList",{
|
|
//layout: "fitColumns",
|
|
height: "100%",
|
|
data: [], //기본 데이터
|
|
columns: fields, //컬럼 설정
|
|
columnDefaults: { //컬럼 공통 규칙
|
|
sorter:()=>{},
|
|
headerSort: false,
|
|
vertAlign: "middle",
|
|
hozAlign: "center",
|
|
resizable: "header",//Resize 는 헤더에서만 가능
|
|
headerHozAlign: "center", //헤더 정렬
|
|
headerSortTristate: true, //데이터 정렬 => 정/역/초기화
|
|
},
|
|
footerElement:'<ul class="pagination justify-content-center align-items-center mb-1"><li><a class="pn_link npage btn btn-light"><span class="f_page">1</span></a></li></ul>',
|
|
headerSortElement: "<i class='bi'></i>", //정렬 아이콘
|
|
});
|
|
|
|
_this.tblList.on("tableBuilt", () => { //Tabulator 초기 데이터 불러오기 이벤트
|
|
_this.getMainList();
|
|
});
|
|
_this.tblList.on("rowClick", (e,tgt) => { //Tabulator Row Click
|
|
_this.rowClick && _this.rowClick(e,tgt);
|
|
});
|
|
_this.tblList.on("headerClick", (e,tgt) => { //Tabulator cell Edited
|
|
_this.columnSort && _this.columnSort(e,tgt);
|
|
});
|
|
|
|
['click','keypress'].forEach(evt => document.querySelector("#bntListSearch") && document.querySelector("#bntListSearch").addEventListener(evt,()=>{
|
|
_this.searchData = {
|
|
BP_CD: document.querySelector('#S_BP_CD').value||'',
|
|
SO_DT_ST: document.querySelector('#S_SO_DT_ST').value||'',
|
|
SO_DT_ED: document.querySelector('#S_SO_DT_ED').value||'',
|
|
MNG_NO: document.querySelector('#S_MNG_NO').value||'',
|
|
SO_NO: '',//document.querySelector('#S_SO_NO').value||'',
|
|
LINE_NUM: document.querySelector('#S_LINE_NUM').value||'',
|
|
NOW_PAGE: 1,
|
|
} // _this.searchData 는 전체적으로 이용되므로 간략화 금지
|
|
_this.getMainList(_this.searchData)
|
|
}));
|
|
['click','keypress'].forEach(evt => document.querySelector("#S_BP_NM") && document.querySelector("#S_BP_NM").addEventListener(evt,()=>{_this.popBP()}));
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnPutPlan") && document.querySelector("#btnPutPlan").addEventListener(evt,()=>{_this.putPlan()}));
|
|
['change','keydown','keyup'].forEach(evt => document.querySelectorAll("#S_BP_NM, #S_SO_DT_ST, #S_SO_DT_ED").forEach(tgt=>tgt.addEventListener(evt,()=>{_this.setFilter()})));
|
|
};
|
|
}
|
|
|
|
//Grid용 클래스. 블록 처리용
|
|
class Tb_class_Spec {
|
|
constructor(){
|
|
let _this = this;
|
|
_this.tblList = "";
|
|
_this.ajax_url = "./condition.ajax.php";
|
|
_this.mn = "";
|
|
}
|
|
|
|
//리스트 로드
|
|
getMainList (mn) {
|
|
let _this = this;
|
|
_this.mn = mn;
|
|
|
|
let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: { mode: 'getSpecList', MNG_NO: _this.mn },
|
|
success: function (data) {
|
|
if (data.code) {
|
|
for(let i = 0; i<data.data.length; i++) {
|
|
if(data.data[i].DIAMETER) {
|
|
data.data[i].TOL_UPPER = Number(data.data[i].DIAMETER) + Number(data.data[i].STD_TOL_UPPER);
|
|
data.data[i].TOL_LOWER = Number(data.data[i].DIAMETER) + Number(data.data[i].STD_TOL_LOWER);
|
|
}
|
|
}
|
|
_this.tblList.setData(data.data);
|
|
//Tb_funcs_Route?.mcTime();
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
window.clearTimeout(talert);
|
|
_this.tblList.clearAlert();
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
//Row 클릭 콜백
|
|
rowClick (e, tgt){
|
|
let _this = this;
|
|
|
|
jQuery(tgt.getElement()).siblings().removeClass("user-checked");
|
|
tgt.getElement().classList.add("user-checked");
|
|
};
|
|
|
|
//Cell 클릭 콜백
|
|
cellClick (e, tgt){
|
|
let _this = this;
|
|
_this.tgt = tgt;
|
|
};
|
|
|
|
//Cell 변경 콜백
|
|
cellEdited (cell){
|
|
let _this = this;
|
|
let data = cell.getData();
|
|
let row = cell.getRow();
|
|
|
|
data._STATUS_ = data._STATUS_||'U';
|
|
|
|
if(data.DIAMETER) {
|
|
let upp = Number(data.DIAMETER) + Number(data.STD_TOL_UPPER);
|
|
let low = Number(data.DIAMETER) + Number(data.STD_TOL_LOWER);
|
|
row.update({'TOL_UPPER':upp, 'TOL_LOWER':low});
|
|
|
|
// if(!document.getElementById('btnPutInsp').disabled)
|
|
// {
|
|
// Tb_funcs_Insp.tblList.getRows().forEach(row=>{
|
|
// Tb_funcs_Insp.getStdTotal( row.getData() );
|
|
// row.update(row.getData());
|
|
// });
|
|
// }
|
|
}
|
|
|
|
switch (cell.getField()) {
|
|
case "DIAMETER":
|
|
Tb_funcs_Route?.mcTime('m');
|
|
break;
|
|
}
|
|
};
|
|
|
|
delSpec (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'delSpecList',
|
|
'MNG_NO': _this.mn,
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("초기화 되었습니다.");
|
|
_this.getMainList(_this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
// 등록
|
|
putSpec (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'putSpecList',
|
|
'reqdata': JSON.stringify(_this.tblList.getData().filter(row=> row._STATUS_)),
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("저장되었습니다.");
|
|
_this.getMainList(_this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
winOpen (){
|
|
let _this = this;
|
|
if( winmode ) return;
|
|
_this.win_pt = window.open('./condition_win.php?winmode=spec','spec', 'width=1024,height=800');
|
|
}
|
|
|
|
init () {
|
|
let _this = this;
|
|
|
|
const fields = [
|
|
{ formatter: "rownum", title: "No", width: "5%", },
|
|
{ field: "SPEC_ITEM", title: "항목", width: "16%", formatter: tb_common_funtions.formatterSelect, formatterParams: {values: varsITEM_SPEC,}, },
|
|
// { field: "QTY", title: "수량", width: "11%", editor:'input', formatter: tb_common_funtions.formatterNumber, },
|
|
{ field: "DIAMETER", title: "치수", width: "17%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "STD_TOL_UPPER", title: "공차<br>상한", width: "12%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "STD_TOL_LOWER", title: "공차<br>하한", width: "12%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "TOL_UPPER", title: "상한값", width: "17%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "TOL_LOWER", title: "하한값", width: "17%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
];
|
|
|
|
_this.tblList = new Tabulator("#tblSpecList",{
|
|
//layout: "fitColumns",
|
|
height: "100%",
|
|
maxHeight: "100%",
|
|
data: [], //기본 데이터
|
|
columns: fields, //컬럼 설정
|
|
columnDefaults: { //컬럼 공통 규칙
|
|
vertAlign: "middle",
|
|
hozAlign: "center",
|
|
resizable: "header",//Resize 는 헤더에서만 가능
|
|
headerHozAlign: "center", //헤더 정렬
|
|
headerSortTristate: true, //데이터 정렬 => 정/역/초기화
|
|
},
|
|
headerSortElement: "<i class='bi'></i>", //정렬 아이콘
|
|
});
|
|
|
|
_this.tblList.on("rowClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.rowClick && _this.rowClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.cellClick && _this.cellClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellEdited", (cell) => { //Tabulator cell Edited
|
|
_this.cellEdited && _this.cellEdited(cell);
|
|
});
|
|
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnDelSpec") && document.querySelector("#btnDelSpec").addEventListener(evt,()=>{
|
|
kuls_confirm("규격정보 초기화", "규격정보를 초기화 하시겠습니까?", ()=>{ _this.delSpec(); }) }
|
|
));
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnPutSpec") && document.querySelector("#btnPutSpec").addEventListener(evt,()=>{_this.putSpec()}));
|
|
};
|
|
}
|
|
|
|
//Grid용 클래스. 블록 처리용
|
|
class Tb_class_Route {
|
|
constructor(){
|
|
let _this = this;
|
|
_this.tblList = "";
|
|
_this.ajax_url = "./condition.ajax.php";
|
|
_this.upload_ajax_url = "../registration/attfile.ajax.php";
|
|
_this.download_url = "/include/getFile.php";
|
|
_this.mn = "";
|
|
_this.st = "";
|
|
}
|
|
|
|
//리스트 로드
|
|
getMainList (mn, st) {
|
|
let _this = this;
|
|
_this.mn = mn;
|
|
_this.st = st;
|
|
|
|
let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: { mode: 'getRouteList', MNG_NO: _this.mn },
|
|
success: function (data) {
|
|
if (data.code) {
|
|
_this.tblList.setData(data.data);
|
|
//_this.mcTime();
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
window.clearTimeout(talert);
|
|
_this.tblList.clearAlert();
|
|
|
|
//멀티파일 업로더
|
|
if (!_this.uploader) {
|
|
_this.uploader = FilePond.create(document.getElementById("rdrawfilepond"), {
|
|
...filepond_ko_KR,
|
|
name: 'upfile',
|
|
allowMultiple: false,
|
|
maxParallelUploads: 1,
|
|
allowProcess: false,
|
|
instantUpload: true,
|
|
server: {
|
|
url: _this.upload_ajax_url + "?mode=putTempFile",
|
|
process: {
|
|
onload: function (data) {
|
|
data = JSON.parse(data);
|
|
let fdata = data.data;
|
|
let file_name = fdata['file_name'];
|
|
let tmp_name = fdata['tmp_name'];
|
|
let file_size = fdata['file_size'];
|
|
let file_type = fdata['file_type'];
|
|
let oldstt = _this.uploader.cell.getData()['_STATUS_'];
|
|
|
|
_this.uploader.cell.getRow().update({
|
|
file_name,
|
|
tmp_name,
|
|
file_size,
|
|
file_type,
|
|
gubun:'temp',
|
|
RDRAW: new Date(), //포매터 작동용
|
|
_STATUS_: (oldstt!=="I"?oldstt:"U"),
|
|
_FSTATUS_: 'I'
|
|
});
|
|
},
|
|
},
|
|
},
|
|
allowFileSizeValidation: true,
|
|
maxFileSize: 100000000,
|
|
credits: {},
|
|
});
|
|
|
|
document.addEventListener('FilePond:addfilestart', (e) => {
|
|
_this.tblList.alert("미리보기 작성중...");
|
|
});
|
|
document.addEventListener('FilePond:processfiles', (e) => {
|
|
_this.tblList.clearAlert();
|
|
});
|
|
}
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
mcTime (val_change) { //라우팅에 의한 가공시간 계산
|
|
let _this = this;
|
|
|
|
_this.sdm = {}; //SPEC DIAMETER
|
|
_this.ptime = {}; //공정별 시간
|
|
_this.cdata = { //가공조건별 데이터
|
|
ctime: {}, //가공조건별 시간
|
|
cfeed: {}, //가공조건별 feed
|
|
crpms: {}, //가공조건별 RPM 회전수
|
|
cillu: {}, //가공조건별 조도
|
|
clens: {}, //가공조건별 가공길이
|
|
cdepth: {}, //가공조건별 가공깊이
|
|
};
|
|
Tb_funcs_Spec.tblList.getData().forEach(v => {
|
|
_this.sdm['S.'+v['SPEC_ITEM']] = v['DIAMETER']||0;
|
|
});
|
|
|
|
_this.calc_rst = JSON.parse(JSON.stringify(Tb_funcs_Cond.tblList.getData()));
|
|
_this.mcLoop(_this.calc_rst, 'CALC_FEED', _this.sdm, val_change);
|
|
_this.mcLoop(_this.calc_rst, 'CALC_TIME', _this.sdm, val_change);
|
|
|
|
let crst = Tb_funcs_Route.calc_rst;
|
|
Object.keys(crst).forEach( k => {
|
|
let tm_tmp = Number(crst[k].CALC_TIME) * (Number(crst[k].OP_COUNT)||1) + Number(crst[k].EXTRA_TM);
|
|
if( typeof _this.cdata.ctime[crst[k].OP_CD] === "undefined" ) _this.cdata.ctime[crst[k].OP_CD] = {};
|
|
if( typeof _this.cdata.cfeed[crst[k].OP_CD] === "undefined" ) _this.cdata.cfeed[crst[k].OP_CD] = {};
|
|
if( typeof _this.cdata.crpms[crst[k].OP_CD] === "undefined" ) _this.cdata.crpms[crst[k].OP_CD] = {};
|
|
if( typeof _this.cdata.cillu[crst[k].OP_CD] === "undefined" ) _this.cdata.cillu[crst[k].OP_CD] = {};
|
|
if( typeof _this.cdata.clens[crst[k].OP_CD] === "undefined" ) _this.cdata.clens[crst[k].OP_CD] = {};
|
|
if( typeof _this.cdata.cdepth[crst[k].OP_CD] === "undefined" ) _this.cdata.cdepth[crst[k].OP_CD] = {};
|
|
_this.cdata.ctime[crst[k].OP_CD][crst[k].PART_CD] = tm_tmp;
|
|
_this.cdata.cfeed[crst[k].OP_CD][crst[k].PART_CD] = crst[k].FEED;
|
|
_this.cdata.crpms[crst[k].OP_CD][crst[k].PART_CD] = crst[k].RPMS;
|
|
_this.cdata.cillu[crst[k].OP_CD][crst[k].PART_CD] = crst[k].ILLU;
|
|
_this.cdata.cdepth[crst[k].OP_CD][crst[k].PART_CD] = crst[k].DEPTH;
|
|
_this.cdata.clens[crst[k].OP_CD][crst[k].PART_CD] = crst[k].CALC_FEED;
|
|
_this.ptime[crst[k].OP_CD] = (_this.ptime[crst[k].OP_CD]||0) + tm_tmp;
|
|
} );
|
|
|
|
_this.setRouteTime(); //공정별 가공시간 적용
|
|
_this.setCondValue(); //가공조건별 계산된 정보 적용
|
|
};
|
|
|
|
mcLoop (calc, fld, sdmrow, val_change) {
|
|
let _this = this;
|
|
|
|
let loop_en = calc.length;
|
|
let max_loop = 10;
|
|
|
|
//console.log(calc);
|
|
//console.log(sdmrow);
|
|
|
|
while( loop_en > 0 && max_loop > 0 ){
|
|
loop_en = calc.length;
|
|
calc.forEach(sikr => {
|
|
let calf = (sikr[fld]||0).toString(); //fv[0] 는 {S.} {P.} {V.} 이거... sikr 의 소속을 확인해서 fv[1] 앞에 소속 pre 를 붙이고 해당 sdmrow 값을 치환하면... 그전에 sdmrow 가 pre 를 붙이고 있어야 한다.
|
|
[...calf.matchAll(/{(.*?)}/g)].forEach( fv => {
|
|
let nvars = '';
|
|
if( Array.isArray(fv[1].match(/^S\./)) ){
|
|
nvars = fv[1];
|
|
}else{
|
|
nvars = sikr.OP_GRP+'_'+fv[1];
|
|
}
|
|
if( typeof(sdmrow[nvars]) !== "undefined" ){
|
|
sikr[fld] = sikr[fld].replaceAll(fv[0],sdmrow[nvars]||0);
|
|
}else{
|
|
switch( fv[1] ){
|
|
case "MO":
|
|
sikr[fld] = sikr[fld].replaceAll(fv[0],sikr['EXTRA_OD']||0);
|
|
break;
|
|
case "MI":
|
|
sikr[fld] = sikr[fld].replaceAll(fv[0],sikr['EXTRA_ID']||0);
|
|
break;
|
|
case "MT":
|
|
sikr[fld] = sikr[fld].replaceAll(fv[0],sikr['EXTRA_TH']||0);
|
|
break;
|
|
}
|
|
}
|
|
|
|
let feed = sikr.OP_FEED||'';
|
|
let rpms = sikr.OP_RPMS;
|
|
sikr.ILLU = sikr.OP_ILLU||'';
|
|
switch( sikr['OP_GRP'] ){ //FEED 및 RPM 구하기
|
|
case "FIN": //정삭 기준
|
|
if( sdmrow['S.OD'] ){
|
|
if( val_change ){
|
|
feed = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'FF');
|
|
rpms = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'FT');
|
|
sikr.ILLU = 12.5;
|
|
}
|
|
sikr[fld] = sikr[fld].replaceAll("{FEED}",feed||1);
|
|
sikr.FEED = feed;
|
|
sikr.RPMS = rpms;
|
|
}
|
|
break;
|
|
case "AAS": //투공 기준
|
|
if( sdmrow['S.IT'] ){
|
|
if( val_change ){
|
|
feed = _this.getFeed('HOLE', sikr['SHAPE_TYPE'], sdmrow['S.IT'], '');
|
|
}
|
|
sikr[fld] = sikr[fld].replaceAll("{FEED}",feed||1);
|
|
sikr.FEED = feed;
|
|
sikr.RPMS = rpms;
|
|
}
|
|
break;
|
|
case "SAM": //시편 기준
|
|
if( val_change ){
|
|
feed = 0.3; //시편 샘플링 표준치
|
|
}
|
|
sikr[fld] = sikr[fld].replaceAll("{FEED}",feed||1);
|
|
sikr.FEED = feed;
|
|
sikr.RPMS = rpms;
|
|
break;
|
|
case "RGH" : //기타 황삭 기준
|
|
if( sdmrow['S.OD'] ){
|
|
if( val_change ){
|
|
feed = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'RF');
|
|
rpms = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'RT');
|
|
}
|
|
sikr[fld] = sikr[fld].replaceAll("{FEED}",feed||1);
|
|
sikr.VC = sikr[fld];
|
|
sikr.FEED = feed;
|
|
sikr.RPMS = rpms;
|
|
sikr.DEPTH = 10;
|
|
}
|
|
case "PRG":
|
|
if( sdmrow['S.OD'] ){
|
|
// if( val_change ){
|
|
// feed = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'RF');
|
|
// rpms = _this.getFeed('TURN', sikr['SHAPE_TYPE'], sdmrow['S.OD'], 'RT');
|
|
// }
|
|
|
|
}
|
|
}
|
|
sikr.DEPTH = sikr.OP_DEPTH||'';
|
|
if( val_change ){
|
|
sikr.DEPTH = 10;
|
|
}
|
|
switch( sikr['OP_GRP'] ){
|
|
case "PRG":
|
|
sikr.DEPTH = 15;
|
|
break;
|
|
case "RGH":
|
|
sikr.DEPTH = 10;
|
|
break;
|
|
}
|
|
});
|
|
|
|
if( [...calf.matchAll(/{(.*?)}/g)].length === 0 ){
|
|
if( fld === "CALC_TIME" ){
|
|
if( !sikr['evtdone'] ){
|
|
sikr[fld] = eval(sikr[fld])// * Number(sikr['OP_COUNT']||1) + Number(sikr['EXTRA_TM']||0);
|
|
sikr['evtdone'] = true;
|
|
sdmrow['T.'+sikr.PART_CD] = sikr[fld];
|
|
sdmrow[sikr.OP_GRP+'_T.'+sikr.PART_CD] = sikr[fld];
|
|
}
|
|
}else{
|
|
if( !sikr['evddone'] ){
|
|
//console.log(sikr.OP_GRP+'_P.'+sikr.PART_CD + ' => ' + sikr[fld]);
|
|
sikr[fld] = eval(sikr[fld]);
|
|
sikr['evddone'] = true;
|
|
sdmrow['P.'+sikr.PART_CD] = sikr[fld];
|
|
sdmrow[sikr.OP_GRP+'_P.'+sikr.PART_CD] = sikr[fld];
|
|
}
|
|
}
|
|
loop_en--;
|
|
}else{
|
|
//console.log(calf.matchAll(/{(.*?)}/g));
|
|
}
|
|
});
|
|
max_loop--;
|
|
}
|
|
}
|
|
|
|
getFeed (cond, shape, val, mode){
|
|
let _this = this;
|
|
|
|
let fdata = varsProcCond[cond][shape].filter( bf => Number(val) >= Number(bf.START_SIZE) && Number(val) <= Number(bf.END_SIZE) );
|
|
if( fdata.length ){
|
|
fdata = fdata[0];
|
|
switch( cond ){
|
|
case "HOLE":
|
|
if( mode ){
|
|
return [fdata.HOLE_TURN_ST,HOLE_TURN_ED];
|
|
}else{
|
|
return fdata.HOLE_FEED;
|
|
}
|
|
case "RATE":
|
|
//추후에
|
|
return false;
|
|
case "SHARE":
|
|
//추후에
|
|
return false;
|
|
case "TURN":
|
|
switch( mode ){
|
|
case "FF":
|
|
return fdata.FINISH_FEED;
|
|
case "RF":
|
|
return fdata.ROUGH_FEED;
|
|
case "FT":
|
|
return fdata.FINISH_TURN;
|
|
break;
|
|
case "RT":
|
|
return fdata.ROUGH_TURN;
|
|
}
|
|
if( mode == "FF" ){
|
|
}else{
|
|
}
|
|
case "WTAMT":
|
|
//후추에
|
|
return false;
|
|
}
|
|
}else{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
setRouteTime(){
|
|
let _this = this;
|
|
|
|
let Rdata = Tb_funcs_Route.tblList.getData();
|
|
Rdata.forEach( row => {
|
|
//row['STD_TACT_TM'] = _this.ptime[row['OP_CD']]?(Math.round(_this.ptime[row['OP_CD']]*1000)/1000):'';
|
|
row['STD_TACT_TM'] = _this.ptime[row['OP_CD']]?Math.round(_this.ptime[row['OP_CD']]):'';
|
|
} );
|
|
Tb_funcs_Route.tblList.replaceData(Rdata);
|
|
}
|
|
|
|
setCondValue(){
|
|
let _this = this;
|
|
|
|
let Cdata = Tb_funcs_Cond.tblList.getData();
|
|
Cdata.forEach( row => {
|
|
row['SPEC_SIZE'] = _this.cdata.clens[row.OP_CD][row.PART_CD];
|
|
row['OP_SIZE'] = Number(_this.cdata.clens[row.OP_CD][row.PART_CD]) + Number(row.EXTRA_OD) + Number(row.EXTRA_ID) + Number(row.EXTRA_TH);
|
|
row['OP_FEED'] = _this.cdata.cfeed[row.OP_CD][row.PART_CD];
|
|
row['OP_RPMS'] = _this.cdata.crpms[row.OP_CD][row.PART_CD];
|
|
row['OP_ILLU'] = _this.cdata.cillu[row.OP_CD][row.PART_CD];
|
|
row['OP_DEPTH'] = _this.cdata.cdepth[row.OP_CD][row.PART_CD];
|
|
row['TACT_TM'] = Math.round(_this.cdata.ctime[row.OP_CD][row.PART_CD]);
|
|
} );
|
|
Tb_funcs_Cond.tblList.replaceData(Cdata);
|
|
}
|
|
|
|
//등록
|
|
uploadFile (cell){
|
|
let _this = this;
|
|
_this.uploader.cell = cell;
|
|
_this.uploader.browse();
|
|
};
|
|
|
|
formatterRemk (cell, formatterParams) {
|
|
let _this = formatterParams._this;
|
|
let rowData = cell.getData();
|
|
|
|
let icon = document.createElement("a");
|
|
icon.className = "btn btn-sm btn-nobd bi bi-justify-left btnfile btnPopover";
|
|
['click','keyup'].forEach(evt => icon.addEventListener(evt, function(){
|
|
Tb_funcs_remk.init(rowData);
|
|
}));
|
|
|
|
return icon;
|
|
}
|
|
|
|
formatterPopover (cell, formatterParams) {
|
|
let _this = formatterParams._this;
|
|
|
|
let icon = document.createElement("a");
|
|
let rowData = cell.getData();
|
|
if( rowData['file_name'] ){
|
|
icon.className = "btn btn-sm btn-nobd fa-solid fa-ellipsis btnfile btnPopover";
|
|
let popover = new bootstrap.Popover(icon, {
|
|
content: "<div>" +
|
|
"<div class='mb-1'><a href='###' class='btn btn-sm pl-3 pr-3 btn-primary btn-rview'>조회</a></div>" +
|
|
"<div class='mb-1'><a href='###' class='btn btn-sm pl-3 pr-3 btn-info btn-rmod'>수정</a></div>" +
|
|
"<div class='mb-1'><a href='###' class='btn btn-sm pl-3 pr-3 btn-danger btn-rdel text-white'>삭제</a></div>" +
|
|
"</div>",
|
|
html: true,
|
|
trigger: "manual",
|
|
});
|
|
['mouseenter','focus'].forEach(evt => popover._element.addEventListener(evt,()=>{
|
|
if( !popover._isShown() ){
|
|
document.querySelectorAll(".btnPopover").forEach(tgt => bootstrap.Popover.getInstance(tgt).hide());
|
|
popover.show(); //tip 보이기 (tip은 매번 새로 만들어진다)
|
|
['mouseleave','blur'].forEach(e => popover.tip.addEventListener(e,()=>popover.hide())); //tip 숨기기 (삭제한다)
|
|
|
|
['click','keyup'].forEach(e => {
|
|
popover.tip.querySelector(".btn-rview").addEventListener(e,()=>{ //조회
|
|
let file_url = _this.download_url+"?gubun="+rowData['gubun']+"&nid="+rowData['MNG_NO']+"&sid="+rowData['OP_CD']+"&file_id="+rowData['file_id']+"&tmp_name="+rowData['tmp_name']+"&name="+rowData['file_name']+"&size="+rowData['file_size'];
|
|
|
|
pop_filedown(file_url, rowData['file_name'].split(".").pop());
|
|
})
|
|
popover.tip.querySelector(".btn-rmod").addEventListener(e,()=>{ //수정
|
|
_this.uploadFile(cell);
|
|
})
|
|
popover.tip.querySelector(".btn-rdel").addEventListener(e,()=>{ //삭제
|
|
let oldstt = cell.getData()['_STATUS_'];
|
|
cell.getRow().update({_STATUS_: (oldstt!=="I"?oldstt:"U"), _FSTATUS_:'D', file_name:'', RDRAW: new Date()});
|
|
popover.hide();
|
|
})
|
|
});
|
|
}
|
|
}));
|
|
}else{
|
|
icon.className = "btn btn-sm btn-nobd fa-regular fa-image btnfile btnfiles";
|
|
['click','keyup'].forEach(evt => icon.addEventListener(evt, function(){
|
|
_this.uploadFile(cell);
|
|
}));
|
|
}
|
|
return icon;
|
|
}
|
|
|
|
//Row 클릭 콜백
|
|
rowClick (e, tgt){
|
|
let _this = this;
|
|
if( e.target.classList.contains("btnfile") ) return; //첨부파일시 Row클릭금지
|
|
|
|
jQuery(tgt.getElement()).siblings().removeClass("user-checked");
|
|
tgt.getElement().classList.add("user-checked");
|
|
|
|
Tb_funcs_Cond.getMainList(_this.st, tgt.getData().OP_SEQ, _this.mn);
|
|
if( Tb_funcs_Cond.win_pt ){
|
|
Tb_funcs_Cond.win_pt.PCondLoad(_this.st, tgt.getData().OP_SEQ, _this.mn);
|
|
}
|
|
$("#btnDelCond").attr("disabled", false);
|
|
$("#btnPutCond").attr("disabled", false);
|
|
|
|
Tb_funcs_Insp.getMainList(_this.st, tgt.getData().OP_SEQ, _this.mn);
|
|
if( Tb_funcs_Insp.win_pt ){
|
|
Tb_funcs_Insp.win_pt.PInspLoad(_this.st, tgt.getData().OP_SEQ, _this.mn);
|
|
}
|
|
$("#btnDelInsp").attr("disabled", false);
|
|
$("#btnPutInsp").attr("disabled", false);
|
|
};
|
|
|
|
//Cell 클릭 콜백
|
|
cellClick (e, tgt){
|
|
let _this = this;
|
|
_this.tgt = tgt;
|
|
|
|
let rowData = tgt.getData();
|
|
switch( tgt.getField() ){
|
|
case "RDRAW":
|
|
//_this.uploadFile(tgt);
|
|
break;
|
|
case "file_url":
|
|
location.href = _this.download_url+"?gubun="+rowData['gubun']+"&nid="+rowData['nid']+"&sid="+rowData['sid']+"&file_id="+rowData['file_id']+"&tmp_name="+rowData['tmp_name']+"&name="+rowData['file_name']+"&size="+rowData['file_size'];
|
|
break;
|
|
}
|
|
};
|
|
|
|
//Cell 변경 콜백
|
|
cellEdited (cell){
|
|
let _this = this;
|
|
cell.getData()._STATUS_ = cell.getData()._STATUS_||'U';
|
|
};
|
|
|
|
delRoute (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'delRouteList',
|
|
'MNG_NO': _this.mn,
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("초기화 되었습니다.");
|
|
_this.getMainList(_this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
// 라우팅 등록
|
|
putRoute (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'putRouteList',
|
|
'reqdata': JSON.stringify(_this.tblList.getData().filter(row=> row._STATUS_)),
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("저장되었습니다.");
|
|
_this.getMainList(_this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
winOpen (){
|
|
let _this = this;
|
|
if( winmode ) return;
|
|
_this.win_pt = window.open('./condition_win.php?winmode=route','route', 'width=1024,height=800');
|
|
}
|
|
|
|
init () {
|
|
let _this = this;
|
|
|
|
const fields = [
|
|
{ field: "OP_SEQ", title: "공순", width: "10%", },
|
|
{ field: "OP_CD", title: "공정명", width: "26%", formatter: tb_common_funtions.formatterSelect, formatterParams: {values: varOPGRP.reduce( (r,v) => {
|
|
return Object.assign(r, v.OPTIONS.reduce( (rev,vo) => {
|
|
rev[vo.OP_CD]=vo.OP_NM; return rev;
|
|
}, {} ) );
|
|
}, {} ),}, },
|
|
{ field: "STD_SETUP_TM", title: "SET UP<br>(분)", width: "16%", editor:'number', },
|
|
{ field: "STD_TACT_TM", title: "가공시간<br>(분)", width: "20%", /*editor:'input',*/ },
|
|
{ field: "REMK", title: "지시<br>사항", width: "14%", formatter: _this.formatterRemk, formatterParams: { _this }, },
|
|
{ field: "RDRAW", title: "도면", width: "14%", formatter: _this.formatterPopover, formatterParams: { _this } },
|
|
];
|
|
|
|
_this.tblList = new Tabulator("#tblRouteList",{
|
|
//layout: "fitColumns",
|
|
height: "100%",
|
|
maxHeight: "100%",
|
|
data: [], //기본 데이터
|
|
columns: fields, //컬럼 설정
|
|
columnDefaults: { //컬럼 공통 규칙
|
|
vertAlign: "middle",
|
|
hozAlign: "center",
|
|
resizable: "header",//Resize 는 헤더에서만 가능
|
|
headerHozAlign: "center", //헤더 정렬
|
|
headerSortTristate: true, //데이터 정렬 => 정/역/초기화
|
|
},
|
|
headerSortElement: "<i class='bi'></i>", //정렬 아이콘
|
|
});
|
|
|
|
_this.tblList.on("rowClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.rowClick && _this.rowClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.cellClick && _this.cellClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellEdited", (cell) => { //Tabulator cell Edited
|
|
_this.cellEdited && _this.cellEdited(cell);
|
|
});
|
|
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnDelRoute") && document.querySelector("#btnDelRoute").addEventListener(evt,()=>{
|
|
kuls_confirm("공정정보 초기화", "공정정보를 초기화 하시겠습니까?", ()=>{ _this.delRoute(); }) }
|
|
));
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnPutRoute") && document.querySelector("#btnPutRoute").addEventListener(evt,()=>{_this.putRoute()}));
|
|
};
|
|
}
|
|
|
|
//Grid용 클래스. 블록 처리용
|
|
class Tb_class_Cond {
|
|
constructor(){
|
|
let _this = this;
|
|
_this.tblList = "";
|
|
_this.ajax_url = "./condition.ajax.php";
|
|
_this.st = "";
|
|
_this.seq = 0;
|
|
_this.mn = "";
|
|
}
|
|
|
|
getAllList (mn) {
|
|
let _this = this;
|
|
_this.mn = mn;
|
|
|
|
let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: { mode: 'getCondList', MNG_NO:mn },
|
|
success: function (data) {
|
|
if (data.code) {
|
|
_this.tblList.setData(data.data);
|
|
_this.getMainList('','');
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
window.clearTimeout(talert);
|
|
_this.tblList.clearAlert();
|
|
}
|
|
});
|
|
return true;
|
|
}
|
|
//리스트 로드
|
|
getMainList (st, seq, mn) {
|
|
let _this = this;
|
|
_this.st = st;
|
|
_this.seq = seq;
|
|
_this.mn = mn;
|
|
|
|
_this.tblList.setFilter(function(data){ //필터링
|
|
return data.SHAPE_TYPE === st && data.OP_SEQ === seq
|
|
}, '=', true);
|
|
|
|
// let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
// ajax_json({
|
|
// url: _this.ajax_url,
|
|
// data: { mode: 'getCondList', SHAPE_TYPE:_this.st, OP_SEQ:_this.seq, MNG_NO:mn },
|
|
// success: function (data) {
|
|
// if (data.code) {
|
|
// _this.tblList.setData(data.data);
|
|
// }else{
|
|
// kuls_alert(data.mesg);
|
|
// }
|
|
// },
|
|
// error: function (request, status, error) {
|
|
// kuls_alert(error.message);
|
|
// },
|
|
// complete: function () {
|
|
// window.clearTimeout(talert);
|
|
// _this.tblList.clearAlert();
|
|
// }
|
|
// });
|
|
return true;
|
|
};
|
|
|
|
//Row 클릭 콜백
|
|
rowClick (e, tgt){
|
|
let _this = this;
|
|
|
|
jQuery(tgt.getElement()).siblings().removeClass("user-checked");
|
|
tgt.getElement().classList.add("user-checked");
|
|
};
|
|
|
|
//Cell 클릭 콜백
|
|
cellClick (e, tgt){
|
|
let _this = this;
|
|
_this.tgt = tgt;
|
|
|
|
//switch( tgt.getField() ){
|
|
// case "DLVY_BP_NM":
|
|
// popPartnerList({tgt_id:'DLVY_BP_CD', tgt_name:'DLVY_BP_NM', tgt_currency:'CURRENCY_CD'}, tgt.getRow()._row);
|
|
// break;
|
|
//}
|
|
};
|
|
|
|
//Cell 변경 콜백
|
|
cellEdited (cell){
|
|
let _this = this;
|
|
cell.getData()._STATUS_ = cell.getData()._STATUS_||'U';
|
|
|
|
Tb_funcs_Route.mcTime();
|
|
};
|
|
|
|
delCond (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'delCondList',
|
|
'MNG_NO': _this.mn,
|
|
'OP_SEQ': _this.seq,
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("초기화 되었습니다.");
|
|
_this.getMainList(_this.st, _this.seq, _this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
// 라우팅 등록
|
|
putCond (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'putCondList',
|
|
'reqdata': JSON.stringify(_this.tblList.getData().filter(row=> row._STATUS_)),
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("저장되었습니다.");
|
|
_this.getMainList(_this.st, _this.seq, _this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
winOpen (){
|
|
let _this = this;
|
|
if( winmode ) return;
|
|
_this.win_pt = window.open('./condition_win.php?winmode=cond','cond', 'width=1024,height=800');
|
|
};
|
|
|
|
init () {
|
|
let _this = this;
|
|
|
|
const fields = [
|
|
{ formatter: "rownum", title: "No", width: "5%", },
|
|
{ field: "PART_CD", title: "가공부위", width: "16%", formatter: tb_common_funtions.formatterSelect, formatterParams: { values: varsOP_PART }, },
|
|
{ field: "SPEC_SIZE", title: "도면<br>치수", width: "7%", },
|
|
{ field: "", title: "가공여유",
|
|
columns:[
|
|
{ field: "EXTRA_OD", title: "외경", width: "5%", editor:"number", cssClass:"font09 p-0", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':0}; }, },
|
|
{ field: "EXTRA_ID", title: "내경", width: "5%", editor:"number", cssClass:"font09 p-0", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':0}; }, },
|
|
{ field: "EXTRA_TH", title: "두께", width: "5%", editor:"number", cssClass:"font09 p-0", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':0}; }, },
|
|
],
|
|
},
|
|
{ field: "OP_SIZE", title: "가공<br>치수", width: "7%", },
|
|
{ field: "", title: "가공조건",
|
|
columns:[
|
|
{ field: "OP_ILLU", title: "조도", width: "7%", editor:'number', editable:(cell)=>{ let val = cell.getData(); return val.OP_GRP === 'FIN' },
|
|
formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':1}; },},
|
|
{ field: "OP_RPMS", title: "회전수", width: "7%", },
|
|
{ field: "OP_FEED", title: "FEED", width: "6%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':0}; }, },
|
|
{ field: "OP_DEPTH", title: "깊이", width: "6%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':0}; }, },
|
|
{ field: "OP_COUNT", title: "횟수", width: "6%", editor:'number', },
|
|
]
|
|
},
|
|
{ field: "EXTRA_TM", title: "추가시간<br>(분)", width: "9%", editor:'number', },
|
|
{ field: "TACT_TM", title: "가공시간<br>(분)", width: "9%", /*editor:'input',*/ },
|
|
];
|
|
|
|
_this.tblList = new Tabulator("#tblCondList",{
|
|
//layout: "fitColumns",
|
|
height: "100%",
|
|
maxHeight: "100%",
|
|
data: [], //기본 데이터
|
|
columns: fields, //컬럼 설정
|
|
columnDefaults: { //컬럼 공통 규칙
|
|
vertAlign: "middle",
|
|
hozAlign: "center",
|
|
resizable: "header",//Resize 는 헤더에서만 가능
|
|
headerHozAlign: "center", //헤더 정렬
|
|
headerSortTristate: true, //데이터 정렬 => 정/역/초기화
|
|
},
|
|
headerSortElement: "<i class='bi'></i>", //정렬 아이콘
|
|
});
|
|
|
|
_this.tblList.on("rowClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.rowClick && _this.rowClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.cellClick && _this.cellClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellEdited", (cell) => { //Tabulator cell Edited
|
|
_this.cellEdited && _this.cellEdited(cell);
|
|
});
|
|
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnDelCond") && document.querySelector("#btnDelCond").addEventListener(evt,()=>{
|
|
kuls_confirm("가공조건 초기화", "가공조건을 초기화 하시겠습니까?", ()=>{ _this.delCond(); }) }
|
|
));
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnPutCond") && document.querySelector("#btnPutCond").addEventListener(evt,()=>{_this.putCond()}));
|
|
};
|
|
}
|
|
|
|
//Grid용 클래스. 블록 처리용
|
|
class Tb_class_Insp {
|
|
constructor(){
|
|
let _this = this;
|
|
_this.tblList = "";
|
|
_this.ajax_url = "./condition.ajax.php";
|
|
_this.st = "";
|
|
_this.seq = 0;
|
|
_this.mn = "";
|
|
}
|
|
|
|
getStdTotal(dt){
|
|
let _this = this;
|
|
|
|
let diameter = Tb_funcs_Spec.tblList.searchData("SPEC_ITEM", "=", dt.INSP_ITEM_CD)[0].DIAMETER;
|
|
if(diameter) {
|
|
dt.SPEC_UPPER = Number(diameter) + Number(dt.STD_TOL_UPPER);
|
|
dt.SPEC_LOWER = Number(diameter) + Number(dt.STD_TOL_LOWER);
|
|
}
|
|
|
|
};
|
|
|
|
getAllList (mn) {
|
|
let _this = this;
|
|
_this.mn = mn;
|
|
|
|
let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: { mode: 'getInspList', MNG_NO:mn },
|
|
success: function (data) {
|
|
if (data.code) {
|
|
_this.tblList.setData(data.data);
|
|
_this.getMainList('','');
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
window.clearTimeout(talert);
|
|
_this.tblList.clearAlert();
|
|
}
|
|
});
|
|
return true;
|
|
}
|
|
|
|
//리스트 로드
|
|
getMainList (st, seq, mn) {
|
|
let _this = this;
|
|
_this.st = st;
|
|
_this.seq = seq;
|
|
_this.mn = mn;
|
|
|
|
_this.tblList.setFilter(function(data){ //필터링
|
|
return data.SHAPE_TYPE === st && data.OP_SEQ === seq
|
|
}, '=', true);
|
|
|
|
// let talert = window.setTimeout(function () { _this.tblList.alert("Loading ...") }, 1000); //1초 이상 지연되면 로딩 출력
|
|
// ajax_json({
|
|
// url: _this.ajax_url,
|
|
// data: { mode: 'getInspList', SHAPE_TYPE:_this.st, OP_SEQ:_this.seq, MNG_NO:mn },
|
|
// success: function (data) {
|
|
// if (data.code) {
|
|
// for(let i=0; i<data.data.length; i++) {
|
|
// _this.getStdTotal(data.data[i]);
|
|
// }
|
|
// _this.tblList.setData(data.data);
|
|
// }else{
|
|
// kuls_alert(data.mesg);
|
|
// }
|
|
// },
|
|
// error: function (request, status, error) {
|
|
// kuls_alert(error.message);
|
|
// },
|
|
// complete: function () {
|
|
// window.clearTimeout(talert);
|
|
// _this.tblList.clearAlert();
|
|
// }
|
|
// });
|
|
return true;
|
|
};
|
|
|
|
//Row 클릭 콜백
|
|
rowClick (e, tgt){
|
|
let _this = this;
|
|
|
|
jQuery(tgt.getElement()).siblings().removeClass("user-checked");
|
|
tgt.getElement().classList.add("user-checked");
|
|
};
|
|
|
|
//Cell 클릭 콜백
|
|
cellClick (e, tgt){
|
|
let _this = this;
|
|
_this.tgt = tgt;
|
|
|
|
//switch( tgt.getField() ){
|
|
// case "DLVY_BP_NM":
|
|
// popPartnerList({tgt_id:'DLVY_BP_CD', tgt_name:'DLVY_BP_NM', tgt_currency:'CURRENCY_CD'}, tgt.getRow()._row);
|
|
// break;
|
|
//}
|
|
};
|
|
|
|
//Cell 변경 콜백
|
|
cellEdited (cell){
|
|
let _this = this;
|
|
|
|
let data = cell.getData();
|
|
let row = cell.getRow();
|
|
|
|
_this.getStdTotal(data);
|
|
|
|
data._STATUS_ = data._STATUS_||'U';
|
|
row.update(data);
|
|
};
|
|
|
|
delInsp (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'delInspList',
|
|
'MNG_NO': _this.mn,
|
|
'OP_SEQ': _this.seq,
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("초기화 되었습니다.");
|
|
_this.getMainList(_this.st, _this.seq, _this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
// 라우팅 등록
|
|
putInsp (){
|
|
let _this = this;
|
|
let postdata = {
|
|
'mode': 'putInspList',
|
|
'reqdata': JSON.stringify(_this.tblList.getData().filter(row=> row._STATUS_)),
|
|
};
|
|
ajax_json({
|
|
url: _this.ajax_url,
|
|
data: postdata,
|
|
success: function (data) {
|
|
if (data.code) {
|
|
kuls_success("저장되었습니다.");
|
|
_this.getMainList(_this.st, _this.seq, _this.mn);
|
|
}else{
|
|
kuls_alert(data.mesg);
|
|
}
|
|
},
|
|
error: function (request, status, error) {
|
|
kuls_alert(error.message);
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
return true;
|
|
};
|
|
|
|
winOpen (){
|
|
let _this = this;
|
|
if( winmode ) return;
|
|
_this.win_pt = window.open('./condition_win.php?winmode=insp','insp', 'width=1024,height=800');
|
|
};
|
|
|
|
init () {
|
|
let _this = this;
|
|
|
|
const fields = [
|
|
{ formatter: "rownum", title: "No", width: "9%", },
|
|
{ field: "INSP_ITEM_CD", title: "검사항목", width: "17%", formatter: tb_common_funtions.formatterSelect, formatterParams: { values: varsITEM_SPEC }, },
|
|
{ field: "INSP_METH", title: "검사방법", width: "16%", formatter: tb_common_funtions.formatterSelect, formatterParams: { values: varsINSP_ITEM }, },
|
|
{ field: "STD_TOL_UPPER", title: "공차상한", width: "16%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "STD_TOL_LOWER", title: "공차하한", width: "16%", editor:'number', formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "SPEC_UPPER", title: "상한값", width: "13%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
{ field: "SPEC_LOWER", title: "하한값", width: "13%", formatter: tb_common_funtions.formatterNumber, formatterParams: function() { return {'precision':3}; }, },
|
|
];
|
|
|
|
_this.tblList = new Tabulator("#tblInspList",{
|
|
//layout: "fitColumns",
|
|
height: "100%",
|
|
maxHeight: "100%",
|
|
data: [], //기본 데이터
|
|
columns: fields, //컬럼 설정
|
|
columnDefaults: { //컬럼 공통 규칙
|
|
vertAlign: "middle",
|
|
hozAlign: "center",
|
|
resizable: "header",//Resize 는 헤더에서만 가능
|
|
headerHozAlign: "center", //헤더 정렬
|
|
headerSortTristate: true, //데이터 정렬 => 정/역/초기화
|
|
},
|
|
headerSortElement: "<i class='bi'></i>", //정렬 아이콘
|
|
});
|
|
|
|
_this.tblList.on("rowClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.rowClick && _this.rowClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellClick", (e,tgt) => { //Tabulator cell Click
|
|
_this.cellClick && _this.cellClick(e,tgt);
|
|
});
|
|
_this.tblList.on("cellEdited", (cell) => { //Tabulator cell Edited
|
|
_this.cellEdited && _this.cellEdited(cell);
|
|
});
|
|
|
|
['click','keypress'].forEach(evt => document.querySelector("#btnDelInsp") && document.querySelector("#btnDelInsp").addEventListener(evt,()=>{
|
|
kuls_confirm("검사규격 초기화", "검사규격을 초기화 하시겠습니까?", ()=>{ _this.delInsp(); }) }
|
|
));
|
|
//['click','keypress'].forEach(evt => document.querySelector("#btnPutInsp") && document.querySelector("#btnPutInsp").addEventListener(evt,()=>{_this.putInsp()}));
|
|
};
|
|
}
|
|
|
|
let varParent = "";
|
|
//let varChild = {};
|
|
function Load_Instance(){ //창에서 사용할 부모 변수
|
|
return {
|
|
Tb_funcs_Detail,
|
|
Tb_funcs_Spec,
|
|
Tb_funcs_Route,
|
|
Tb_funcs_Cond,
|
|
Tb_funcs_Insp
|
|
}
|
|
}
|
|
|
|
if( winmode ){ //부모변수 받기
|
|
varParent = window.opener.Load_Instance();
|
|
|
|
}else{
|
|
// varChild = window.child.Load_Instance();
|
|
}
|
|
|
|
let Tb_funcs_Detail = varParent ? varParent.Tb_funcs_Detail : new Tb_class_Detail() ;
|
|
let Tb_funcs_Spec = varParent ? varParent.Tb_funcs_Spec : new Tb_class_Spec() ;
|
|
let Tb_funcs_Route = varParent ? varParent.Tb_funcs_Route : new Tb_class_Route() ;
|
|
let Tb_funcs_Cond = varParent ? varParent.Tb_funcs_Cond : new Tb_class_Cond() ;
|
|
let Tb_funcs_Insp = varParent ? varParent.Tb_funcs_Insp : new Tb_class_Insp() ;
|
|
let Tb_funcs_remk = new conditionRemkManager();
|
|
let Tb_funcs_draw = new drawManager();
|
|
|
|
switch( winmode ){
|
|
case "detail":
|
|
Tb_funcs_Detail = new Tb_class_Detail();
|
|
document.getElementById('blockDetailList').classList.remove('d-none');
|
|
Tb_funcs_Detail.init();
|
|
Tb_funcs_Detail.tblList.on("tableBuilt",function() { //창에서 수정금지
|
|
Tb_funcs_Detail.tblList.getColumns().forEach( v => v.updateDefinition({editable:false}) );
|
|
Tb_funcs_Detail.getMainList(varParent.Tb_funcs_Detail.sdata);
|
|
});
|
|
break;
|
|
|
|
case "spec":
|
|
Tb_funcs_Spec = new Tb_class_Spec();
|
|
document.getElementById('blockSpecList').classList.remove('d-none');
|
|
Tb_funcs_Spec.init();
|
|
Tb_funcs_Spec.tblList.on("tableBuilt",function() { //창에서 수정금지
|
|
Tb_funcs_Spec.tblList.getColumns().forEach(v => v.updateDefinition({editable: false}));
|
|
Tb_funcs_Spec.getMainList(varParent.Tb_funcs_Spec.mn);
|
|
});
|
|
break;
|
|
|
|
case "route":
|
|
Tb_funcs_Route = new Tb_class_Route();
|
|
document.getElementById('blockRouteList').classList.remove('d-none');
|
|
Tb_funcs_Route.init();
|
|
Tb_funcs_Route.tblList.on("tableBuilt",function() { //창에서 수정금지
|
|
Tb_funcs_Route.tblList.getColumns().forEach(v => v.updateDefinition({editable: false}));
|
|
Tb_funcs_Route.getMainList(varParent.Tb_funcs_Route.mn,varParent.Tb_funcs_Route.st);
|
|
});
|
|
break;
|
|
|
|
case "cond":
|
|
Tb_funcs_Cond = new Tb_class_Cond();
|
|
document.getElementById('blockCondList').classList.remove('d-none');
|
|
Tb_funcs_Cond.init();
|
|
Tb_funcs_Cond.tblList.on("tableBuilt",function(){ //창에서 수정금지
|
|
Tb_funcs_Cond.tblList.getColumns().forEach( v => v.updateDefinition({editable:false}) );
|
|
Tb_funcs_Cond.getMainList(varParent.Tb_funcs_Cond.st,varParent.Tb_funcs_Cond.seq,varParent.Tb_funcs_Cond.mn);
|
|
});
|
|
break;
|
|
|
|
case "insp":
|
|
Tb_funcs_Insp = new Tb_class_Insp();
|
|
document.getElementById('blockInspList').classList.remove('d-none');
|
|
Tb_funcs_Insp.init();
|
|
Tb_funcs_Insp.tblList.on("tableBuilt",function(){ //창에서 수정금지
|
|
Tb_funcs_Insp.tblList.getColumns().forEach( v => v.updateDefinition({editable:false}) );
|
|
Tb_funcs_Insp.getMainList(varParent.Tb_funcs_Insp.st,varParent.Tb_funcs_Insp.seq,varParent.Tb_funcs_Insp.mn);
|
|
});
|
|
break;
|
|
|
|
default:
|
|
Tb_funcs_Detail.init();
|
|
Tb_funcs_Spec.init();
|
|
Tb_funcs_Route.init();
|
|
Tb_funcs_Cond.init();
|
|
Tb_funcs_Insp.init();
|
|
}
|
|
|
|
//아래는 팝업창 기능용
|
|
|
|
function PDetailLoad(mn){
|
|
Tb_funcs_Detail.getMainList(mn)
|
|
}
|
|
|
|
function PSpecLoad(mn){
|
|
Tb_funcs_Spec.getMainList(mn)
|
|
}
|
|
|
|
function PRouteLoad(mn,st){
|
|
Tb_funcs_Route.getMainList(mn,st)
|
|
}
|
|
|
|
function PCondLoad(st,os,mn){
|
|
if( st ){
|
|
Tb_funcs_Cond.getMainList(st,os,mn);
|
|
}else{
|
|
Tb_funcs_Cond.getAllList(mn);
|
|
}
|
|
}
|
|
|
|
function PInspLoad(st,os,mn){
|
|
if( st ){
|
|
Tb_funcs_Insp.getMainList(st,os,mn)
|
|
}else{
|
|
Tb_funcs_Insp.getAllList(mn)
|
|
}
|
|
}
|
|
|
|
window.addEventListener("beforeunload", function(event) { //새로고침이나 페이지 이동시 창강제 닫기
|
|
Tb_funcs_Detail?.win_pt?.close();
|
|
Tb_funcs_Spec?.win_pt?.close();
|
|
Tb_funcs_Route?.win_pt?.close();
|
|
Tb_funcs_Cond?.win_pt?.close();
|
|
Tb_funcs_Insp?.win_pt?.close();
|
|
}); |