소스 검색

창고관리 개발중

marseyes 2 년 전
부모
커밋
1716344bc6
2개의 변경된 파일29개의 추가작업 그리고 24개의 파일을 삭제
  1. 25 0
      src/main/webapp/js/app/config.js
  2. 4 24
      src/main/webapp/js/app/stockmng/ITP_STOCKMNG04010.js

+ 25 - 0
src/main/webapp/js/app/config.js

@@ -2015,6 +2015,31 @@ function itp_fn_grid_add_row(gridId, fn, cm, menuId) {
2015 2015
 	return last_row_id;
2016 2016
 };
2017 2017
 
2018
+function itp_fn_add_grid_row(gridId, fn, cm, menuId) {
2019
+	if (cm !== undefined || typeof cm !== 'undefined') {
2020
+		if (cm !== null) {
2021
+			const cols = $(gridId).jqGrid('getGridParam', 'colModel');
2022
+			for (var i=0; i<cols.length; i++) {
2023
+				for (var j=0; j<cm.length; j++) {
2024
+					if (cols[i].name == cm[j]) {
2025
+						$(gridId).jqGrid('setColProp', cols[i].name, {editable: false});
2026
+					}
2027
+				}
2028
+			}
2029
+		}
2030
+	}
2031
+	$(gridId + '_list').find('.ui-jqgrid-bdiv').css('min-height', 'auto');
2032
+	$('#ITP_' + menuId + '_jqGridEmpty').hide();
2033
+	$(gridId).jqGrid('addRow', {position: 'last'});
2034
+	var rids = $(gridId).jqGrid('getDataIDs');
2035
+	var last_row_id = rids[rids.length - 1];
2036
+	$(gridId).jqGrid('setCell', last_row_id, 'viewCd', 'C');
2037
+	if (fn !== undefined || typeof fn !== 'undefined') {
2038
+		fn(last_row_id, rids.length);
2039
+	}
2040
+	return last_row_id;
2041
+};
2042
+
2018 2043
 function itp_fn_grid_del_row(gridId) {
2019 2044
 	const rowKey = $(gridId).getGridParam('selrow');
2020 2045
     if (!rowKey) {

+ 4 - 24
src/main/webapp/js/app/stockmng/ITP_STOCKMNG04010.js

@@ -147,7 +147,7 @@ const gridColModel = {
147 147
 			label: "로케이션",
148 148
 			width: '10', fixed: false, align: 'center',
149 149
 			sortable: false, editable: true, edittype: 'text',
150
-			editrules: {required: true}
150
+			editrules: {required: false}
151 151
 		},
152 152
 		{
153 153
 			index: 'LOCATION_NM', name: 'locationNm',
@@ -755,29 +755,9 @@ let locInfoObj = {
755 755
 	},
756 756
 	button: {
757 757
 		addRow: function() {
758
-			// 팝업
759
-			var popFn = function(rowDataPop) {
760
-				// 기존등록 데이터
761
-				var exists = '';
762
-				const rowData = $(STOCKMNG04010_DETAIL_GRID_ID).getRowData();
763
-				$.each(rowData, function(key, value) {
764
-					exists = exists + value.authNo + ';';
765
-				});
766
-
767
-				$.each(rowDataPop, function(key, value) {
768
-					if(exists.indexOf(value.authNo) < 0) {
769
-						// 행추가
770
-						$(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('addRow', {position: 'last'});
771
-						var rids = $(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('getDataIDs');
772
-						var last_row_id = rids[rids.length - 1];
773
-						$(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('setCell', last_row_id, 'viewCd', 'C');
774
-						$(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('setCell', last_row_id, 'authNo', value.authNo);
775
-						$(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('setCell', last_row_id, 'authNm', value.authNm);
776
-					}
777
-				});
778
-				$(STOCKMNG04010_DETAIL_GRID_EMPTY).hide();
779
-			};
780
-			fn_call_popup('comm', 'AUTH_SCH_POPUP', '#ITP_ASIDE', popFn, null, 'S');
758
+			// $(STOCKMNG04010_DETAIL_GRID_ID).jqGrid('addRow', {position: 'last'});
759
+			// $(STOCKMNG04010_DETAIL_GRID_EMPTY).hide();
760
+			STOCKMNG04010_DETAIL_GRID_LAST_ROW_ID = itp_fn_add_grid_row(STOCKMNG04010_DETAIL_GRID_ID, undefined, ['location'],'STOCKMNG04010_DETAIL');
781 761
 		},
782 762
 		delRow: function() {
783 763
 			itp_fn_grid_del_row(STOCKMNG04010_DETAIL_GRID_ID);