Selaa lähdekoodia

매장단가 관리 수정 & 그리드 높이 수정

isna 2 vuotta sitten
vanhempi
commit
ee76738ca1

+ 33 - 1
src/main/webapp/js/app/stinfo/ITP_STINFO06010.js

@@ -712,7 +712,14 @@ let modifyObj = {
712 712
 					itp_fn_grid_load_complete(data, STINFO06010_DETAIL_GRID_ID, false, 'number', 'STINFO06010', modifyObj.itp_STINFO06010_search, modifyObj.empty, true, data.gridRecords, true); 
713 713
 					*/
714 714
 					itp_fn_set_resize(STINFO06010_DETAIL_GRID_ID, STINFO06010_DETAIL_GRID_LIST, 'lg');
715
-					$('#ITP_STINFO06010_DETAIL_jqGrid_list .ui-jqgrid-bdiv').height(600); 
715
+					const container=$('#ITP_STINFO06010_DETAIL_jqGrid_list').closest('#ITP_CONTAINER');
716
+					let hei=container.height();
717
+					if(hei>300 ) {
718
+						hei-=210;
719
+					} else {
720
+						hei=300;
721
+					} 
722
+					$('#ITP_STINFO06010_DETAIL_jqGrid_list .ui-jqgrid-bdiv').height(hei); 
716 723
 					const rowCnt = $(STINFO06010_DETAIL_GRID_ID).jqGrid('getGridParam', 'records');
717 724
 					let viewHtml = '';
718 725
 					viewHtml += '<span class="itp_shrv fix">';
@@ -810,6 +817,31 @@ let createObj = {
810 817
 					return;
811 818
 				}
812 819
 			}
820
+			var checkCount=0;
821
+			const checkMap={};
822
+			const checkIncr = function(cur, idx) {
823
+				const itemId=cur.itemId;
824
+				if( cur.unitTargetCd=='Y' && checkMap.hasOwnProperty(itemId)) {
825
+					// 이미 대상인 아이템이 있다면
826
+					const prev=checkMap[itemId];
827
+					$('#jqg_ITP_STINFO06010_DETAIL_jqGrid_'+prev).prop('checked',true);
828
+					$('#jqg_ITP_STINFO06010_DETAIL_jqGrid_'+idx).prop('checked',true);
829
+					checkCount++;
830
+				}
831
+				// 대상인경우 맵에추가
832
+				if( cur.unitTargetCd=='Y' ) {
833
+					checkMap[itemId]=idx;
834
+				}
835
+				return true;
836
+			};
837
+			var idx=1;
838
+			$('#ITP_STINFO06010_DETAIL_jqGrid .cbox.checkbox').prop('checked',false); 
839
+			for(var cur of $(STINFO06010_DETAIL_GRID_ID).getRowData()) {
840
+				checkIncr(cur, idx++);
841
+			}
842
+			if(checkCount>0 ) {
843
+				return itp_fn_modal_alert_ajax(checkCount+ " 개 품목 동일한 대상건이 있습니다 ");
844
+			}
813 845
 			if (isValid) {
814 846
 				itp_fn_grid_save_rows(STINFO06010_DETAIL_GRID_ID);
815 847
 

+ 8 - 1
src/main/webapp/js/app/stockmng/ITP_STOCKMNG03010.js

@@ -413,7 +413,14 @@ let listObj = {
413 413
 			ajaxCall(STOCK_BASE_MNG_DETAIL_GRID_LIST, param, result=>{
414 414
 				const data=result.gridRows; 
415 415
 				const rowCnt=data.length;  
416
-				$('#ITP_STOCKMNG03010_jqGrid_list .ui-jqgrid-bdiv').height(520); 
416
+				const container=$('#ITP_STOCKMNG03010_jqGrid_list').closest('#ITP_CONTAINER');
417
+				let hei=container.height();
418
+				if(hei>300 ) {
419
+					hei-=255;
420
+				} else {
421
+					hei=300;
422
+				} 
423
+				$('#ITP_STOCKMNG03010_jqGrid_list .ui-jqgrid-bdiv').height(hei); 
417 424
 				var idx=1;
418 425
 				for(var cur of data ) {
419 426
 					$(STOCKMNG03010_GRID_ID).addRowData(idx++, cur);