Преглед изворни кода

단가관리 계약 업로드

dwkim пре 2 година
родитељ
комит
7e0faf911c

+ 24 - 0
src/main/webapp/app/stinfo/STINFO05010.html

@@ -7,8 +7,13 @@
7 7
 					<button type="button" id="ITP_BTN_STINFO05010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8 8
 					<button type="button" id="ITP_BTN_STINFO05010_MODIFY" class="btn btn-success btn-sm UPB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;수정&nbsp;&nbsp;</button>
9 9
 					<button type="button" id="ITP_BTN_STINFO05010_NEWREG" class="btn btn-primary btn-sm NEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;신규등록&nbsp;&nbsp;</button>
10
+					
11
+					<button type="button" id="ITP_BTN_STINFO05010_TEMPLATE_DOWNLOAD" class="btn btn-primary btn-sm UPLD"><i class="glyphicon "></i>&nbsp;&nbsp;템플릿다운로드&nbsp;&nbsp;</button>
12
+					<button type="button" id="ITP_BTN_STINFO05010_FILE_UPLOAD" class="btn btn-warning btn-sm UPLD"><i class="glyphicon "></i>&nbsp;&nbsp;파일업로드&nbsp;&nbsp;</button>
13
+					
10 14
 					<button type="button" id="ITP_BTN_STINFO05010_SAVE" class="btn btn-success btn-sm SAB"><i class="glyphicon "></i>&nbsp;&nbsp;저장&nbsp;&nbsp;</button>
11 15
 					<button type="button" id="ITP_BTN_STINFO05010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
16
+					<button type="button" id="ITP_BTN_STINFO05010_UPLOAD" class="btn btn-warning btn-sm UPLD"><i class="glyphicon"></i>&nbsp;&nbsp;엑셀업로드&nbsp;&nbsp;</button>
12 17
 				</div>				
13 18
 			</div>
14 19
 			<div class="itp_det_in">
@@ -79,6 +84,25 @@
79 84
 						</div>
80 85
 					</div>
81 86
 				</div>
87
+				
88
+				<div id="ITP_AJAX_STINFO05010_UPLOAD_CONTAINER">
89
+					<form id="ITP_FORM_STINFO05010_UPLOAD" class="form-horizontal">
90
+						<input type="hidden" id="ITP_FORM_STINFO05010_UPLOAD_BRAND_ID" name="brandId" />
91
+						<input id="ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE" type="file" style="display:none;" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
92
+															
93
+					</form>
94
+					
95
+					<div class="itp_table fix">
96
+						<div id="ITP_STINFO05010_UPLOAD_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
97
+							<div id="ITP_STINFO05010_UPLOAD_jqGridView" class="itp_views fix"></div>
98
+							<table id="ITP_STINFO05010_UPLOAD_jqGrid"></table>
99
+							<div id="ITP_STINFO05010_UPLOAD_jqGridPager"></div>
100
+							<div id="ITP_STINFO05010_UPLOAD_jqGridEmpty" class="itp_no_data"></div>
101
+						</div>
102
+					</div>
103
+				</div>
104
+				
105
+				
82 106
 				<div id="ITP_AJAX_STINFO05010_DETAIL_CONTAINER">
83 107
 					<div class="itp_form itp_type1 fix">
84 108
 						<div class="col-xs-12">

BIN
src/main/webapp/excel_template/contract_upload_v1.xlsx


+ 1 - 1
src/main/webapp/js/app/stinfo/ITP_STINFO04010.js

@@ -1160,7 +1160,7 @@ let uploadObj = {
1160 1160
             $.jgrid.gridUnload(STINFO04010_UPLOAD_GRID_ID);
1161 1161
         }
1162 1162
     }
1163
-}
1163
+};
1164 1164
 
1165 1165
 /*신규화면 Object*/
