Merge pull request '그리드 날짜 정렬 오류 수정' (#132) from V2026012702 into main
Reviewed-on: #132
This commit was merged in pull request #132.
This commit is contained in:
@@ -101,14 +101,14 @@ var columns = [
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '주문유형', field : 'CATEGORY_NAME', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '90', title : '제품구분', field : 'PRODUCT_NAME', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '국내/해외', field : 'AREA_NAME', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '접수일', field : 'REG_DATE', sorter:"date", sorterParams:{format:"YYYY-MM-DD"} },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '접수일', field : 'REG_DATE', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '120', title : '고객사', field : 'CUSTOMER_NAME', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '80', title : '유/무상', field : 'FREE_OF_CHARGE', sorter:"string"},
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '품번', field : 'PRODUCT_ITEM_CODE', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : '품명', field : 'PRODUCT_ITEM_NAME', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'left', width : '150', title : 'S/N', field : 'SERIAL_NO', sorter:"string" },
|
||||
{headerHozAlign : 'center', hozAlign : 'right', width : '90', title : '수주수량', field : 'CONTRACT_QTY', sorter:"number" },
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '요청납기', field : 'REQ_DEL_DATE', sorter:"date", sorterParams:{format:"YYYY-MM-DD"} }
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '요청납기', field : 'REQ_DEL_DATE', sorter:"string" }
|
||||
],
|
||||
},
|
||||
|
||||
@@ -129,7 +129,7 @@ var columns = [
|
||||
{
|
||||
title:'구매', headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '발주일', field : 'ORDER_DATE', sorter:"date", sorterParams:{format:"YYYY-MM-DD"}},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '발주일', field : 'ORDER_DATE', sorter:"string"},
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '입고율', field : 'RECEIVING_RATE', sorter:"number"}
|
||||
]
|
||||
},
|
||||
@@ -153,7 +153,7 @@ var columns = [
|
||||
{
|
||||
title:'출하', headerHozAlign:'center',
|
||||
columns:[
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '출하일', field : 'SHIPMENT_DATE', sorter:"date", sorterParams:{format:"YYYY-MM-DD"}}
|
||||
{headerHozAlign : 'center', hozAlign : 'center', width : '90', title : '출하일', field : 'SHIPMENT_DATE', sorter:"string"}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
@@ -103,7 +103,7 @@ $(document).ready(function(){
|
||||
// 컬럼 정의 (입고품목 상세 기준) - 신규
|
||||
// =====================================================
|
||||
var columns = [
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:80, widthGrow:1, title:'검사일', field:'INSPECTION_DATE', frozen: true},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:80, widthGrow:1, title:'검사일', field:'INSPECTION_DATE', frozen: true, sorter: "string"},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:70, widthGrow:1, title:'검사자', field:'INSPECTOR_NAME', frozen: true},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:105, widthGrow:1, title:'품의서 No', field:'PROPOSAL_NO', frozen: true},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:105, widthGrow:1, title:'발주서 No', field:'PURCHASE_ORDER_NO', frozen: true},
|
||||
@@ -121,7 +121,7 @@ var columns = [
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'left', minWidth:120, widthGrow:3, title:'부품명', field:'PART_NAME', frozen: true},
|
||||
{headerHozAlign:'center', hozAlign:'left', minWidth:130, widthGrow:2, title:'공급업체', field:'PARTNER_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1, title:'입고일', field:'DELIVERY_DATE'},
|
||||
{headerHozAlign:'center', hozAlign:'center', minWidth:90, widthGrow:1, title:'입고일', field:'DELIVERY_DATE', sorter: "string"},
|
||||
{headerHozAlign:'center', hozAlign:'right', minWidth:80, widthGrow:1, title:'입고수량', field:'DELIVERY_QTY',
|
||||
formatter:"money", formatterParams:{thousand:",", precision:false}
|
||||
},
|
||||
|
||||
@@ -39,6 +39,33 @@ var _columnAppStatus = [{
|
||||
}
|
||||
}];
|
||||
|
||||
// 날짜 컬럼 자동 sorter 적용 (문자열 정렬 사용 - YYYY-MM-DD 형식은 문자열 정렬로도 날짜순 정렬됨)
|
||||
var _dateSorter = "string";
|
||||
|
||||
// 날짜 필드명 패턴 (_DATE로 끝나거나 DATE_로 시작하거나 정확히 일치하는 경우)
|
||||
var _dateFieldExact = ['REGDATE', 'REG_DATE', 'MOD_DATE', 'UPD_DATE', 'START_DATE', 'END_DATE', 'DEPLOY_DATE', 'DELIVERY_DATE', 'ORDER_DATE', 'CONFIRM_DATE', 'APPROVAL_DATE', 'CREATE_DATE', 'UPDATE_DATE', 'INSERT_DATE', 'MODIFY_DATE', 'EFFECTIVE_DATE', 'EXPIRE_DATE', 'DUE_DATE', 'PLAN_DATE', 'ACTUAL_DATE', 'REQUEST_DATE', 'COMPLETE_DATE', 'CLOSE_DATE', 'OPEN_DATE', 'SHIP_DATE', 'RECEIVE_DATE', 'PURCHASE_DATE', 'SALES_DATE', 'CONTRACT_DATE', 'SIGN_DATE', 'ISSUE_DATE', 'VALID_DATE', 'FROM_DATE', 'TO_DATE', 'INSPECTION_DATE'];
|
||||
|
||||
// 컬럼에 날짜 sorter 자동 적용
|
||||
function fnc_applyDateSorter(columns) {
|
||||
for (var i = 0; i < columns.length; i++) {
|
||||
var col = columns[i];
|
||||
// sorter가 이미 정의되지 않은 경우에만 적용
|
||||
if (!col.sorter && col.field) {
|
||||
var fieldUpper = col.field.toUpperCase();
|
||||
// 1. 정확히 일치하는 필드명 체크
|
||||
// 2. _DATE로 끝나는 경우 (예: DEPLOY_DATE, REG_DATE)
|
||||
// 3. DATE_로 시작하는 경우 (예: DATE_FROM, DATE_TO)
|
||||
var isDateField = (_dateFieldExact.indexOf(fieldUpper) > -1) ||
|
||||
(fieldUpper.length > 5 && fieldUpper.substring(fieldUpper.length - 5) === '_DATE') ||
|
||||
(fieldUpper.length > 5 && fieldUpper.substring(0, 5) === 'DATE_');
|
||||
if (isDateField) {
|
||||
col.sorter = _dateSorter;
|
||||
}
|
||||
}
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
|
||||
function fnc_tabul_search(layoutParam, gridObj, searchURL, columnParam, showCheck, showNo, p_selectable, p_movableColumns, isNotSearchFirst, formId, hidePaging, showApp, checkValidation, rowSelectionControl) {
|
||||
|
||||
//alert(document.form1.page.value);
|
||||
@@ -55,7 +82,7 @@ function fnc_tabul_search(layoutParam, gridObj, searchURL, columnParam, showChec
|
||||
var allColumns = [];
|
||||
if(showCheck) allColumns = allColumns.concat(_columnCheck);
|
||||
if(showNo) allColumns = allColumns.concat(_columnNo);
|
||||
allColumns = allColumns.concat(columnParam);
|
||||
allColumns = allColumns.concat(fnc_applyDateSorter(columnParam)); // 날짜 컬럼 자동 sorter 적용
|
||||
if(showApp) allColumns = allColumns.concat(_columnAppStatus);
|
||||
|
||||
gridObj = new Tabulator("#mainGrid", {
|
||||
|
||||
Reference in New Issue
Block a user