|
@@ -137,6 +137,7 @@ let pageObj = {
|
137
|
137
|
|
138
|
138
|
const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'),whsDvsn: whsDvsn};
|
139
|
139
|
fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
|
|
140
|
+
|
140
|
141
|
},
|
141
|
142
|
callback: {
|
142
|
143
|
create: function(rowDataPop) {
|
|
@@ -348,6 +349,8 @@ let createObj = {
|
348
|
349
|
var reqMsg = "";
|
349
|
350
|
|
350
|
351
|
//정산 타입이 무정산이면 스킵
|
|
352
|
+ var apprTypeCd = "Y" // Y 정상결재, NP 선불, NA 후불
|
|
353
|
+
|
351
|
354
|
var loanDvsn = $('#ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val();
|
352
|
355
|
|
353
|
356
|
if (loanDvsn != null && loanDvsn != "") {
|
|
@@ -359,11 +362,15 @@ let createObj = {
|
359
|
362
|
var pchReqAtm = itp_fn_currency_unfmatter($('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text(),"","");
|
360
|
363
|
|
361
|
364
|
if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
|
362
|
|
- alert(ITP_MSG_LOCALE.message.ajax.lackReqAmt);
|
363
|
|
- return;
|
|
365
|
+ if (loanDvsn == 'LD01') {
|
|
366
|
+ apprTypeCd = 'NP';
|
|
367
|
+ } else {
|
|
368
|
+ apprTypeCd = 'NA';
|
|
369
|
+ }
|
364
|
370
|
}
|
365
|
371
|
}
|
366
|
372
|
}
|
|
373
|
+
|
367
|
374
|
|
368
|
375
|
if (itp_fn_form_event.isValid(formId)) {
|
369
|
376
|
// 품목대상 정보 확인 필요
|
|
@@ -398,7 +405,23 @@ let createObj = {
|
398
|
405
|
|
399
|
406
|
if (chkQtyYn == "Y") return;
|
400
|
407
|
|
401
|
|
- var saveReq = {
|
|
408
|
+ if (arg == 'PR20') {
|
|
409
|
+ console.log(apprTypeCd);
|
|
410
|
+ if (apprTypeCd == "Y") { // 여신 구분, 여신금액
|
|
411
|
+ reqMsg = ' 납품요청일 : ' + dlvReqDt + '<br> 품목수 : ' + itemcnt + '<br> 구매요청금액 : ' + dlvReqAmt + '<br><br>' + ITP_MSG_LOCALE.message.ajax.reqSave ;
|
|
412
|
+ itp_fn_modal_confirm(reqMsg, createObj.button.saveReq(arg), null);
|
|
413
|
+ } else // 금액 부족시
|
|
414
|
+ createObj.button.saveApprReq(arg,apprTypeCd);
|
|
415
|
+ }
|
|
416
|
+
|
|
417
|
+ } else {
|
|
418
|
+ createObj.button.saveReq(arg);
|
|
419
|
+ }
|
|
420
|
+
|
|
421
|
+ },
|
|
422
|
+ saveReq: function(arg) {
|
|
423
|
+ const formId = '#ITP_FORM_POMNG01010_DETAIL';
|
|
424
|
+ var saveFn = {
|
402
|
425
|
callBack: function(args) {
|
403
|
426
|
$(formId).val(arg);
|
404
|
427
|
let gridInsertData = [];
|
|
@@ -419,7 +442,7 @@ let createObj = {
|
419
|
442
|
}
|
420
|
443
|
});
|
421
|
444
|
|
422
|
|
- if (chkQtyYn == "Y") return;
|
|
445
|
+ //if (chkQtyYn == "Y") return;
|
423
|
446
|
|
424
|
447
|
let param = $(formId).serializeObject();
|
425
|
448
|
param.gridInsertData = gridInsertData;
|
|
@@ -432,18 +455,42 @@ let createObj = {
|
432
|
455
|
fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
433
|
456
|
}
|
434
|
457
|
};
|
|
458
|
+ itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveFn, null);
|
|
459
|
+ },
|
|
460
|
+ saveApprReq: function(arg, apprTypeCd) {
|
|
461
|
+ var apprFn = {
|
|
462
|
+ callBack: function(args,apprTypeCd) {
|
|
463
|
+ // 결재금액이 부족하여 결재란으로 이동처리
|
|
464
|
+ var popFn = function(rowDataPop) {
|
|
465
|
+ // 결재 성공시 승인처리함
|
|
466
|
+ console.log(rowDataPop);
|
|
467
|
+ createObj.button.saveReq(arg);
|
|
468
|
+ };
|
|
469
|
+ // 결제 팝업 : LD01(선불(충전)), LD02(후불(신용))
|
|
470
|
+ // 결제타입코드 : 10(선불(충전)), 20(후불(결제)), 30(후불(선결제))
|
|
471
|
+ // 구매요청 번호 전달 -
|
|
472
|
+ //var loanDvsn = $('#ITP_FORM_LOANMNG02010_SEARCH_STORE_LOAN_DVSN').val();
|
|
473
|
+ var pchActAtm = itp_fn_currency_unfmatter($('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text(),"","");
|
|
474
|
+ var pchReqAtm = itp_fn_currency_unfmatter($('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text(),"","");
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+ var args = {'payTpCd': '40',
|
|
478
|
+ 'brandId': fn_make_user_info.get('brandId'),
|
|
479
|
+ 'storeId': fn_make_user_info.get('storeId'),
|
|
480
|
+ 'prchReqUnqNo': $('ITP_FORM_POMNG01010_DETAIL_PCH_REQ_UNQ_NO').val(),
|
|
481
|
+ 'goodsAmt': pchReqAtm-pchActAtm};
|
|
482
|
+
|
|
483
|
+ fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'S');
|
|
484
|
+ }
|
|
485
|
+ };
|
435
|
486
|
|
436
|
|
- if (arg == 'PR20') {
|
437
|
|
- reqMsg = ' 납품요청일 : ' + dlvReqDt + '<br> 품목수 : ' + itemcnt + '<br> 구매요청금액 : ' + dlvReqAmt + '<br><br>' + ITP_MSG_LOCALE.message.ajax.reqSave ;
|
438
|
|
- itp_fn_modal_confirm(reqMsg, saveReq, null);
|
439
|
|
- } else {
|
440
|
|
- itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveReq, null);
|
441
|
|
- }
|
442
|
|
-
|
443
|
|
-
|
444
|
|
-
|
|
487
|
+ if (apprTypeCd == 'NP') { // 선불
|
|
488
|
+ itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, apprFn, null);
|
|
489
|
+ } else { //후불
|
|
490
|
+ itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, apprFn, null);
|
445
|
491
|
}
|
446
|
|
- }
|
|
492
|
+ }
|
|
493
|
+
|
447
|
494
|
},
|
448
|
495
|
load: function() {
|
449
|
496
|
const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
|
|
@@ -468,6 +515,8 @@ let createObj = {
|
468
|
515
|
$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text("0");
|
469
|
516
|
$('#ITP_FORM_POMNG01010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
|
470
|
517
|
$('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text(itp_fn_number_comma(result.ordUseAmt));
|
|
518
|
+ $('#ITP_FORM_POMNG01010_DETAIL .fnPchReqUnqNo').text(result.pchReqUnqNo);
|
|
519
|
+ $('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_PCH_REQ_UNQ_NO').val(result.pchReqUnqNo);
|
471
|
520
|
|
472
|
521
|
pageObj.grid.init();
|
473
|
522
|
}
|