|
@@ -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 () {
|
|
@@ -193,6 +300,9 @@ let pageObj = {
|
193
|
300
|
case 'ITP_FORM_STINFO05010_DETAIL_DUP' : createObj.button.duplicate(); break; // 중복체크
|
194
|
301
|
case 'ITP_BTN_STINFO05010_RESET_PW' : createObj.button.resetPass(); break; // 상세:비밀번호 초기화
|
195
|
302
|
case 'ITP_BTN_STINFO05010_EXCEL' : listObj.excelDown(); break; // 엑셀 다운로드 버튼
|
|
303
|
+ case 'ITP_BTN_STINFO05010_UPLOAD' : listObj.button.upload(); break; // 엑셀업로드 버튼
|
|
304
|
+ case 'ITP_BTN_STINFO05010_TEMPLATE_DOWNLOAD' : uploadObj.button.downTemplate(); break; // 템플릿 다운로드
|
|
305
|
+ case 'ITP_BTN_STINFO05010_FILE_UPLOAD' : uploadObj.button.uploadFile(); break; // 파일 업로드
|
196
|
306
|
}
|
197
|
307
|
});
|
198
|
308
|
});
|
|
@@ -219,6 +329,8 @@ let pageObj = {
|
219
|
329
|
itp_fn_set_file_upload('ITP_' + id + '_DETAIL_UPLOAD', 'notice', true, false, id, fileArgs);
|
220
|
330
|
},
|
221
|
331
|
switchScreen: function(mode) {
|
|
332
|
+ SCREEN_MODE = mode;
|
|
333
|
+
|
222
|
334
|
$('.itp_det_head').find('button[id^="ITP_BTN_STINFO05010_"]').each(function(i) {
|
223
|
335
|
$(this).hide();
|
224
|
336
|
});
|
|
@@ -228,10 +340,15 @@ let pageObj = {
|
228
|
340
|
if(mode == 'LIST') { // 목록
|
229
|
341
|
itp_fn_fire_window_resize();
|
230
|
342
|
$('#ITP_AJAX_STINFO05010_LIST_CONTAINER').show();
|
231
|
|
- fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_SRH', '#ITP_BTN_STINFO05010_NEWREG']);
|
|
343
|
+ fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_SRH', '#ITP_BTN_STINFO05010_NEWREG', '#ITP_BTN_STINFO05010_UPLOAD']);
|
232
|
344
|
$('#ITP_FORM_STINFO05010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
233
|
345
|
$('#ITP_BTN_STINFO05010_EXCEL').show();
|
234
|
|
- } else if(mode == 'ADD') { // 등록
|
|
346
|
+ } else if(mode == 'UPLOAD') { // 엑셀업로드
|
|
347
|
+ $('#ITP_AJAX_STINFO05010_UPLOAD_CONTAINER').show();
|
|
348
|
+ fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_FILE_UPLOAD','#ITP_BTN_STINFO05010_TEMPLATE_DOWNLOAD','#ITP_BTN_STINFO05010_SAVE', '#ITP_BTN_STINFO05010_CANCELLIST']);
|
|
349
|
+ $('#ITP_FORM_STINFO05010_UPLOAD_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
350
|
+
|
|
351
|
+ }else if(mode == 'ADD') { // 등록
|
235
|
352
|
$('#ITP_AJAX_STINFO05010_DETAIL_CONTAINER').show();
|
236
|
353
|
fn_show_btn_auth_array(['#ITP_BTN_STINFO05010_CANCELLIST', '#ITP_BTN_STINFO05010_SAVE']);
|
237
|
354
|
|
|
@@ -298,6 +415,11 @@ let listObj = {
|
298
|
415
|
if(!fn_make_user_info.isEmpty()) {
|
299
|
416
|
createObj.init();
|
300
|
417
|
}
|
|
418
|
+ },
|
|
419
|
+ upload: function() {
|
|
420
|
+ if(!fn_make_user_info.isEmpty()) {
|
|
421
|
+ uploadObj.init();
|
|
422
|
+ }
|
301
|
423
|
}
|
302
|
424
|
},
|
303
|
425
|
form: function() {
|
|
@@ -546,21 +668,67 @@ let createObj = {
|
546
|
668
|
listObj.grid.search();
|
547
|
669
|
},
|
548
|
670
|
save: function() {
|
549
|
|
- const formId = '#ITP_FORM_STINFO05010_DETAIL';
|
550
|
671
|
|
551
|
|
- $('#ITP_FORM_STINFO05010_DETAIL_UNIT').removeAttr('disabled');
|
552
|
|
- itp_fn_form_clear_validate(null, formId);
|
553
|
|
-
|
554
|
|
- if (itp_fn_form_event.isValid(formId)) {
|
555
|
|
- itp_fn_form_event.removeChar(formId);
|
556
|
|
- let param = $(formId).serializeObject();
|
557
|
|
- // console.log(JSON.stringify(param));
|
558
|
|
- var searhFn = function() {
|
559
|
|
- ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
|
560
|
|
- $('#ITP_FORM_STINFO05010_DETAIL_UNIT').attr('disabled', true);
|
561
|
|
- listObj.grid.search();
|
|
672
|
+ if(SCREEN_MODE == 'UPLOAD') { // 엑셀 일괄저장
|
|
673
|
+ // 그리드 체크
|
|
674
|
+ var reccount = $(STINFO05010_UPLOAD_GRID_ID).getGridParam("reccount");
|
|
675
|
+ if(reccount < 1) {
|
|
676
|
+ return;
|
|
677
|
+ }
|
|
678
|
+ let check = true;
|
|
679
|
+ const rowData = $(STINFO05010_UPLOAD_GRID_ID).getRowData();
|
|
680
|
+ $.each(rowData, function(key, value) {
|
|
681
|
+ if(check) {
|
|
682
|
+ if(value.normalYn != 'ok') {
|
|
683
|
+ check = false;
|
|
684
|
+ }
|
|
685
|
+ }
|
|
686
|
+ });
|
|
687
|
+ if(!check) {
|
|
688
|
+ itp_fn_modal_alert_ajax('비정상 데이터가 포함되어 있습니다.');
|
|
689
|
+ return;
|
|
690
|
+ }
|
|
691
|
+
|
|
692
|
+ var modalFn = {
|
|
693
|
+ callBack: () => {
|
|
694
|
+ const formId = '#ITP_FORM_STINFO05010_UPLOAD';
|
|
695
|
+
|
|
696
|
+ let gridInsertData = [];
|
|
697
|
+ $.each(rowData, function(key, value) {
|
|
698
|
+ gridInsertData.push(value);
|
|
699
|
+ });
|
|
700
|
+
|
|
701
|
+ let param = $(formId).serializeObject();
|
|
702
|
+ param.list = gridInsertData;
|
|
703
|
+
|
|
704
|
+ var searhFn = function() {
|
|
705
|
+ ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
|
|
706
|
+ listObj.grid.search();
|
|
707
|
+ };
|
|
708
|
+ // console.log("excel save ==> ", param);
|
|
709
|
+ fn_ajax_call(API_DETAIL_SAVE_LIST, JSON.stringify(param), searhFn, 'POST');
|
|
710
|
+ }
|
562
|
711
|
};
|
563
|
|
- fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
|
712
|
+ itp_fn_modal_confirm('저장 하시겠습니까?', modalFn);
|
|
713
|
+
|
|
714
|
+ } else {
|
|
715
|
+
|
|
716
|
+ const formId = '#ITP_FORM_STINFO05010_DETAIL';
|
|
717
|
+
|
|
718
|
+ $('#ITP_FORM_STINFO05010_DETAIL_UNIT').removeAttr('disabled');
|
|
719
|
+ itp_fn_form_clear_validate(null, formId);
|
|
720
|
+
|
|
721
|
+ if (itp_fn_form_event.isValid(formId)) {
|
|
722
|
+ itp_fn_form_event.removeChar(formId);
|
|
723
|
+ let param = $(formId).serializeObject();
|
|
724
|
+ // console.log(JSON.stringify(param));
|
|
725
|
+ var searhFn = function() {
|
|
726
|
+ ITP_FORM_STINFO05010_DETAIL_IS_WRITING = false;
|
|
727
|
+ $('#ITP_FORM_STINFO05010_DETAIL_UNIT').attr('disabled', true);
|
|
728
|
+ listObj.grid.search();
|
|
729
|
+ };
|
|
730
|
+ fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
|
731
|
+ }
|
564
|
732
|
}
|
565
|
733
|
}
|
566
|
734
|
}
|
|
@@ -654,3 +822,154 @@ var popSearch = {
|
654
|
822
|
}
|
655
|
823
|
}
|
656
|
824
|
};
|
|
825
|
+
|
|
826
|
+/* 엑셀업로드 화면 */
|
|
827
|
+let uploadObj = {
|
|
828
|
+ init: function () {
|
|
829
|
+ this.grid.init();
|
|
830
|
+
|
|
831
|
+ },
|
|
832
|
+ button: {
|
|
833
|
+ downTemplate: function() {
|
|
834
|
+ var lidx = window.location.href.lastIndexOf('/');
|
|
835
|
+ window.location.assign(window.location.href.substring(0, lidx) + '/excel_template/contract_upload_v1.xlsx');
|
|
836
|
+ },
|
|
837
|
+ uploadFile: function() {
|
|
838
|
+ uploadObj.grid.clearData();
|
|
839
|
+console.log("file upload ====first first==========================");
|
|
840
|
+ // 파일선택
|
|
841
|
+ $('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').click();
|
|
842
|
+ console.log("file upload ====end endend==========================");
|
|
843
|
+ },
|
|
844
|
+ makeExcelDataList: function(excelData) {
|
|
845
|
+ console.log("file upload ===========33333333333333333333333====================");
|
|
846
|
+ var processArray = [];
|
|
847
|
+ for(var n=2; n<excelData.length; n++ ) {
|
|
848
|
+ var data=excelData[n];
|
|
849
|
+ var processData = {viewCd:'C'};
|
|
850
|
+ processData.itemId = data.A.toString();
|
|
851
|
+ processData.spplyId = data.B.toString();
|
|
852
|
+ processData.contSttDt = data.C.toString();
|
|
853
|
+ processData.contEndDt = data.D.toString();
|
|
854
|
+ processData.curr = data.E.toString();
|
|
855
|
+ processData.unitAmt = data.F.toString();
|
|
856
|
+ processData.leadTime = data.G.toString();
|
|
857
|
+ processData.storeSaleUnitAmt = data.H.toString();
|
|
858
|
+ processArray.push(processData);
|
|
859
|
+ }
|
|
860
|
+ console.log("file upload ===============4444444444444444444================");
|
|
861
|
+ // 그리드 체크
|
|
862
|
+ var reccount = processArray.length;
|
|
863
|
+ if(reccount < 1) {
|
|
864
|
+ itp_fn_modal_alert_ajax('단가계약 업로드 데이터가 없습니다');
|
|
865
|
+ return;
|
|
866
|
+ }
|
|
867
|
+ const formId = '#ITP_FORM_STINFO05010_UPLOAD';
|
|
868
|
+ const brandId=fn_make_user_info.get('brandId'), list = [];
|
|
869
|
+ for(var cur of processArray ) {
|
|
870
|
+ list.push(cur);
|
|
871
|
+ }
|
|
872
|
+console.log("file upload ========555555555555555555=======================");
|
|
873
|
+ ajaxCall('/api/itemunit/chk-contract-list', {brandId, list}, function(result) {
|
|
874
|
+ if(result.errorCnt !=0 ) {
|
|
875
|
+ itp_fn_modal_alert_ajax('단가계약 업로드 오류가 '+result.errorCnt+ ' 건 있습니다. 오류내역 확인후 다시 업로드 하세요');
|
|
876
|
+ }
|
|
877
|
+ var grid=$(STINFO05010_UPLOAD_GRID_ID);
|
|
878
|
+ for(var cur of result.itemList) {
|
|
879
|
+ $(STINFO05010_UPLOAD_GRID_ID).jqGrid('addRow', {position: 'last'});
|
|
880
|
+ var rowId = $('#ITP_STINFO05010_UPLOAD_jqGrid .jqgrow').last().attr('id');
|
|
881
|
+ console.log("xxxxxxx", cur, rowId);
|
|
882
|
+ grid.jqGrid('setCell', rowId, 'viewCd', 'C');
|
|
883
|
+ grid.jqGrid('setCell', rowId, 'normalYn', cur.resultCd=='00'?'ok': '<font color=red>오류</font>');
|
|
884
|
+ grid.jqGrid('setCell', rowId, 'errorMsg', cur.resultCd!='00'?cur.resultMsg:'');
|
|
885
|
+ grid.jqGrid('setCell', rowId, 'itemId', cur.itemId);
|
|
886
|
+ grid.jqGrid('setCell', rowId, 'itemNm', cur.itemNm);
|
|
887
|
+ grid.jqGrid('setCell', rowId, 'spplyId', cur.spplyId);
|
|
888
|
+ grid.jqGrid('setCell', rowId, 'spplyNm', cur.spplyNm);
|
|
889
|
+ grid.jqGrid('setCell', rowId, 'contSttDt', cur.contSttDt);
|
|
890
|
+ grid.jqGrid('setCell', rowId, 'contEndDt', cur.contEndDt);
|
|
891
|
+ grid.jqGrid('setCell', rowId, 'curr', cur.curr);
|
|
892
|
+ grid.jqGrid('setCell', rowId, 'unitAmt', cur.unitAmt);
|
|
893
|
+ grid.jqGrid('setCell', rowId, 'leadTime', cur.leadTime);
|
|
894
|
+ grid.jqGrid('setCell', rowId, 'storeSaleUnitAmt', cur.storeSaleUnitAmt);
|
|
895
|
+ }
|
|
896
|
+ $(STINFO05010_UPLOAD_GRID_EMPTY).hide();
|
|
897
|
+ }, 'POST');
|
|
898
|
+
|
|
899
|
+ }
|
|
900
|
+ },
|
|
901
|
+ change: function() {
|
|
902
|
+ // 파일선택
|
|
903
|
+ $('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').off('change').on('change', function(obj) {
|
|
904
|
+ var input = obj.target;
|
|
905
|
+
|
|
906
|
+ console.log("file upload ===============================");
|
|
907
|
+
|
|
908
|
+ var reader = new FileReader();
|
|
909
|
+ var rABS = !!reader.readAsBinaryString;
|
|
910
|
+ if( !input.files || input.files.length==0 ) {
|
|
911
|
+ return;
|
|
912
|
+ }
|
|
913
|
+
|
|
914
|
+ console.log("file upload ========1111111111111111=======================");
|
|
915
|
+ reader.onload = function(){
|
|
916
|
+ var fileData = reader.result;
|
|
917
|
+ var wb = XLSX.read(fileData, {type : rABS ? 'binary' : 'array'});
|
|
918
|
+ var sheetNameList = wb.SheetNames; // 시트 이름 목록 가져오기
|
|
919
|
+ var firstSheetName = sheetNameList[0]; // 첫번째 시트명
|
|
920
|
+ var firstSheet = wb.Sheets[firstSheetName]; // 첫번째 시트
|
|
921
|
+ var rowObj =XLSX.utils.sheet_to_json(firstSheet, {header:"A", defval: ""});
|
|
922
|
+ // console.log("excel load length=="+rowObj.length);
|
|
923
|
+
|
|
924
|
+ $('#ITP_FORM_STINFO05010_UPLOAD_EXCEL_UPLOAD_SELECT_FILE').val('');
|
|
925
|
+ if(rowObj.length < 3) {
|
|
926
|
+ itp_fn_modal_alert_ajax('엑셀파일에 단가계약 데이터를 기술하세요.');
|
|
927
|
+ return;
|
|
928
|
+ } else if(rowObj.length > 1001) {
|
|
929
|
+ itp_fn_modal_alert_ajax('엑셀 일괄처리는 최대 1000건까지 가능합니다.');
|
|
930
|
+ return;
|
|
931
|
+ }
|
|
932
|
+ console.log("file upload =============2222222222222222222222==================");
|
|
933
|
+ uploadObj.button.makeExcelDataList(rowObj);
|
|
934
|
+ };
|
|
935
|
+ if(rABS) reader.readAsBinaryString(input.files[0]);
|
|
936
|
+ else reader.readAsArrayBuffer(input.files[0]);
|
|
937
|
+ itp_fn_set_resize(STINFO05010_UPLOAD_GRID_ID, STINFO05010_UPLOAD_GRID_LIST, 'lg');
|
|
938
|
+ });
|
|
939
|
+ },
|
|
940
|
+ grid: {
|
|
941
|
+ init: function () {
|
|
942
|
+ this.search();
|
|
943
|
+ },
|
|
944
|
+ colModel: gridColModel.upload,
|
|
945
|
+ search: function() {
|
|
946
|
+ pageObj.switchScreen('UPLOAD');
|
|
947
|
+ this.unload();
|
|
948
|
+ this.load();
|
|
949
|
+ },
|
|
950
|
+ load: function() {
|
|
951
|
+ $(STINFO05010_UPLOAD_GRID_ID).jqGrid({
|
|
952
|
+ colModel: gridColModel.upload,
|
|
953
|
+ multiselect: false,
|
|
954
|
+ rownumbers: true,
|
|
955
|
+ }).navGrid(null, ITP_GRID_NAV_DEFAULTS.navGrid);
|
|
956
|
+ gridStatus( STINFO05010_UPLOAD_GRID_ID, 'STINFO04010_UPLOAD', "엑셀 파일업로드로 품목을 추가하세요");
|
|
957
|
+ itp_fn_set_resize(STINFO05010_UPLOAD_GRID_ID, STINFO05010_UPLOAD_GRID_LIST, 'lg');
|
|
958
|
+ var cttHeight=$(STINFO05010_UPLOAD_GRID_LIST).closest('.itp_det_in').height();
|
|
959
|
+ if(cttHeight) {
|
|
960
|
+ cttHeight-=95;
|
|
961
|
+ // console.log("content height == "+cttHeight);
|
|
962
|
+ $(STINFO05010_UPLOAD_GRID_LIST).find('.ui-jqgrid-bdiv').css('max-height', cttHeight+'px');
|
|
963
|
+ }
|
|
964
|
+ },
|
|
965
|
+ clearData : function() {
|
|
966
|
+ $(STINFO05010_UPLOAD_GRID_ID).jqGrid('clearGridData', true);
|
|
967
|
+ $(STINFO05010_UPLOAD_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
968
|
+ $(STINFO05010_UPLOAD_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
969
|
+ $(STINFO05010_UPLOAD_GRID_EMPTY).show();
|
|
970
|
+ },
|
|
971
|
+ unload : function() {
|
|
972
|
+ $.jgrid.gridUnload(STINFO05010_UPLOAD_GRID_ID);
|
|
973
|
+ }
|
|
974
|
+ }
|
|
975
|
+};
|