|
@@ -1,6 +1,6 @@
|
1
|
1
|
require(['config'], function() {
|
2
|
2
|
require([], function($) {
|
3
|
|
- listObj.init();
|
|
3
|
+ pageObj.init();
|
4
|
4
|
});
|
5
|
5
|
});
|
6
|
6
|
|
|
@@ -11,9 +11,8 @@ require(['config'], function() {
|
11
|
11
|
* const gridColModel = {} : 화면 Grid Object *
|
12
|
12
|
* let pageObj = {} : 화면공통 Object *
|
13
|
13
|
* let listObj = {} : 목록화면 Object *
|
14
|
|
- * let viewObj = {} : 상세화면 Object *
|
15
|
14
|
* let modifyObj = {} : 수정화면 Object *
|
16
|
|
- * let createObj = {} : 신규화면 Object *
|
|
15
|
+
|
17
|
16
|
*******************************************************/
|
18
|
17
|
|
19
|
18
|
/*화면 변수*/
|
|
@@ -22,17 +21,158 @@ const INOUTMNG01010_GRID_LIST = '#ITP_INOUTMNG01010_jqGrid_list';
|
22
|
21
|
const INOUTMNG01010_GRID_PAGER = '#ITP_INOUTMNG01010_jqGridPager';
|
23
|
22
|
const INOUTMNG01010_GRID_EMPTY = '#ITP_INOUTMNG01010_jqGridEmpty';
|
24
|
23
|
|
25
|
|
-let ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
|
26
|
|
-let INOUTMNG01010_LAST_ROW_ID;
|
|
24
|
+const INOUTMNG01010_DETAIL_GRID_ID = '#ITP_INOUTMNG01010_DETAIL_jqGrid';
|
|
25
|
+const INOUTMNG01010_DETAIL_GRID_LIST = '#ITP_INOUTMNG01010_DETAIL_jqGrid_list';
|
|
26
|
+const INOUTMNG01010_DETAIL_GRID_PAGER = '#ITP_INOUTMNG01010_DETAIL_jqGridPager';
|
|
27
|
+const INOUTMNG01010_DETAIL_GRID_EMPTY = '#ITP_INOUTMNG01010_DETAIL_jqGridEmpty';
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+//let ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
|
|
31
|
+let INOUTMNG01010_GRID_LAST_ROW_ID;
|
27
|
32
|
|
28
|
33
|
|
29
|
34
|
/*API URL*/
|
30
|
35
|
let API_DETAIL_GRID_LIST = '/api/pomng/inoutmng/target-grid-list'; // 목록
|
31
|
|
-
|
|
36
|
+let API_DETAIL_SAVE = '/api/pomng/inoutmng/save-inst-shmt'; // 출하지시
|
32
|
37
|
|
33
|
38
|
/*화면 Grid ColModel*/
|
34
|
39
|
const gridColModel = {
|
35
|
40
|
list: [
|
|
41
|
+ {
|
|
42
|
+ index: 'BRAND_ID', name: 'brandId',
|
|
43
|
+ label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
|
|
44
|
+ width: '13', fixed: false, align: 'center',
|
|
45
|
+ sortable: false, hidden: true
|
|
46
|
+ },
|
|
47
|
+ {
|
|
48
|
+ index: 'BRAND_NM', name: 'brandNm',
|
|
49
|
+ label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
|
|
50
|
+ width: '10', fixed: false, align: 'center',
|
|
51
|
+ sortable: false, hidden: false
|
|
52
|
+ },
|
|
53
|
+ {
|
|
54
|
+ index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
|
|
55
|
+ label: ITP_MSG_LOCALE.label.pchPodrUnqNo, //구매발주번호
|
|
56
|
+ width: '10', fixed: false, align: 'center',
|
|
57
|
+ sortable: false, hidden: false
|
|
58
|
+ },
|
|
59
|
+ {
|
|
60
|
+ index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
|
|
61
|
+ label: ITP_MSG_LOCALE.label.pchPodrDtlNo, //구매발주항번
|
|
62
|
+ width: '10', fixed: false, align: 'center',
|
|
63
|
+ sortable: false, hidden: false
|
|
64
|
+ },
|
|
65
|
+ {
|
|
66
|
+ index: 'ITEM_ID', name: 'itemId',
|
|
67
|
+ label: ITP_MSG_LOCALE.label.itemId, //품목아이디
|
|
68
|
+ width: '10', fixed: false, align: 'center',
|
|
69
|
+ sortable: false, hidden: false
|
|
70
|
+ },
|
|
71
|
+ {
|
|
72
|
+ index: 'ITEM_NM', name: 'itemNm',
|
|
73
|
+ label: ITP_MSG_LOCALE.label.itemNm, //품목명
|
|
74
|
+ width: '10', fixed: false, align: 'left',
|
|
75
|
+ sortable: false, hidden: false
|
|
76
|
+ },
|
|
77
|
+ {
|
|
78
|
+ index: 'WHS_ID', name: 'whsId',
|
|
79
|
+ label: ITP_MSG_LOCALE.label.whsId, //납품창고아이디
|
|
80
|
+ width: '13', fixed: false, align: 'center',
|
|
81
|
+ sortable: false, hidden: true
|
|
82
|
+ },
|
|
83
|
+ {
|
|
84
|
+ index: 'WHS_NM', name: 'whsNm',
|
|
85
|
+ label: ITP_MSG_LOCALE.label.whsNm, //납품창고명
|
|
86
|
+ width: '15', fixed: false, align: 'left',
|
|
87
|
+ sortable: false, hidden: false
|
|
88
|
+ },
|
|
89
|
+ {
|
|
90
|
+ index: 'LOCATION', name: 'location',
|
|
91
|
+ label: ITP_MSG_LOCALE.label.location, //납품LOCATION
|
|
92
|
+ width: '15', fixed: false, align: 'center',
|
|
93
|
+ sortable: false, hidden: true
|
|
94
|
+ },
|
|
95
|
+ {
|
|
96
|
+ index: 'UNIT_AMT', name: 'unitAmt',
|
|
97
|
+ label: ITP_MSG_LOCALE.label.unitAmt, //단가
|
|
98
|
+ width: '6', fixed: false, align: 'right',
|
|
99
|
+ sortable: false, hidden: false,
|
|
100
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
101
|
+ },
|
|
102
|
+ {
|
|
103
|
+ index: 'PODR_QTY', name: 'podrQty',
|
|
104
|
+ label: ITP_MSG_LOCALE.label.podrQty, //발주수량
|
|
105
|
+ width: '10', fixed: false, align: 'right',
|
|
106
|
+ sortable: false, hidden: false,
|
|
107
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
108
|
+ },
|
|
109
|
+ {
|
|
110
|
+ index: 'SHMT_QTY', name: 'shmtQty',
|
|
111
|
+ label: ITP_MSG_LOCALE.label.shmtQty, //출고수량
|
|
112
|
+ width: '10', fixed: false, align: 'right',
|
|
113
|
+ sortable: true, editable: false, edittype: 'text',
|
|
114
|
+ hidden: true
|
|
115
|
+ },
|
|
116
|
+ {
|
|
117
|
+ index: 'STCK_QTY', name: 'stckQty',
|
|
118
|
+ label: ITP_MSG_LOCALE.label.stckQty, //현 재고
|
|
119
|
+ width: '10', fixed: false, align: 'right',
|
|
120
|
+ sortable: false, hidden: false,
|
|
121
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
122
|
+ },
|
|
123
|
+ {
|
|
124
|
+ index: 'EXPRY_YN', name: 'expryYn',
|
|
125
|
+ label: ITP_MSG_LOCALE.label.expryYn, //유통기한여부
|
|
126
|
+ width: '10', fixed: false, align: 'center',
|
|
127
|
+ sortable: false, hidden: false
|
|
128
|
+ },
|
|
129
|
+ {
|
|
130
|
+ index: 'EXPRY_PERIOD', name: 'expryPeriod',
|
|
131
|
+ label: ITP_MSG_LOCALE.label.expryPeriod, //유통기한기간
|
|
132
|
+ width: '10', fixed: false, align: 'center',
|
|
133
|
+ sortable: false, hidden: true
|
|
134
|
+ },
|
|
135
|
+ {
|
|
136
|
+ index: 'EXPRY_DATE', name: 'expryDate',
|
|
137
|
+ label: ITP_MSG_LOCALE.label.expryDate, //유통일자
|
|
138
|
+ width: '20', fixed: false, align: 'center',
|
|
139
|
+ sortable: false, hidden: true,
|
|
140
|
+ editable: false, sorttype: "date",
|
|
141
|
+ editoptions: { dataInit: function(e) { $(e).datepicker(ITP_DATE_LANGUAGE); } }
|
|
142
|
+ },
|
|
143
|
+ {
|
|
144
|
+ index: 'PODR_AMT', name: 'podrAmt',
|
|
145
|
+ label: ITP_MSG_LOCALE.label.podrAmt, //발주금액
|
|
146
|
+ width: '10', fixed: false, align: 'right',
|
|
147
|
+ sortable: false, hidden: false,
|
|
148
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
149
|
+ },
|
|
150
|
+ {
|
|
151
|
+ index: 'DLV_REQ_DT', name: 'dlvReqDt',
|
|
152
|
+ label: ITP_MSG_LOCALE.label.dlvReqDt, //납품요청일
|
|
153
|
+ width: '10', fixed: false, align: 'center',
|
|
154
|
+ sortable: false, hidden: false
|
|
155
|
+ },
|
|
156
|
+ {
|
|
157
|
+ index: 'SHMT_WHS_ID', name: 'shmtWhsId',
|
|
158
|
+ label: ITP_MSG_LOCALE.label.shmtWhsId, //출고창고아이디
|
|
159
|
+ width: '10', fixed: false, align: 'right',
|
|
160
|
+ sortable: false, hidden: true
|
|
161
|
+ },
|
|
162
|
+ {
|
|
163
|
+ index: 'SHMT_LOCATION', name: 'shmtLocation',
|
|
164
|
+ label: ITP_MSG_LOCALE.label.shmtLocation, //출고LOCATION
|
|
165
|
+ width: '10', fixed: false, align: 'center',
|
|
166
|
+ sortable: false, hidden: true
|
|
167
|
+ },
|
|
168
|
+ {
|
|
169
|
+ index: 'SHMT_WHS_NM', name: 'shmtWhsNm',
|
|
170
|
+ label: ITP_MSG_LOCALE.label.shmtWhsNm, //출고창고명
|
|
171
|
+ width: '10', fixed: false, align: 'center',
|
|
172
|
+ sortable: false, hidden: false
|
|
173
|
+ }
|
|
174
|
+ ],
|
|
175
|
+ detail: [
|
36
|
176
|
{
|
37
|
177
|
index: 'BRAND_ID', name: 'brandId',
|
38
|
178
|
label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
|
|
@@ -170,68 +310,53 @@ const gridColModel = {
|
170
|
310
|
]
|
171
|
311
|
};
|
172
|
312
|
|
173
|
|
-
|
174
|
|
-
|
175
|
|
-/*목록화면 Object*/
|
176
|
|
-let listObj = {
|
177
|
|
- init: function() {
|
178
|
|
- this.view();
|
179
|
|
- this.action();
|
|
313
|
+/*화면공통 Object*/
|
|
314
|
+let pageObj = {
|
|
315
|
+ init: function () {
|
|
316
|
+ this.ui.init();
|
180
|
317
|
this.event.init();
|
181
|
|
- this.grid.init();
|
182
|
|
- },
|
183
|
|
- view: function() {
|
184
|
|
- // 버튼 권한설정
|
185
|
|
- fn_proc_btn_auth('INOUTMNG01010');
|
186
|
|
-
|
187
|
|
- // 공통코드 표시
|
188
|
|
- $('select').each(function() {
|
189
|
|
- if ($(this).data('select-code')) {
|
190
|
|
- fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
191
|
|
- }
|
192
|
|
- });
|
193
|
|
-
|
194
|
|
- var now = new Date();
|
195
|
|
- $('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
196
|
|
- $('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
|
197
|
|
- $('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
|
198
|
|
-
|
199
|
|
-
|
|
318
|
+ this.action();
|
200
|
319
|
},
|
201
|
|
- itp_INOUTMNG01010_search: false,
|
202
|
|
- button: {
|
203
|
|
- search: function() {
|
204
|
|
- console.log("search event");
|
205
|
|
- listObj.itp_INOUTMNG01010_search = true;
|
206
|
|
- let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
|
207
|
|
- param.gridSize = $.jgrid.defaults.rowNum;
|
208
|
|
- param.gridPage = $.jgrid.defaults.page;
|
209
|
|
- param.sbrandId = fn_make_user_info.get('brandId');
|
210
|
|
- $(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
|
|
320
|
+ ui: {
|
|
321
|
+ init: function () {
|
|
322
|
+ this.view();
|
|
323
|
+ this.grid();
|
|
324
|
+ this.ready();
|
211
|
325
|
},
|
212
|
|
- shmtout: function() {
|
213
|
|
-
|
214
|
|
- console.log("search event");
|
215
|
|
- listObj.itp_INOUTMNG01010_search = true;
|
216
|
|
- let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
|
217
|
|
- param.gridSize = $.jgrid.defaults.rowNum;
|
218
|
|
- param.gridPage = $.jgrid.defaults.page;
|
219
|
|
- param.sbrandId = fn_make_user_info.get('brandId');
|
220
|
|
- $(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
|
221
|
|
-
|
|
326
|
+ view: function() {
|
|
327
|
+ // 버튼 권한설정
|
|
328
|
+ fn_proc_btn_auth('INOUTMNG01010');
|
|
329
|
+
|
|
330
|
+ // 공통코드 표시
|
|
331
|
+ $('select').each(function() {
|
|
332
|
+ if($(this).data('select-code')) {
|
|
333
|
+ fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
|
334
|
+ }
|
|
335
|
+ });
|
222
|
336
|
|
|
337
|
+ // 조회일자 지정
|
|
338
|
+ var now = new Date();
|
|
339
|
+ $('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
|
340
|
+ $('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
|
|
341
|
+ $('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
|
|
342
|
+ },
|
|
343
|
+ grid: function() {
|
|
344
|
+ itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
|
|
345
|
+ listObj.empty.init();
|
|
346
|
+ itp_fn_fire_window_resize();
|
|
347
|
+ },
|
|
348
|
+ ready: function() {
|
|
349
|
+ listObj.init();
|
223
|
350
|
}
|
224
|
351
|
},
|
225
|
|
- action: function() {
|
|
352
|
+ action: function () {
|
226
|
353
|
var _this = this;
|
227
|
354
|
// 출하창고 조회 버튼 클릭
|
228
|
355
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SHMT_WHS_NM').on('click', function() {
|
229
|
|
- console.log("=================================");
|
230
|
356
|
_this.popup('S');
|
231
|
357
|
});
|
232
|
358
|
// 출하창고 텍스트 삭제 버튼 클릭
|
233
|
359
|
$('#ITP_FORM_INOUTMNG01010_DELETE_SHMT_WHS_NM').on('click', function() {
|
234
|
|
- console.log("=================================");
|
235
|
360
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val('');
|
236
|
361
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val('');
|
237
|
362
|
|
|
@@ -239,18 +364,15 @@ let listObj = {
|
239
|
364
|
|
240
|
365
|
// 납품장소 조회 버튼 클릭
|
241
|
366
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_WHS_NM').on('click', function() {
|
242
|
|
- console.log("=================================");
|
243
|
367
|
_this.popup('W');
|
244
|
368
|
});
|
245
|
369
|
// 납품장소 텍스트 삭제 버튼 클릭
|
246
|
370
|
$('#ITP_FORM_INOUTMNG01010_DELETE_WHS_NM').on('click', function() {
|
247
|
|
- console.log("=================================");
|
248
|
371
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val('');
|
249
|
372
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val('');
|
250
|
373
|
});
|
251
|
|
-
|
252
|
374
|
},
|
253
|
|
- popup: function(arg) {
|
|
375
|
+ popup: function (arg) {
|
254
|
376
|
var popFn;
|
255
|
377
|
// 팝업
|
256
|
378
|
if (arg == "S") {
|
|
@@ -272,11 +394,11 @@ let listObj = {
|
272
|
394
|
|
273
|
395
|
|
274
|
396
|
fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
|
275
|
|
-
|
|
397
|
+
|
|
398
|
+
|
276
|
399
|
},
|
277
|
400
|
callback: {
|
278
|
401
|
shmtwhs: function(rowDataPop) {
|
279
|
|
- console.log(rowDataPop);
|
280
|
402
|
if (rowDataPop) {
|
281
|
403
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(rowDataPop.whsNm);
|
282
|
404
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(rowDataPop.whsId);
|
|
@@ -284,7 +406,6 @@ let listObj = {
|
284
|
406
|
|
285
|
407
|
},
|
286
|
408
|
whs: function(rowDataPop) {
|
287
|
|
- console.log(rowDataPop);
|
288
|
409
|
if (rowDataPop) {
|
289
|
410
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
|
290
|
411
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
|
|
@@ -293,33 +414,145 @@ let listObj = {
|
293
|
414
|
}
|
294
|
415
|
},
|
295
|
416
|
event: {
|
296
|
|
- init: function() {
|
|
417
|
+ init: function () {
|
297
|
418
|
this.button();
|
298
|
419
|
},
|
299
|
|
- button: function() {
|
|
420
|
+ button: function () {
|
300
|
421
|
// 버튼 클릭 이벤트
|
301
|
422
|
$('button').each(function() {
|
302
|
423
|
var id = $(this).attr('id');
|
303
|
424
|
$(this).on('click', function() {
|
304
|
|
- console.log("button");
|
305
|
|
- console.log(id);
|
306
|
425
|
switch (id) {
|
307
|
|
- case 'ITP_BTN_INOUTMNG01010_SRH': listObj.button.search(); break; // 조회 버튼 클릭
|
308
|
|
- case 'ITP_BTN_INOUTMNG01010_OUT': listObj.button.shmtout(); break; // 출하지시 버튼
|
309
|
|
-
|
|
426
|
+ case 'ITP_BTN_INOUTMNG01010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
|
427
|
+ case 'ITP_BTN_INOUTMNG01010_OUC' : listObj.button.shmtcreat(); break; // 출하생성 버튼
|
|
428
|
+ case 'ITP_BTN_INOUTMNG01010_OUT' : modifyObj.button.save(); break; // 출하지시 버튼
|
|
429
|
+ case 'ITP_BTN_INOUTMNG01010_CANCELLIST' : modifyObj.button.cancel(); break; // 취소/목록 버튼
|
310
|
430
|
}
|
311
|
431
|
});
|
312
|
432
|
});
|
313
|
|
-
|
|
433
|
+
|
314
|
434
|
$('body').on('click', function(e) {
|
315
|
|
- var gridId = INOUTMNG01010_GRID_ID.replace('#', '');
|
316
|
|
- var rids = $(INOUTMNG01010_GRID_ID).jqGrid('getDataIDs');
|
|
435
|
+
|
|
436
|
+ var gridId = (INOUTMNG01010_DETAIL_GRID_ID).replace('#', '');
|
|
437
|
+ var rids = $(INOUTMNG01010_DETAIL_GRID_ID).jqGrid('getDataIDs');
|
317
|
438
|
var last_row_id = rids[rids.length - 1];
|
318
|
|
-
|
319
|
|
- itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010');
|
|
439
|
+
|
|
440
|
+ itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010_DETAIL');
|
320
|
441
|
});
|
321
|
442
|
|
|
443
|
+ }
|
|
444
|
+ },
|
|
445
|
+ switchScreen: function(mode) {
|
|
446
|
+ $('.itp_det_head').find('button[id^="ITP_BTN_INOUTMNG01010_"]').each(function(i) {
|
|
447
|
+ $(this).hide();
|
|
448
|
+ });
|
|
449
|
+ $('#ITP_TAB_INOUTMNG01010').find('div[id$="_CONTAINER"]').each(function(i) {
|
|
450
|
+ $(this).hide();
|
|
451
|
+ });
|
|
452
|
+ if(mode == 'LIST') { // 목록
|
|
453
|
+ $('#ITP_AJAX_INOUTMNG01010_LIST_CONTAINER').show();
|
|
454
|
+ fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG01010_SRH', '#ITP_BTN_INOUTMNG01010_OUC']);
|
|
455
|
+ $('#ITP_FORM_INOUTMNG01010_DETAIL_SBRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
456
|
+ } else if(mode == 'DETAIL') { // 출하지시 상세
|
|
457
|
+ $('#ITP_AJAX_INOUTMNG01010_DETAIL_CONTAINER').show();
|
|
458
|
+ fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG01010_OUT', '#ITP_BTN_INOUTMNG01010_CANCELLIST']);
|
|
459
|
+ $('#ITP_FORM_INOUTMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
460
|
+
|
|
461
|
+ //pageObj.grid.init(param);
|
|
462
|
+ }
|
|
463
|
+ },
|
|
464
|
+ grid: {
|
|
465
|
+ init: function(param) {
|
|
466
|
+ this.gridId = INOUTMNG01010_DETAIL_GRID_ID;
|
|
467
|
+ this.gridList = INOUTMNG01010_DETAIL_GRID_LIST;
|
|
468
|
+ this.gridEmpty = INOUTMNG01010_DETAIL_GRID_EMPTY;
|
|
469
|
+ var now = new Date();
|
|
470
|
+ $('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
|
471
|
+ $('#ITP_FORM_INOUTMNG01010_DETAIL_DLV_SCH_DT').datepicker('setDate', new Date(param.dlvSchDt));
|
|
472
|
+ $('#ITP_FORM_INOUTMNG01010_DETAIL .fnBrandNm').text(param.brandNm);
|
|
473
|
+
|
|
474
|
+ this.gridRows = param.recordData;
|
|
475
|
+ this.unload();
|
|
476
|
+ this.load(param.recordData);
|
|
477
|
+
|
|
478
|
+ },
|
|
479
|
+ gridId: '',
|
|
480
|
+ button: {},
|
|
481
|
+ gridList: '',
|
|
482
|
+ gridEmpty: '',
|
|
483
|
+ gridRows: '',
|
|
484
|
+ load: function(gridRows) {
|
|
485
|
+
|
|
486
|
+ var _this = this;
|
|
487
|
+ var option = {
|
|
488
|
+ gridId: _this.gridId,
|
|
489
|
+ colModel: gridColModel.detail,
|
|
490
|
+ data: gridRows,
|
|
491
|
+ loadComplete: function(data) {
|
|
492
|
+ $(INOUTMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
|
|
493
|
+ data.records === 0 ? _this.clearData(mode) : $(INOUTMNG01010_DETAIL_GRID_EMPTY).hide();
|
|
494
|
+
|
|
495
|
+ },
|
|
496
|
+ onCellSelect: function(rowid, cellIdx, cellValue) {
|
|
497
|
+ INOUTMNG01010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_GRID_LAST_ROW_ID, _this.gridId, ['pchReqDtlNo']);
|
|
498
|
+ }
|
|
499
|
+ };
|
|
500
|
+ itp_fn_grid_make_local(option);
|
|
501
|
+ },
|
|
502
|
+ clearData : function(mode) {
|
|
503
|
+ $(INOUTMNG01010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
|
|
504
|
+ $(INOUTMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
505
|
+ $(INOUTMNG01010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
506
|
+ $(INOUTMNG01010_DETAIL_GRID_EMPTY).show();
|
|
507
|
+ },
|
|
508
|
+ unload : function() {
|
|
509
|
+ $.jgrid.gridUnload(this.gridId);
|
|
510
|
+ }
|
|
511
|
+ }
|
|
512
|
+};
|
322
|
513
|
|
|
514
|
+/*목록화면 Object*/
|
|
515
|
+let listObj = {
|
|
516
|
+ init: function () {
|
|
517
|
+ this.grid.init();
|
|
518
|
+ },
|
|
519
|
+ itp_INOUTMNG01010_search: false,
|
|
520
|
+ button: {
|
|
521
|
+ search: function() {
|
|
522
|
+ listObj.itp_INOUTMNG01010_search = true;
|
|
523
|
+ let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
|
|
524
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
525
|
+ param.gridPage = $.jgrid.defaults.page;
|
|
526
|
+ $(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
|
|
527
|
+ },
|
|
528
|
+ shmtcreat: function() {
|
|
529
|
+ //선택되어진 row 값 전송할예정
|
|
530
|
+ let gridUpdateData = [];
|
|
531
|
+ const rowKey = $(INOUTMNG01010_GRID_ID).getGridParam('selrow');
|
|
532
|
+ if (!rowKey) {
|
|
533
|
+ return;
|
|
534
|
+ }
|
|
535
|
+
|
|
536
|
+ var selectedIds = $(INOUTMNG01010_GRID_ID).getGridParam('selarrrow');
|
|
537
|
+
|
|
538
|
+ var brandNm = "";
|
|
539
|
+ var maxDlvSchDt = "";
|
|
540
|
+
|
|
541
|
+ for (var i=selectedIds.length-1; i>=0; i--) {
|
|
542
|
+ var rowData = $(INOUTMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[i]);
|
|
543
|
+
|
|
544
|
+ gridUpdateData.push(rowData);
|
|
545
|
+ if (rowData.dlvReqDt > maxDlvSchDt) {
|
|
546
|
+ maxDlvSchDt = rowData.dlvReqDt;
|
|
547
|
+ }
|
|
548
|
+ sbrandNm =rowData.brandNm;
|
|
549
|
+ }
|
|
550
|
+
|
|
551
|
+ let param = {brandNm: sbrandNm, dlvSchDt: maxDlvSchDt };
|
|
552
|
+ param.recordData = gridUpdateData;
|
|
553
|
+ pageObj.switchScreen('DETAIL');
|
|
554
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_INOUTMNG01010_DETAIL');
|
|
555
|
+ pageObj.grid.init(param);
|
323
|
556
|
}
|
324
|
557
|
},
|
325
|
558
|
empty: {
|
|
@@ -329,7 +562,7 @@ let listObj = {
|
329
|
562
|
$(INOUTMNG01010_GRID_EMPTY).on('click', function() {
|
330
|
563
|
_this.back();
|
331
|
564
|
_this.itp_INOUTMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
|
332
|
|
- $(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(_this.itp_INOUTMNG01010_param) }).trigger('reloadGrid');
|
|
565
|
+ $(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_INOUTMNG01010_param)}).trigger('reloadGrid');
|
333
|
566
|
});
|
334
|
567
|
},
|
335
|
568
|
itp_INOUTMNG01010_param: {},
|
|
@@ -341,43 +574,39 @@ let listObj = {
|
341
|
574
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').val(this.itp_INOUTMNG01010_param.fromDt);
|
342
|
575
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').val(this.itp_INOUTMNG01010_param.toDt);
|
343
|
576
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(this.itp_INOUTMNG01010_param.sshmtWhsId);
|
|
577
|
+ $('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(this.itp_INOUTMNG01010_param.sshmtWhsNm);
|
|
578
|
+ $('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(this.itp_INOUTMNG01010_param.swhsNm);
|
344
|
579
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(this.itp_INOUTMNG01010_param.swhsId);
|
345
|
580
|
$('#ITP_FORM_INOUTMNG01010_SEARCH_ITEM_NM').val(this.itp_INOUTMNG01010_param.sItemNm);
|
346
|
581
|
}
|
347
|
582
|
},
|
348
|
583
|
grid: {
|
349
|
|
- init: function() {
|
|
584
|
+ init: function () {
|
350
|
585
|
// 데이터 없을때
|
351
|
586
|
listObj.empty.push();
|
352
|
587
|
itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
|
353
|
588
|
itp_fn_fire_window_resize();
|
354
|
589
|
this.search();
|
355
|
|
-
|
|
590
|
+
|
356
|
591
|
},
|
357
|
592
|
colModel: gridColModel.list,
|
358
|
593
|
search: function() {
|
|
594
|
+ pageObj.switchScreen('LIST');
|
359
|
595
|
this.unload();
|
360
|
596
|
this.load();
|
361
|
597
|
},
|
362
|
598
|
load: function() {
|
363
|
599
|
let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
|
364
|
600
|
param.gridSize = $.jgrid.defaults.rowNum;
|
365
|
|
- param.sbrandId = fn_make_user_info.get('brandId');
|
366
|
|
-
|
|
601
|
+
|
367
|
602
|
var option = {
|
368
|
603
|
multiselect: true,
|
369
|
604
|
autowidth: true,
|
370
|
|
- //cellEdit: true,
|
371
|
605
|
gridId: INOUTMNG01010_GRID_ID,
|
372
|
606
|
colModel: gridColModel.list,
|
373
|
|
- //viewrecords:false,
|
374
|
607
|
param: param,
|
375
|
608
|
url: DOMAIN + API_DETAIL_GRID_LIST,
|
376
|
609
|
pager: INOUTMNG01010_GRID_PAGER,
|
377
|
|
-
|
378
|
|
- onCellSelect: function(rowid, cellIdx, cellValue) {
|
379
|
|
- INOUTMNG01010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_LAST_ROW_ID, INOUTMNG01010_GRID_ID, ['pchPodrUnqNo']);
|
380
|
|
- },
|
381
|
610
|
loadComplete: function(data) {
|
382
|
611
|
itp_fn_grid_load_complete(data, INOUTMNG01010_GRID_ID, true, 'number', 'INOUTMNG01010', listObj.itp_INOUTMNG01010_search, listObj.empty, true, data.gridRecords, true);
|
383
|
612
|
},
|
|
@@ -389,10 +618,10 @@ let listObj = {
|
389
|
618
|
},
|
390
|
619
|
button: {
|
391
|
620
|
},
|
392
|
|
- unload: function() {
|
|
621
|
+ unload : function() {
|
393
|
622
|
$.jgrid.gridUnload(INOUTMNG01010_GRID_ID);
|
394
|
623
|
},
|
395
|
|
- clearData: function() {
|
|
624
|
+ clearData : function() {
|
396
|
625
|
$(INOUTMNG01010_GRID_ID).jqGrid('clearGridData', true);
|
397
|
626
|
$(INOUTMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
398
|
627
|
$(INOUTMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
@@ -401,4 +630,84 @@ let listObj = {
|
401
|
630
|
}
|
402
|
631
|
};
|
403
|
632
|
|
|
633
|
+/*수정화면 Object*/
|
|
634
|
+let modifyObj = {
|
|
635
|
+ init: function (param) {
|
|
636
|
+ this.load(param);
|
|
637
|
+ },
|
|
638
|
+ button: {
|
|
639
|
+ modify: function (param) {
|
|
640
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_INOUTMNG01010_DETAIL');
|
|
641
|
+ //const selectVal = $('#ITP_FORM_INOUTMNG01010_VIEW_STORE_ID').val();
|
|
642
|
+ //const key = {brandId:fn_make_user_info.get('brandId'), storeId: selectVal, viewCd: 'R'};
|
|
643
|
+ //var param = $.param(key);
|
|
644
|
+ //modifyObj.load(param);
|
|
645
|
+ },
|
|
646
|
+ cancel: function() {
|
|
647
|
+ document.getElementById('ITP_FORM_INOUTMNG01010_DETAIL').reset();
|
|
648
|
+ listObj.grid.search();
|
|
649
|
+ },
|
|
650
|
+ save: function() {
|
|
651
|
+ $('body').trigger('click');
|
|
652
|
+ const formId = ('#ITP_FORM_INOUTMNG01010_DETAIL');
|
|
653
|
+ itp_fn_form_clear_validate(null, formId);
|
|
654
|
+
|
|
655
|
+ if (itp_fn_form_event.isValid(formId)) {
|
|
656
|
+
|
|
657
|
+ var modalFn = {
|
|
658
|
+ callBack: () => {
|
|
659
|
+ itp_fn_form_event.removeChar('#ITP_FORM_OPER03010_DETAIL');
|
|
660
|
+ var chkQtyYn = "N";
|
|
661
|
+ let gridInsertData = [];
|
|
662
|
+ const rowData = $(INOUTMNG01010_DETAIL_GRID_ID).getRowData();
|
|
663
|
+
|
|
664
|
+ $.each(rowData, function(key, value) {
|
|
665
|
+
|
|
666
|
+ if (value.shmtQty == '' || value.shmtQty < 1 ) {
|
|
667
|
+ alert("출고수량을 입력해주세요!");
|
|
668
|
+ chkQtyYn = "Y";
|
|
669
|
+ return false;
|
|
670
|
+ }
|
|
671
|
+
|
|
672
|
+ if (value.stckQty < valus.shmtQty) {
|
|
673
|
+ alert("출고지시할 수량이 부족합니다.");
|
|
674
|
+ chkQtyYn = "Y";
|
|
675
|
+ return false;
|
|
676
|
+ }
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+ if (value.podrQty > value.shmtQty ) {
|
|
680
|
+ alert("출고수량이 발주수량보다 클수 없습니다!");
|
|
681
|
+ chkQtyYn = "Y";
|
|
682
|
+ return false;
|
|
683
|
+ }
|
|
684
|
+
|
|
685
|
+ gridInsertData.push(value);
|
|
686
|
+ });
|
|
687
|
+
|
|
688
|
+ if (chkQtyYn == "Y") return;
|
|
689
|
+
|
|
690
|
+ let param = $(formId).serializeObject();
|
|
691
|
+ param.viewCd = "C";
|
|
692
|
+ param.gridInsertData = gridInsertData;
|
|
693
|
+ console.log(JSON.stringify(param));
|
|
694
|
+ var searhFn = function () {
|
|
695
|
+ //ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
|
|
696
|
+ pageObj.grid.clearData();
|
|
697
|
+ modifyObj.button.cancel();
|
|
698
|
+ }
|
|
699
|
+ fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
|
700
|
+ }
|
|
701
|
+ };
|
|
702
|
+ itp_fn_modal_confirm('출하지시 하시겠습니까?', modalFn);
|
|
703
|
+ }
|
|
704
|
+ }
|
|
705
|
+ },
|
|
706
|
+
|
|
707
|
+ load: function(param) {
|
|
708
|
+ //console.log(param);
|
|
709
|
+ //pageObj.grid.load("DETAIL",param);
|
|
710
|
+ }
|
|
711
|
+};
|
|
712
|
+
|
404
|
713
|
|