|
@@ -34,10 +34,7 @@ let mobPageObj = {
|
34
|
34
|
}
|
35
|
35
|
});
|
36
|
36
|
|
37
|
|
- if(fn_make_user_info.get('authTpCd') === '50') {
|
38
|
|
- $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_BTN_MRTNMNG05010_LIST_SEARCH_SPPLY_NM').attr('disabled', true);
|
39
|
|
- $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_BTN_MRTNMNG05010_LIST_DELETE_SPPLY_NM').attr('disabled', true);
|
40
|
|
- }
|
|
37
|
+ (fn_make_user_info.get('authTpCd') === '50') ? $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH .schSpply').hide() : $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH .schSpply').show();
|
41
|
38
|
|
42
|
39
|
// 조회일자 지정
|
43
|
40
|
$('#ITP_MOBILE_MRTNMNG05010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
|
|
@@ -68,13 +65,6 @@ let mobPageObj = {
|
68
|
65
|
return false;
|
69
|
66
|
});
|
70
|
67
|
|
71
|
|
- $(document).on('click', '#ITP_POP_MRTNMNG05010_LIST_SPPLY_ROWS li button', function() {
|
72
|
|
- mobPopObj.popSpply.choice($(this));
|
73
|
|
- });
|
74
|
|
-
|
75
|
|
- $(document).on('click', '#ITP_LIST_MRTNMNG05010_POP_WHS_ROWS li button', function() {
|
76
|
|
- mobPopObj.popWhsNm.choice($(this));
|
77
|
|
- });
|
78
|
68
|
}
|
79
|
69
|
},
|
80
|
70
|
switchScreen: function(mode) {
|
|
@@ -103,8 +93,7 @@ let mobContObj = {
|
103
|
93
|
var formId = '#ITP_FORM_MRTNMNG05010_LIST_SEARCH';
|
104
|
94
|
itp_fn_form_clear_validate(null, formId);
|
105
|
95
|
if (itp_fn_form_event.isValid(formId)) {
|
106
|
|
- this.listPage = 0;
|
107
|
|
- this.totPage = 0;
|
|
96
|
+ this.listPage = 1;
|
108
|
97
|
this.rows.length = 0;
|
109
|
98
|
$('#ITP_LIST_MRTNMNG05010_LIST_ITEM_ROWS').empty();
|
110
|
99
|
setTimeout(function() {
|
|
@@ -126,12 +115,14 @@ let mobContObj = {
|
126
|
115
|
$.each(result.gridRows, function (i, item) {
|
127
|
116
|
$('#ITP_LIST_MRTNMNG05010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MRTNMNG05010_LIST_ITEM_ROWCOPY').html());
|
128
|
117
|
var $li = $('#ITP_LIST_MRTNMNG05010_LIST_ITEM_AREA .panel-group > .item-row:last');
|
129
|
|
- $li.find('.fnRtnPodrUnqNo').text(item.rtnPodrUnqNo);
|
130
|
|
- $li.find('.fnColSchDt').text(item.colSchDt);
|
131
|
|
- $li.find('.fnSpplyNm').text(item.spplyNm);
|
132
|
|
- $li.find('.fnRtnWhsNm').text(item.rtnWhsNm);
|
133
|
118
|
$li.find('.fnItemNm').text(item.itemNm);
|
134
|
|
- $li.find('.fnColReqQty').text(CommonObj.comma.set(item.colReqQty));
|
|
119
|
+ $li.find('.fnWhsNm').text(item.whsNm);
|
|
120
|
+ $li.find('.fnRtnWhsNm').text(item.rtnWhsNm);
|
|
121
|
+ $li.find('.fnColReqDt').text(CommonObj.nullToString(item.colReqDt));
|
|
122
|
+ $li.find('.fnColSchDt').text(CommonObj.nullToString(item.colSchDt));
|
|
123
|
+ $li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
|
|
124
|
+ $li.find('.fncolReqAmt').text(CommonObj.currency.add(item.colReqAmt));
|
|
125
|
+ $li.find('.fnRodrQty').text(CommonObj.currency.add(item.rodrQty, ''));
|
135
|
126
|
$li.find('#ITP_FORM_MRTNMNG05010_LIST_COL_QTY').val(item.colQty);
|
136
|
127
|
mobContObj.list.rows.push(item);
|
137
|
128
|
});
|
|
@@ -228,6 +219,7 @@ let mobPopObj = {
|
228
|
219
|
init: function() {
|
229
|
220
|
this.rows.length = 0;
|
230
|
221
|
mobPopObj.show(this.popId);
|
|
222
|
+ $('#ITP_FORM_MRTNMNG05010_POP_SPPLY_SEARCH #ITP_FORM_MRTNMNG05010_POP_SPPLY_KEYWORD').val('');
|
231
|
223
|
this.search();
|
232
|
224
|
this.action();
|
233
|
225
|
},
|
|
@@ -242,6 +234,7 @@ let mobPopObj = {
|
242
|
234
|
fn_ajax_call(API_POP_SPPLY_LIST, JSON.stringify(param), callbackFn, 'POST');
|
243
|
235
|
},
|
244
|
236
|
view: function(gridRows) {
|
|
237
|
+ var _this = this;
|
245
|
238
|
this.rows = gridRows;
|
246
|
239
|
$.each(gridRows, function (i, item) {
|
247
|
240
|
$('#ITP_POP_MRTNMNG05010_LIST_SPPLY_AREA .panel-group').append($('#ITP_POP_MRTNMNG05010_LIST_SPPLY_ROWCOPY').html());
|
|
@@ -249,6 +242,7 @@ let mobPopObj = {
|
249
|
242
|
$li.find('.fnSpplyNm').text(item.spplyNm);
|
250
|
243
|
$li.find('.fnStNm').text($li.find('.fnStNm').text().replace('$', item.stNm));
|
251
|
244
|
$li.find('.fnSpplyId').data('item-key', item.spplyId);
|
|
245
|
+ $('#ITP_POP_MRTNMNG05010_LIST_SPPLY_ROWS li button')[$li.index()].addEventListener('click', function() { _this.choice(this); });
|
252
|
246
|
});
|
253
|
247
|
},
|
254
|
248
|
choice: function(elem) {
|
|
@@ -269,7 +263,7 @@ let mobPopObj = {
|
269
|
263
|
var id = $(this).attr('id');
|
270
|
264
|
switch (id) {
|
271
|
265
|
case 'ITP_BTN_MRTNMNG05010_POP_SPPLY_SEARCH' : _this.search(); break;
|
272
|
|
- case 'ITP_BTN_MRTNMNG05010_POP_SPPLY_CHOICE' : _this.choice($(this)); break;
|
|
266
|
+ // case 'ITP_BTN_MRTNMNG05010_POP_SPPLY_CHOICE' : _this.choice($(this)); break;
|
273
|
267
|
case 'ITP_BTN_MRTNMNG05010_POP_SPPLY_CLOSE' : _this.close(); break;
|
274
|
268
|
}
|
275
|
269
|
return false;
|
|
@@ -288,67 +282,50 @@ let mobPopObj = {
|
288
|
282
|
},
|
289
|
283
|
popWhsNm: {
|
290
|
284
|
popId: 'ITP_POP_MRTNMNG05010_WHS_AREA',
|
291
|
|
- rows: [],
|
292
|
285
|
init: function () {
|
|
286
|
+ $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .mb_0').children().remove();
|
|
287
|
+ $('#ITP_POP_MRTNMNG05010_WHS_AREA #ITP_FORM_MRTNMNG05010_POP_WHS_KEYWORD').val('');
|
293
|
288
|
this.rows.length = 0;
|
294
|
289
|
mobPopObj.show(this.popId);
|
295
|
290
|
this.search();
|
296
|
291
|
this.action();
|
297
|
292
|
},
|
|
293
|
+ rows: [],
|
298
|
294
|
search: function () {
|
299
|
295
|
var _this = this;
|
300
|
|
- $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .panel-group').empty();
|
|
296
|
+ $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .mb_0').empty();
|
301
|
297
|
var callbackFn = function(result) {
|
302
|
|
- console.log(result);
|
303
|
|
- _this.view(result.gridRows);
|
|
298
|
+ $.each(result.gridRows, function (i, item) {
|
|
299
|
+ $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .mb_0').append($('#ITP_LIST_MRTNMNG05010_POP_WHS_ROWCOPY').html());
|
|
300
|
+ var $li = $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .mb_0 > .row_2:last');
|
|
301
|
+ $li.find('.fnWhsNm').text(item.whsNm);
|
|
302
|
+ $li.find('.fnLocationNm').text(item.locationNm);
|
|
303
|
+ $li.find('.fnWhsId').data('whs-id', item.whsId);
|
|
304
|
+ $li.find('.fnWhsId').data('location', item.location);
|
|
305
|
+ $('#ITP_LIST_MRTNMNG05010_POP_WHS_ROWS li button')[$li.index()].addEventListener('click', function() { _this.choice(this); });
|
|
306
|
+ });
|
304
|
307
|
};
|
305
|
308
|
const param = $('#ITP_FORM_MRTNMNG05010_POP_WHS').serializeObject();
|
306
|
|
- param.swhsDvsn = CommonObj.schWhsDvsn();
|
|
309
|
+ (fn_make_user_info.get('authTpCd') === '50') ? param.swhsDvsn = 'W02' : param.swhsDvsn = 'W01';
|
307
|
310
|
fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
|
308
|
311
|
},
|
309
|
|
- view: function(gridRows) {
|
310
|
|
- this.rows = gridRows;
|
311
|
|
- $.each(gridRows, function (i, item) {
|
312
|
|
- $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MRTNMNG05010_POP_WHS_ROWCOPY').html());
|
313
|
|
- var $li = $('#ITP_LIST_MRTNMNG05010_POP_WHS_AREA .panel-group > .list-row:last');
|
314
|
|
- $li.find('.fnWhsNm').text(item.whsNm);
|
315
|
|
- $li.find('.fnLocationNm').text(item.locationNm);
|
316
|
|
- $li.find('.fnWhsId').data('whs-id', item.whsId);
|
|
312
|
+ action: function() {
|
|
313
|
+ var _this = this;
|
|
314
|
+ $('#ITP_FORM_MRTNMNG05010_POP_WHS button[id="ITP_BTN_MRTNMNG05010_POP_WHS_SEARCH"]').off('click').on('click', function() {
|
|
315
|
+ _this.search();
|
317
|
316
|
});
|
318
|
317
|
},
|
319
|
318
|
choice: function(elem) {
|
320
|
|
- var _this = this;
|
321
|
319
|
var whsId = $(elem).data('whs-id');
|
322
|
|
- $.each(this.rows, function (i, item) {
|
323
|
|
- if(whsId === item.whsId) {
|
324
|
|
- $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_ID').val(item.whsId);
|
325
|
|
- $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_NM').val(item.whsNm);
|
326
|
|
- _this.close();
|
327
|
|
- return false;
|
328
|
|
- }
|
329
|
|
- });
|
330
|
|
- },
|
331
|
|
- action: function() {
|
332
|
|
- var _this = this;
|
333
|
|
- $('button[id^="ITP_BTN_MRTNMNG05010_POP_WHS"]').off('click').on('click', function() {
|
334
|
|
- var id = $(this).attr('id');
|
335
|
|
- switch (id) {
|
336
|
|
- case 'ITP_BTN_MRTNMNG05010_POP_WHS_SEARCH' : _this.search(); break;
|
337
|
|
- case 'ITP_BTN_MRTNMNG05010_POP_WHS_CHOICE' : _this.choice($(this)); break;
|
338
|
|
- case 'ITP_BTN_MRTNMNG05010_POP_WHS_CLOSE' : _this.close(); break;
|
339
|
|
- }
|
340
|
|
- return false;
|
341
|
|
- });
|
|
320
|
+ var whsNm = $(elem).parent().prev().find('.fnWhsNm').text();
|
|
321
|
+ var location = $(elem).data('location');
|
|
322
|
+ $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_ID').val(whsId);
|
|
323
|
+ $('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_NM').val(whsNm);
|
|
324
|
+ mobPopObj.hide(this.popId);
|
342
|
325
|
},
|
343
|
326
|
delete: function() {
|
344
|
327
|
$('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_ID').val('');
|
345
|
328
|
$('#ITP_FORM_MRTNMNG05010_LIST_SEARCH #ITP_FORM_MRTNMNG05010_LIST_SEARCH_WHS_NM').val('');
|
346
|
|
- },
|
347
|
|
- close: function() {
|
348
|
|
- this.rows.length = 0;
|
349
|
|
- $('#ITP_POP_MRTNMNG05010_LIST_WHS_AREA .panel-group').empty();
|
350
|
|
- $('#ITP_FORM_MRTNMNG05010_POP_WHS #ITP_FORM_MRTNMNG05010_POP_WHS_KEYWORD').val('');
|
351
|
|
- mobPopObj.hide(this.popId);
|
352
|
329
|
}
|
353
|
330
|
},
|
354
|
331
|
show: function(popId) {
|