|
@@ -9,8 +9,8 @@ require(['config'], function() {
|
9
|
9
|
const API_MOBILE_GRID_LIST = '/api/stock/cdd/detail-grid-list'; // 목록
|
10
|
10
|
const API_MOBILE_SAVE = '/api/stock/cdd/save-stock-cdd'; // 저장
|
11
|
11
|
const API_MOBILE_BARCODE = '/api/stock/mng/info-barcode-stock'; // 바코드
|
12
|
|
-const API_MOBILE_LOCATION = '/api/whs/mng/location-grid-list'; // 이력
|
13
|
|
-const API_POP_SEARCH_LIST = '/api/whs/mng/detail-grid-list';
|
|
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';
|
14
|
14
|
const API_POP_STOCK_MNG_LIST = '/api/stock/mng/detail-grid-list';
|
15
|
15
|
|
16
|
16
|
const PAGE_MODE_LIST = "LIST";
|
|
@@ -52,8 +52,6 @@ let mobPageObj = {
|
52
|
52
|
$('button[id^="ITP_BTN_MSTOCKMNG02010_LIST"]').on('click', function() {
|
53
|
53
|
var id = $(this).attr('id');
|
54
|
54
|
switch (id) {
|
55
|
|
- case 'ITP_BTN_MSTOCKMNG02010_LIST_SEARCH_WHS_NM' : mobPopObj.popWhsNm.init(); break;
|
56
|
|
- case 'ITP_BTN_MSTOCKMNG02010_LIST_DELETE_WHS_NM' : mobPopObj.popWhsNm.delete(); break;
|
57
|
55
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_SEARCH' : mobContentObj.list.search(); break;
|
58
|
56
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_BARCODE' : mobContentObj.barcode.callApp(); break;
|
59
|
57
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_SAVE' : mobContentObj.list.save(); break;
|
|
@@ -70,8 +68,8 @@ let mobPageObj = {
|
70
|
68
|
}
|
71
|
69
|
});
|
72
|
70
|
|
73
|
|
- $(document).on('click', '#ITP_LIST_MSTOCKMNG02010_POP_STORE_ROWS li button', function() {
|
74
|
|
- mobPopObj.popWhsNm.choice($(this));
|
|
71
|
+ $('select[id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM"]').on('change', function() {
|
|
72
|
+ mobContentObj.list.locationList();
|
75
|
73
|
});
|
76
|
74
|
}
|
77
|
75
|
},
|
|
@@ -114,6 +112,7 @@ let mobContentObj = {
|
114
|
112
|
rows: [],
|
115
|
113
|
init: function() {
|
116
|
114
|
mobPageObj.switchScreen(PAGE_MODE_LIST);
|
|
115
|
+ this.whsList();
|
117
|
116
|
},
|
118
|
117
|
search: function() {
|
119
|
118
|
var formId = '#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH';
|
|
@@ -122,6 +121,27 @@ let mobContentObj = {
|
122
|
121
|
mobPopObj.popItemNm.init();
|
123
|
122
|
}
|
124
|
123
|
},
|
|
124
|
+ whsList: function() {
|
|
125
|
+ const brandIdVal = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_BRAND_ID').val();
|
|
126
|
+ const storeIdVal = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_STORE_ID').val();
|
|
127
|
+ const param = {sbrandId: brandIdVal, sstoreId: storeIdVal, pagingYn: false};
|
|
128
|
+ fn_ajax_call(API_MOBILE_WHS_GRID_LIST, JSON.stringify(param), function(result) {
|
|
129
|
+ fn_make_select_whs(result.gridRows, 'ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM');
|
|
130
|
+ if(result.gridRecords > 0) {
|
|
131
|
+ $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM').trigger('change');
|
|
132
|
+ }
|
|
133
|
+ }, 'POST');
|
|
134
|
+ },
|
|
135
|
+ locationList: function() {
|
|
136
|
+ var _this = this;
|
|
137
|
+ const brandIdVal = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_BRAND_ID').val();
|
|
138
|
+ const storeIdVal = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_STORE_ID').val();
|
|
139
|
+ const whsIdVal = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM').val();
|
|
140
|
+ const param = {brandId: brandIdVal, storeId: storeIdVal, whsId: whsIdVal, pagingYn: false};
|
|
141
|
+ fn_ajax_call(API_MOBILE_LOCATION_LIST, JSON.stringify(param), function(result) {
|
|
142
|
+ fn_make_select_location(result.gridRows, 'ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_LOCATION');
|
|
143
|
+ }, 'POST');
|
|
144
|
+ },
|
125
|
145
|
itemAdd: function(rows) {
|
126
|
146
|
var _this = this;
|
127
|
147
|
$.each(rows, function(index, item) {
|
|
@@ -221,85 +241,6 @@ let mobContentObj = {
|
221
|
241
|
};
|
222
|
242
|
|
223
|
243
|
let mobPopObj = {
|
224
|
|
- popWhsNm: {
|
225
|
|
- popId: 'ITP_POP_MSTOCKMNG02010_WHS_AREA',
|
226
|
|
- rows: [],
|
227
|
|
- init: function () {
|
228
|
|
- this.rows.length = 0;
|
229
|
|
- mobContentObj.list.validClear();
|
230
|
|
- mobPopObj.show(this.popId);
|
231
|
|
- this.search();
|
232
|
|
- this.action();
|
233
|
|
- },
|
234
|
|
- search: function () {
|
235
|
|
- var _this = this;
|
236
|
|
- $('#ITP_LIST_MSTOCKMNG02010_POP_WHS_AREA .panel-group').empty();
|
237
|
|
- var callbackFn = function(result) {
|
238
|
|
- console.log(result);
|
239
|
|
- _this.view(result.gridRows);
|
240
|
|
- };
|
241
|
|
- const param = $('#ITP_FORM_MSTOCKMNG02010_POP_WHS').serializeObject();
|
242
|
|
- console.log(JSON.stringify(param));
|
243
|
|
- fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
|
244
|
|
- },
|
245
|
|
- view: function(gridRows) {
|
246
|
|
- this.rows = gridRows;
|
247
|
|
- $.each(gridRows, function (i, item) {
|
248
|
|
- $('#ITP_LIST_MSTOCKMNG02010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG02010_POP_WHS_ROWCOPY').html());
|
249
|
|
- var $li = $('#ITP_LIST_MSTOCKMNG02010_POP_WHS_AREA .panel-group > .list-row:last');
|
250
|
|
- $li.find('.fnWhsNm').text(item.whsNm);
|
251
|
|
- $li.find('.fnLocationNm').text(item.locationNm);
|
252
|
|
- $li.find('.fnWhsId').data('whs-id', item.whsId);
|
253
|
|
- });
|
254
|
|
- },
|
255
|
|
- choice: function(elem) {
|
256
|
|
- var _this = this;
|
257
|
|
- var whsId = $(elem).data('whs-id');
|
258
|
|
- $.each(this.rows, function (i, item) {
|
259
|
|
- if(whsId === item.whsId) {
|
260
|
|
- $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_ID').val(item.whsId);
|
261
|
|
- $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM').val(item.whsNm);
|
262
|
|
- _this.close();
|
263
|
|
- _this.location(item.whsId);
|
264
|
|
- return false;
|
265
|
|
- }
|
266
|
|
- });
|
267
|
|
- },
|
268
|
|
- location: function(whsId) {
|
269
|
|
- var callbackFn = function(result) {
|
270
|
|
- fn_make_select_location(result.gridRows, 'ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_LOCATION');
|
271
|
|
- };
|
272
|
|
- var param = {
|
273
|
|
- 'brandId': fn_make_user_info.get('brandId'),
|
274
|
|
- 'storeId': fn_make_user_info.get('storeId'),
|
275
|
|
- 'whsId': whsId
|
276
|
|
- };
|
277
|
|
- fn_ajax_call(API_MOBILE_LOCATION, JSON.stringify(param), callbackFn, 'POST');
|
278
|
|
- },
|
279
|
|
- action: function() {
|
280
|
|
- var _this = this;
|
281
|
|
- $('button[id^="ITP_BTN_MSTOCKMNG02010_POP_WHS"]').off('click').on('click', function() {
|
282
|
|
- var id = $(this).attr('id');
|
283
|
|
- switch (id) {
|
284
|
|
- case 'ITP_BTN_MSTOCKMNG02010_POP_WHS_SEARCH' : _this.search(); break;
|
285
|
|
- case 'ITP_BTN_MSTOCKMNG02010_POP_WHS_CHOICE' : _this.choice($(this)); break;
|
286
|
|
- case 'ITP_BTN_MSTOCKMNG02010_POP_WHS_CLOSE' : _this.close(); break;
|
287
|
|
- }
|
288
|
|
- return false;
|
289
|
|
- });
|
290
|
|
- },
|
291
|
|
- delete: function() {
|
292
|
|
- $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_ID').val('');
|
293
|
|
- $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM').val('');
|
294
|
|
- $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH select[name="slocation"] option').empty();
|
295
|
|
- },
|
296
|
|
- close: function() {
|
297
|
|
- this.rows.length = 0;
|
298
|
|
- $('#ITP_POP_MSTOCKMNG02010_LIST_WHS_AREA .panel-group').empty();
|
299
|
|
- $('#ITP_FORM_MSTOCKMNG02010_POP_WHS #ITP_FORM_MSTOCKMNG02010_POP_WHS_KEYWORD').val('');
|
300
|
|
- mobPopObj.hide(this.popId);
|
301
|
|
- }
|
302
|
|
- },
|
303
|
244
|
popItemNm: {
|
304
|
245
|
popId: 'ITP_POP_MSTOCKMNG02010_ITEM_AREA',
|
305
|
246
|
rows: [],
|