|
@@ -12,15 +12,17 @@ const POMNG04010_GRID_LIST = '#ITP_POMNG04010_jqGrid_list';
|
12
|
12
|
const POMNG04010_GRID_PAGER = '#ITP_POMNG04010_jqGridPager';
|
13
|
13
|
const POMNG04010_GRID_EMPTY = '#ITP_POMNG04010_jqGridEmpty';
|
14
|
14
|
|
15
|
|
-const POMNG04010_GRID_DETAIL_ID = '#ITP_POMNG04010_DETAIL_jqGrid';
|
16
|
|
-const POMNG04010_GRID_DETAIL_LIST = '#ITP_POMNG04010_DETAIL_jqGrid_list';
|
17
|
|
-const POMNG04010_GRID_DETAIL_PAGER = '#ITP_POMNG04010_DETAIL_jqGridPager';
|
18
|
|
-const POMNG04010_GRID_DETAIL_EMPTY = '#ITP_POMNG04010_DETAIL_jqGridEmpty';
|
|
15
|
+const POMNG04010_DETAIL_GRID_ID = '#ITP_POMNG04010_DETAIL_jqGrid';
|
|
16
|
+const POMNG04010_DETAIL_GRID_LIST = '#ITP_POMNG04010_DETAIL_jqGrid_list';
|
|
17
|
+const POMNG04010_DETAIL_GRID_PAGER = '#ITP_POMNG04010_DETAIL_jqGridPager';
|
|
18
|
+const POMNG04010_DETAIL_GRID_EMPTY = '#ITP_POMNG04010_DETAIL_jqGridEmpty';
|
|
19
|
+
|
|
20
|
+let ITP_PODR_DTL_ST_CD = fn_make_common_cd_list(CODE_LIST, 'PODR_DTL_ST_CD', true, '구매발주상세상태코드');
|
19
|
21
|
|
20
|
22
|
|
21
|
23
|
//API URL
|
22
|
24
|
let API_POMNG_PO_DETAIL_GRID_LIST = '/api/pomng/po/detail-grid-list';
|
23
|
|
-let API_POMNG_PO_INFO_PCHODR_ = '/api/pomng/po/info-pchOdr';
|
|
25
|
+let API_POMNG_PO_INFO_PCHODR = '/api/pomng/po/info-pchOdr';
|
24
|
26
|
let API_POMNG_PO_CANCEL_PCHPO = '/api/pomng/po/cancel-pchPo';
|
25
|
27
|
|
26
|
28
|
|
|
@@ -77,7 +79,7 @@ const gridColModel = {
|
77
|
79
|
},
|
78
|
80
|
{
|
79
|
81
|
index: 'PODR_ITEM_QTY', name: 'podrItemQty',
|
80
|
|
- label: ITP_MSG_LOCALE.label.podpodrItemQtyrDt, // 발주품목수
|
|
82
|
+ label: ITP_MSG_LOCALE.label.podrItemQty, // 발주품목수
|
81
|
83
|
width: '10', fixed: false, align: 'center',
|
82
|
84
|
sortable: false, hidden: false
|
83
|
85
|
},
|
|
@@ -96,6 +98,12 @@ const gridColModel = {
|
96
|
98
|
width: '10', fixed: false, align: 'center',
|
97
|
99
|
sortable: false, hidden: true
|
98
|
100
|
},
|
|
101
|
+ {
|
|
102
|
+ index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
|
|
103
|
+ label: ITP_MSG_LOCALE.label.pchPodrDtlNo, // 발주항번
|
|
104
|
+ width: '5', fixed: false, align: 'center',
|
|
105
|
+ sortable: false, hidden: false
|
|
106
|
+ },
|
99
|
107
|
{
|
100
|
108
|
index: 'ITEM_ID', name: 'itemId',
|
101
|
109
|
label: ITP_MSG_LOCALE.label.itemId, // 품목번호
|
|
@@ -126,12 +134,6 @@ const gridColModel = {
|
126
|
134
|
width: '5', fixed: false, align: 'center',
|
127
|
135
|
sortable: false, hidden: false
|
128
|
136
|
},
|
129
|
|
- {
|
130
|
|
- index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
|
131
|
|
- label: ITP_MSG_LOCALE.label.pchPodrDtlNo, // 발주항번
|
132
|
|
- width: '5', fixed: false, align: 'center',
|
133
|
|
- sortable: false, hidden: false
|
134
|
|
- },
|
135
|
137
|
{
|
136
|
138
|
index: 'PODR_AMT', name: 'podrAmt',
|
137
|
139
|
label: ITP_MSG_LOCALE.label.podrAmt, // 발주금액
|
|
@@ -140,21 +142,21 @@ const gridColModel = {
|
140
|
142
|
},
|
141
|
143
|
{
|
142
|
144
|
index: 'WHS_PASS_QTY', name: 'whsPassQty',
|
143
|
|
- label: ITP_MSG_LOCALE.label.whsPassQty, // 발주항번
|
|
145
|
+ label: ITP_MSG_LOCALE.label.whsPassQty, // 출고가능수량
|
144
|
146
|
width: '5', fixed: false, align: 'center',
|
145
|
147
|
sortable: false, hidden: false
|
146
|
148
|
},
|
147
|
149
|
{
|
148
|
|
- index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
|
149
|
|
- label: ITP_MSG_LOCALE.label.pchPodrDtlNo, // 발주항번
|
|
150
|
+ index: 'PODR_DTL_ST_CD', name: 'podrDtlStCd',
|
|
151
|
+ label: ITP_MSG_LOCALE.label.podrDtlStCd, // 구매발주상세상태코드
|
150
|
152
|
width: '5', fixed: false, align: 'center',
|
151
|
|
- sortable: false, hidden: false
|
|
153
|
+ sortable: false, hidden: false, formatter: 'select', edittype: 'select',
|
|
154
|
+ editoptions: {value: ITP_PODR_DTL_ST_CD},
|
152
|
155
|
}
|
153
|
156
|
]
|
154
|
157
|
};
|
155
|
158
|
|
156
|
159
|
|
157
|
|
-
|
158
|
160
|
/*화면공통 Object*/
|
159
|
161
|
let pageObj = {
|
160
|
162
|
init: function() {
|
|
@@ -163,9 +165,354 @@ let pageObj = {
|
163
|
165
|
},
|
164
|
166
|
ui: {
|
165
|
167
|
init: function() {
|
166
|
|
-
|
|
168
|
+ this.view();
|
|
169
|
+ this.grid();
|
|
170
|
+ this.ready();
|
|
171
|
+ },
|
|
172
|
+ view: function() {
|
|
173
|
+ // 버튼 권한설정
|
|
174
|
+ fn_proc_btn_auth('POMNG04010');
|
|
175
|
+ // 공통코드 표시
|
|
176
|
+ $('select').each(function() {
|
|
177
|
+ if($(this).data('select-code')) {
|
|
178
|
+ fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
|
179
|
+ }
|
|
180
|
+ });
|
|
181
|
+ // 조회일자 지정
|
|
182
|
+ var now = new Date();
|
|
183
|
+ var defaultToDate = new Date(now);
|
|
184
|
+ defaultToDate.setDate(now.getDate() + 5);
|
|
185
|
+ $('#ITP_TAB_POMNG04010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
|
186
|
+ $('#ITP_FORM_POMNG04010_SEARCH_FROM_DT').datepicker('setDate', '2020.10.01');
|
|
187
|
+ $('#ITP_FORM_POMNG04010_SEARCH_TO_DT').datepicker('setDate', '2024.10.01');
|
|
188
|
+ },
|
|
189
|
+ grid: function() {
|
|
190
|
+ itp_fn_jqgrid_resize(POMNG04010_GRID_ID, POMNG04010_GRID_LIST, 'lg');
|
|
191
|
+ listObj.empty.init();
|
|
192
|
+ itp_fn_fire_window_resize();
|
|
193
|
+ },
|
|
194
|
+ ready: function() {
|
|
195
|
+ listObj.init();
|
|
196
|
+ }
|
|
197
|
+ },
|
|
198
|
+ event: {
|
|
199
|
+ init: function() {
|
|
200
|
+ this.button();
|
|
201
|
+ },
|
|
202
|
+ button: function() {
|
|
203
|
+ // 버튼 클릭 이벤트
|
|
204
|
+ $('button').each(function() {
|
|
205
|
+ var id = $(this).attr('id');
|
|
206
|
+ $(this).on('click', function() {
|
|
207
|
+ switch (id) {
|
|
208
|
+ case 'ITP_BTN_POMNG04010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
|
209
|
+ case 'ITP_BTN_POMNG04010_NEWREG' : listObj.button.create(); break; // 신규등록 버튼
|
|
210
|
+ case 'ITP_BTN_POMNG04010_MODIFY' : modifyObj.button.modify(); break; // 수정 버튼
|
|
211
|
+ case 'ITP_BTN_POMNG04010_CANCELLIST' : modifyObj.button.cancel(); break; // 취소/목록 버튼
|
|
212
|
+ case 'ITP_BTN_POMNG04010_DELETE' : break; // 발주 취소 버튼(예정)
|
|
213
|
+ }
|
|
214
|
+ });
|
|
215
|
+ });
|
|
216
|
+ }
|
|
217
|
+ },
|
|
218
|
+ switchScreen: function(mode) {
|
|
219
|
+ $('.itp_det_head').find('button[id^="ITP_BTN_POMNG04010_"]').each(function(i) {
|
|
220
|
+ $(this).hide();
|
|
221
|
+ });
|
|
222
|
+ $('#ITP_TAB_POMNG04010').find('div[id$="_CONTAINER"]').each(function(i) {
|
|
223
|
+ $(this).hide();
|
|
224
|
+ });
|
|
225
|
+ if(mode == 'LIST') { // 목록
|
|
226
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG04010_SRH', '#ITP_BTN_POMNG04010_NEWREG']);
|
|
227
|
+ $('#ITP_AJAX_POMNG04010_LIST_CONTAINER').show();
|
|
228
|
+ $('#ITP_FORM_POMNG04010_SEARCH #ITP_FORM_POMNG04010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
229
|
+ $('#ITP_BTN_POMNG04010_SEARCH_WHS_NM').show();
|
|
230
|
+ $('#ITP_BTN_POMNG04010_DELETE_WHS_NM').show();
|
|
231
|
+ } else if(mode == 'ADD') { // 등록
|
|
232
|
+ $('#ITP_AJAX_POMNG04010_DETAIL_CONTAINER').show();
|
|
233
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG04010_CANCELLIST', '#ITP_BTN_POMNG04010_SAVE']);
|
|
234
|
+
|
|
235
|
+ $('#ITP_FORM_POMNG04010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
|
|
236
|
+ $(this).attr('id') === 'ITP_FORM_POMNG04010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
|
|
237
|
+ if(elem.type === 'select') {
|
|
238
|
+ $(this).val('').prop('selected', true);
|
|
239
|
+ }
|
|
240
|
+ });
|
|
241
|
+ $('#ITP_FORM_POMNG04010_DETAIL #ITP_FORM_POMNG04010_DETAIL_FILE_NO').val('');
|
|
242
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BRAND_ID').removeAttr('readonly');
|
|
243
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BRAND_NM').removeAttr('readonly');
|
|
244
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BSNS_REG_NO').removeAttr('readonly');
|
|
245
|
+ $('#ITP_FORM_POMNG04010_DETAIL_CORP_REG_NO').removeAttr('readonly');
|
|
246
|
+ // $('#ITP_FORM_POMNG04010_DETAIL_SEARCH_AFFL_SHOP').removeAttr('disabled');
|
|
247
|
+ // $('#ITP_FORM_POMNG04010_DETAIL_DELETE_AFFL_SHOP').removeAttr('disabled');
|
|
248
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SEARCH_AFFL_SHOP').show();
|
|
249
|
+ $('#ITP_FORM_POMNG04010_DETAIL_DELETE_AFFL_SHOP').show();
|
|
250
|
+ $('#ITP_FORM_POMNG04010_DETAIL .itp_form_info').hide();
|
|
251
|
+ $('#ITP_FORM_POMNG04010_DETAIL .itp_form_change').show();
|
|
252
|
+
|
|
253
|
+ $('#ITP_FORM_POMNG04010_DETAIL #ITP_FORM_POMNG04010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
|
|
254
|
+ $('#ITP_FORM_POMNG04010_DETAIL #ITP_FORM_POMNG04010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
255
|
+
|
|
256
|
+ $('.fnBrandId').text('(자동부여)');
|
|
257
|
+ } else if(mode == 'MODIFY') { // 수정
|
|
258
|
+ $('#ITP_AJAX_POMNG04010_DETAIL_CONTAINER').show();
|
|
259
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG04010_CANCELLIST', '#ITP_BTN_POMNG04010_SAVE']);
|
|
260
|
+
|
|
261
|
+ $('#ITP_BTN_POMNG04010_CANCELLIST').show();
|
|
262
|
+ $('#ITP_BTN_POMNG04010_DELETE').show();
|
|
263
|
+
|
|
264
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BRAND_ID').attr('readonly', true);
|
|
265
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BRAND_NM').attr('readonly', true);
|
|
266
|
+ $('#ITP_FORM_POMNG04010_DETAIL_BSNS_REG_NO').attr('readonly', true);
|
|
267
|
+ $('#ITP_FORM_POMNG04010_DETAIL_CORP_REG_NO').attr('readonly', true);
|
|
268
|
+ // $('#ITP_FORM_POMNG04010_DETAIL_SEARCH_AFFL_SHOP').attr('disabled', true);
|
|
269
|
+ // $('#ITP_FORM_POMNG04010_DETAIL_DELETE_AFFL_SHOP').attr('disabled', true);
|
|
270
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SEARCH_AFFL_SHOP').hide();
|
|
271
|
+ $('#ITP_FORM_POMNG04010_DETAIL_DELETE_AFFL_SHOP').hide();
|
|
272
|
+ $('#ITP_FORM_POMNG04010_DETAIL .itp_form_info').show();
|
|
273
|
+ $('#ITP_FORM_POMNG04010_DETAIL .itp_form_change').hide();
|
|
274
|
+
|
|
275
|
+ $('#ITP_FORM_POMNG04010_DETAIL #ITP_FORM_POMNG04010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
276
|
+ } else if(mode == 'VIEW') { // 보기
|
|
277
|
+ $('#ITP_AJAX_POMNG04010_VIEW_CONTAINER').show();
|
|
278
|
+ fn_show_btn_auth_array(['#ITP_BTN_POMNG04010_MODIFY', '#ITP_BTN_POMNG04010_CANCELLIST']);
|
|
279
|
+ }
|
|
280
|
+ }
|
|
281
|
+};
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+/*목록화면 Object*/
|
|
285
|
+let listObj = {
|
|
286
|
+ init: function() {
|
|
287
|
+ this.grid.init();
|
|
288
|
+ },
|
|
289
|
+ itp_POMNG04010_param: {},
|
|
290
|
+ itp_POMNG04010_search: false,
|
|
291
|
+ button: {
|
|
292
|
+ search: function() {
|
|
293
|
+ listObj.itp_POMNG04010_search = true;
|
|
294
|
+ let param = $('#ITP_FORM_POMNG04010_SEARCH').serializeObject();
|
|
295
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
296
|
+ param.gridPage = $.jgrid.defaults.page;
|
|
297
|
+ param.sidx = '0';
|
|
298
|
+ console.log(JSON.stringify(param));
|
|
299
|
+ $(POMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
|
|
300
|
+ }
|
|
301
|
+ },
|
|
302
|
+ empty: {
|
|
303
|
+ init: function() {
|
|
304
|
+ var _this = this;
|
|
305
|
+ this.push();
|
|
306
|
+ $(POMNG04010_GRID_EMPTY).on('click', function() {
|
|
307
|
+ _this.back();
|
|
308
|
+ listObj.itp_POMNG04010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
309
|
+ $(POMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_POMNG04010_param)}).trigger('reloadGrid');
|
|
310
|
+ });
|
|
311
|
+ },
|
|
312
|
+ push: function() {
|
|
313
|
+ let param = $('#ITP_FORM_POMNG04010_SEARCH').serializeObject();
|
|
314
|
+ listObj.itp_POMNG04010_param = param;
|
|
315
|
+ param.sidx = '0';
|
|
316
|
+ },
|
|
317
|
+ back: function() {
|
|
318
|
+ $('#ITP_FORM_POMNG04010_SERVICE_BRAND_TYPE').val(listObj.itp_POMNG04010_param.brandType);
|
|
319
|
+ $('#ITP_FORM_POMNG04010_SERVICE_ST_CD').val(listObj.itp_POMNG04010_param.stCd);
|
|
320
|
+ $('#ITP_FORM_POMNG04010_SEARCH_BRAND_NM').val(listObj.itp_POMNG04010_param.brandNm);
|
|
321
|
+ }
|
|
322
|
+ },
|
|
323
|
+ grid: {
|
|
324
|
+ init: function() {
|
|
325
|
+ // 데이터 없을때
|
|
326
|
+ listObj.empty.push();
|
|
327
|
+ this.search();
|
|
328
|
+ },
|
|
329
|
+ colModel: gridColModel.list,
|
|
330
|
+ search: function() {
|
|
331
|
+ pageObj.switchScreen('LIST');
|
|
332
|
+ this.unload();
|
|
333
|
+ this.load();
|
|
334
|
+ },
|
|
335
|
+ load: function() {
|
|
336
|
+ let param = $('#ITP_FORM_POMNG04010_SEARCH').serializeObject();
|
|
337
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
338
|
+ param.sidx = '0';
|
|
339
|
+ console.log(JSON.stringify(param));
|
|
340
|
+ var option = {
|
|
341
|
+ gridId: POMNG04010_GRID_ID,
|
|
342
|
+ colModel: gridColModel.list,
|
|
343
|
+ param: param,
|
|
344
|
+ url: DOMAIN + API_POMNG_PO_DETAIL_GRID_LIST,
|
|
345
|
+ pager: POMNG04010_GRID_PAGER,
|
|
346
|
+ onCellSelect: function(rowId, cellIdx, cellValue) {
|
|
347
|
+ var cm = $(this).jqGrid('getGridParam', 'colModel');
|
|
348
|
+ var colNm = cm[cellIdx].name;
|
|
349
|
+ if (colNm === 'pchPodrUnqNo') {
|
|
350
|
+ const pchPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'pchPodrUnqNo');
|
|
351
|
+ const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
|
|
352
|
+ const key = {pchPodrUnqNo: pchPodrUnqNoVal, brandId: brandIdVal};
|
|
353
|
+ var param = $.param(key);
|
|
354
|
+ modifyObj.init(param);
|
|
355
|
+ }
|
|
356
|
+ },
|
|
357
|
+ loadComplete: function(data) {
|
|
358
|
+ console.log(data);
|
|
359
|
+ itp_fn_grid_load_complete(data, POMNG04010_GRID_ID, true, 'number', 'POMNG04010', listObj.itp_POMNG04010_search, listObj.empty, true, data.gridRecords, true);
|
|
360
|
+ var ids = $(POMNG04010_GRID_ID).getDataIDs();
|
|
361
|
+ $.each(ids, function(idx, rowId) {
|
|
362
|
+ $(POMNG04010_GRID_ID).jqGrid('setCell', rowId, 'pchPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
|
|
363
|
+ });
|
|
364
|
+ },
|
|
365
|
+ onPaging: function(action) {
|
|
366
|
+ itp_fn_grid_paging(POMNG04010_GRID_ID, action, param);
|
|
367
|
+ }
|
|
368
|
+ };
|
|
369
|
+ itp_fn_grid_make_remote(option);
|
|
370
|
+ },
|
|
371
|
+ clearData: function() {
|
|
372
|
+ $(POMNG04010_GRID_ID).jqGrid('clearGridData', true);
|
|
373
|
+ $(POMNG04010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
374
|
+ $(POMNG04010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
375
|
+ $(POMNG04010_GRID_EMPTY).show();
|
|
376
|
+ },
|
|
377
|
+ unload: function() {
|
|
378
|
+ $.jgrid.gridUnload(POMNG04010_GRID_ID);
|
|
379
|
+ }
|
|
380
|
+ },
|
|
381
|
+ action: function() {
|
|
382
|
+ var _this = this;
|
|
383
|
+ // 공급업체 조회 버튼 클릭
|
|
384
|
+ $('#ITP_BTN_POMNG04010_SEARCH_SPPLY_ID').on('click', function() {
|
|
385
|
+ _this.popup('spply');
|
|
386
|
+ });
|
|
387
|
+ // 공급업체 텍스트 삭제 버튼 클릭
|
|
388
|
+ $('#ITP_BTN_POMNG04010_DELETE_SPPLY_ID').on('click', function() {
|
|
389
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SPPLY_NM').val('');
|
|
390
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SPPLY_ID').val('');
|
|
391
|
+ });
|
|
392
|
+ // 매장/창고 조회 버튼 클릭
|
|
393
|
+ $('#ITP_BTN_POMNG04010_SEARCH_WHS_ID').on('click', function() {
|
|
394
|
+ _this.popup('whs');
|
|
395
|
+ });
|
|
396
|
+ // 매장/창고 텍스트 삭제 버튼 클릭
|
|
397
|
+ $('#ITP_BTN_POMNG04010_DELETE_WHS_ID').on('click', function() {
|
|
398
|
+ $('#ITP_FORM_POMNG04010_DETAIL_WHS_NM').val('');
|
|
399
|
+ $('#ITP_FORM_POMNG04010_DETAIL_WHS_ID').val('');
|
|
400
|
+ });
|
|
401
|
+ },
|
|
402
|
+ popup: function(keyword) {
|
|
403
|
+ var popFn = this.callback.create;
|
|
404
|
+ // const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
|
|
405
|
+ if(keyword === 'spply'){
|
|
406
|
+ fn_call_popup('biz', 'BIZPOP_STORE_SPPLY', '#ITP_ASIDE', popFn, /*key*/null, 'S');
|
|
407
|
+ } else if(keyword === 'whs'){
|
|
408
|
+ fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, /*key*/null, 'S');
|
|
409
|
+ }
|
|
410
|
+ },
|
|
411
|
+ callback: {
|
|
412
|
+ create: function(rowDataPop) {
|
|
413
|
+ console.log(rowDataPop);
|
|
414
|
+ if(rowDataPop.hasOwnProperty('whsId') == false) {
|
|
415
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SPPLY_NM').val(rowDataPop.spplyNm);
|
|
416
|
+ $('#ITP_FORM_POMNG04010_DETAIL_SPPLY_ID').val(rowDataPop.spplyId);
|
|
417
|
+ } else {
|
|
418
|
+ $('#ITP_FORM_POMNG04010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
|
|
419
|
+ $('#ITP_FORM_POMNG04010_DETAIL_WHS_ID').val(rowDataPop.whsId);
|
|
420
|
+ }
|
167
|
421
|
}
|
168
|
422
|
}
|
169
|
423
|
};
|
170
|
|
-console.log(CONN_KEY);
|
171
|
|
-console.log(CODE_LIST);
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+/*수정화면 Object*/
|
|
427
|
+let modifyObj = {
|
|
428
|
+ init: function(param) {
|
|
429
|
+ this.load(param);
|
|
430
|
+ },
|
|
431
|
+ itp_POMNG04010_param: {},
|
|
432
|
+ itp_POMNG04010_search: false,
|
|
433
|
+ button: {
|
|
434
|
+ cancel: function() {
|
|
435
|
+ listObj.grid.search();
|
|
436
|
+ }
|
|
437
|
+ },
|
|
438
|
+ empty: {
|
|
439
|
+ init: function() {
|
|
440
|
+ var _this = this;
|
|
441
|
+ this.push();
|
|
442
|
+ $(POMNG04010_VIEW_GRID_EMPTY).on('click', function() {
|
|
443
|
+ _this.back();
|
|
444
|
+ viewObj.itp_POMNG04010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
445
|
+ $(POMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(viewObj.itp_POMNG04010_param)}).trigger('reloadGrid');
|
|
446
|
+ });
|
|
447
|
+ },
|
|
448
|
+ push: function() {
|
|
449
|
+ let param = $('#ITP_FORM_POMNG04010_DETAIL').serializeObject();
|
|
450
|
+ viewObj.itp_POMNG04010_param = param;
|
|
451
|
+ },
|
|
452
|
+ back: function() {
|
|
453
|
+ $('#ITP_FORM_POMNG04010_SERVICE_BRAND_TYPE').val(viewObj.itp_POMNG04010_param.brandType);
|
|
454
|
+ $('#ITP_FORM_POMNG04010_SERVICE_ST_CD').val(viewObj.itp_POMNG04010_param.stCd);
|
|
455
|
+ $('#ITP_FORM_POMNG04010_SEARCH_BRAND_NM').val(viewObj.itp_POMNG04010_param.brandNm);
|
|
456
|
+ }
|
|
457
|
+ },
|
|
458
|
+ load: function(param) {
|
|
459
|
+ fn_ajax_call(API_POMNG_PO_INFO_PCHODR, param, this.callback, 'GET');
|
|
460
|
+ },
|
|
461
|
+ callback: function(result) {
|
|
462
|
+ console.log(result);
|
|
463
|
+
|
|
464
|
+ // 그리드 전화번호 '-' 함수
|
|
465
|
+ function convertTel(value){
|
|
466
|
+ answer = (value.startsWith('0')) ? value.replace(/[^0-9]/g, "")
|
|
467
|
+ .replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
|
|
468
|
+ .replace("--", "-") : '';
|
|
469
|
+ return answer;
|
|
470
|
+ }
|
|
471
|
+ let telNo = convertTel(result.podrMgrTelNo);
|
|
472
|
+
|
|
473
|
+ pageObj.switchScreen('MODIFY');
|
|
474
|
+ $('#ITP_FORM_POMNG04010_DETAIL #ITP_FORM_POMNG04010_DETAIL_AFFL_SHOP_ID').val(result.afflShopId);
|
|
475
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnBrandNm').text(result.brandNm);
|
|
476
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPchPodrUnqNo').text(result.pchPodrUnqNo);
|
|
477
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnSpplyNm').text(result.spplyId);
|
|
478
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPodrDt').text(result.podrDt);
|
|
479
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPchOdrStCd').text(result.pchOdrStNm);
|
|
480
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPodrTotalAmt').text(result.podrTotalAmt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','));
|
|
481
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPodrMgrNm').text(result.podrMgrNm);
|
|
482
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnPodrMgrNo').text(telNo);
|
|
483
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnDlvDvsn').text(result.dlvDvsnNm);
|
|
484
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnDlvReqDt').text(result.dlvReqDt);
|
|
485
|
+ $('#ITP_FORM_POMNG04010_DETAIL .fnShmtWhsNm').text(result.shmtWhsDvsnNm);
|
|
486
|
+
|
|
487
|
+ modifyObj.grid.init('MODIFY', result.pchOdrDtlList)
|
|
488
|
+ },
|
|
489
|
+ grid: {
|
|
490
|
+ init: function(mode, gridData) {
|
|
491
|
+ this.mode = mode;
|
|
492
|
+ this.gridId = (mode === 'VIEW') ? POMNG04010_VIEW_GRID_ID : POMNG04010_DETAIL_GRID_ID;
|
|
493
|
+ this.gridList = (mode === 'VIEW') ? POMNG04010_VIEW_GRID_LIST : POMNG04010_DETAIL_GRID_LIST;
|
|
494
|
+ this.gridEmpty = (mode === 'VIEW') ? POMNG04010_VIEW_GRID_EMPTY : POMNG04010_DETAIL_GRID_EMPTY;
|
|
495
|
+ this.unload();
|
|
496
|
+ this.load(mode, gridData);
|
|
497
|
+ },
|
|
498
|
+ mode: '',
|
|
499
|
+ colModel: gridColModel.view,
|
|
500
|
+ load: function(mode, gridData) {
|
|
501
|
+ var _this = this;
|
|
502
|
+ var option = {
|
|
503
|
+ gridId: _this.gridId,
|
|
504
|
+ colModel: gridColModel.detail,
|
|
505
|
+ data: gridData,
|
|
506
|
+ multiselect: true,
|
|
507
|
+ loadComplete: function(data) {
|
|
508
|
+ console.log(data);
|
|
509
|
+ itp_fn_grid_load_complete(data, POMNG04010_DETAIL_GRID_ID, true, 'number', 'POMNG04010', modifyObj.itp_POMNG04010_search, modifyObj.empty, true, data.gridRecords, true);
|
|
510
|
+ }
|
|
511
|
+ };
|
|
512
|
+ itp_fn_grid_make_local(option);
|
|
513
|
+ },
|
|
514
|
+ unload: function() {
|
|
515
|
+ $.jgrid.gridUnload(this.gridId);
|
|
516
|
+ }
|
|
517
|
+ }
|
|
518
|
+};
|