浏览代码

그리드 올림

whakdo963 2 年之前
父节点
当前提交
6ba4482469

+ 36 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG02010.js

@@ -626,6 +626,42 @@ let listObj = {
626 626
 					$.each(ids, function(idx, rowId) {
627 627
 						$(RTNMNG02010_GRID_ID).jqGrid('setCell', rowId, 'rtnReqUnqNo', '', ITP_GRID_COL_STYLE.link);
628 628
 					});
629
+					const self=this;
630
+					if(self.sortUse) return;
631
+					self.sortUse=true;
632
+					$(RTNMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
633
+					$(RTNMNG02010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(3).css('cursor','pointer');
634
+					$(RTNMNG02010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
635
+						const idx=$(this).index();
636
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
637
+						if(idx==3 || idx==2 ) {
638
+							var field='',sort=self['sort'+idx];
639
+							if(sort ) {
640
+								sort=sort=='asc'?'desc':'asc';
641
+							} else {
642
+								// 등록일 내림차순, 제목 오름차순
643
+								sort=idx==3? 'asc':idx==2? 'desc': 'asc';
644
+							}
645
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
646
+							self['sort'+idx]=sort;
647
+							if(idx==3) {
648
+								field='rtnReqUnqNo';
649
+							} else if(idx==2) {
650
+								field='brandNm';
651
+							} 
652
+							param.page=1;
653
+							param.sidx=field;
654
+							param.sord=sort;
655
+							
656
+							$(RTNMNG02010_GRID_ID).jqGrid('setGridParam',{
657
+								postData:JSON.stringify(param)
658
+							}).trigger('reloadGrid');
659
+							$(this).find('.s-ico').show();
660
+							$(this).find('.ui-grid-ico-sort').hide();
661
+							$(this).find(icon).show();
662
+
663
+						}
664
+					});
629 665
 				},
630 666
 				onPaging: function(action) {
631 667
 					itp_fn_grid_paging(RTNMNG02010_GRID_ID, action, param);

+ 36 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG03011.js

@@ -573,6 +573,42 @@ let listObj = {
573 573
 						if(rs) $(this).closest('td').attr('rowspan', rs);
574 574
 						else if(ds=='none') $(this).closest('td').hide(); 
575 575
 					});
576
+					const self=this;
577
+					if(self.sortUse) return;
578
+					self.sortUse=true;
579
+					$(POMNG03011_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
580
+					$(POMNG03011_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(3).css('cursor','pointer');
581
+					$(POMNG03011_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
582
+						const idx=$(this).index();
583
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
584
+						if(idx==3 || idx==2 ) {
585
+							var field='',sort=self['sort'+idx];
586
+							if(sort ) {
587
+								sort=sort=='asc'?'desc':'asc';
588
+							} else {
589
+								// 등록일 내림차순, 제목 오름차순
590
+								sort=idx==3? 'asc':idx==2? 'desc': 'asc';
591
+							}
592
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
593
+							self['sort'+idx]=sort;
594
+							if(idx==3) {
595
+								field='pchReqUnqNo';
596
+							} else if(idx==2) {
597
+								field='brandNm';
598
+							} 
599
+							param.page=1;
600
+							param.sidx=field;
601
+							param.sord=sort;
602
+							
603
+							$(POMNG03011_GRID_ID).jqGrid('setGridParam',{
604
+								postData:JSON.stringify(param)
605
+							}).trigger('reloadGrid');
606
+							$(this).find('.s-ico').show();
607
+							$(this).find('.ui-grid-ico-sort').hide();
608
+							$(this).find(icon).show();
609
+
610
+						}
611
+					});
576 612
 				}, 
577 613
 			};
578 614
 			itp_fn_grid_make_remote(option);

+ 68 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG04010.js

