瀏覽代碼

재고기준관리 정렬처리

isna 2 年之前
父節點
當前提交
9ca1288c0c
共有 1 個文件被更改,包括 32 次插入19 次删除
  1. 32 19
      src/main/webapp/js/app/stockmng/ITP_STOCKMNG03010.js

+ 32 - 19
src/main/webapp/js/app/stockmng/ITP_STOCKMNG03010.js

@@ -408,46 +408,59 @@ let listObj = {
408
 					}, 100);
408
 					}, 100);
409
 				},
409
 				},
410
 				loadComplete: function(data) {
410
 				loadComplete: function(data) {
411
+					let param = $('#ITP_FORM_STOCKMNG03010_SEARCH').serializeObject();
411
 					const self=this;
412
 					const self=this;
412
 					if(self.sortUse) return;
413
 					if(self.sortUse) return;
413
 					self.sortUse=true;
414
 					self.sortUse=true;
414
-					self['sort3']='asc'; 
415
-					const th=$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(3);
415
+					self['sort9']='asc'; 
416
+					const th=$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(9);
416
 					th.find('.s-ico').show();
417
 					th.find('.s-ico').show();
417
 					th.find('.ui-grid-ico-sort').hide();
418
 					th.find('.ui-grid-ico-sort').hide();
418
 					th.find('.glyphicon-triangle-bottom').show();//asc 는 bottom 으로
419
 					th.find('.glyphicon-triangle-bottom').show();//asc 는 bottom 으로
419
-					//$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
420
-					$(STOCKMNG03010_GRID_LIST).find('th').eq(3).css({cursor:'pointer',background:'#FFEBCD'});
420
+					$(STOCKMNG03010_GRID_LIST).find('th').css('cursor','default'); 
421
 					$(STOCKMNG03010_GRID_LIST).find('th').eq(9).css({cursor:'pointer',background:'#FFEBCD'});
421
 					$(STOCKMNG03010_GRID_LIST).find('th').eq(9).css({cursor:'pointer',background:'#FFEBCD'});
422
 					$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
422
 					$(STOCKMNG03010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
423
 						const idx=$(this).index();
423
 						const idx=$(this).index();
424
 						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
424
 						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
425
-						if(idx==3 || idx==9) {
425
+						if( idx==9) {
426
 							var field='',sort=self['sort'+idx];
426
 							var field='',sort=self['sort'+idx];
427
 							if(sort ) {
427
 							if(sort ) {
428
 								sort=sort=='asc'?'desc':'asc';
428
 								sort=sort=='asc'?'desc':'asc';
429
-							} else {
430
-								// 등록일 내림차순, 제목 오름차순
431
-								sort=idx==3? 'asc':idx==9? 'desc': 'asc';
432
-							}
429
+							} 
433
 							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
430
 							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
434
 							self['sort'+idx]=sort;
431
 							self['sort'+idx]=sort;
435
-							if(idx==3) {
436
-								field='location';
437
-							} else if(idx==9) {
438
-								field='itemNm';
439
-							} 
432
+							field='itemNm';
440
 							param.page=1;
433
 							param.page=1;
441
 							param.sidx=field;
434
 							param.sidx=field;
442
 							param.sord=sort;
435
 							param.sord=sort;
443
-							
444
-							$(STOCKMNG03010_GRID_ID).jqGrid('setGridParam',{
445
-								postData:JSON.stringify(param)
446
-							}).trigger('reloadGrid');
436
+							param.pagingYn=false; 
447
 							$(this).find('.s-ico').show();
437
 							$(this).find('.s-ico').show();
448
 							$(this).find('.ui-grid-ico-sort').hide();
438
 							$(this).find('.ui-grid-ico-sort').hide();
449
 							$(this).find(icon).show();
439
 							$(this).find(icon).show();
450
-
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');
451
 						}
464
 						}
452
 					});
465
 					});
453
 				},
466
 				},