|
@@ -291,6 +291,7 @@ let mobPopObj = {
|
291
|
291
|
},
|
292
|
292
|
popWhsNm: {
|
293
|
293
|
init: function () {
|
|
294
|
+ $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .mb_0').children().remove();
|
294
|
295
|
this.rows.length = 0;
|
295
|
296
|
this.search();
|
296
|
297
|
this.action();
|
|
@@ -301,21 +302,18 @@ let mobPopObj = {
|
301
|
302
|
$('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group').empty();
|
302
|
303
|
var callbackFn = function(result) {
|
303
|
304
|
console.log(result);
|
304
|
|
- _this.view(result.gridRows);
|
|
305
|
+ $.each(result.gridRows, function (i, item) {
|
|
306
|
+ $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .mb_0').append($('#ITP_LIST_MPOMNG01010_POP_WHS_ROWCOPY').html());
|
|
307
|
+ var $li = $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .mb_0 > .row_2:last');
|
|
308
|
+ $li.find('.fnWhsNm').text(item.whsNm);
|
|
309
|
+ $li.find('.fnLocationNm').text(item.locationNm);
|
|
310
|
+ $li.find('.fnWhsId').data('whs-id', item.whsId);
|
|
311
|
+ });
|
305
|
312
|
};
|
306
|
313
|
const param = $('#ITP_FORM_MPOMNG01010_POP_WHS').serializeObject();
|
|
314
|
+ (fn_make_user_info.get('authTpCd') === '50') ? param.swhsDvsn = 'W02' : param.swhsDvsn = 'W01';
|
307
|
315
|
fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
|
308
|
316
|
},
|
309
|
|
- view: function(gridRows) {
|
310
|
|
- this.rows = gridRows;
|
311
|
|
- $.each(gridRows, function (i, item) {
|
312
|
|
- $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_WHS_ROWCOPY').html());
|
313
|
|
- var $li = $('#ITP_LIST_MPOMNG01010_POP_WHS_AREA .panel-group > .row_2:last');
|
314
|
|
- $li.find('.fnWhsNm').text(item.whsNm);
|
315
|
|
- $li.find('.fnLocationNm').text(item.locationNm);
|
316
|
|
- $li.find('.fnWhsId').data('whs-id', item.whsId);
|
317
|
|
- });
|
318
|
|
- },
|
319
|
317
|
action: function() {
|
320
|
318
|
var _this = this;
|
321
|
319
|
$('#ITP_LIST_MPOMNG01010_POP_WHS_AREA button[id$="POP_WHS_CHOICE"]').off('click').on('click', function() {
|
|
@@ -410,20 +408,18 @@ let mobPopObj = {
|
410
|
408
|
});
|
411
|
409
|
},
|
412
|
410
|
save: function() {
|
413
|
|
- var procSave = function (rtnFn) {
|
|
411
|
+ var procSave = function () {
|
414
|
412
|
let param = $('#ITP_FORM_MPOMNG01010_DETAIL').serializeObject();
|
415
|
413
|
$.each(mobContObj.list.rows, function(index, item) {
|
416
|
414
|
item['viewCd'] = 'C';
|
|
415
|
+ item['pchReqAmt'] = Number(item.unitAmt) * Number(item.pchReqQty);
|
417
|
416
|
});
|
418
|
417
|
param.gridInsertData = mobContObj.list.rows;
|
419
|
418
|
var saveFn = function (result) {
|
420
|
419
|
console.log(result);
|
421
|
420
|
mobPopObj.hide('ITP_POP_MPOMNG01010_REQ_AREA');
|
422
|
|
- console.log(typeof rtnFn === 'function');
|
423
|
|
- // if(typeof rtnFn === 'function') rtnFn();
|
424
|
421
|
mobContObj.reset();
|
425
|
422
|
};
|
426
|
|
- console.log(param);
|
427
|
423
|
fn_ajax_call(API_MOBILE_SAVE, JSON.stringify(param), saveFn, 'POST');
|
428
|
424
|
};
|
429
|
425
|
if (this.saveMode === 1 || this.saveMode === 2 || this.saveMode === 3) {
|
|
@@ -431,11 +427,6 @@ let mobPopObj = {
|
431
|
427
|
$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_ST_CD').val(PCH_REQ_ST_CD_TEMP_SAVE);
|
432
|
428
|
procSave();
|
433
|
429
|
} else if (this.saveMode === 4 || this.saveMode === 5) {
|
434
|
|
- // 결제 팝업 결과
|
435
|
|
- var popFn = function(rowDataPop) {
|
436
|
|
- console.log(JSON.stringify(rowDataPop));
|
437
|
|
- procSave(function(result) { mobContObj.reset(); });
|
438
|
|
- };
|
439
|
430
|
// 결제 팝업
|
440
|
431
|
var ordUseAmt = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text());
|
441
|
432
|
var pchReqAmtTot = CommonObj.onlyNumber($('#ITP_FORM_MPOMNG01010_DETAIL .fnPchReqAmtTot').text());
|
|
@@ -445,7 +436,7 @@ let mobPopObj = {
|
445
|
436
|
'storeId' : $('#ITP_FORM_MPOMNG01010_DETAIL_STORE_ID').val(),
|
446
|
437
|
'goodsAmt' : Number(pchReqAmtTot - ordUseAmt)
|
447
|
438
|
};
|
448
|
|
- fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', popFn, args, 'M');
|
|
439
|
+ fn_call_popup('biz', 'BIZPOP_PO_PAYMENT', '#ITP_ASIDE', procSave, args, 'M');
|
449
|
440
|
}
|
450
|
441
|
}
|
451
|
442
|
},
|