1166 1166
 let createObj = {

+ 335 - 16
src/main/webapp/js/app/stinfo/ITP_STINFO05010.js

@@ -24,6 +24,12 @@ const STINFO05010_GRID_LIST = '#ITP_STINFO05010_jqGrid_list';
24 24
 const STINFO05010_GRID_PAGER = '#ITP_STINFO05010_jqGridPager';
25 25
 const STINFO05010_GRID_EMPTY = '#ITP_STINFO05010_jqGridEmpty';
26 26
 
27
+const STINFO05010_UPLOAD_GRID_ID = '#ITP_STINFO05010_UPLOAD_jqGrid';
28
+const STINFO05010_UPLOAD_GRID_LIST = '#ITP_STINFO05010_UPLOAD_jqGrid_list';
29
+const STINFO05010_UPLOAD_GRID_PAGER = '#ITP_STINFO05010_UPLOAD_jqGridPager';
30
+const STINFO05010_UPLOAD_GRID_EMPTY = '#ITP_STINFO05010_UPLOAD_jqGridEmpty';
31
+
32
+
27 33
 let ITP_FORM_STINFO05010_DETAIL_IS_DUPLICATE = false;
28 34
 let ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
29 35
 
@@ -32,6 +38,9 @@ let API_DETAIL_GRID_LIST 	= '/api/itemunit/detail-grid-list';	    // 목록
32 38
 let API_DETAIL_INFO 		= '/api/itemunit/info-itemunit';		// 상세
33 39
 let API_DETAIL_SAVE 		= '/api/itemunit/save-itemunit';		// 저장
34 40
 let API_ITEM_CLASS_LEVEL	= '/api/item/class-level-list';			//품목분류 level 검색
41
+let API_DETAIL_SAVE_LIST 	= '/api/itemunit/save-contract-list';		// 일괄저장
42
+
43
+let SCREEN_MODE;
35 44
 
36 45
 /*화면 Grid ColModel*/
37 46
 const gridColModel = {
@@ -116,7 +125,104 @@ const gridColModel = {
116 125
 			width: '11', fixed: false, align: 'center',
117 126
 			sortable: false, hidden: false
118 127
 		}
119
-	]
128
+	],
129
+	upload: [
130
+		{
131
+			index: 'VIEW_CD', name: 'viewCd',
132
+			label: ITP_MSG_LOCALE.label.viewCd,
133
+			width: 0, fixed: false, align: 'center',
134
+			sortable: false, hidden: true
135
+		},
136
+		{
137
+			index: 'NORMAL_YN', name: 'normalYn',
138
+			label: "정상여부",
139
+			width: 60, fixed: false, align: 'center',
140
+			minwidth: 80, 
141
+			sortable: false, editable: false, edittype: 'text',
142
+			editrules: {required: false}
143
+		},
144
+		{
145
+			index: 'ERROR_MSG', name: 'errorMsg',
146
+			label: "에러메시지",
147
+			width: 120, fixed: false, align: 'center',
148
+			minwidth: 100, maxwidth: 300,
149
+			sortable: false, editable: false, edittype: 'text',
150
+			editrules: {required: false}
151
+		},
152
+        {
153
+            index: 'ITEM_ID', name: 'itemId',
154
+            label: ITP_MSG_LOCALE.label.itemId, //품목명
155
+            width: 120, fixed: false, align: 'center',
156
+			minwidth: 100, 
157
+            sortable: false, hidden: false
158
+        },
159
+		{
160
+            index: 'ITEM_NM', name: 'itemNm',
161
+            label: ITP_MSG_LOCALE.label.itemNm, //품목명
162
+            width: 150, fixed: false, align: 'left',
163
+			minwidth: 100, 
164
+            sortable: false, hidden: false
165
+        },
166
+        {
167
+            index: 'SPPLY_ID', name: 'spplyId',
168
+            label: ITP_MSG_LOCALE.label.spplyId, //공급업체번호
169
+            width: 100, fixed: false, align: 'center',
170
+			minwidth: 80, 
171
+            sortable: false, hidden: false
172
+        },
173
+		{
174
+            index: 'SPPLY_NM', name: 'spplyNm',
175
+            label: ITP_MSG_LOCALE.label.spplyNm, //공급업체명
176
+            width: 150, fixed: false, align: 'left',
177
+			minwidth: 100, 
178
+            sortable: false, hidden: false
179
+        },
180
+		{
181
+            index: 'CONT_STT_DT', name: 'contSttDt',
182
+            label: '계약시작일', 
183
+            width: 80, fixed: false, align: 'center',
184
+			minwidth: 80,  
185
+			sortable: false, hidden: false
186
+        },
187
+		{
188
+            index: 'CONT_END_DT', name: 'contEndDt',
189
+            label: '계약종료일', 
190
+            width: 80, fixed: false, align: 'center',
191
+			minwidth: 80,  
192
+			sortable: false, hidden: false
193
+        },
194
+		{
195
+            index: 'CURR', name: 'curr',
196
+            label: '통화', 
197
+            width: 80, fixed: false, align: 'center',
198
+			minwidth: 60,  
199
+			sortable: false, hidden: false
200
+        },
201
+		{
202
+            index: 'UNIT_AMT', name: 'unitAmt',
203
+            label: '단가', 
204
+            width: 80, fixed: false, align: 'right',
205
+			minwidth: 60,  
206
+			sortable: false, hidden: false,
207
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
208
+        },
209
+		{
210
+            index: 'LEAD_TIME', name: 'leadTime',
211
+            label: '리드타임', 
212
+            width: 80, fixed: false, align: 'right', 
213
+			minwidth: 60, 
214
+			sortable: false, hidden: false,
215
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
216
+        },
217
+		{
218
+            index: 'STORE_SALE_UNIT_AMT', name: 'storeSaleUnitAmt',
219
+            label: '매장판매가', 
220
+            width: 80, fixed: false, align: 'right', 
221
+			minwidth: 60, 
222
+			sortable: false, hidden: false,
223
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
224
+        }
225
+    ]
120 226
 };
