|
@@ -6,9 +6,11 @@ require(['config'], function() {
|
6
|
6
|
});
|
7
|
7
|
|
8
|
8
|
/*API URL*/
|
9
|
|
-const API_MOBILE_GRID_LIST = '/api/unpaid/mng/detail-grid-list'; // 목록
|
10
|
|
-const API_MOBILE_INFO = '/api/unpaid/mng/info-unpaid'; // 상세
|
11
|
|
-const API_MOBILE_HISTORY = '/api/unpaid/mng/stl-grid-list'; // 이력
|
|
9
|
+const API_MOBILE_GRID_LIST = '/api/stock/cdd/detail-grid-list'; // 목록
|
|
10
|
+const API_MOBILE_INFO = '/api/stock/cdd/info-cdd'; // 상세
|
|
11
|
+const API_MOBILE_SAVE = '/api/stock/cdd/save-stock-cdd'; // 저장
|
|
12
|
+const API_MOBILE_WHS_GRID_LIST = '/api/whs/mng/detail-grid-list';
|
|
13
|
+const API_MOBILE_LOCATION_LIST = '/api/whs/mng/location-grid-list';
|
12
|
14
|
const API_POP_SEARCH_LIST = '/api/store/pop-grid-list';
|
13
|
15
|
|
14
|
16
|
const PAGE_MODE_LIST = "LIST";
|
|
@@ -27,16 +29,6 @@ let mobPageObj = {
|
27
|
29
|
this.info();
|
28
|
30
|
},
|
29
|
31
|
view: function() {
|
30
|
|
- // 공통코드 표시
|
31
|
|
- $('select').each(function() {
|
32
|
|
- if($(this).data('select-code')) {
|
33
|
|
- fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
34
|
|
- }
|
35
|
|
- });
|
36
|
|
-
|
37
|
|
- // 조회일자 지정
|
38
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_FROM_DT').val(itp_fn_date_add('M', -1));
|
39
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_TO_DT').val(itp_fn_date_add('M', 0));
|
40
|
32
|
},
|
41
|
33
|
info: function() {
|
42
|
34
|
$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
|
|
@@ -45,14 +37,14 @@ let mobPageObj = {
|
45
|
37
|
},
|
46
|
38
|
event: {
|
47
|
39
|
init: function() {
|
48
|
|
- this.button();
|
|
40
|
+ this.action();
|
49
|
41
|
},
|
50
|
|
- button: function() {
|
|
42
|
+ action: function() {
|
51
|
43
|
$('button[id^="ITP_BTN_MSTOCKMNG01010_LIST"]').on('click', function() {
|
52
|
44
|
var id = $(this).attr('id');
|
53
|
45
|
switch (id) {
|
54
|
|
- case 'ITP_BTN_MSTOCKMNG01010_LIST_SEARCH_STORE_NM' : mobPopObj.popStoreNm.init(); break;
|
55
|
|
- case 'ITP_BTN_MSTOCKMNG01010_LIST_DELETE_STORE_NM' : mobPopObj.popStoreNm.delete(); break;
|
|
46
|
+ case 'ITP_BTN_MSTOCKMNG01010_LIST_SEARCH_WHS_NM' : mobPopObj.popWhsNm.init(); break;
|
|
47
|
+ case 'ITP_BTN_MSTOCKMNG01010_LIST_DETELE_WHS_NM' : mobPopObj.popWhsNm.delete(); break;
|
56
|
48
|
case 'ITP_BTN_MSTOCKMNG01010_LIST_SEARCH' : mobContentObj.list.search(); break;
|
57
|
49
|
}
|
58
|
50
|
return false;
|
|
@@ -67,12 +59,16 @@ let mobPageObj = {
|
67
|
59
|
return false;
|
68
|
60
|
});
|
69
|
61
|
|
|
62
|
+ $('select[id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM"]').on('change', function() {
|
|
63
|
+ mobContentObj.list.locationList();
|
|
64
|
+ });
|
|
65
|
+
|
70
|
66
|
$(document).on('click', '#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWS li', function() {
|
71
|
67
|
var item = mobContentObj.list.rows[$(this).index()];
|
72
|
68
|
mobContentObj.view.init(item);
|
73
|
69
|
});
|
74
|
70
|
|
75
|
|
- $(document).on('click', '#ITP_LIST_MSTOCKMNG01010_POP_STORE_ROWS li button', function() {
|
|
71
|
+ $(document).on('click', '#ITP_LIST_MSTOCKMNG01010_POP_WHS_ROWS li button', function() {
|
76
|
72
|
mobPopObj.popWhsNm.choice($(this));
|
77
|
73
|
});
|
78
|
74
|
}
|
|
@@ -120,7 +116,8 @@ let mobContentObj = {
|
120
|
116
|
rows: [],
|
121
|
117
|
init: function() {
|
122
|
118
|
mobPageObj.switchScreen(PAGE_MODE_LIST);
|
123
|
|
- this.search();
|
|
119
|
+ // this.search();
|
|
120
|
+ this.whsList();
|
124
|
121
|
},
|
125
|
122
|
search: function() {
|
126
|
123
|
this.listPage = 0;
|
|
@@ -140,27 +137,45 @@ let mobContentObj = {
|
140
|
137
|
$('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWCOPY').html());
|
141
|
138
|
var $li = $('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group > .list-row:last');
|
142
|
139
|
$li.find('.fnStoreNm').text(item.storeNm);
|
143
|
|
- $li.find('.fnLoanDvsnNm').text(item.loanDvsnNm);
|
144
|
|
- var limitAmt;
|
145
|
|
- if(item.loanDvsn == 'LD01') { // 선불(충전)
|
146
|
|
- limitAmt = item.chrgeLimitAmt;
|
147
|
|
- } else if(item.loanDvsn == 'LD02') { // 후불(신용)
|
148
|
|
- limitAmt = item.credtLimitAmt;
|
149
|
|
- }
|
150
|
|
- $li.find('.fnLimitAmt').text(CommonObj.currency.add(limitAmt));
|
151
|
|
- $li.find('.fnPosbLimitAmt').text(CommonObj.currency.add(limitAmt - item.useAmtTotal));
|
152
|
|
- $li.find('.fnTmpRcvAcctTotal').text(CommonObj.currency.add(item.tmpRcvAcctTotal));
|
153
|
|
- $li.find('.fnUseAmtTotal').text(CommonObj.currency.add(item.useAmtTotal));
|
154
|
|
- $li.find('.fnUseYnNm').text(item.useYnNm);
|
155
|
140
|
_this.rows.push(item);
|
156
|
141
|
});
|
157
|
142
|
};
|
158
|
143
|
var errFn = function() { _this.isSearch = false;};
|
159
|
144
|
const param = $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH').serializeObject();
|
160
|
145
|
param.gridPage = ++this.listPage;
|
161
|
|
- param.gridSize = this.listSize
|
162
|
|
- // console.log(JSON.stringify(param));
|
|
146
|
+ param.gridSize = this.listSize;
|
|
147
|
+ param.pagingYn = true;
|
|
148
|
+ console.log(JSON.stringify(param));
|
163
|
149
|
fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
|
|
150
|
+ },
|
|
151
|
+ whsList: function() {
|
|
152
|
+ const brandIdVal = $('#ITP_FORM_MLOANMNG01010_LIST_SEARCH_BRAND_ID').val();
|
|
153
|
+ const storeIdVal = $('#ITP_FORM_MLOANMNG01010_LIST_SEARCH_STORE_ID').val();
|
|
154
|
+ const param = {sbrandId: brandIdVal, sstoreId: storeIdVal, pagingYn: false};
|
|
155
|
+
|
|
156
|
+ fn_ajax_call(API_MOBILE_WHS_GRID_LIST, JSON.stringify(param), function(result) {
|
|
157
|
+ console.log(result);
|
|
158
|
+ fn_make_select_whs(result.gridRows, 'ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM');
|
|
159
|
+ fn_make_select_whs(result.gridRows, 'ITP_FORM_MSTOCKMNG01010_POP_WHS_NM');
|
|
160
|
+
|
|
161
|
+ if(result.gridRecords > 0) {
|
|
162
|
+ $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM').trigger('change');
|
|
163
|
+ }
|
|
164
|
+ }, 'POST');
|
|
165
|
+ },
|
|
166
|
+ locationList: function() {
|
|
167
|
+ const brandIdVal = $('#ITP_FORM_MLOANMNG01010_LIST_SEARCH_BRAND_ID').val();
|
|
168
|
+ const storeIdVal = $('#ITP_FORM_MLOANMNG01010_LIST_SEARCH_STORE_ID').val();
|
|
169
|
+ const whsIdVal = $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM').val();
|
|
170
|
+ const param = {brandId: brandIdVal, storeId: storeIdVal, whsId: whsIdVal, pagingYn: false};
|
|
171
|
+ console.log(JSON.stringify(param));
|
|
172
|
+
|
|
173
|
+ fn_ajax_call(API_MOBILE_LOCATION_LIST, JSON.stringify(param), function(result) {
|
|
174
|
+
|
|
175
|
+ fn_make_select_location(result.gridRows, 'ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_LOCATION');
|
|
176
|
+ fn_make_select_location(result.gridRows, 'ITP_FORM_MSTOCKMNG01010_POP_LOCATION');
|
|
177
|
+
|
|
178
|
+ }, 'POST');
|
164
|
179
|
}
|
165
|
180
|
},
|
166
|
181
|
view: {
|
|
@@ -199,51 +214,6 @@ let mobContentObj = {
|
199
|
214
|
$(id).find('.fnUseAmtTotal').text(CommonObj.currency.add(result.useAmtTotal));
|
200
|
215
|
_this.history.init(result.loanMgntUnqNo);
|
201
|
216
|
},
|
202
|
|
- history: {
|
203
|
|
- rows: [],
|
204
|
|
- init: function(loanMgntUnqNo) {
|
205
|
|
- // 조회일자 지정
|
206
|
|
- $('#ITP_FORM_MSTOCKMNG01010_VIEW_SEARCH_FROM_DT').val(itp_fn_date_add('M', -1));
|
207
|
|
- $('#ITP_FORM_MSTOCKMNG01010_VIEW_SEARCH_TO_DT').val(itp_fn_date_add('M', 0));
|
208
|
|
- this.loanMgntUnqNo = loanMgntUnqNo;
|
209
|
|
- this.search();
|
210
|
|
- },
|
211
|
|
- search: function() {
|
212
|
|
- this.listPage = 0;
|
213
|
|
- this.totPage = 0;
|
214
|
|
- this.rows.length = 0;
|
215
|
|
- $('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWS').empty();
|
216
|
|
- this.load();
|
217
|
|
- },
|
218
|
|
- load: function() {
|
219
|
|
- var _this = this;
|
220
|
|
- this.isSearch = true;
|
221
|
|
- var callbackFn = function(result) {
|
222
|
|
- console.log(result);
|
223
|
|
- _this.isSearch = false;
|
224
|
|
- _this.totPage = result.gridTotal;
|
225
|
|
- $.each(result.gridRows, function (i, item) {
|
226
|
|
- $('#ITP_LIST_MSTOCKMNG01010_VIEW_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_VIEW_ITEM_ROWCOPY').html());
|
227
|
|
- var $li = $('#ITP_LIST_MSTOCKMNG01010_VIEW_ITEM_AREA .panel-group > .list-row:last');
|
228
|
|
- $li.find('.fnLoanRegDt').text(item.loanRegDt);
|
229
|
|
- $li.find('.fnDpstPayDvsnNm').text(item.dpstPayDvsnNm);
|
230
|
|
- $li.find('.fnDstpAmt').text(item.dstpAmt);
|
231
|
|
- $li.find('.fnTrscAfBal').text(item.trscAfBal);
|
232
|
|
- $li.find('.fnUse').text(item.use);
|
233
|
|
- _this.rows.push(item);
|
234
|
|
- });
|
235
|
|
- };
|
236
|
|
- var errFn = function() { _this.isSearch = false;};
|
237
|
|
- const param = $('#ITP_FORM_MSTOCKMNG01010_VIEW_SEARCH').serializeObject();
|
238
|
|
- param.gridPage = ++this.listPage;
|
239
|
|
- param.gridSize = this.listSize;
|
240
|
|
- param.sloanMgntUnqNo = _this.loanMgntUnqNo;
|
241
|
|
- param.fromDt = CommonObj.onlyNumber(param.fromDt);
|
242
|
|
- param.toDt = CommonObj.onlyNumber(param.toDt);
|
243
|
|
- console.log(JSON.stringify(param));
|
244
|
|
- fn_ajax_call(API_MOBILE_HISTORY, JSON.stringify(param), callbackFn, 'POST', errFn);
|
245
|
|
- }
|
246
|
|
- },
|
247
|
217
|
cancel: function () {
|
248
|
218
|
var id = '#ITP_AJAX_MSTOCKMNG01010_VIEW_CONTAINER';
|
249
|
219
|
$(id).find('.fnItemid').text('');
|
|
@@ -261,8 +231,8 @@ let mobContentObj = {
|
261
|
231
|
};
|
262
|
232
|
|
263
|
233
|
let mobPopObj = {
|
264
|
|
- popStoreNm: {
|
265
|
|
- popId: 'ITP_POP_MSTOCKMNG01010_STORE_AREA',
|
|
234
|
+ popWhsNm: {
|
|
235
|
+ popId: 'ITP_POP_MSTOCKMNG01010_WHS_AREA',
|
266
|
236
|
rows: [],
|
267
|
237
|
init: function () {
|
268
|
238
|
this.rows.length = 0;
|
|
@@ -272,56 +242,69 @@ let mobPopObj = {
|
272
|
242
|
},
|
273
|
243
|
search: function () {
|
274
|
244
|
var _this = this;
|
275
|
|
- $('#ITP_LIST_MSTOCKMNG01010_POP_STORE_AREA .panel-group').empty();
|
|
245
|
+ $('#ITP_LIST_MSTOCKMNG01010_POP_WHS_AREA .panel-group').empty();
|
276
|
246
|
var callbackFn = function(result) {
|
277
|
247
|
console.log(result);
|
278
|
248
|
_this.view(result.gridRows);
|
279
|
249
|
};
|
280
|
|
- const param = $('#ITP_FORM_MSTOCKMNG01010_POP_STORE').serializeObject();
|
|
250
|
+ const param = $('#ITP_FORM_MSTOCKMNG01010_POP_WHS').serializeObject();
|
|
251
|
+ console.log(JSON.stringify(param));
|
281
|
252
|
fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
|
282
|
253
|
},
|
283
|
254
|
view: function(gridRows) {
|
284
|
255
|
this.rows = gridRows;
|
285
|
256
|
$.each(gridRows, function (i, item) {
|
286
|
|
- $('#ITP_LIST_MSTOCKMNG01010_POP_STORE_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_POP_STORE_ROWCOPY').html());
|
287
|
|
- var $li = $('#ITP_LIST_MSTOCKMNG01010_POP_STORE_AREA .panel-group > .list-row:last');
|
288
|
|
- $li.find('.fnStoreNm').text(item.storeNm);
|
289
|
|
- $li.find('.fnStoreStNm').text(item.storeStNm);
|
290
|
|
- $li.find('.fnStoreId').data('store-id', item.storeId);
|
|
257
|
+ $('#ITP_LIST_MSTOCKMNG01010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_POP_WHS_ROWCOPY').html());
|
|
258
|
+ var $li = $('#ITP_LIST_MSTOCKMNG01010_POP_WHS_AREA .panel-group > .list-row:last');
|
|
259
|
+ $li.find('.fnWhsNm').text(item.whsNm);
|
|
260
|
+ $li.find('.fnLocationNm').text(item.locationNm);
|
|
261
|
+ $li.find('.fnWhsId').data('whs-id', item.whsId);
|
291
|
262
|
});
|
292
|
263
|
},
|
293
|
264
|
choice: function(elem) {
|
294
|
265
|
var _this = this;
|
295
|
|
- var storeId = $(elem).data('store-id');
|
|
266
|
+ var whsId = $(elem).data('whs-id');
|
296
|
267
|
$.each(this.rows, function (i, item) {
|
297
|
|
- if(storeId === item.storeId) {
|
298
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_STORE_ID').val(item.storeId);
|
299
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_STORE_NM').val(item.storeNm);
|
|
268
|
+ if(whsId === item.whsId) {
|
|
269
|
+ $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_ID').val(item.whsId);
|
|
270
|
+ $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM').val(item.whsNm);
|
300
|
271
|
_this.close();
|
|
272
|
+ _this.location(item.whsId);
|
301
|
273
|
return false;
|
302
|
274
|
}
|
303
|
275
|
});
|
304
|
276
|
},
|
|
277
|
+ location: function(whsId) {
|
|
278
|
+ var callbackFn = function(result) {
|
|
279
|
+ fn_make_select_location(result.gridRows, 'ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_LOCATION');
|
|
280
|
+ };
|
|
281
|
+ var param = {
|
|
282
|
+ 'brandId': fn_make_user_info.get('brandId'),
|
|
283
|
+ 'storeId': fn_make_user_info.get('storeId'),
|
|
284
|
+ 'whsId': whsId
|
|
285
|
+ };
|
|
286
|
+ fn_ajax_call(API_MOBILE_LOCATION, JSON.stringify(param), callbackFn, 'POST');
|
|
287
|
+ },
|
305
|
288
|
action: function() {
|
306
|
289
|
var _this = this;
|
307
|
|
- $('button[id^="ITP_BTN_MSTOCKMNG01010_POP_STORE"]').off('click').on('click', function() {
|
|
290
|
+ $('button[id^="ITP_BTN_MSTOCKMNG01010_POP_WHS"]').off('click').on('click', function() {
|
308
|
291
|
var id = $(this).attr('id');
|
309
|
292
|
switch (id) {
|
310
|
|
- case 'ITP_BTN_MSTOCKMNG01010_POP_STORE_SEARCH' : _this.search(); break;
|
311
|
|
- case 'ITP_BTN_MSTOCKMNG01010_POP_STORE_CHOICE' : _this.choice($(this)); break;
|
312
|
|
- case 'ITP_BTN_MSTOCKMNG01010_POP_STORE_CLOSE' : _this.close(); break;
|
|
293
|
+ case 'ITP_BTN_MSTOCKMNG01010_POP_WHS_SEARCH' : _this.search(); break;
|
|
294
|
+ case 'ITP_BTN_MSTOCKMNG01010_POP_WHS_CHOICE' : _this.choice($(this)); break;
|
|
295
|
+ case 'ITP_BTN_MSTOCKMNG01010_POP_WHS_CLOSE' : _this.close(); break;
|
313
|
296
|
}
|
314
|
297
|
return false;
|
315
|
298
|
});
|
316
|
299
|
},
|
317
|
300
|
delete: function() {
|
318
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_STORE_ID').val('');
|
319
|
|
- $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_STORE_NM').val('');
|
|
301
|
+ $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_ID').val('');
|
|
302
|
+ $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH #ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM').val('');
|
320
|
303
|
},
|
321
|
304
|
close: function() {
|
322
|
305
|
this.rows.length = 0;
|
323
|
306
|
$('#ITP_POP_MSTOCKMNG01010_LIST_WHS_AREA .panel-group').empty();
|
324
|
|
- $('#ITP_FORM_MSTOCKMNG01010_POP_STORE #ITP_FORM_MSTOCKMNG01010_POP_STORE_KEYWORD').val('');
|
|
307
|
+ $('#ITP_FORM_MSTOCKMNG01010_POP_WHS #ITP_FORM_MSTOCKMNG01010_POP_WHS_KEYWORD').val('');
|
325
|
308
|
mobPopObj.hide(this.popId);
|
326
|
309
|
}
|
327
|
310
|
},
|