|
@@ -387,6 +387,7 @@ let listObj = {
|
387
|
387
|
grid: {
|
388
|
388
|
init: function () {
|
389
|
389
|
// 데이터 없을때
|
|
390
|
+ const self=this;
|
390
|
391
|
listObj.empty.push();
|
391
|
392
|
makeGrid({
|
392
|
393
|
gridId: STOCKMNG03010_GRID_ID,
|
|
@@ -407,9 +408,7 @@ let listObj = {
|
407
|
408
|
});
|
408
|
409
|
}, 100);
|
409
|
410
|
},
|
410
|
|
- loadComplete: function(data) {
|
411
|
|
- let param = $('#ITP_FORM_STOCKMNG03010_SEARCH').serializeObject();
|
412
|
|
- const self=this;
|
|
411
|
+ loadComplete: function(data) {
|
413
|
412
|
if(self.sortUse) return;
|
414
|
413
|
self.sortUse=true;
|
415
|
414
|
self['sort9']='asc';
|
|
@@ -421,61 +420,37 @@ let listObj = {
|
421
|
420
|
$(STOCKMNG03010_GRID_LIST).find('th').eq(9).css({cursor:'pointer',background:'#FFEBCD'});
|
422
|
421
|
$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
|
423
|
422
|
const idx=$(this).index();
|
424
|
|
- console.log("xxxx grid header click xxxxxxx index=="+idx, param );
|
425
|
423
|
if( idx==9) {
|
426
|
|
- var field='',sort=self['sort'+idx];
|
|
424
|
+ var sort=self['sort'+idx];
|
427
|
425
|
if(sort ) {
|
428
|
426
|
sort=sort=='asc'?'desc':'asc';
|
429
|
|
- }
|
430
|
|
- const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top';
|
431
|
|
- self['sort'+idx]=sort;
|
432
|
|
- field='itemNm';
|
433
|
|
- param.page=1;
|
434
|
|
- param.sidx=field;
|
435
|
|
- param.sord=sort;
|
436
|
|
- param.pagingYn=false;
|
|
427
|
+ }
|
|
428
|
+ self['sort'+idx]=sort;
|
|
429
|
+ const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top';
|
437
|
430
|
$(this).find('.s-ico').show();
|
438
|
431
|
$(this).find('.ui-grid-ico-sort').hide();
|
439
|
|
- $(this).find(icon).show();
|
440
|
|
- listObj.grid.clearData();
|
441
|
|
- ajaxCall(STOCK_BASE_MNG_DETAIL_GRID_LIST, param, result=>{
|
442
|
|
- const data=result.gridRows;
|
443
|
|
- const rowCnt=data.length;
|
444
|
|
- const container=$('#ITP_STOCKMNG03010_jqGrid_list').closest('#ITP_CONTAINER');
|
445
|
|
- let hei=container.height();
|
446
|
|
- if(hei>300 ) {
|
447
|
|
- hei-=255;
|
448
|
|
- } else {
|
449
|
|
- hei=300;
|
450
|
|
- }
|
451
|
|
- $('#ITP_STOCKMNG03010_jqGrid_list .ui-jqgrid-bdiv').height(hei);
|
452
|
|
- var idx=1;
|
453
|
|
- for(var cur of data ) {
|
454
|
|
- $(STOCKMNG03010_GRID_ID).addRowData(idx++, cur);
|
455
|
|
- }
|
456
|
|
- let viewHtml = '';
|
457
|
|
- viewHtml += '<span class="itp_shrv fix">';
|
458
|
|
- viewHtml += '<span class="shrv_txt">' + ITP_MSG_LOCALE.label.total + '</span>';
|
459
|
|
- viewHtml += '<span class="shrv_num shrv_tot">(<em>' + rowCnt + '</em>)</span>';
|
460
|
|
- viewHtml += '</span>';
|
461
|
|
- $('#ITP_STOCKMNG03010_jqGridView').html(viewHtml).show();
|
462
|
|
- $(STOCKMNG03010_GRID_EMPTY).hide();
|
463
|
|
- }, 'POST');
|
|
432
|
+ $(this).find(icon).show();
|
|
433
|
+ self.search();
|
464
|
434
|
}
|
465
|
435
|
});
|
466
|
436
|
},
|
467
|
|
- });
|
468
|
|
-
|
|
437
|
+ });
|
469
|
438
|
this.search();
|
470
|
439
|
},
|
471
|
440
|
search: function() {
|
|
441
|
+ const self=this;
|
472
|
442
|
pageObj.switchScreen('LIST');
|
473
|
443
|
this.clearData();
|
474
|
444
|
$('#ITP_FORM_STOCKMNG03010_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
475
|
445
|
$('#ITP_FORM_STOCKMNG03010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
476
|
446
|
$('#ITP_FORM_STOCKMNG03010_SEARCH_BRAND_NM').val(fn_make_user_info.get('brandNm'));
|
477
|
447
|
let param = $('#ITP_FORM_STOCKMNG03010_SEARCH').serializeObject();
|
478
|
|
- param.pagingYn=false;
|
|
448
|
+ var idx=9;
|
|
449
|
+ var field='itemNm',sort=self['sort'+idx];
|
|
450
|
+ param.page=1;
|
|
451
|
+ param.sidx=field;
|
|
452
|
+ param.sord=sort;
|
|
453
|
+ param.pagingYn=false;
|
479
|
454
|
ajaxCall(STOCK_BASE_MNG_DETAIL_GRID_LIST, param, result=>{
|
480
|
455
|
const data=result.gridRows;
|
481
|
456
|
const rowCnt=data.length;
|