|
@@ -0,0 +1,699 @@
|
|
1
|
+require(['config'], function() {
|
|
2
|
+ require([
|
|
3
|
+ ], function($) {
|
|
4
|
+ pageObj.init();
|
|
5
|
+ });
|
|
6
|
+});
|
|
7
|
+
|
|
8
|
+/********************************************************
|
|
9
|
+ --------------------------------------------------------
|
|
10
|
+ - Object 목록 -
|
|
11
|
+ --------------------------------------------------------
|
|
12
|
+ * const gridColModel = {} : 화면 Grid Object *
|
|
13
|
+ * let pageObj = {} : 화면공통 Object *
|
|
14
|
+ * let listObj = {} : 목록화면 Object *
|
|
15
|
+ * let viewObj = {} : 상세화면 Object *
|
|
16
|
+ * let modifyObj = {} : 수정화면 Object *
|
|
17
|
+ * let createObj = {} : 신규화면 Object *
|
|
18
|
+ * let sfflyObj = {} : 공급업체담당자 Object *
|
|
19
|
+ *******************************************************/
|
|
20
|
+
|
|
21
|
+/*화면 변수*/
|
|
22
|
+const POMNG02010_GRID_ID = '#ITP_POMNG02010_jqGrid';
|
|
23
|
+const POMNG02010_GRID_LIST = '#ITP_POMNG02010_jqGrid_list';
|
|
24
|
+const POMNG02010_GRID_PAGER = '#ITP_POMNG02010_jqGridPager';
|
|
25
|
+const POMNG02010_GRID_EMPTY = '#ITP_POMNG02010_jqGridEmpty';
|
|
26
|
+
|
|
27
|
+const POMNG02010_VIEW_GRID_ID = '#ITP_POMNG02010_VIEW_jqGrid';
|
|
28
|
+const POMNG02010_VIEW_GRID_LIST = '#ITP_POMNG02010_VIEW_jqGrid_list';
|
|
29
|
+const POMNG02010_VIEW_GRID_PAGER = '#ITP_POMNG02010_VIEW_jqGridPager';
|
|
30
|
+const POMNG02010_VIEW_GRID_EMPTY = '#ITP_POMNG02010_VIEW_jqGridEmpty';
|
|
31
|
+
|
|
32
|
+const POMNG02010_DETAIL_GRID_ID = '#ITP_POMNG02010_DETAIL_jqGrid';
|
|
33
|
+const POMNG02010_DETAIL_GRID_LIST = '#ITP_POMNG02010_DETAIL_jqGrid_list';
|
|
34
|
+const POMNG02010_DETAIL_GRID_PAGER = '#ITP_POMNG02010_DETAIL_jqGridPager';
|
|
35
|
+const POMNG02010_DETAIL_GRID_EMPTY = '#ITP_POMNG02010_DETAIL_jqGridEmpty';
|
|
36
|
+
|
|
37
|
+//let ITP_FORM_POMNG02010_DETAIL_IS_DUPLICATE = false;
|
|
38
|
+let ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
|
|
39
|
+
|
|
40
|
+let POMNG02010_GRID_LAST_ROW_ID;
|
|
41
|
+
|
|
42
|
+//let ITP_COMMON_ASSGN_TASK = fn_make_common_cd_list(CODE_LIST, 'ASSGN_TASK', true, '담당업무');
|
|
43
|
+
|
|
44
|
+/*API URL*/
|
|
45
|
+let API_DETAIL_GRID_LIST = '/api/pomng/detail-grid-list'; // 목록
|
|
46
|
+let API_DETAIL_INFO = '/api/pomng/info-pchReq'; // 상세
|
|
47
|
+let API_DETAIL_SAVE = '/api/pomng/save-pchReq'; // 저장
|
|
48
|
+//let API_INTI_PW = '/api/spply/inti-spplyPw'; // 패스워드 초기화
|
|
49
|
+//let API_POP_GRID_LIST = '/api/spply/pop-grid-list'; // 공급사 팝업 그리드 리스트
|
|
50
|
+
|
|
51
|
+/*화면 Grid ColModel*/
|
|
52
|
+const gridColModel = {
|
|
53
|
+ list: [
|
|
54
|
+ {
|
|
55
|
+ index: 'PCH_REQ_UNQ_NO', name: 'pchReqUnqNo',
|
|
56
|
+ label: ITP_MSG_LOCALE.label.pchReqUnqNo
|
|
57
|
+ , //공급업체번호
|
|
58
|
+ width: '10', fixed: false, align: 'center',
|
|
59
|
+ sortable: false, hidden: true
|
|
60
|
+ },
|
|
61
|
+ {
|
|
62
|
+ index: 'BRAND_ID', name: 'brandId',
|
|
63
|
+ label: ITP_MSG_LOCALE.label.brandId, //브랜드ID
|
|
64
|
+ width: '10', fixed: false, align: 'center',
|
|
65
|
+ sortable: false, hidden: true
|
|
66
|
+ },
|
|
67
|
+ {
|
|
68
|
+ index: 'BRAND_NM', name: 'brandNm',
|
|
69
|
+ label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
|
|
70
|
+ width: '10', fixed: false, align: 'center',
|
|
71
|
+ sortable: false, hidden: false
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ index: 'STORE_ID', name: 'storeId',
|
|
75
|
+ label: ITP_MSG_LOCALE.label.storeId, //공급업체명
|
|
76
|
+ width: '13', fixed: false, align: 'center',
|
|
77
|
+ sortable: false, hidden: false
|
|
78
|
+ },
|
|
79
|
+
|
|
80
|
+ {
|
|
81
|
+ index: 'PCH_REQ_NM', name: 'pchReqNm',
|
|
82
|
+ label: ITP_MSG_LOCALE.label.pchReqNm, //사업자등록번호
|
|
83
|
+ width: '13', fixed: false, align: 'center',
|
|
84
|
+ sortable: false, hidden: false
|
|
85
|
+ },
|
|
86
|
+ {
|
|
87
|
+ index: 'PCH_REQ_ST_CD', name: 'pchReqStCd',
|
|
88
|
+ label: ITP_MSG_LOCALE.label.pchReqStCd, //대표자명
|
|
89
|
+ width: '15', fixed: false, align: 'center',
|
|
90
|
+ sortable: false, hidden: true
|
|
91
|
+ },
|
|
92
|
+ {
|
|
93
|
+ index: 'PCH_REQ_ST_NM', name: 'pchReqStNm',
|
|
94
|
+ label: ITP_MSG_LOCALE.label.pchReqStNm, //상태
|
|
95
|
+ width: '6', fixed: false, align: 'center',
|
|
96
|
+ sortable: false, hidden: false
|
|
97
|
+ },
|
|
98
|
+ {
|
|
99
|
+ index: 'PCH_REQ_DT', name: 'pchReqDt',
|
|
100
|
+ label: ITP_MSG_LOCALE.label.pchReqDt, //최초등록일
|
|
101
|
+ width: '10', fixed: false, align: 'center',
|
|
102
|
+ sortable: false, hidden: false
|
|
103
|
+ },
|
|
104
|
+ {
|
|
105
|
+ index: 'PCH_REQ_ITEM_QTY', name: 'pchReqItemQty',
|
|
106
|
+ label: ITP_MSG_LOCALE.label.pchReqItemQty, //최초등록일
|
|
107
|
+ width: '10', fixed: false, align: 'center',
|
|
108
|
+ sortable: false, hidden: false
|
|
109
|
+ },
|
|
110
|
+ {
|
|
111
|
+ index: 'PCH_REQ_TOTAL_AMT', name: 'pchReqTotalAmt',
|
|
112
|
+ label: ITP_MSG_LOCALE.label.pchReqTotalAmt, //최초등록일
|
|
113
|
+ width: '10', fixed: false, align: 'center',
|
|
114
|
+ sortable: false, hidden: false
|
|
115
|
+ },
|
|
116
|
+ {
|
|
117
|
+ index: 'PCH_REQ_RJCT_DT', name: 'pchReqRjctDt',
|
|
118
|
+ label: ITP_MSG_LOCALE.label.pchReqRjctDt, //최초등록일
|
|
119
|
+ width: '10', fixed: false, align: 'center',
|
|
120
|
+ sortable: false, hidden: false
|
|
121
|
+ },
|
|
122
|
+ {
|
|
123
|
+ index: 'PCH_REQ_RJCT_NM', name: 'pchReqRjctNm',
|
|
124
|
+ label: ITP_MSG_LOCALE.label.pchReqRjctNm, //최초등록일
|
|
125
|
+ width: '10', fixed: false, align: 'center',
|
|
126
|
+ sortable: false, hidden: false
|
|
127
|
+ },
|
|
128
|
+ {
|
|
129
|
+ index: 'PCH_REQ_MGR_NM', name: 'pchReqMgrNm',
|
|
130
|
+ label: ITP_MSG_LOCALE.label.pchReqMgrNm, //최초등록일
|
|
131
|
+ width: '10', fixed: false, align: 'center',
|
|
132
|
+ sortable: false, hidden: false
|
|
133
|
+ },
|
|
134
|
+ {
|
|
135
|
+ index: 'DLV_REQ_DT', name: 'dlvReqDt',
|
|
136
|
+ label: ITP_MSG_LOCALE.label.dlvReqDt, //최초등록일
|
|
137
|
+ width: '10', fixed: false, align: 'center',
|
|
138
|
+ sortable: false, hidden: false
|
|
139
|
+ },
|
|
140
|
+ {
|
|
141
|
+ index: 'WHS_LOCATION_NM', name: 'whsLocationNm',
|
|
142
|
+ label: ITP_MSG_LOCALE.label.whsLocationNm, //최초등록일
|
|
143
|
+ width: '10', fixed: false, align: 'center',
|
|
144
|
+ sortable: false, hidden: false
|
|
145
|
+ }
|
|
146
|
+ ],
|
|
147
|
+ detail: [
|
|
148
|
+ {
|
|
149
|
+ index: 'VIEW_CD', name: 'viewCd',
|
|
150
|
+ label: ITP_MSG_LOCALE.label.viewCd,
|
|
151
|
+ width: '10', fixed: false, align: 'center',
|
|
152
|
+ sortable: false, hidden: true
|
|
153
|
+ },
|
|
154
|
+ {
|
|
155
|
+ index: 'SPPLY_ID', name: 'spplyId',
|
|
156
|
+ label: ITP_MSG_LOCALE.label.spplyId,
|
|
157
|
+ width: '10', fixed: false, align: 'center',
|
|
158
|
+ sortable: false, hidden: true
|
|
159
|
+ },
|
|
160
|
+ {
|
|
161
|
+ index: 'SPPLY_MGR_ID', name: 'spplyMgrId',
|
|
162
|
+ label: ITP_MSG_LOCALE.label.spplyMgrId,
|
|
163
|
+ width: '10', fixed: false, align: 'center',
|
|
164
|
+ sortable: false, hidden: true
|
|
165
|
+ },
|
|
166
|
+ {
|
|
167
|
+ index: 'ASSGN_TASK_NM', name: 'spplyMgrNm',
|
|
168
|
+ label: ITP_MSG_LOCALE.label.spplyMgrNm, //담당자명
|
|
169
|
+ width: '20', fixed: false, align: 'center',
|
|
170
|
+ sortable: false, editable: true, edittype: 'text',
|
|
171
|
+ editrules: {required: true}
|
|
172
|
+ },
|
|
173
|
+ {
|
|
174
|
+ index: 'POSITION', name: 'position',
|
|
175
|
+ label: ITP_MSG_LOCALE.label.position, //직위
|
|
176
|
+ width: '30', fixed: false, align: 'center',
|
|
177
|
+ sortable: true, editable: true, edittype: 'text',
|
|
178
|
+ editrules: {required: true}
|
|
179
|
+ },
|
|
180
|
+ {
|
|
181
|
+ index: 'RPRST_EMAIL', name: 'rprstEmal',
|
|
182
|
+ label: ITP_MSG_LOCALE.label.rprstEmal, //이메일
|
|
183
|
+ width: '10', fixed: false, align: 'center',
|
|
184
|
+ sortable: false, editable: true, edittype: 'text'
|
|
185
|
+ },
|
|
186
|
+ {
|
|
187
|
+ index: 'RPRST_TEL_NO', name: 'rprstTelNo',
|
|
188
|
+ label: ITP_MSG_LOCALE.label.rprstMblNo, //핸드폰번호
|
|
189
|
+ width: '10', fixed: false, align: 'center',
|
|
190
|
+ sortable: false, editable: true, edittype: 'text'
|
|
191
|
+ },
|
|
192
|
+ {
|
|
193
|
+ index: 'ASSGN_TASK', name: 'assgnTask',
|
|
194
|
+ label: ITP_MSG_LOCALE.label.assgnTaskNm, //담당업무
|
|
195
|
+ width: '10', fixed: false, align: 'center',
|
|
196
|
+ sortable: false, editable: true, formatter: 'select', edittype: 'select',
|
|
197
|
+ editoptions: {value: ITP_COMMON_ASSGN_TASK},
|
|
198
|
+ editrules: {required: false}
|
|
199
|
+ }/*,
|
|
200
|
+ {
|
|
201
|
+ index: 'ASSGN_TASK_NM', name: 'assgnTaskNm',
|
|
202
|
+ label: ITP_MSG_LOCALE.label.assgnTaskNm, //담당업무
|
|
203
|
+ width: '10', fixed: false, align: 'center',
|
|
204
|
+ sortable: false, editable: true, edittype: 'text'
|
|
205
|
+ }*/
|
|
206
|
+ ]
|
|
207
|
+};
|
|
208
|
+
|
|
209
|
+/*화면공통 Object*/
|
|
210
|
+let pageObj = {
|
|
211
|
+ init: function () {
|
|
212
|
+ this.ui.init();
|
|
213
|
+ this.event.init();
|
|
214
|
+ this.fileUpload();
|
|
215
|
+ },
|
|
216
|
+ ui: {
|
|
217
|
+ init: function () {
|
|
218
|
+ this.view();
|
|
219
|
+ this.grid();
|
|
220
|
+ this.ready();
|
|
221
|
+ },
|
|
222
|
+ view: function() {
|
|
223
|
+ // 버튼 권한설정
|
|
224
|
+ fn_proc_btn_auth('POMNG02010');
|
|
225
|
+
|
|
226
|
+ // 공통코드 표시
|
|
227
|
+ $('select').each(function() {
|
|
228
|
+ if($(this).data('select-code')) {
|
|
229
|
+ fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
|
230
|
+ }
|
|
231
|
+ });
|
|
232
|
+ },
|
|
233
|
+ grid: function() {
|
|
234
|
+ itp_fn_jqgrid_resize(POMNG02010_GRID_ID, POMNG02010_GRID_LIST, 'lg');
|
|
235
|
+ listObj.empty.init();
|
|
236
|
+ itp_fn_fire_window_resize();
|
|
237
|
+ },
|
|
238
|
+ ready: function() {
|
|
239
|
+ listObj.init();
|
|
240
|
+ }
|
|
241
|
+ },
|
|
242
|
+ event: {
|
|
243
|
+ init: function () {
|
|
244
|
+ this.button();
|
|
245
|
+ },
|
|
246
|
+ button: function () {
|
|
247
|
+ // 버튼 클릭 이벤트
|
|
248
|
+ $('button').each(function() {
|
|
249
|
+ var id = $(this).attr('id');
|
|
250
|
+ $(this).on('click', function() {
|
|
251
|
+ switch (id) {
|
|
252
|
+ case 'ITP_BTN_POMNG02010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
|
253
|
+ case 'ITP_BTN_POMNG02010_NEWREG' : listObj.button.create(); break; // 신규등록 버튼
|
|
254
|
+ case 'ITP_BTN_POMNG02010_MODIFY' : modifyObj.button.modify(); break; // 수정 버튼
|
|
255
|
+ case 'ITP_BTN_POMNG02010_CANCELLIST' : createObj.button.cancel(); break; // 취소/목록 버튼
|
|
256
|
+ case 'ITP_BTN_POMNG02010_DELETE' : break; // 삭제 버튼
|
|
257
|
+ case 'ITP_BTN_POMNG02010_SAVE' : createObj.button.save(); break; // 저장 버튼
|
|
258
|
+ case 'ITP_BTN_POMNG02010_DETAIL_ADDROW' : createObj.button.addRow(); break; // 행추가
|
|
259
|
+ case 'ITP_BTN_POMNG02010_DETAIL_DELROW' : createObj.button.delRow(); break; // 행삭제
|
|
260
|
+ case 'ITP_FORM_POMNG02010_DETAIL_ADRES_SCH' : createObj.button.address(); break; // 신규등록 주소 찾기
|
|
261
|
+ }
|
|
262
|
+ });
|
|
263
|
+ });
|
|
264
|
+
|
|
265
|
+ $('body').on('click', function(e) {
|
|
266
|
+ var gridId = POMNG02010_DETAIL_GRID_ID.replace('#', '');
|
|
267
|
+ var rids = $(POMNG02010_DETAIL_GRID_ID).jqGrid('getDataIDs');
|
|
268
|
+ var last_row_id = rids[rids.length - 1];
|
|
269
|
+ itp_fn_grid_reset_selection(e, last_row_id, gridId, 'POMNG02010_DETAIL');
|
|
270
|
+ });
|
|
271
|
+
|
|
272
|
+ }
|
|
273
|
+ },
|
|
274
|
+ fileUpload: function() {
|
|
275
|
+ //파일업로드(등록/수정화면)
|
|
276
|
+ var id = 'POMNG02010';
|
|
277
|
+ var acctScrId = 'POMNG02010_ACCT';
|
|
278
|
+ $('#ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD').empty();
|
|
279
|
+ const acctFileArgs = {
|
|
280
|
+ 'fileNo': $('#ITP_FORM_' + id + '_DETAIL_ACCT_FILE_NO').val(),
|
|
281
|
+ 'viewCd': $('#ITP_FORM_' + id + '_DETAIL_VIEW_CD').val(),
|
|
282
|
+ 'showYn': $('#ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD').attr('data-show-yn'),
|
|
283
|
+ 'fileId': '#ITP_FORM_' + id + '_DETAIL_ACCT_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
|
|
284
|
+ };
|
|
285
|
+ itp_fn_set_file_upload('ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD', 'notice', true, false, acctScrId, acctFileArgs);
|
|
286
|
+
|
|
287
|
+ var corpScrId = 'POMNG02010_CORP';
|
|
288
|
+ $('#ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD').empty();
|
|
289
|
+ const corpFileArgs = {
|
|
290
|
+ 'fileNo': $('#ITP_FORM_' + id + '_DETAIL_CORP_FILE_NO').val(),
|
|
291
|
+ 'viewCd': $('#ITP_FORM_' + id + '_DETAIL_VIEW_CD').val(),
|
|
292
|
+ 'showYn': $('#ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD').attr('data-show-yn'),
|
|
293
|
+ 'fileId': '#ITP_FORM_' + id + '_DETAIL_CORP_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
|
|
294
|
+ };
|
|
295
|
+ itp_fn_set_file_upload('ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD', 'notice', true, false, corpScrId, corpFileArgs);
|
|
296
|
+ },
|
|
297
|
+ switchScreen: function(mode) {
|
|
298
|
+ $('.itp_det_head').find('button[id^="ITP_BTN_POMNG02010_"]').each(function(i) {
|
|
299
|
+ $(this).hide();
|
|
300
|
+ });
|
|
301
|
+ $('#ITP_TAB_POMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
|
|
302
|
+ $(this).hide();
|
|
303
|
+ });
|
|
304
|
+ if(mode == 'LIST') { // 목록
|
|
305
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_SRH', '#ITP_BTN_POMNG02010_NEWREG']);
|
|
306
|
+ $('#ITP_AJAX_POMNG02010_LIST_CONTAINER').show();
|
|
307
|
+ $('#ITP_FORM_POMNG02010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
308
|
+ } else if(mode == 'ADD') { // 등록
|
|
309
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_CANCELLIST', '#ITP_BTN_POMNG02010_SAVE']);
|
|
310
|
+ $('#ITP_AJAX_POMNG02010_DETAIL_CONTAINER').show();
|
|
311
|
+
|
|
312
|
+ $('#ITP_FORM_POMNG02010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
|
|
313
|
+ $(this).attr('id') === 'ITP_FORM_POMNG02010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
|
|
314
|
+ if(elem.type === 'select') {
|
|
315
|
+ $(this).val('').prop('selected', true);
|
|
316
|
+ }
|
|
317
|
+ });
|
|
318
|
+
|
|
319
|
+ // 가맹점 정보 설정
|
|
320
|
+ $('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
|
|
321
|
+ $('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
322
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
|
|
323
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnSpplyId').text('(자동부여) (비밀번호는 사업자번호로 초기화 됩니다.)');
|
|
324
|
+ $('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').hide();
|
|
325
|
+ $('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').show();
|
|
326
|
+
|
|
327
|
+ $('#ITP_BTN_POMNG02010_RESET_PW').hide();
|
|
328
|
+ $.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
|
|
329
|
+ $.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
|
|
330
|
+ } else if(mode == 'MODIFY') { // 수정
|
|
331
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_CANCELLIST', '#ITP_BTN_POMNG02010_SAVE', '#ITP_BTN_POMNG02010_RESET_PW']);
|
|
332
|
+ $('#ITP_AJAX_POMNG02010_DETAIL_CONTAINER').show();
|
|
333
|
+ $('#ITP_BTN_POMNG02010_RESET_PW').show();
|
|
334
|
+ $('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').show();
|
|
335
|
+ $('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').hide();
|
|
336
|
+
|
|
337
|
+ $('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
|
|
338
|
+ $('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
339
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
|
|
340
|
+ $.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
|
|
341
|
+ $.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
|
|
342
|
+ } else if(mode == 'VIEW') { // 보기
|
|
343
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_MODIFY', '#ITP_BTN_POMNG02010_CANCELLIST']);
|
|
344
|
+ $('#ITP_AJAX_POMNG02010_VIEW_CONTAINER').show();
|
|
345
|
+ }
|
|
346
|
+ },
|
|
347
|
+ grid: {
|
|
348
|
+ init: function(mode, gridRows) {
|
|
349
|
+ this.gridId = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_ID : POMNG02010_DETAIL_GRID_ID;
|
|
350
|
+ this.gridList = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_LIST : POMNG02010_DETAIL_GRID_LIST;
|
|
351
|
+ this.gridEmpty = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY;
|
|
352
|
+ this.gridRows = gridRows;
|
|
353
|
+ this.unload();
|
|
354
|
+ this.load(mode, gridRows);
|
|
355
|
+ },
|
|
356
|
+ gridId: '',
|
|
357
|
+ gridList: '',
|
|
358
|
+ gridEmpty: '',
|
|
359
|
+ gridRows: '',
|
|
360
|
+ load: function(mode, gridRows) {
|
|
361
|
+ var _this = this;
|
|
362
|
+ var option = {
|
|
363
|
+ gridId: _this.gridId,
|
|
364
|
+ colModel: gridColModel.detail,
|
|
365
|
+ data: gridRows,
|
|
366
|
+ multiselect: (mode !== 'VIEW'),
|
|
367
|
+ // cellEdit: (mode !== 'VIEW'),
|
|
368
|
+ loadComplete: function(data) {
|
|
369
|
+ $(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
|
|
370
|
+ (Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
|
|
371
|
+ },
|
|
372
|
+ onCellSelect: function(rowid, cellIdx, cellValue) {
|
|
373
|
+ console.log('mode ===> ' + mode);
|
|
374
|
+ if(mode !== 'VIEW') {
|
|
375
|
+ POMNG02010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, POMNG02010_GRID_LAST_ROW_ID, _this.gridId, ['actionId']);
|
|
376
|
+ }
|
|
377
|
+ }
|
|
378
|
+ /*,
|
|
379
|
+ afterSaveCell: function(rowid,name,val,iRow,iCol) {
|
|
380
|
+ if(mode !== 'VIEW') {
|
|
381
|
+ console.log(rowid);
|
|
382
|
+ console.log(name);
|
|
383
|
+ console.log(val);
|
|
384
|
+ console.log(iRow);
|
|
385
|
+ console.log(iCol);
|
|
386
|
+ }
|
|
387
|
+ },
|
|
388
|
+ afterEditCell: function (rowid, cellname, val, iRow, iCol){
|
|
389
|
+ if(mode !== 'VIEW') {
|
|
390
|
+ $("#" + rowid + "_" + cellname).blur(function(){
|
|
391
|
+ $("#grid").jqGrid("saveCell",iRow,iCol);
|
|
392
|
+ });
|
|
393
|
+ }
|
|
394
|
+ }*/
|
|
395
|
+ };
|
|
396
|
+ itp_fn_grid_make_local(option);
|
|
397
|
+ },
|
|
398
|
+ unload : function() {
|
|
399
|
+ $.jgrid.gridUnload(this.gridId);
|
|
400
|
+ },
|
|
401
|
+ changeRows: function(gridRows) {
|
|
402
|
+ var modifyRows = [];
|
|
403
|
+ var chkColumns = ['spplyMgrNm', 'position', 'rprstEmal', 'rprstTelNo', 'assgnTask'];
|
|
404
|
+ $.each(this.gridRows, function(index, item) {
|
|
405
|
+ var row = gridRows[index];
|
|
406
|
+ if(row.viewCd === 'C') {
|
|
407
|
+ modifyRows.push(item);
|
|
408
|
+ } else {
|
|
409
|
+ if(row.itemId === item.itemId) {
|
|
410
|
+ $.each(chkColumns, function(index, column) {
|
|
411
|
+ if(row[column].toString() !== item[column].toString()) {
|
|
412
|
+ row.viewCd = 'U';
|
|
413
|
+ modifyRows.push(row);
|
|
414
|
+ return false;
|
|
415
|
+ }
|
|
416
|
+ });
|
|
417
|
+ }
|
|
418
|
+ }
|
|
419
|
+ });
|
|
420
|
+ return modifyRows;
|
|
421
|
+ }
|
|
422
|
+ }
|
|
423
|
+};
|
|
424
|
+
|
|
425
|
+/*목록화면 Object*/
|
|
426
|
+let listObj = {
|
|
427
|
+ init: function () {
|
|
428
|
+ this.grid.init();
|
|
429
|
+ },
|
|
430
|
+ itp_POMNG02010_search: false,
|
|
431
|
+ button: {
|
|
432
|
+ search: function() {
|
|
433
|
+ listObj.itp_POMNG02010_search = true;
|
|
434
|
+ let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
|
|
435
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
436
|
+ param.gridPage = $.jgrid.defaults.page;
|
|
437
|
+ $(POMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
|
|
438
|
+ },
|
|
439
|
+ create: function() {
|
|
440
|
+ if(!fn_make_user_info.isEmpty()) {
|
|
441
|
+ createObj.init();
|
|
442
|
+ }
|
|
443
|
+ }
|
|
444
|
+ },
|
|
445
|
+ empty: {
|
|
446
|
+ init: function() {
|
|
447
|
+ var _this = this;
|
|
448
|
+ this.push();
|
|
449
|
+ $(POMNG02010_GRID_EMPTY).on('click', function() {
|
|
450
|
+ _this.back();
|
|
451
|
+ _this.itp_POMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
452
|
+ $(POMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_POMNG02010_param)}).trigger('reloadGrid');
|
|
453
|
+ });
|
|
454
|
+ },
|
|
455
|
+ itp_POMNG02010_param: {},
|
|
456
|
+ push: function() {
|
|
457
|
+ let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
|
|
458
|
+ listObj.itp_POMNG02010_param = param;
|
|
459
|
+ },
|
|
460
|
+ back: function() {
|
|
461
|
+ $('#ITP_FORM_POMNG02010_SERVICE_ST_DT').val(this.itp_POMNG02010_param.serviceStDt);
|
|
462
|
+ $('#ITP_FORM_POMNG02010_SEARCH_BSNS_REG_NO').val(this.itp_POMNG02010_param.sbsnsRegNo);
|
|
463
|
+ $('#ITP_FORM_POMNG02010_SEARCH_SPPLY_NM').val(this.itp_POMNG02010_param.sspplyNm);
|
|
464
|
+ }
|
|
465
|
+ },
|
|
466
|
+ grid: {
|
|
467
|
+ init: function () {
|
|
468
|
+ // 데이터 없을때
|
|
469
|
+ listObj.empty.push();
|
|
470
|
+ this.search();
|
|
471
|
+ },
|
|
472
|
+ colModel: gridColModel.list,
|
|
473
|
+ search: function() {
|
|
474
|
+ pageObj.switchScreen('LIST');
|
|
475
|
+ this.unload();
|
|
476
|
+ this.load();
|
|
477
|
+ },
|
|
478
|
+ load: function() {
|
|
479
|
+ let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
|
|
480
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
481
|
+ param.sbrandId = fn_make_user_info.get('brandId');
|
|
482
|
+
|
|
483
|
+ var option = {
|
|
484
|
+ gridId: POMNG02010_GRID_ID,
|
|
485
|
+ colModel: gridColModel.list,
|
|
486
|
+ param: param,
|
|
487
|
+ url: DOMAIN + API_DETAIL_GRID_LIST,
|
|
488
|
+ pager: POMNG02010_GRID_PAGER,
|
|
489
|
+ onCellSelect: function(rowId, cellIdx, cellValue) {
|
|
490
|
+ var cm = $(this).jqGrid('getGridParam', 'colModel');
|
|
491
|
+ var colNm = cm[cellIdx].name;
|
|
492
|
+ if (colNm == 'spplyId') {
|
|
493
|
+ const selectVal = $(this).jqGrid('getCell', rowId, 'spplyId');
|
|
494
|
+ const key = {brandId:fn_make_user_info.get('brandId'), spplyId: selectVal, viewCd: 'R'};
|
|
495
|
+ var param = $.param(key);
|
|
496
|
+ viewObj.init(param);
|
|
497
|
+ }
|
|
498
|
+ },
|
|
499
|
+ loadComplete: function(data) {
|
|
500
|
+ console.log(data);
|
|
501
|
+ itp_fn_grid_load_complete(data, POMNG02010_GRID_ID, true, 'number', 'POMNG02010', listObj.itp_POMNG02010_search, listObj.empty, true, data.gridRecords, true);
|
|
502
|
+ var ids = $(POMNG02010_GRID_ID).getDataIDs();
|
|
503
|
+ $.each(ids, function(idx, rowId) {
|
|
504
|
+ $(POMNG02010_GRID_ID).jqGrid('setCell', rowId, 'spplyId', '', ITP_GRID_COL_STYLE.link);
|
|
505
|
+ });
|
|
506
|
+ },
|
|
507
|
+ onPaging: function(action) {
|
|
508
|
+ itp_fn_grid_paging(POMNG02010_GRID_ID, action, param);
|
|
509
|
+ }
|
|
510
|
+ };
|
|
511
|
+ itp_fn_grid_make_remote(option);
|
|
512
|
+ },
|
|
513
|
+ clearData : function() {
|
|
514
|
+ $(POMNG02010_GRID_ID).jqGrid('clearGridData', true);
|
|
515
|
+ $(POMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
516
|
+ $(POMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
517
|
+ $(POMNG02010_GRID_EMPTY).show();
|
|
518
|
+ },
|
|
519
|
+ unload : function() {
|
|
520
|
+ $.jgrid.gridUnload(POMNG02010_GRID_ID);
|
|
521
|
+ }
|
|
522
|
+ }
|
|
523
|
+};
|
|
524
|
+
|
|
525
|
+/*상세화면 Object*/
|
|
526
|
+let viewObj = {
|
|
527
|
+ init: function (param) {
|
|
528
|
+ this.load(param);
|
|
529
|
+ },
|
|
530
|
+ load: function(param) {
|
|
531
|
+ fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
|
|
532
|
+ },
|
|
533
|
+ callback: function (result) {
|
|
534
|
+ console.log(result);
|
|
535
|
+ pageObj.switchScreen('VIEW');
|
|
536
|
+ $('#ITP_FORM_POMNG02010_VIEW #ITP_FORM_POMNG02010_VIEW_SPPLY_ID').val(result.spplyId);
|
|
537
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnBrandNm').text(result.brandNm);
|
|
538
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnStCd').text(result.stNm);
|
|
539
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnSpplyId').text(result.spplyId);
|
|
540
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnCorpType').text(result.corpTypeNm);
|
|
541
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnSpplyNm').text(result.spplyNm);
|
|
542
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnBsnsCndt').text(result.bsnsCndt);
|
|
543
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnBsnsRegNo').text(result.bsnsRegNo);
|
|
544
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnCtgrBsns').text(result.ctgrBsns);
|
|
545
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnCorpRegNo').text(result.corpRegNo);
|
|
546
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnTelNo').text(result.mgrTelNo);
|
|
547
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnOwnerNm').text(result.ownerNm);
|
|
548
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnFaxNo').text(result.faxNo);
|
|
549
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnMblNo').text(result.mgrMblNo);
|
|
550
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnEmalAddr').text(result.mgrEmal);
|
|
551
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnAreaCd').text(result.areaNm);
|
|
552
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnBnkCd').text(result.bnkNm);
|
|
553
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnAcctNo').text(result.acctNo);
|
|
554
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnOwacNm').text(result.owacNm);
|
|
555
|
+ // 통장사본 fileBookCopyNoList
|
|
556
|
+ //$('#ITP_FORM_POMNG02010_VIEW .fnFilePath').text(result.fileBookCopyNoList);
|
|
557
|
+ // 사업자등록파일 fileBsnsRegNoList
|
|
558
|
+ //$('#ITP_FORM_POMNG02010_VIEW .fnFilePath').text(result.fileBsnsRegNoList);
|
|
559
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnZipNo').text(result.zipNo);
|
|
560
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnLoadAddr').text(result.addr1);
|
|
561
|
+ $('#ITP_FORM_POMNG02010_VIEW .fnDtlAddr').text(result.addr2);
|
|
562
|
+ // $('#ITP_FORM_POMNG02010_VIEW .fnRegDt').text(result.openDt);
|
|
563
|
+ // $('#ITP_FORM_POMNG02010_VIEW .fnCloseDt').text(result.openDt);
|
|
564
|
+
|
|
565
|
+ itp_fn_attach_file.view('ITP_POMNG02010_VIEW_ACCT_FILE', result.fileBookCopyNoList
|
|
566
|
+ , 'form-control itp_input', 'border:none; top:12px; left:12px; height:100px; width:125px; position:absolute;');
|
|
567
|
+
|
|
568
|
+ itp_fn_attach_file.view('ITP_POMNG02010_VIEW_REG_NO_FILE', result.fileBsnsRegNoList
|
|
569
|
+ , 'form-control itp_input', 'border:none; top:12px; left:12px; height:100px; width:125px; position:absolute;');
|
|
570
|
+
|
|
571
|
+ // 담당자정보 리스트 조회
|
|
572
|
+ pageObj.grid.init('VIEW', result.spplyMgrList);
|
|
573
|
+ // viewObj.grid.load(result.spplyMgrList);
|
|
574
|
+ }
|
|
575
|
+};
|
|
576
|
+
|
|
577
|
+/*수정화면 Object*/
|
|
578
|
+let modifyObj = {
|
|
579
|
+ init: function () {
|
|
580
|
+ },
|
|
581
|
+ button: {
|
|
582
|
+ modify: function (param) {
|
|
583
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_POMNG02010_DETAIL');
|
|
584
|
+ const selectVal = $('#ITP_FORM_POMNG02010_VIEW_SPPLY_ID').val();
|
|
585
|
+ const key = {brandId:fn_make_user_info.get('brandId'), spplyId: selectVal, viewCd: 'R'};
|
|
586
|
+ var param = $.param(key);
|
|
587
|
+ modifyObj.load(param);
|
|
588
|
+ }
|
|
589
|
+ },
|
|
590
|
+ load: function(param) {
|
|
591
|
+ fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
|
|
592
|
+ },
|
|
593
|
+ callback: function (result) {
|
|
594
|
+ console.log(result);
|
|
595
|
+ pageObj.switchScreen('MODIFY');
|
|
596
|
+
|
|
597
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_VIEW_CD').val('U');
|
|
598
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_STORE_ID').val(result.storeId);
|
|
599
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
600
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(result.brandNm);
|
|
601
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ST_CD').val(result.stCd);
|
|
602
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_SPPLY_ID').val(result.spplyId);
|
|
603
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnSpplyId').text(result.spplyId);
|
|
604
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CORP_TYPE').val(result.corpType);
|
|
605
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_SPPLY_NM').val(result.spplyNm);
|
|
606
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BSNS_CNDT').val(result.bsnsCndt);
|
|
607
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BSNS_REG_NO').val(result.bsnsRegNo);
|
|
608
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnBsnsRegNo').text(result.bsnsRegNo);
|
|
609
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CTGR_BSNS').val(result.ctgrBsns);
|
|
610
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CORP_REG_NO').val(result.corpRegNo);
|
|
611
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnCorpRegNo').text(result.corpRegNo);
|
|
612
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_TEL_NO').val(result.mgrTelNo);
|
|
613
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_OWNER_NM').val(result.ownerNm);
|
|
614
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_FAX_NO').val(result.faxNo);
|
|
615
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_MBL_NO').val(result.mgrMblNo);
|
|
616
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_EMAL_ADDR').val(result.mgrEmal);
|
|
617
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_AREA_CD').val(result.areaCd);
|
|
618
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BNK_CD').val(result.bnkCd);
|
|
619
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ACCT_NO').val(result.acctNo);
|
|
620
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_OWAC_NM').val(result.owacNm);
|
|
621
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_FROM_DT').val(result.openDt);
|
|
622
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ZIPNO').val(result.zipNo);
|
|
623
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ADRES').val(result.addr1);
|
|
624
|
+ $('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ADRES_DTL').val(result.addr2);
|
|
625
|
+
|
|
626
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnRegId').text(result.sysRegId);
|
|
627
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnRegDt').text(result.sysRegDttm);
|
|
628
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnChgId').text(result.sysChgId);
|
|
629
|
+ $('#ITP_FORM_POMNG02010_DETAIL .fnChgDt').text(result.sysChgDttm);
|
|
630
|
+
|
|
631
|
+ // 담당자정보 리스트 조회
|
|
632
|
+ pageObj.grid.init('DETAIL', result.spplyMgrList);
|
|
633
|
+ // modifyObj.grid.load(result.spplyMgrList);
|
|
634
|
+ }
|
|
635
|
+};
|
|
636
|
+
|
|
637
|
+/*신규화면 Object*/
|
|
638
|
+let createObj = {
|
|
639
|
+ init: function () {
|
|
640
|
+ pageObj.switchScreen('ADD');
|
|
641
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_POMNG02010_DETAIL');
|
|
642
|
+ $('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
643
|
+ pageObj.grid.init('DETAIL', []);
|
|
644
|
+ },
|
|
645
|
+ button: {
|
|
646
|
+ cancel: function() {
|
|
647
|
+ listObj.grid.search();
|
|
648
|
+ },
|
|
649
|
+ address: function() {
|
|
650
|
+ kakaoMap.simpleAddress('ITP_FORM_POMNG02010_DETAIL');
|
|
651
|
+ },
|
|
652
|
+ addRow: function() {
|
|
653
|
+ itp_fn_grid_add_row(POMNG02010_DETAIL_GRID_ID, undefined, ['spplyId'], 'POMNG02010_DETAIL');
|
|
654
|
+ },
|
|
655
|
+ delRow: function() {
|
|
656
|
+ itp_fn_grid_del_row(POMNG02010_DETAIL_GRID_ID);
|
|
657
|
+ },
|
|
658
|
+ save: function() {
|
|
659
|
+ const formId = '#ITP_FORM_POMNG02010_DETAIL';
|
|
660
|
+ itp_fn_form_clear_validate(null, formId);
|
|
661
|
+
|
|
662
|
+ if (itp_fn_form_event.isValid(formId)) {
|
|
663
|
+ itp_fn_grid_save_rows(POMNG02010_DETAIL_GRID_ID);
|
|
664
|
+ let gridInsertData = [];
|
|
665
|
+ // let gridUpdateData = [];
|
|
666
|
+ let gridDeleteData = [];
|
|
667
|
+ for(var i=0; i<$(POMNG02010_DETAIL_GRID_ID).getGridParam('reccount'); i++) {
|
|
668
|
+ $(POMNG02010_DETAIL_GRID_ID).jqGrid('saveCell', i+1, 2)
|
|
669
|
+ }
|
|
670
|
+ const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
|
|
671
|
+ console.log(rowData);
|
|
672
|
+ var gridUpdateData = pageObj.grid.changeRows(rowData);
|
|
673
|
+ $.each(rowData, function(key, value) {
|
|
674
|
+ if (value.viewCd !== 'R') {
|
|
675
|
+ if (value.viewCd === 'C') {
|
|
676
|
+ value.spplyId = $(formId + '_SPPLY_ID').val();
|
|
677
|
+ gridInsertData.push(value);
|
|
678
|
+ } else if (value.viewCd === 'U') {
|
|
679
|
+ gridUpdateData.push(value);
|
|
680
|
+ } else if (value.viewCd === 'D') {
|
|
681
|
+ gridDeleteData.push(value);
|
|
682
|
+ }
|
|
683
|
+ }
|
|
684
|
+ });
|
|
685
|
+ itp_fn_form_event.removeChar(formId);
|
|
686
|
+ let param = $(formId).serializeObject();
|
|
687
|
+ param.gridInsertData = gridInsertData;
|
|
688
|
+ param.gridUpdateData = gridUpdateData;
|
|
689
|
+ param.gridDeleteData = gridDeleteData;
|
|
690
|
+ console.log(JSON.stringify(param));
|
|
691
|
+ var searhFn = function() {
|
|
692
|
+ ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
|
|
693
|
+ listObj.grid.search();
|
|
694
|
+ };
|
|
695
|
+ // fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
|
696
|
+ }
|
|
697
|
+ }
|
|
698
|
+ }
|
|
699
|
+};
|