|
@@ -0,0 +1,492 @@
|
|
1
|
+require(['config'], function() {
|
|
2
|
+ require([], function($) {
|
|
3
|
+ listObj.init();
|
|
4
|
+ });
|
|
5
|
+});
|
|
6
|
+
|
|
7
|
+/********************************************************
|
|
8
|
+ --------------------------------------------------------
|
|
9
|
+ - Object 목록 -
|
|
10
|
+ --------------------------------------------------------
|
|
11
|
+ * const gridColModel = {} : 화면 Grid Object *
|
|
12
|
+ * let pageObj = {} : 화면공통 Object *
|
|
13
|
+ * let listObj = {} : 목록화면 Object *
|
|
14
|
+ * let viewObj = {} : 상세화면 Object *
|
|
15
|
+ * let modifyObj = {} : 수정화면 Object *
|
|
16
|
+ * let createObj = {} : 신규화면 Object *
|
|
17
|
+ *******************************************************/
|
|
18
|
+
|
|
19
|
+/*화면 변수*/
|
|
20
|
+const RTNMNG05010_GRID_ID = '#ITP_RTNMNG05010_jqGrid';
|
|
21
|
+const RTNMNG05010_GRID_LIST = '#ITP_RTNMNG05010_jqGrid_list';
|
|
22
|
+const RTNMNG05010_GRID_PAGER = '#ITP_RTNMNG05010_jqGridPager';
|
|
23
|
+const RTNMNG05010_GRID_EMPTY = '#ITP_RTNMNG05010_jqGridEmpty';
|
|
24
|
+
|
|
25
|
+let ITP_FORM_RTNMNG05010_DETAIL_IS_WRITING = false;
|
|
26
|
+let RTNMNG05010_LAST_ROW_ID;
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+/*API URL*/
|
|
30
|
+let API_DETAIL_GRID_LIST = '/api/rtnmng/inoutmng/retstock-target-grid-list'; // 목록
|
|
31
|
+let API_DETAIL_SAVE = '/api/rtnmng/inoutmng/save-retstock'; // 반품처리
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+/*화면 Grid ColModel*/
|
|
35
|
+const gridColModel = {
|
|
36
|
+ list: [
|
|
37
|
+ {
|
|
38
|
+ index: 'BRAND_ID', name: 'brandId',
|
|
39
|
+ label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
|
|
40
|
+ width: '10', fixed: false, align: 'center',
|
|
41
|
+ sortable: false, hidden: true
|
|
42
|
+ },
|
|
43
|
+ {
|
|
44
|
+ index: 'BRAND_NM', name: 'brandNm',
|
|
45
|
+ label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
|
|
46
|
+ width: '10', fixed: false, align: 'left',
|
|
47
|
+ sortable: false, hidden: false
|
|
48
|
+ },
|
|
49
|
+ {
|
|
50
|
+ index: 'COL_PICK_UNQ_NO', name: 'colPickUnqNo',
|
|
51
|
+ label: '수거서번호',
|
|
52
|
+ width: '10', fixed: false, align: 'center',
|
|
53
|
+ sortable: false, hidden: true
|
|
54
|
+ },
|
|
55
|
+ {
|
|
56
|
+ index: 'COL_PICK_DTL_NO', name: 'colPickDtlNo',
|
|
57
|
+ label: '수거서항번',
|
|
58
|
+ width: '5', fixed: false, align: 'center',
|
|
59
|
+ sortable: false, hidden: true
|
|
60
|
+ },
|
|
61
|
+ {
|
|
62
|
+ index: 'RTN_PODR_UNQ_NO', name: 'rtnPodrUnqNo',
|
|
63
|
+ label: '반품발주번호',
|
|
64
|
+ width: '12', fixed: false, align: 'center',
|
|
65
|
+ sortable: false, hidden: false
|
|
66
|
+ },
|
|
67
|
+ {
|
|
68
|
+ index: 'RTN_PODR_DTL_NO', name: 'rtnPodrDtlNo',
|
|
69
|
+ label: '항번',
|
|
70
|
+ width: '5', fixed: false, align: 'center',
|
|
71
|
+ sortable: false, hidden: false
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ index: 'ITEM_ID', name: 'itemId',
|
|
75
|
+ label: ITP_MSG_LOCALE.label.itemId, //품목아이디
|
|
76
|
+ width: '13', fixed: false, align: 'center',
|
|
77
|
+ sortable: false, hidden: false
|
|
78
|
+ },
|
|
79
|
+ {
|
|
80
|
+ index: 'ITEM_NM', name: 'itemNm',
|
|
81
|
+ label: ITP_MSG_LOCALE.label.itemNm, //품목명
|
|
82
|
+ width: '10', fixed: false, align: 'left',
|
|
83
|
+ sortable: false, hidden: false
|
|
84
|
+ },
|
|
85
|
+ {
|
|
86
|
+ index: 'COL_QTY', name: 'colQty',
|
|
87
|
+ label: '수거수량',
|
|
88
|
+ width: '8', fixed: false, align: 'right',
|
|
89
|
+ sortable: true, editable: true, edittype: 'text',
|
|
90
|
+ editrules: { required: false, number: true },
|
|
91
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
92
|
+ },
|
|
93
|
+ {
|
|
94
|
+ index: 'COL_REQ_QTY', name: 'colReqQty',
|
|
95
|
+ label: '수거요청수량',
|
|
96
|
+ width: '8', fixed: false, align: 'right',
|
|
97
|
+ sortable: false, hidden: false,
|
|
98
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
99
|
+ },
|
|
100
|
+ {
|
|
101
|
+ index: 'RODR_QTY', name: 'rodrQty',
|
|
102
|
+ label: '반품발주수량',
|
|
103
|
+ width: '8', fixed: false, align: 'right',
|
|
104
|
+ sortable: false, hidden: true,
|
|
105
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
106
|
+ },
|
|
107
|
+ {
|
|
108
|
+ index: 'COL_AMT', name: 'colAmt',
|
|
109
|
+ label: '수거금액',
|
|
110
|
+ width: '10', fixed: false, align: 'right',
|
|
111
|
+ sortable: false, hidden: false,
|
|
112
|
+ formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
113
|
+ },
|
|
114
|
+ {
|
|
115
|
+ index: 'WHS_ID', name: 'whsId',
|
|
116
|
+ label: '반품입고창고',
|
|
117
|
+ width: '10', fixed: false, align: 'center',
|
|
118
|
+ sortable: false, hidden: true
|
|
119
|
+ },
|
|
120
|
+ {
|
|
121
|
+ index: 'LOCATION', name: 'location',
|
|
122
|
+ label: '반품입고창고location',
|
|
123
|
+ width: '10', fixed: false, align: 'center',
|
|
124
|
+ sortable: false, hidden: true
|
|
125
|
+ },
|
|
126
|
+ {
|
|
127
|
+ index: 'WHS_NM', name: 'whsNm',
|
|
128
|
+ label: '반품입고창고',
|
|
129
|
+ width: '10', fixed: false, align: 'center',
|
|
130
|
+ sortable: false, hidden: false
|
|
131
|
+ },
|
|
132
|
+ {
|
|
133
|
+ index: 'RTN_WHS_ID', name: 'rtnWhsId',
|
|
134
|
+ label: '수거창고',
|
|
135
|
+ width: '10', fixed: false, align: 'center',
|
|
136
|
+ sortable: false, hidden: true
|
|
137
|
+ },
|
|
138
|
+ {
|
|
139
|
+ index: 'RTN_LOCATION', name: 'rtnLocation',
|
|
140
|
+ label: '수거LOCATION',
|
|
141
|
+ width: '10', fixed: false, align: 'center',
|
|
142
|
+ sortable: false, hidden: true
|
|
143
|
+ },
|
|
144
|
+ {
|
|
145
|
+ index: 'RTN_WHS_NM', name: 'rtnWhsNm',
|
|
146
|
+ label: '수거창고명',
|
|
147
|
+ width: '10', fixed: false, align: 'center',
|
|
148
|
+ sortable: false, hidden: false
|
|
149
|
+ },
|
|
150
|
+ {
|
|
151
|
+ index: 'COL_SCH_DT', name: 'colSchDt',
|
|
152
|
+ label: '수거예정일',
|
|
153
|
+ width: '8', fixed: false, align: 'center',
|
|
154
|
+ sortable: false, hidden: false
|
|
155
|
+ },
|
|
156
|
+ {
|
|
157
|
+ index: 'PICK_MGR_NM', name: 'pickMgrNm',
|
|
158
|
+ label: '수거담당자명',
|
|
159
|
+ width: '10', fixed: false, align: 'center',
|
|
160
|
+ sortable: false, hidden: false
|
|
161
|
+ },
|
|
162
|
+ {
|
|
163
|
+ index: 'PICK_MGR_TEL_NO', name: 'pickMgrTelNo',
|
|
164
|
+ label: '수거담당자연락처',
|
|
165
|
+ width: '10', fixed: false, align: 'center',
|
|
166
|
+ sortable: false, hidden: false
|
|
167
|
+ },
|
|
168
|
+ {
|
|
169
|
+ index: 'SPPLY_ID', name: 'spplyId',
|
|
170
|
+ label: '공급사아이디',
|
|
171
|
+ width: '10', fixed: false, align: 'center',
|
|
172
|
+ sortable: false, hidden: true
|
|
173
|
+ },
|
|
174
|
+ {
|
|
175
|
+ index: 'SPPLY_NM', name: 'spplyNm',
|
|
176
|
+ label: '공급사명',
|
|
177
|
+ width: '10', fixed: false, align: 'center',
|
|
178
|
+ sortable: false, hidden: true
|
|
179
|
+ }
|
|
180
|
+ ]
|
|
181
|
+};
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+/*목록화면 Object*/
|
|
185
|
+let listObj = {
|
|
186
|
+ init: function() {
|
|
187
|
+ this.view();
|
|
188
|
+ this.action();
|
|
189
|
+ this.event.init();
|
|
190
|
+ this.grid.init();
|
|
191
|
+ },
|
|
192
|
+ view: function() {
|
|
193
|
+ // 버튼 권한설정
|
|
194
|
+ fn_proc_btn_auth('RTNMNG05010');
|
|
195
|
+
|
|
196
|
+ // 공통코드 표시
|
|
197
|
+ $('select').each(function() {
|
|
198
|
+ if ($(this).data('select-code')) {
|
|
199
|
+ fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
|
200
|
+ }
|
|
201
|
+ });
|
|
202
|
+
|
|
203
|
+ var now = new Date();
|
|
204
|
+ $('#ITP_TAB_RTNMNG05010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
|
205
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
|
|
206
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
|
|
207
|
+
|
|
208
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val('xxx'); // 임시
|
|
209
|
+ },
|
|
210
|
+ itp_RTNMNG05010_search: false,
|
|
211
|
+ button: {
|
|
212
|
+ search: function() {
|
|
213
|
+ // console.log("search event");
|
|
214
|
+ listObj.itp_RTNMNG05010_search = true;
|
|
215
|
+ let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
|
|
216
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
217
|
+ param.gridPage = $.jgrid.defaults.page;
|
|
218
|
+ param.sbrandId = fn_make_user_info.get('brandId');
|
|
219
|
+ param.sstoreId = fn_make_user_info.get('storeId');
|
|
220
|
+
|
|
221
|
+ // if (param.swhsId == "") {
|
|
222
|
+ if ($('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val() == "") {
|
|
223
|
+ itp_fn_modal_alert("수거창고를 지정해주세요!");
|
|
224
|
+ return;
|
|
225
|
+ }
|
|
226
|
+
|
|
227
|
+ if (param.fromDt == '' || param.toDt == '') {
|
|
228
|
+ itp_fn_modal_alert("수거요청일 기간을 지정해주세요!");
|
|
229
|
+ return;
|
|
230
|
+ }
|
|
231
|
+
|
|
232
|
+ $(RTNMNG05010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
|
|
233
|
+ },
|
|
234
|
+ save: function() {
|
|
235
|
+
|
|
236
|
+ $('body').trigger('click');
|
|
237
|
+
|
|
238
|
+ const rowKey = $(RTNMNG05010_GRID_ID).getGridParam('selrow');
|
|
239
|
+ if (!rowKey) {
|
|
240
|
+ itp_fn_modal_alert( "반품처리할 품목을 선택하세요.");
|
|
241
|
+ return;
|
|
242
|
+ }
|
|
243
|
+
|
|
244
|
+ var selectedIds = $(RTNMNG05010_GRID_ID).getGridParam('selarrrow');
|
|
245
|
+
|
|
246
|
+ for (var i=selectedIds.length-1; i>=0; i--) {
|
|
247
|
+ // gridUpdateData.push($(RTNMNG05010_GRID_ID).jqGrid('getRowData', selectedIds[i]));
|
|
248
|
+
|
|
249
|
+ const rowData = $(RTNMNG05010_GRID_ID).jqGrid('getRowData', selectedIds[i]);
|
|
250
|
+
|
|
251
|
+ console.log(JSON.stringify(rowData));
|
|
252
|
+ }
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+ var modalFn = {
|
|
257
|
+ callBack: () => {
|
|
258
|
+ //itp_fn_form_event.removeChar('#ITP_FORM_OPER03010_DETAIL');
|
|
259
|
+ var chkQtyYn1 = true;
|
|
260
|
+ var chkQtyYn2 = true;
|
|
261
|
+ let gridInsertData = [];
|
|
262
|
+ const rowData = $(RTNMNG05010_GRID_ID).getRowData();
|
|
263
|
+ var cwhsId = "";
|
|
264
|
+
|
|
265
|
+ $.each(rowData, function(key, value) {
|
|
266
|
+ if (value.whsQty != '') {
|
|
267
|
+ if (parseInt(value.colQty) > parseInt(value.colReqQty)) {
|
|
268
|
+ chkQtyYn1 = false;
|
|
269
|
+ }
|
|
270
|
+ if (cwhsId != "" && cwhsId != value.rtnWhsId) {
|
|
271
|
+ chkQtyYn2 = false;
|
|
272
|
+ }
|
|
273
|
+ cwhsId = value.rtnWhsId;
|
|
274
|
+ gridInsertData.push(value);
|
|
275
|
+ }
|
|
276
|
+ });
|
|
277
|
+
|
|
278
|
+ if (chkQtyYn1 == false) {
|
|
279
|
+ itp_fn_modal_alert("수거요청수량보다 수거수량이 더 많습니다.");
|
|
280
|
+ return;
|
|
281
|
+ }
|
|
282
|
+ if (chkQtyYn2 == false) {
|
|
283
|
+ itp_fn_modal_alert("서로 다른 반품창고 품목은 처리할 수 없습니다.");
|
|
284
|
+ return;
|
|
285
|
+ }
|
|
286
|
+
|
|
287
|
+ if (gridInsertData.length == 0) {
|
|
288
|
+ itp_fn_modal_alert("반품처리할 품목을 없습니다.");
|
|
289
|
+ return ;
|
|
290
|
+ }
|
|
291
|
+
|
|
292
|
+ let param = {};
|
|
293
|
+ param.viewCd = "C";
|
|
294
|
+ param.whsId = cwhsId;
|
|
295
|
+ param.brandId = fn_make_user_info.get('brandId');
|
|
296
|
+ param.storeId = fn_make_user_info.get('storeId');
|
|
297
|
+ // param.dlvCnfmDocFileNo = "";
|
|
298
|
+ param.gridInsertData = gridInsertData;
|
|
299
|
+ console.log(JSON.stringify(param));
|
|
300
|
+ var searhFn = function () {
|
|
301
|
+ //ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
|
|
302
|
+ listObj.button.search();
|
|
303
|
+ }
|
|
304
|
+ fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
|
305
|
+ }
|
|
306
|
+ };
|
|
307
|
+
|
|
308
|
+ itp_fn_modal_confirm('반품처리 하시겠습니까?', modalFn);
|
|
309
|
+
|
|
310
|
+ }
|
|
311
|
+ },
|
|
312
|
+ action: function() {
|
|
313
|
+ var _this = this;
|
|
314
|
+
|
|
315
|
+ // 공급업체 조회 버튼 클릭
|
|
316
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_POP_SSPPLY_NM').on('click', function() {
|
|
317
|
+ _this.popup('spply');
|
|
318
|
+ });
|
|
319
|
+ // 공급업체 텍스트 삭제 버튼 클릭
|
|
320
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SSPPLY_NM').on('click', function() {
|
|
321
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_NM').val('');
|
|
322
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_ID').val('');
|
|
323
|
+ });
|
|
324
|
+
|
|
325
|
+ // 매장/창고 조회 버튼 클릭
|
|
326
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_POP_SWHS_NM').on('click', function() {
|
|
327
|
+ _this.popup('whs');
|
|
328
|
+ });
|
|
329
|
+ // 매장/창고 텍스트 삭제 버튼 클릭
|
|
330
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SWHS_NM').on('click', function() {
|
|
331
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_NM').val('');
|
|
332
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_ID').val('');
|
|
333
|
+ });
|
|
334
|
+
|
|
335
|
+ // 매장/창고 조회 버튼 클릭
|
|
336
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_POP_SRTN_WHS_NM').on('click', function() {
|
|
337
|
+ _this.popup('rwhs');
|
|
338
|
+ });
|
|
339
|
+ // 매장/창고 텍스트 삭제 버튼 클릭
|
|
340
|
+ $('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SRTN_WHS_NM').on('click', function() {
|
|
341
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val('');
|
|
342
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val('');
|
|
343
|
+ });
|
|
344
|
+
|
|
345
|
+ },
|
|
346
|
+ popup: function(arg) {
|
|
347
|
+ var whsDvsn = "";
|
|
348
|
+ if (fn_make_user_info.get('storeId') == "") {
|
|
349
|
+ whsDvsn = "W01";
|
|
350
|
+ } else {
|
|
351
|
+ whsDvsn = "W02";
|
|
352
|
+ }
|
|
353
|
+
|
|
354
|
+ if(arg === 'spply'){
|
|
355
|
+ var popFn = this.callback.supply;
|
|
356
|
+ const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
|
|
357
|
+ fn_call_popup('biz', 'BIZPOP_STORE_SPPLY', '#ITP_ASIDE', popFn, key, 'S');
|
|
358
|
+ } else if(arg === 'whs'){
|
|
359
|
+ var popFn = this.callback.whs;
|
|
360
|
+ const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:whsDvsn};
|
|
361
|
+ fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
|
|
362
|
+ } else if(arg === 'rwhs'){
|
|
363
|
+ var popFn = this.callback.rwhs;
|
|
364
|
+ const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:"W02"};
|
|
365
|
+ fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
|
|
366
|
+ }
|
|
367
|
+
|
|
368
|
+ },
|
|
369
|
+ callback: {
|
|
370
|
+ supply: function(rowDataPop) {
|
|
371
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_NM').val(rowDataPop.spplyNm);
|
|
372
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_ID').val(rowDataPop.spplyId);
|
|
373
|
+ },
|
|
374
|
+ whs: function(rowDataPop) {
|
|
375
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
|
|
376
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
|
|
377
|
+ },
|
|
378
|
+ rwhs: function(rowDataPop) {
|
|
379
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val(rowDataPop.whsNm);
|
|
380
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val(rowDataPop.whsId);
|
|
381
|
+ }
|
|
382
|
+ },
|
|
383
|
+ event: {
|
|
384
|
+ init: function() {
|
|
385
|
+ this.button();
|
|
386
|
+ },
|
|
387
|
+ button: function() {
|
|
388
|
+ // 버튼 클릭 이벤트
|
|
389
|
+ $('button').each(function() {
|
|
390
|
+ var id = $(this).attr('id');
|
|
391
|
+ $(this).on('click', function() {
|
|
392
|
+ // console.log("button");
|
|
393
|
+ // console.log(id);
|
|
394
|
+ switch (id) {
|
|
395
|
+ case 'ITP_BTN_RTNMNG05010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
|
396
|
+ case 'ITP_BTN_RTNMNG05010_RTN_PROC' : listObj.button.save(); break; // 입고처리 버튼
|
|
397
|
+
|
|
398
|
+ }
|
|
399
|
+ });
|
|
400
|
+ });
|
|
401
|
+
|
|
402
|
+ $('body').on('click', function(e) {
|
|
403
|
+ var gridId = RTNMNG05010_GRID_ID.replace('#', '');
|
|
404
|
+ var rids = $(RTNMNG05010_GRID_ID).jqGrid('getDataIDs');
|
|
405
|
+ var last_row_id = rids[rids.length - 1];
|
|
406
|
+
|
|
407
|
+ itp_fn_grid_reset_selection(e, last_row_id, gridId, 'RTNMNG05010');
|
|
408
|
+ });
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+ }
|
|
412
|
+ },
|
|
413
|
+ empty: {
|
|
414
|
+ init: function() {
|
|
415
|
+ var _this = this;
|
|
416
|
+ this.push();
|
|
417
|
+ $(RTNMNG05010_GRID_EMPTY).on('click', function() {
|
|
418
|
+ _this.back();
|
|
419
|
+ _this.itp_RTNMNG05010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
420
|
+ $(RTNMNG05010_GRID_ID).setGridParam({ 'postData': JSON.stringify(_this.itp_RTNMNG05010_param) }).trigger('reloadGrid');
|
|
421
|
+ });
|
|
422
|
+ },
|
|
423
|
+ itp_RTNMNG05010_param: {},
|
|
424
|
+ push: function() {
|
|
425
|
+ let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
|
|
426
|
+ listObj.itp_RTNMNG05010_param = param;
|
|
427
|
+ },
|
|
428
|
+ back: function() {
|
|
429
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_FROM_DT').val(this.itp_RTNMNG05010_param.fromDt);
|
|
430
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_TO_DT').val(this.itp_RTNMNG05010_param.toDt);
|
|
431
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_DLV_STTMT_UNQ_NO').val(this.itp_RTNMNG05010_param.sDlvSttmtUnqNo);
|
|
432
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_SPPLY_ID').val(this.itp_RTNMNG05010_param.sSpplyId);
|
|
433
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_WHS_ID').val(this.itp_RTNMNG05010_param.sWhsId);
|
|
434
|
+ $('#ITP_FORM_RTNMNG05010_SEARCH_ITEM_NM').val(this.itp_RTNMNG05010_param.sItemNm);
|
|
435
|
+ }
|
|
436
|
+ },
|
|
437
|
+ grid: {
|
|
438
|
+ init: function() {
|
|
439
|
+ // 데이터 없을때
|
|
440
|
+ listObj.empty.push();
|
|
441
|
+ itp_fn_jqgrid_resize(RTNMNG05010_GRID_ID, RTNMNG05010_GRID_LIST, 'lg');
|
|
442
|
+ itp_fn_fire_window_resize();
|
|
443
|
+ this.search();
|
|
444
|
+
|
|
445
|
+ },
|
|
446
|
+ colModel: gridColModel.list,
|
|
447
|
+ search: function() {
|
|
448
|
+ this.unload();
|
|
449
|
+ this.load();
|
|
450
|
+ },
|
|
451
|
+ load: function() {
|
|
452
|
+ let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
|
|
453
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
454
|
+ param.sbrandId = fn_make_user_info.get('brandId');
|
|
455
|
+ param.sstoreId = fn_make_user_info.get('storeId');
|
|
456
|
+ // param.swhsId = "Order";
|
|
457
|
+ var option = {
|
|
458
|
+ multiselect: true,
|
|
459
|
+ autowidth: true,
|
|
460
|
+ gridId: RTNMNG05010_GRID_ID,
|
|
461
|
+ colModel: gridColModel.list,
|
|
462
|
+ param: param,
|
|
463
|
+ url: DOMAIN + API_DETAIL_GRID_LIST,
|
|
464
|
+ pager: RTNMNG05010_GRID_PAGER,
|
|
465
|
+ onCellSelect: function(rowid, cellIdx, cellValue) {
|
|
466
|
+ RTNMNG05010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, RTNMNG05010_LAST_ROW_ID, RTNMNG05010_GRID_ID, ['pchPodrUnqNo']);
|
|
467
|
+ },
|
|
468
|
+ loadComplete: function(data) {
|
|
469
|
+ itp_fn_grid_load_complete(data, RTNMNG05010_GRID_ID, true, 'number', 'RTNMNG05010', listObj.itp_RTNMNG05010_search, listObj.empty, true, data.gridRecords, true);
|
|
470
|
+ },
|
|
471
|
+ onPaging: function(action) {
|
|
472
|
+ itp_fn_grid_paging(RTNMNG05010_GRID_ID, action, param);
|
|
473
|
+ }
|
|
474
|
+ };
|
|
475
|
+ itp_fn_grid_make_remote(option);
|
|
476
|
+ },
|
|
477
|
+ button: {
|
|
478
|
+ },
|
|
479
|
+ unload: function() {
|
|
480
|
+ $.jgrid.gridUnload(RTNMNG05010_GRID_ID);
|
|
481
|
+ },
|
|
482
|
+ clearData: function() {
|
|
483
|
+ $(RTNMNG05010_GRID_ID).jqGrid('clearGridData', true);
|
|
484
|
+ $(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
485
|
+ $(RTNMNG05010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
486
|
+ $(RTNMNG05010_GRID_EMPTY).show();
|
|
487
|
+ }
|
|
488
|
+
|
|
489
|
+ }
|
|
490
|
+};
|
|
491
|
+
|
|
492
|
+
|