|
@@ -25,6 +25,10 @@ const RTNMNG01010_DETAIL_GRID_EMPTY = '#ITP_RTNMNG01010_DETAIL_jqGridEmpty'; //
|
25
|
25
|
|
26
|
26
|
let RTNMNG01010_DETAIL_GRID_LAST_ROW_ID;
|
27
|
27
|
|
|
28
|
+/* 공통코드 리스트 */
|
|
29
|
+let ITP_COMMON_CD_RTN_DVSN = fn_make_common_cd_list(CODE_LIST, 'RTN_DVSN', false);
|
|
30
|
+let ITP_COMMON_CD_RTN_RSN_DVSN = fn_make_common_cd_list(CODE_LIST, 'RTN_RSN_DVSN', false);
|
|
31
|
+
|
28
|
32
|
/*API URL*/
|
29
|
33
|
let API_DETAIL_INIT_INFO = '/api/rtnmng/init-rtnReq'
|
30
|
34
|
let API_DETAIL_SAVE = '/api/rtnmng/save-rtnReq';
|
|
@@ -38,17 +42,29 @@ const gridColModel = {
|
38
|
42
|
width: '10', fixed: false, align: 'center',
|
39
|
43
|
sortable: false, hidden: true
|
40
|
44
|
},
|
|
45
|
+ {
|
|
46
|
+ index: 'RTN_REQ_UNQ_NO', name: 'rtnReqUnqNo',
|
|
47
|
+ label: '반품요청번호',
|
|
48
|
+ width: '10', fixed: false, align: 'center',
|
|
49
|
+ sortable: false, editable: false, edittype: 'text', hidden: true
|
|
50
|
+ },
|
|
51
|
+ {
|
|
52
|
+ index: 'RTN_REQ_DTL_NO', name: 'rtnReqDtlNo',
|
|
53
|
+ label: '반품요청상세번호',
|
|
54
|
+ width: '10', fixed: false, align: 'center',
|
|
55
|
+ sortable: false, editable: false, edittype: 'text', hidden: true
|
|
56
|
+ },
|
41
|
57
|
{
|
42
|
58
|
index: 'ITEM_ID', name: 'itemId',
|
43
|
59
|
label: ITP_MSG_LOCALE.label.itemId,
|
44
|
|
- width: '20', fixed: false, align: 'center',
|
|
60
|
+ width: '15', fixed: false, align: 'center',
|
45
|
61
|
sortable: false, editable: false, edittype: 'text',
|
46
|
62
|
editrules: { required: true }
|
47
|
63
|
},
|
48
|
64
|
{
|
49
|
65
|
index: 'ITEM_NM', name: 'itemNm',
|
50
|
66
|
label: ITP_MSG_LOCALE.label.itemNm,
|
51
|
|
- width: '30', fixed: false, align: 'center',
|
|
67
|
+ width: '25', fixed: false, align: 'center',
|
52
|
68
|
sortable: true, editable: false, edittype: 'text',
|
53
|
69
|
editrules: { required: true }
|
54
|
70
|
},
|
|
@@ -66,21 +82,48 @@ const gridColModel = {
|
66
|
82
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
67
|
83
|
},
|
68
|
84
|
{
|
69
|
|
- index: 'PCH_REQ_QTY', name: 'pchReqQty',
|
70
|
|
- label: ITP_MSG_LOCALE.label.pchReqQty, //수량
|
|
85
|
+ index: 'RTN_QTY', name: 'rtnQty',
|
|
86
|
+ label: '반품수량', //수량
|
71
|
87
|
width: '10', fixed: false, align: 'right',
|
72
|
88
|
sortable: false, editable: true, edittype: 'text',
|
73
|
89
|
editrules: { number:true },
|
74
|
90
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
75
|
91
|
},
|
76
|
92
|
{
|
77
|
|
- index: 'PCH_REQ_AMT', name: 'pchReqAmt',
|
78
|
|
- label: ITP_MSG_LOCALE.label.pchReqAmt,
|
|
93
|
+ index: 'RTN_AMT', name: 'rtnAmt',
|
|
94
|
+ label: '반품예상금액',
|
79
|
95
|
width: '10', fixed: false, align: 'right',
|
80
|
96
|
sortable: false, editable: false, edittype: 'text', hidden: false,
|
81
|
97
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
98
|
+ },
|
|
99
|
+ {
|
|
100
|
+ index: 'RTN_DVSN', name: 'rtnDvsn',
|
|
101
|
+ label: '반품구분',
|
|
102
|
+ width: '10', fixed: false, align: 'center',
|
|
103
|
+ sortable: false, editable: true, formatter: 'select', edittype: 'select',
|
|
104
|
+ editoptions: {value: ITP_COMMON_CD_RTN_DVSN},
|
|
105
|
+ editrules: {required: true}
|
|
106
|
+ },
|
|
107
|
+ {
|
|
108
|
+ index: 'RTN_RSN_DVSN', name: 'rtnRsnDvsn',
|
|
109
|
+ label: '사유구분',
|
|
110
|
+ width: '10', fixed: false, align: 'center',
|
|
111
|
+ sortable: false, editable: true, formatter: 'select', edittype: 'select',
|
|
112
|
+ editoptions: {value: ITP_COMMON_CD_RTN_RSN_DVSN},
|
|
113
|
+ editrules: {required: true}
|
|
114
|
+ },
|
|
115
|
+ {
|
|
116
|
+ index: 'RTN_RSN', name: 'rtnRsn',
|
|
117
|
+ label: '반품사유',
|
|
118
|
+ width: '15', fixed: false, align: 'right',
|
|
119
|
+ sortable: false, editable: true, edittype: 'text'
|
|
120
|
+ },
|
|
121
|
+ {
|
|
122
|
+ index: 'SPPLY_ID', name: 'spplyId',
|
|
123
|
+ label: '공급사아이디',
|
|
124
|
+ width: '10', fixed: false, align: 'center',
|
|
125
|
+ sortable: false, editable: false, edittype: 'text', hidden: true
|
82
|
126
|
},
|
83
|
|
-
|
84
|
127
|
{
|
85
|
128
|
index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
|
86
|
129
|
label: ITP_MSG_LOCALE.label.brandUnitUnqNo,
|
|
@@ -117,10 +160,10 @@ let pageObj = {
|
117
|
160
|
});
|
118
|
161
|
// 납품장소 텍스트 삭제 버튼 클릭
|
119
|
162
|
$('#ITP_FORM_RTNMNG01010_DELETE_WHS_NM').on('click', function() {
|
120
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_WHS_NM').val('');
|
121
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_WHS_ID').val('');
|
122
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_LOCATION_NM').val('');
|
123
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_LOCATION').val('');
|
|
163
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_NM').val('');
|
|
164
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_ID').val('');
|
|
165
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION_NM').val('');
|
|
166
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION').val('');
|
124
|
167
|
|
125
|
168
|
});
|
126
|
169
|
},
|
|
@@ -143,12 +186,11 @@ let pageObj = {
|
143
|
186
|
create: function(rowDataPop) {
|
144
|
187
|
console.log(rowDataPop);
|
145
|
188
|
if(rowDataPop) {
|
146
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
|
147
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_WHS_ID').val(rowDataPop.whsId);
|
148
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_LOCATION_NM').val(rowDataPop.locationNm);
|
149
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_LOCATION').val(rowDataPop.location);
|
150
|
|
- }
|
151
|
|
-
|
|
189
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_NM').val(rowDataPop.whsNm);
|
|
190
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_ID').val(rowDataPop.whsId);
|
|
191
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION_NM').val(rowDataPop.locationNm);
|
|
192
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION').val(rowDataPop.location);
|
|
193
|
+ }
|
152
|
194
|
}
|
153
|
195
|
},
|
154
|
196
|
itp_RTNMNG01010_param: {}, // ==>dwkim
|
|
@@ -174,7 +216,7 @@ let pageObj = {
|
174
|
216
|
//var now = new Date(date.getDate() + 5);
|
175
|
217
|
var now = new Date();
|
176
|
218
|
$('#ITP_TAB_RTNMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
177
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
|
|
219
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_COL_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
|
178
|
220
|
|
179
|
221
|
//납품장소 필드 readonly
|
180
|
222
|
$('#ITP_FORM_RTNMNG01010_DETAIL_WHS_NM').attr('readonly', true);
|
|
@@ -200,8 +242,8 @@ let pageObj = {
|
200
|
242
|
var id = $(this).attr('id');
|
201
|
243
|
$(this).on('click', function() {
|
202
|
244
|
switch (id) {
|
203
|
|
- case 'ITP_BTN_RTNMNG01010_SRH': createObj.button.save("PR20"); break; // 구매요청
|
204
|
|
- case 'ITP_BTN_RTNMNG01010_NEWREG': createObj.button.save("PR00"); break; // 임시저장
|
|
245
|
+ case 'ITP_BTN_RTNMNG01010_REQ' : createObj.button.save("RR20"); break; // 요청
|
|
246
|
+ case 'ITP_BTN_RTNMNG01010_TEMP_SAVE' : createObj.button.save("RR00"); break; // 임시저장
|
205
|
247
|
case 'ITP_BTN_RTNMNG01010_DETAIL_ADDROW': pageObj.grid.button.addRow(); break; // 품목추가
|
206
|
248
|
case 'ITP_BTN_RTNMNG01010_DETAIL_DELROW': pageObj.grid.button.delRow(); break; // 품목삭제
|
207
|
249
|
}
|
|
@@ -242,7 +284,7 @@ let pageObj = {
|
242
|
284
|
});
|
243
|
285
|
|
244
|
286
|
$.each(rowDataPop, function(key, value) {
|
245
|
|
- if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
|
|
287
|
+ if (exists.indexOf(value.brandUnitUnqNo) < 0) {
|
246
|
288
|
value['viewCd'] = "C";
|
247
|
289
|
$(RTNMNG01010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
|
248
|
290
|
}
|
|
@@ -324,12 +366,11 @@ let createObj = {
|
324
|
366
|
newinit: function() {
|
325
|
367
|
$('#ITP_FORM_RTNMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
326
|
368
|
$('#ITP_FORM_RTNMNG01010_DETAIL_STORE_ID').val(fn_make_user_info.get('storeId'));
|
327
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_PCH_REQ_NM').val('');
|
328
|
369
|
$('#ITP_FORM_RTNMNG01010_DETAIL_NOTE').val('');
|
|
370
|
+
|
329
|
371
|
var now = new Date();
|
330
|
372
|
$('#ITP_TAB_RTNMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
331
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
|
332
|
|
-
|
|
373
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_COL_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
|
333
|
374
|
|
334
|
375
|
this.load(); //==>dwkim 초기화 하여 다시 초기 데이타 가져와 뿌려줌
|
335
|
376
|
const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
|
|
@@ -341,32 +382,15 @@ let createObj = {
|
341
|
382
|
|
342
|
383
|
const formId = '#ITP_FORM_RTNMNG01010_DETAIL';
|
343
|
384
|
itp_fn_form_clear_validate(null, formId);
|
344
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL_PCH_REQ_ST_CD').val(arg);
|
|
385
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL_RTN_REQ_ST_CD').val(arg);
|
345
|
386
|
|
346
|
|
- //정산 타입이 무정산이면 스킵
|
347
|
|
- var loanDvsn = $('#ITP_FORM_RTNMNG01010_DETAIL_LOAN_DVSN').val();
|
348
|
|
-
|
349
|
|
- if (loanDvsn != null && loanDvsn != "") {
|
350
|
|
-
|
351
|
|
- if (loanDvsn != 'LD03' && arg == 'PR20' ) {
|
352
|
|
- var pchActAtm = $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchActAmt').text();
|
353
|
|
- var pchReqAtm = $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchReqAmt').text();
|
354
|
|
-
|
355
|
|
- if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
|
356
|
|
- alert(ITP_MSG_LOCALE.message.ajax.lackReqAmt);
|
357
|
|
- return;
|
358
|
|
- }
|
359
|
|
- }
|
360
|
|
- }
|
361
|
|
-
|
362
|
387
|
if (itp_fn_form_event.isValid(formId)) {
|
363
|
388
|
// 품목대상 정보 확인 필요
|
364
|
389
|
var records = $(RTNMNG01010_DETAIL_GRID_ID).getGridParam('reccount');
|
365
|
390
|
if (records == 0) {
|
366
|
|
- alert( "요청할 품목내역이 없습니다.");
|
367
|
|
- return ;
|
368
|
|
- }
|
369
|
|
-
|
|
391
|
+ alert( "요청할 품목내역이 없습니다.");
|
|
392
|
+ return ;
|
|
393
|
+ }
|
370
|
394
|
|
371
|
395
|
var saveReq = {
|
372
|
396
|
callBack: function(args) {
|
|
@@ -387,14 +411,14 @@ let createObj = {
|
387
|
411
|
gridDeleteData.push(value);
|
388
|
412
|
}
|
389
|
413
|
}
|
390
|
|
- });
|
391
|
|
-
|
|
414
|
+ });
|
392
|
415
|
|
393
|
416
|
let param = $(formId).serializeObject();
|
394
|
417
|
param.gridInsertData = gridInsertData;
|
395
|
418
|
param.gridUpdateData = gridUpdateData;
|
396
|
419
|
param.gridDeleteData = gridDeleteData;
|
397
|
420
|
console.log(JSON.stringify(param));
|
|
421
|
+
|
398
|
422
|
var searhFn = function() {
|
399
|
423
|
createObj.newinit();
|
400
|
424
|
};
|
|
@@ -406,35 +430,27 @@ let createObj = {
|
406
|
430
|
} else {
|
407
|
431
|
itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveReq, null);
|
408
|
432
|
}
|
409
|
|
-
|
410
|
|
-
|
411
|
|
-
|
412
|
433
|
}
|
413
|
434
|
}
|
414
|
435
|
},
|
415
|
436
|
load: function() {
|
416
|
|
- const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
|
|
437
|
+ const key = {brandId:fn_make_user_info.get('brandId'), storeId:fn_make_user_info.get('storeId')};
|
417
|
438
|
fn_ajax_call(API_DETAIL_INIT_INFO, key, this.callback, 'GET');
|
418
|
439
|
},
|
419
|
440
|
callback: function(result) {
|
420
|
|
-
|
421
|
441
|
$('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_VIEW_CD').val('C');
|
422
|
442
|
|
423
|
443
|
$('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_BRAND_ID').val(result.brandId);
|
424
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_STORE_ID').val(result.storeId);
|
425
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_LOAN_DVSN').val(result.loanDvsn);
|
426
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
|
427
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
|
428
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_WHS_ID').val(result.whsId);
|
429
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_WHS_NM').val(result.whsNm);
|
430
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_LOCATION').val(result.location);
|
431
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_LOCATION_NM').val(result.locationNm);
|
|
444
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_STORE_ID').val(result.storeId);
|
|
445
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_REQ_DEPT').val(result.reqDept);
|
|
446
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_AUTH_TP_CD').val(result.authTpCd);
|
|
447
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_WHS_DVSN').val(result.whsDvsn);
|
|
448
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_ID').val(result.rtnWhsId);
|
|
449
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_RTN_WHS_NM').val(result.rtnWhsNm);
|
|
450
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION').val(result.rtnLocation);
|
|
451
|
+ $('#ITP_FORM_RTNMNG01010_DETAIL #ITP_FORM_RTNMNG01010_DETAIL_RTN_LOCATION_NM').val(result.rtnLocationNm);
|
|
452
|
+
|
432
|
453
|
$('#ITP_FORM_RTNMNG01010_DETAIL .fnBrandNm').text(result.brandNm);
|
433
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchReqDept').text(result.reqDept);
|
434
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchReqMgrNm').text(result.userNm);
|
435
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchReqAmt').text("0");
|
436
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
|
437
|
|
- $('#ITP_FORM_RTNMNG01010_DETAIL .fnPchActAmt').text(result.ordUseAmt);
|
438
|
454
|
|
439
|
455
|
pageObj.grid.init();
|
440
|
456
|
}
|