121 227
 
122 228
 /*화면공통 Object*/
@@ -124,6 +230,7 @@ let pageObj = {
124 230
 	init: function () {
125 231
 		this.ui.init();
126 232
 		this.event.init();
233
+		uploadObj.change();
127 234
 	},
128 235
 	ui: {
129 236
 		init: function () {
@@ -191,6 +298,9 @@ let pageObj = {
191 298
 						case 'ITP_FORM_STINFO05010_DETAIL_DUP'		: createObj.button.duplicate();	break;	// 중복체크
192 299
 						case 'ITP_BTN_STINFO05010_RESET_PW'			: createObj.button.resetPass();	break;	// 상세:비밀번호 초기화
193 300
 						case 'ITP_BTN_STINFO05010_EXCEL'			: listObj.excelDown(); 			break;	// 엑셀 다운로드 버튼
301
+						case 'ITP_BTN_STINFO05010_UPLOAD'			: listObj.button.upload(); 		break;	// 엑셀업로드 버튼
302
+						case 'ITP_BTN_STINFO05010_TEMPLATE_DOWNLOAD'	: uploadObj.button.downTemplate();	break;	// 템플릿 다운로드
303
+                        case 'ITP_BTN_STINFO05010_FILE_UPLOAD'		: uploadObj.button.uploadFile();	break;	// 파일 업로드
194 304
 					}
195 305
 				});
196 306
 			});
@@ -217,6 +327,8 @@ let pageObj = {
217 327
 		itp_fn_set_file_upload('ITP_' + id + '_DETAIL_UPLOAD', 'notice', true, false, id, fileArgs);
218 328
 	},
