|
@@ -327,7 +327,7 @@ let mobPopObj = {
|
327
|
327
|
},
|
328
|
328
|
popWhsNm: {
|
329
|
329
|
init: function () {
|
330
|
|
- $('#ITP_POP_MPOMNG01010_WHS_AREA #ITP_FORM_MPOMNG01010_POP_WHS_KEYWORD').val('');
|
|
330
|
+ $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .mb_0').children().remove();
|
331
|
331
|
this.rows.length = 0;
|
332
|
332
|
this.search();
|
333
|
333
|
this.action();
|
|
@@ -335,62 +335,43 @@ let mobPopObj = {
|
335
|
335
|
rows: [],
|
336
|
336
|
search: function () {
|
337
|
337
|
var _this = this;
|
338
|
|
- $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .panel-group').empty();
|
|
338
|
+ $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .mb_0').empty();
|
339
|
339
|
var callbackFn = function(result) {
|
340
|
340
|
console.log(result);
|
341
|
|
- _this.view(result.gridRows);
|
|
341
|
+ $.each(result.gridRows, function (i, item) {
|
|
342
|
+ $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .mb_0').append($('#ITP_LIST_MRTNMNG01010_POP_WHS_ROWCOPY').html());
|
|
343
|
+ var $li = $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .mb_0 > .row_2:last');
|
|
344
|
+ $li.find('.fnWhsNm').text(item.whsNm);
|
|
345
|
+ $li.find('.fnLocationNm').text(item.locationNm);
|
|
346
|
+ $li.find('.fnWhsId').data('whs-id', item.whsId);
|
|
347
|
+ $li.find('.fnWhsId').data('location', item.location);
|
|
348
|
+ $('#ITP_LIST_MRTNMNG01010_POP_WHS_ROWS li button')[$li.index()].addEventListener('click', function() { _this.choice(this); });
|
|
349
|
+ });
|
342
|
350
|
};
|
343
|
351
|
const param = $('#ITP_FORM_MRTNMNG01010_POP_WHS').serializeObject();
|
344
|
352
|
(fn_make_user_info.get('authTpCd') === '50') ? param.swhsDvsn = 'W02' : param.swhsDvsn = 'W01';
|
345
|
353
|
fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
|
346
|
354
|
},
|
347
|
|
- view: function(gridRows) {
|
348
|
|
- this.rows = gridRows;
|
349
|
|
- $.each(gridRows, function (i, item) {
|
350
|
|
- $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MRTNMNG01010_POP_WHS_ROWCOPY').html());
|
351
|
|
- var $li = $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .panel-group > .row_2:last');
|
352
|
|
- $li.find('.fnWhsNm').text(item.whsNm);
|
353
|
|
- $li.find('.fnLocationNm').text(item.locationNm);
|
354
|
|
- $li.find('.fnWhsId').data('whs-id', item.whsId);
|
355
|
|
- });
|
356
|
|
- },
|
357
|
355
|
action: function() {
|
358
|
356
|
var _this = this;
|
359
|
|
- $('button[id^="ITP_BTN_MRTNMNG01010_POP_WHS"]').off('click').on('click', function() {
|
360
|
|
- var id = $(this).attr('id');
|
361
|
|
- switch (id) {
|
362
|
|
- case 'ITP_BTN_MRTNMNG01010_POP_WHS_SEARCH' : _this.search(); break;
|
363
|
|
- case 'ITP_BTN_MRTNMNG01010_POP_WHS_CHOICE' : _this.choice($(this)); break;
|
364
|
|
- case 'ITP_BTN_MRTNMNG01010_POP_WHS_CLOSE' : _this.close(); break;
|
365
|
|
- }
|
366
|
|
- return false;
|
|
357
|
+ $('#ITP_FORM_MRTNMNG01010_POP_WHS button[id="ITP_BTN_MRTNMNG01010_POP_WHS_SEARCH"]').off('click').on('click', function() {
|
|
358
|
+ _this.search();
|
367
|
359
|
});
|
368
|
360
|
},
|
369
|
361
|
choice: function(elem) {
|
370
|
|
- var _this = this;
|
371
|
362
|
var whsId = $(elem).data('whs-id');
|
372
|
|
- $.each(this.rows, function (i, item) {
|
373
|
|
- if(whsId === item.whsId) {
|
374
|
|
- console.log(item);
|
375
|
|
- $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_ID').val(item.whsId);
|
376
|
|
- $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_NM').val(item.whsNm);
|
377
|
|
- $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_LOCATION').val(item.location);
|
378
|
|
- mobPopObj.hide(ID_ITP_POP_MRTNMNG01010_WHS_AREA);
|
379
|
|
- itp_fn_form_clear_validate(null, '#ITP_FORM_MRTNMNG01010_DETAIL');
|
380
|
|
- return false;
|
381
|
|
- }
|
382
|
|
- });
|
|
363
|
+ var whsNm = $(elem).parent().prev().find('.fnWhsNm').text();
|
|
364
|
+ var location = $(elem).data('location');
|
|
365
|
+ $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_ID').val(whsId);
|
|
366
|
+ $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_NM').val(whsNm);
|
|
367
|
+ $('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_LOCATION').val(location);
|
|
368
|
+ mobPopObj.hide(ID_ITP_POP_MRTNMNG01010_WHS_AREA);
|
|
369
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_MRTNMNG01010_DETAIL');
|
383
|
370
|
},
|
384
|
371
|
delete: function() {
|
385
|
372
|
$('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_ID').val('');
|
386
|
373
|
$('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_WHS_NM').val('');
|
387
|
374
|
$('#ITP_FORM_MRTNMNG01010_DETAIL #ITP_FORM_MRTNMNG01010_DETAIL_LOCATION').val('');
|
388
|
|
- },
|
389
|
|
- close: function() {
|
390
|
|
- this.rows.length = 0;
|
391
|
|
- $('#ITP_LIST_MRTNMNG01010_POP_WHS_AREA .panel-group').empty();
|
392
|
|
- $('#ITP_POP_MRTNMNG01010_WHS_AREA #ITP_FORM_MRTNMNG01010_POP_WHS_KEYWORD').val('');
|
393
|
|
- mobPopObj.hide(this.popId);
|
394
|
375
|
}
|
395
|
376
|
},
|
396
|
377
|
popReqConfirm: {
|
|
@@ -442,6 +423,7 @@ let mobPopObj = {
|
442
|
423
|
var _this = this;
|
443
|
424
|
$('button[id$="CLOSE"]').off('click').on('click', function() {
|
444
|
425
|
var id = $(this).attr('id');
|
|
426
|
+ console.log('id ===> ' + id);
|
445
|
427
|
if($(this).hasClass('btn-pop-close')) {
|
446
|
428
|
_this.hide(id);
|
447
|
429
|
}
|