@@ -349,6 +349,40 @@ let listObj = {
349 349
                     $.each(ids, function(idx, rowId) {
350 350
                         $(RTNMNG04010_GRID_ID).jqGrid('setCell', rowId, 'rtnPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
351 351
                     });
352
+                    const self=this;
353
+					if(self.sortUse) return;
354
+					self.sortUse=true;
355
+					$(RTNMNG04010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
356
+					$(RTNMNG04010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(2).css('cursor','pointer');
357
+					$(RTNMNG04010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
358
+						const idx=$(this).index();
359
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
360
+						if(idx==2 ) {
361
+							var field='',sort=self['sort'+idx];
362
+							if(sort ) {
363
+								sort=sort=='asc'?'desc':'asc';
364
+							} else {
365
+								// 등록일 내림차순, 제목 오름차순
366
+								sort=idx==2? 'asc':idx==1? 'desc': 'asc';
367
+							}
368
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
369
+							self['sort'+idx]=sort;
370
+							if(idx==2) {
371
+								field='rtnPodrUnqNo';
372
+							} 
373
+							param.page=1;
374
+							param.sidx=field;
375
+							param.sord=sort;
376
+							
377
+							$(RTNMNG04010_GRID_ID).jqGrid('setGridParam',{
378
+								postData:JSON.stringify(param)
379
+							}).trigger('reloadGrid');
380
+							$(this).find('.s-ico').show();
381
+							$(this).find('.ui-grid-ico-sort').hide();
382
+							$(this).find(icon).show();
383
+
384
+						}
385
+					});
352 386
 				},
353 387
 				onPaging: function(action) {
354 388
                     itp_fn_grid_paging(RTNMNG04010_GRID_ID, action, param);
@@ -575,6 +609,40 @@ let modifyObj = {
575 609
 						}
576 610
 					}
577 611
 					itp_fn_grid_load_complete(data, RTNMNG04010_DETAIL_GRID_ID, true, 'number', 'RTNMNG04010', modifyObj.itp_RTNMNG04010_search, modifyObj.empty, true, data.gridRecords, true);
612
+					const self=this;
613
+					if(self.sortUse) return;
614
+					self.sortUse=true;
615
+					$(RTNMNG04010_DETAIL_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
616
+					$(RTNMNG04010_DETAIL_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(1).css('cursor','pointer');
617
+					$(RTNMNG04010_DETAIL_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
618
+						const idx=$(this).index();
619
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
620
+						if(idx==1 ) {
621
+							var field='',sort=self['sort'+idx];
622
+							if(sort ) {
623
+								sort=sort=='asc'?'desc':'asc';
624
+							} else {
625
+								// 등록일 내림차순, 제목 오름차순
626
+								sort=idx==1? 'asc':idx==2? 'desc': 'asc';
627
+							}
628
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
629
+							self['sort'+idx]=sort;
630
+							if(idx==1) {
631
+								field='rtnReqUnqNo';
632
+							}
633
+							param.page=1;
634
+							param.sidx=field;
635
+							param.sord=sort;
636
+							
637
+							$(RTNMNG04010_DETAIL_GRID_ID).jqGrid('setGridParam',{
638
+								postData:JSON.stringify(param)
639
+							}).trigger('reloadGrid');
640
+							$(this).find('.s-ico').show();
641
+							$(this).find('.ui-grid-ico-sort').hide();
642
+							$(this).find(icon).show();
643
+
644
+						}
645
+					});
578 646
 				}
579 647
 			};
580 648
 			itp_fn_grid_make_local(option);

+ 40 - 24
src/main/webapp/js/app/rtnmng/ITP_RTNMNG05010.js

@@ -34,30 +34,6 @@ let API_DETAIL_SAVE 	 = '/api/rtnmng/inoutmng/save-retstock';				// 반품처리
34 34
 /*화면 Grid ColModel*/
35 35
 const gridColModel = {
36 36
 	list: [
37
-		{
38
-			index: 'BRAND_ID', name: 'brandId',
39
-			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
40
-			width: '10', fixed: false, align: 'center',
41
-			sortable: false, hidden: true
42
-		},
43
-		{
44
-			index: 'STORE_ID', name: 'storeId',
45
-			label: '매장아이디', 
46
-			width: '10', fixed: false, align: 'center',
47
-			sortable: false, hidden: true
48
-		},
49
-		{
50
-			index: 'COL_PICK_UNQ_NO', name: 'colPickUnqNo',
51
-			label: '수거서번호', 
52
-			width: '10', fixed: false, align: 'center',
53
-			sortable: false, hidden: true
54
-		},
55
-		{
56
-			index: 'COL_PICK_DTL_NO', name: 'colPickDtlNo',
57
-			label: '수거서항번', 
58
-			width: '5', fixed: false, align: 'center',
59
-			sortable: false, hidden: true
60
-		},		
61 37
 		{
62 38
 			index: 'RTN_PODR_UNQ_NO', name: 'rtnPodrUnqNo',
63 39
 			label: '반품발주번호', 
@@ -502,6 +478,46 @@ let listObj = {
502 478
 						var colQty = rowData.colReqQty
503 479
 						$(RTNMNG05010_GRID_ID).jqGrid('setRowData', ids[i], {colQty: colQty});
504 480
 					}
481
+					const self=this;
482
+					if(self.sortUse) return;
483
+					self.sortUse=true;
484
+					$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
485
+					$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(1).css('cursor','pointer');
486
+					$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(2).css('cursor','pointer');
487
+					$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(4).css('cursor','pointer');
488
+					$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
489
+						const idx=$(this).index();
490
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
491
+						if(idx==1 || idx==2 || idx==4) {
492
+							var field='',sort=self['sort'+idx];
493
+							if(sort ) {
494
+								sort=sort=='asc'?'desc':'asc';
495
+							} else {
496
+								// 등록일 내림차순, 제목 오름차순
497
+								sort=idx==1? 'asc':idx==2? 'desc': 'asc';
498
+							}
499
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
500
+							self['sort'+idx]=sort;
501
+							if(idx==1) {
502
+								field='rtnPodrUnqNo';
503
+							} else if(idx==2) {
504
+								field='rtnPodrDtlNo';
505
+							} else if(idx==4) {
506
+								field='itemNm';
507
+							} 
508
+							param.page=1;
509
+							param.sidx=field;
510
+							param.sord=sort;
511
+							
512
+							$(RTNMNG05010_GRID_ID).jqGrid('setGridParam',{
513
+								postData:JSON.stringify(param)
514
+							}).trigger('reloadGrid');
515
+							$(this).find('.s-ico').show();
516
+							$(this).find('.ui-grid-ico-sort').hide();
517
+							$(this).find(icon).show();
518
+
519
+						}
520
+					});
505 521
 				},
506 522
 				onPaging: function(action) {
507 523
 					itp_fn_grid_paging(RTNMNG05010_GRID_ID, action, param);

+ 40 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG06010.js

@@ -277,6 +277,46 @@ let listObj = {
277 277
                     $.each(ids, function(idx, rowId) {
278 278
                         $(RTNMNG06010_GRID_ID).jqGrid('setCell', rowId, 'pchPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
279 279
                     });
280
+                    const self=this;
281
+					if(self.sortUse) return;
282
+					self.sortUse=true;
283
+					$(RTNMNG06010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').css('cursor','default');
284
+					$(RTNMNG06010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(1).css('cursor','pointer');
285
+					$(RTNMNG06010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(2).css('cursor','pointer');
286
+					$(RTNMNG06010_GRID_LIST).find('.ui-jqgrid-labels .ui-th-div').eq(4).css('cursor','pointer');
287
+					$(RTNMNG06010_GRID_LIST).find('.ui-jqgrid-labels>th').on('click', function() {
288
+						const idx=$(this).index();
289
+						console.log("xxxx grid header click xxxxxxx index=="+idx, param );
290
+						if(idx==1 || idx==2 || idx==4) {
291
+							var field='',sort=self['sort'+idx];
292
+							if(sort ) {
293
+								sort=sort=='asc'?'desc':'asc';
294
+							} else {
295
+								// 등록일 내림차순, 제목 오름차순
296
+								sort=idx==1? 'asc':idx==2? 'desc': 'asc';
297
+							}
298
+							const icon=sort=='asc'? '.glyphicon-triangle-bottom': '.glyphicon-triangle-top'; 
299
+							self['sort'+idx]=sort;
300
+							if(idx==1) {
301
+								field='rtnPodrUnqNo';
302
+							} else if(idx==2) {
303
+								field='rtnPodrDtlNo';
304
+							} else if(idx==4) {
305
+								field='itemNm';
306
+							} 
307
+							param.page=1;
308
+							param.sidx=field;
309
+							param.sord=sort;
310
+							
311
+							$(RTNMNG06010_GRID_ID).jqGrid('setGridParam',{
312
+								postData:JSON.stringify(param)
313
+							}).trigger('reloadGrid');
314
+							$(this).find('.s-ico').show();
315
+							$(this).find('.ui-grid-ico-sort').hide();
316
+							$(this).find(icon).show();
317
+
318
+						}
319
+					});
280 320
 				},
281 321
 				onPaging: function(action) {
282 322
                     itp_fn_grid_paging(RTNMNG06010_GRID_ID, action, param);