219 329
 	switchScreen: function(mode) {
330
+		SCREEN_MODE = mode;
331
+		
220 332
 		$('.itp_det_head').find('button[id^="ITP_BTN_STINFO05010_"]').each(function(i) {
221 333
 			$(this).hide();
222 334
 		});
@@ -226,10 +338,15 @@ let pageObj = {
226 338
 		if(mode == 'LIST') { // 목록
227 339
 			itp_fn_fire_window_resize();
228 340
 			$('#ITP_AJAX_STINFO05010_LIST_CONTAINER').show();
229
-			fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_SRH', '#ITP_BTN_STINFO05010_NEWREG']);
341
+			fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_SRH', '#ITP_BTN_STINFO05010_NEWREG', '#ITP_BTN_STINFO05010_UPLOAD']);
230 342
 			$('#ITP_FORM_STINFO05010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
231 343
 			$('#ITP_BTN_STINFO05010_EXCEL').show();
232
-		} else if(mode == 'ADD') { // 등록
344
+		} else if(mode == 'UPLOAD') { // 엑셀업로드
345
+			$('#ITP_AJAX_STINFO05010_UPLOAD_CONTAINER').show();
346
+			fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_FILE_UPLOAD','#ITP_BTN_STINFO05010_TEMPLATE_DOWNLOAD','#ITP_BTN_STINFO05010_SAVE', '#ITP_BTN_STINFO05010_CANCELLIST']);
347
+            $('#ITP_FORM_STINFO05010_UPLOAD_BRAND_ID').val(fn_make_user_info.get('brandId'));
348
+
349
+        }else if(mode == 'ADD') { // 등록
233 350
 			$('#ITP_AJAX_STINFO05010_DETAIL_CONTAINER').show();
234 351
 			fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_CANCELLIST', '#ITP_BTN_STINFO05010_SAVE']);
235 352
 
@@ -296,6 +413,11 @@ let listObj = {
296 413
 			if(!fn_make_user_info.isEmpty()) {
297 414
 				createObj.init();
298 415
 			}
416
+		},
417
+		upload: function() {
418
+			if(!fn_make_user_info.isEmpty()) {
419
+                uploadObj.init();
420
+            }
299 421
 		}
300 422
 	},
301 423
 	form: function() {
@@ -544,21 +666,67 @@ let createObj = {
544 666
 			listObj.grid.search();
545 667
 		},
546 668
 		save: function() {
547
-			const formId = '#ITP_FORM_STINFO05010_DETAIL';
548 669
 			
549
-			$('#ITP_FORM_STINFO05010_DETAIL_UNIT').removeAttr('disabled');
550
-			itp_fn_form_clear_validate(null, formId);
551
-
552
-			if (itp_fn_form_event.isValid(formId)) {
553
-				itp_fn_form_event.removeChar(formId);
554
-				let param = $(formId).serializeObject();
555
-				// console.log(JSON.stringify(param));
556
-				var searhFn = function() {
557
-					ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
558
-					$('#ITP_FORM_STINFO05010_DETAIL_UNIT').attr('disabled', true);
559
-					listObj.grid.search();
670
+			if(SCREEN_MODE == 'UPLOAD') { // 엑셀 일괄저장
671
+				// 그리드 체크
672
+				var reccount = $(STINFO05010_UPLOAD_GRID_ID).getGridParam("reccount");
673
+				if(reccount < 1) {
674
+					return;
675
+				}
676
+				let check = true;
677
+				const rowData = $(STINFO05010_UPLOAD_GRID_ID).getRowData();
678
+				$.each(rowData, function(key, value) {
679
+					if(check) {
680
+						if(value.normalYn != 'ok') {
681
+							check = false;
682
+						}							
683
+					}							
684
+				});
685
+				if(!check) {
686
+					itp_fn_modal_alert_ajax('비정상 데이터가 포함되어 있습니다.');
687
+					return;
688
+				}
689
+				
690
+				var modalFn = {
691
+					callBack: () => {						
692
+						const formId = '#ITP_FORM_STINFO05010_UPLOAD';						
693
+						
694
+						let gridInsertData = [];						
695
+						$.each(rowData, function(key, value) {
696
+							gridInsertData.push(value);
697
+						});
698
+						
699
+						let param = $(formId).serializeObject();                        
700
+						param.list = gridInsertData;
701
+						
702
+						var searhFn = function() {
703
+		                    ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
704
+		                    listObj.grid.search();
705
+		                };
706
+                        // console.log("excel save ==> ", param);
707
+		                fn_ajax_call(API_DETAIL_SAVE_LIST, JSON.stringify(param), searhFn, 'POST');
708
+					}
560 709
 				};
561
-				fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
710
+				itp_fn_modal_confirm('저장 하시겠습니까?', modalFn);				
711
+				
712
+			} else {
713
+			
714
+				const formId = '#ITP_FORM_STINFO05010_DETAIL';
715
+				
716
+				$('#ITP_FORM_STINFO05010_DETAIL_UNIT').removeAttr('disabled');
717
+				itp_fn_form_clear_validate(null, formId);
718
+	
719
+				if (itp_fn_form_event.isValid(formId)) {
720
+					itp_fn_form_event.removeChar(formId);
721
+					let param = $(formId).serializeObject();
722
+					// console.log(JSON.stringify(param));
723
+					var searhFn = function() {
724
+						ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
725
+						$('#ITP_FORM_STINFO05010_DETAIL_UNIT').attr('disabled', true);
726
+						listObj.grid.search();
727
+					};
728
+					fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
729
+				}
562 730
 			}
563 731
 		}
564 732
 	}
@@ -652,3 +820,154 @@ var popSearch = {
652 820
 		}
653 821
 	}
654 822
 };
823
+
824
+/* 엑셀업로드 화면 */
825
+let uploadObj = {
826
+	init: function () {
827
+		this.grid.init();
828
+		
829
+	}, 
830
+	button: {
831
+        downTemplate: function() {
832
+            var lidx = window.location.href.lastIndexOf('/');
833
+			window.location.assign(window.location.href.substring(0, lidx) + '/excel_template/contract_upload_v1.xlsx');
834
+        },
835
+        uploadFile: function() {
836
+        	uploadObj.grid.clearData();
837
+console.log("file upload ====first first==========================");
838
+			// 파일선택
839
+			$('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').click();
840
+			console.log("file upload ====end endend==========================");
841
+        }, 
842
+		makeExcelDataList: function(excelData) {
843
+			console.log("file upload ===========33333333333333333333333====================");
844
+			var processArray = [];
845
+			for(var n=2; n<excelData.length; n++ ) {
846
+                var data=excelData[n]; 
847
+                var processData = {viewCd:'C'};				
848
+				processData.itemId 		= data.A.toString(); 		
849
+				processData.spplyId 	= data.B.toString(); 		
850
+				processData.contSttDt 	= data.C.toString(); 	
851
+				processData.contEndDt 	= data.D.toString(); 	
852
+				processData.curr 		= data.E.toString(); 	
853
+				processData.unitAmt 	= data.F.toString(); 	
854
+				processData.leadTime 	= data.G.toString(); 	
855
+				processData.storeSaleUnitAmt = data.H.toString(); 	
856
+				processArray.push(processData);
857
+			}
858
+			console.log("file upload ===============4444444444444444444================");
859
+            // 그리드 체크
860
+            var reccount = processArray.length;
861
+            if(reccount < 1) {
862
+                itp_fn_modal_alert_ajax('단가계약 업로드 데이터가 없습니다');
863
+                return;
864
+            } 
865
+            const formId = '#ITP_FORM_STINFO05010_UPLOAD';	
866
+            const brandId=fn_make_user_info.get('brandId'), list = [];
867
+            for(var cur of processArray ) {
868
+                list.push(cur);
869
+            }
870
+console.log("file upload ========555555555555555555=======================");
871
+            ajaxCall('/api/itemunit/chk-contract-list', {brandId, list}, function(result) {
872
+                if(result.errorCnt !=0 ) {
873
+                    itp_fn_modal_alert_ajax('단가계약 업로드 오류가 '+result.errorCnt+ ' 건 있습니다. 오류내역 확인후 다시 업로드 하세요');
874
+                }
875
+                var grid=$(STINFO05010_UPLOAD_GRID_ID);
876
+                for(var cur of result.itemList) {
877
+                    $(STINFO05010_UPLOAD_GRID_ID).jqGrid('addRow', {position: 'last'}); 
878
+                    var rowId = $('#ITP_STINFO05010_UPLOAD_jqGrid .jqgrow').last().attr('id');
879
+                    console.log("xxxxxxx", cur, rowId);
880
+                    grid.jqGrid('setCell', rowId, 'viewCd', 'C');					
881
+                    grid.jqGrid('setCell', rowId, 'normalYn', cur.resultCd=='00'?'ok': '<font color=red>오류</font>');  
882
+                    grid.jqGrid('setCell', rowId, 'errorMsg', cur.resultCd!='00'?cur.resultMsg:''); 
883
+                    grid.jqGrid('setCell', rowId, 'itemId', cur.itemId);				
884
+                    grid.jqGrid('setCell', rowId, 'itemNm', cur.itemNm);
885
+                    grid.jqGrid('setCell', rowId, 'spplyId', cur.spplyId);	
886
+                    grid.jqGrid('setCell', rowId, 'spplyNm', cur.spplyNm);	
887
+                    grid.jqGrid('setCell', rowId, 'contSttDt', cur.contSttDt);	
888
+                    grid.jqGrid('setCell', rowId, 'contEndDt', cur.contEndDt);	
889
+                    grid.jqGrid('setCell', rowId, 'curr', cur.curr);	
890
+                    grid.jqGrid('setCell', rowId, 'unitAmt', cur.unitAmt);	
891
+                    grid.jqGrid('setCell', rowId, 'leadTime', cur.leadTime);	
892
+                    grid.jqGrid('setCell', rowId, 'storeSaleUnitAmt', cur.storeSaleUnitAmt);	
893
+                }  
894
+                $(STINFO05010_UPLOAD_GRID_EMPTY).hide();
895
+            }, 'POST');
896
+           
897
+		}
898
+    }, 
899
+	change: function() {
900
+		// 파일선택
901
+        $('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').off('change').on('change', function(obj) {  					
902
+			var input = obj.target;
903
+			
904
+			console.log("file upload ===============================");
905
+			
906
+		    var reader = new FileReader();
907
+			var rABS = !!reader.readAsBinaryString;
908
+            if( !input.files || input.files.length==0 ) {
909
+                return;
910
+            }
911
+
912
+			console.log("file upload ========1111111111111111=======================");
913
+		    reader.onload = function(){
914
+		        var fileData = reader.result;
915
+		        var wb = XLSX.read(fileData, {type : rABS ? 'binary' : 'array'});
916
+		        var sheetNameList = wb.SheetNames; // 시트 이름 목록 가져오기 
917
+		        var firstSheetName = sheetNameList[0]; // 첫번째 시트명
918
+		        var firstSheet = wb.Sheets[firstSheetName]; // 첫번째 시트 
919
+		        var rowObj =XLSX.utils.sheet_to_json(firstSheet, {header:"A", defval: ""});
920
+				// console.log("excel load length=="+rowObj.length);
921
+				
922
+				$('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').val('');
923
+				if(rowObj.length < 3) {
924
+					itp_fn_modal_alert_ajax('엑셀파일에 단가계약 데이터를 기술하세요.');
925
+					return;
926
+				} else if(rowObj.length > 1001) {
927
+					itp_fn_modal_alert_ajax('엑셀 일괄처리는 최대 1000건까지 가능합니다.');
928
+					return;
929
+				}
930
+				console.log("file upload =============2222222222222222222222==================");
931
+				uploadObj.button.makeExcelDataList(rowObj);				
932
+		    };
933
+		    if(rABS) reader.readAsBinaryString(input.files[0]); 
934
+			else reader.readAsArrayBuffer(input.files[0]);	
935
+            itp_fn_set_resize(STINFO05010_UPLOAD_GRID_ID, STINFO05010_UPLOAD_GRID_LIST, 'lg');		
936
+		});
937
+	}, 
938
+	grid: {
939
+        init: function () {
940
+            this.search();
941
+        },
942
+        colModel: gridColModel.upload,
943
+        search: function() {
944
+            pageObj.switchScreen('UPLOAD');
945
+            this.unload();
946
+            this.load();
947
+        },
948
+        load: function() { 
949
+            $(STINFO05010_UPLOAD_GRID_ID).jqGrid({
950
+                colModel: gridColModel.upload, 
951
+                multiselect: false,
952
+		        rownumbers: true,
953
+            }).navGrid(null, ITP_GRID_NAV_DEFAULTS.navGrid);
954
+            gridStatus( STINFO05010_UPLOAD_GRID_ID, 'STINFO04010_UPLOAD', "엑셀 파일업로드로 품목을 추가하세요");
955
+            itp_fn_set_resize(STINFO05010_UPLOAD_GRID_ID, STINFO05010_UPLOAD_GRID_LIST, 'lg');
956
+            var cttHeight=$(STINFO05010_UPLOAD_GRID_LIST).closest('.itp_det_in').height();
957
+            if(cttHeight) {
958
+                cttHeight-=95;
959
+                // console.log("content height == "+cttHeight);
960
+                $(STINFO05010_UPLOAD_GRID_LIST).find('.ui-jqgrid-bdiv').css('max-height', cttHeight+'px');
961
+            }
962
+        },
963
+        clearData : function() {
964
+            $(STINFO05010_UPLOAD_GRID_ID).jqGrid('clearGridData', true);
965
+            $(STINFO05010_UPLOAD_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
966
+            $(STINFO05010_UPLOAD_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
967
+            $(STINFO05010_UPLOAD_GRID_EMPTY).show();
968
+        },
969
+        unload : function() {
970
+            $.jgrid.gridUnload(STINFO05010_UPLOAD_GRID_ID);
971
+        }
972
+    }
973
+};