|
@@ -8,8 +8,10 @@ require(['config'], function() {
|
8
|
8
|
/*API URL*/
|
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
|
+const API_MOBILE_BARCODE = '/api/stock/mng/info-barcode-stock'; // 바코드
|
11
|
12
|
const API_MOBILE_LOCATION = '/api/whs/mng/location-grid-list'; // 이력
|
12
|
13
|
const API_POP_SEARCH_LIST = '/api/whs/mng/detail-grid-list';
|
|
14
|
+const API_POP_STOCK_MNG_LIST = '/api/stock/mng/detail-grid-list';
|
13
|
15
|
|
14
|
16
|
const PAGE_MODE_LIST = "LIST";
|
15
|
17
|
const PAGE_MODE_VIEW = "VIEW";
|
|
@@ -53,7 +55,7 @@ let mobPageObj = {
|
53
|
55
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_SEARCH_WHS_NM' : mobPopObj.popWhsNm.init(); break;
|
54
|
56
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_DELETE_WHS_NM' : mobPopObj.popWhsNm.delete(); break;
|
55
|
57
|
case 'ITP_BTN_MSTOCKMNG02010_LIST_SEARCH' : mobContentObj.list.search(); break;
|
56
|
|
- case 'ITP_BTN_MSTOCKMNG02010_LIST_BARCODE' : mobContentObj.list.barcode(); break;
|
|
58
|
+ case 'ITP_BTN_MSTOCKMNG02010_LIST_BARCODE' : mobContentObj.barcode.callApp(); break;
|
57
|
59
|
}
|
58
|
60
|
return false;
|
59
|
61
|
});
|
|
@@ -113,58 +115,46 @@ let mobPageObj = {
|
113
|
115
|
|
114
|
116
|
let mobContentObj = {
|
115
|
117
|
list: {
|
116
|
|
- listSize: 10,
|
117
|
|
- listPage: 0,
|
118
|
|
- totPage: 0,
|
119
|
|
- isSearch: false,
|
120
|
118
|
rows: [],
|
121
|
119
|
init: function() {
|
122
|
120
|
mobPageObj.switchScreen(PAGE_MODE_LIST);
|
123
|
|
- this.search();
|
124
|
121
|
},
|
125
|
122
|
search: function() {
|
126
|
|
- this.listPage = 0;
|
127
|
|
- this.totPage = 0;
|
128
|
|
- this.rows.length = 0;
|
129
|
|
- $('#ITP_LIST_MSTOCKMNG02010_LIST_ITEM_ROWS').empty();
|
130
|
|
- this.load();
|
|
123
|
+ var formId = '#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH';
|
|
124
|
+ itp_fn_form_clear_validate(null, formId);
|
|
125
|
+ if (itp_fn_form_event.isValid(formId)) {
|
|
126
|
+ mobPopObj.popItemNm.init();
|
|
127
|
+ }
|
131
|
128
|
},
|
132
|
|
- load: function() {
|
133
|
|
- var _this = this;
|
134
|
|
- this.isSearch = true;
|
135
|
|
- var callbackFn = function(result) {
|
|
129
|
+ validClear: function() {
|
|
130
|
+ var formId = '#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH';
|
|
131
|
+ itp_fn_form_clear_validate(null, formId);
|
|
132
|
+ }
|
|
133
|
+ },
|
|
134
|
+ barcode: {
|
|
135
|
+ callApp: function() {
|
|
136
|
+ var formId = '#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH';
|
|
137
|
+ itp_fn_form_clear_validate(null, formId);
|
|
138
|
+ if (itp_fn_form_event.isValid(formId)) {
|
|
139
|
+ this.callbackFn('');
|
|
140
|
+ // location.replace('app:barcode');
|
|
141
|
+ // location.href = 'app:barcode';
|
|
142
|
+ }
|
|
143
|
+ },
|
|
144
|
+ callbackFn: function(barcode) {
|
|
145
|
+ var infoFn = function(result) {
|
136
|
146
|
console.log(result);
|
137
|
|
- _this.isSearch = false;
|
138
|
|
- _this.totPage = result.gridTotal;
|
139
|
|
- $.each(result.gridRows, function (i, item) {
|
140
|
|
- $('#ITP_LIST_MSTOCKMNG02010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG02010_LIST_ITEM_ROWCOPY').html());
|
141
|
|
- var $li = $('#ITP_LIST_MSTOCKMNG02010_LIST_ITEM_AREA .panel-group > .list-row:last');
|
142
|
|
- $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
|
|
- _this.rows.push(item);
|
156
|
|
- });
|
157
|
147
|
};
|
158
|
|
- var errFn = function() { _this.isSearch = false;};
|
|
148
|
+ // const param = {
|
|
149
|
+ // 'sBrandId': $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MLOANMNG02010_LIST_SEARCH_BRAND_ID').val(),
|
|
150
|
+ // 'sWhsId': $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_ID').val(),
|
|
151
|
+ // 'sLocation': $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_LOCATION').val(),
|
|
152
|
+ // 'sBarcode': barcode
|
|
153
|
+ // };
|
|
154
|
+ // fn_ajax_call(API_MOBILE_BARCODE, param, callbackFn, 'GET');
|
159
|
155
|
const param = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH').serializeObject();
|
160
|
|
- param.gridPage = ++this.listPage;
|
161
|
|
- param.gridSize = this.listSize
|
162
|
|
- // console.log(JSON.stringify(param));
|
163
|
|
- fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
|
164
|
|
- },
|
165
|
|
- barcode: function() {
|
166
|
|
- location.replace('app:barcode');
|
167
|
|
- // location.href = 'app:barcode';
|
|
156
|
+ param['sBarcode'] = barcode;
|
|
157
|
+ fn_ajax_call(API_MOBILE_BARCODE, JSON.stringify(param), infoFn, 'GET');
|
168
|
158
|
}
|
169
|
159
|
}
|
170
|
160
|
};
|
|
@@ -175,6 +165,7 @@ let mobPopObj = {
|
175
|
165
|
rows: [],
|
176
|
166
|
init: function () {
|
177
|
167
|
this.rows.length = 0;
|
|
168
|
+ mobContentObj.list.validClear();
|
178
|
169
|
mobPopObj.show(this.popId);
|
179
|
170
|
this.search();
|
180
|
171
|
this.action();
|
|
@@ -239,6 +230,7 @@ let mobPopObj = {
|
239
|
230
|
delete: function() {
|
240
|
231
|
$('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_ID').val('');
|
241
|
232
|
$('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH #ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM').val('');
|
|
233
|
+ $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH select[name="slocation"] option').empty();
|
242
|
234
|
},
|
243
|
235
|
close: function() {
|
244
|
236
|
this.rows.length = 0;
|
|
@@ -247,9 +239,44 @@ let mobPopObj = {
|
247
|
239
|
mobPopObj.hide(this.popId);
|
248
|
240
|
}
|
249
|
241
|
},
|
|
242
|
+ popItemNm: {
|
|
243
|
+ popId: 'ITP_POP_MSTOCKMNG02010_ITEM_AREA',
|
|
244
|
+ rows: [],
|
|
245
|
+ init: function () {
|
|
246
|
+ this.rows.length = 0;
|
|
247
|
+ mobPopObj.show(this.popId);
|
|
248
|
+ this.search();
|
|
249
|
+ this.action();
|
|
250
|
+ },
|
|
251
|
+ search: function () {
|
|
252
|
+ var _this = this;
|
|
253
|
+ var callbackFn = function(result) {
|
|
254
|
+ console.log(result);
|
|
255
|
+ _this.rows = result.gridRows;
|
|
256
|
+ $.each(result.gridRows, function (i, item) {
|
|
257
|
+ $('#ITP_LIST_MSTOCKMNG02010_POP_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG02010_POP_ITEM_ROWCOPY').html());
|
|
258
|
+ var $li = $('#ITP_LIST_MSTOCKMNG02010_POP_ITEM_AREA .panel-group > .list-row:last');
|
|
259
|
+ $li.find('.fnItemId').text(item.itemId);
|
|
260
|
+ $li.find('.fnItemNm').text(item.itemNm);
|
|
261
|
+ $li.find('.fnUnit').text(item.unit);
|
|
262
|
+ $li.find('.fnStckQty').text(CommonObj.currency.add(item.stckQty, '개'));
|
|
263
|
+ });
|
|
264
|
+ };
|
|
265
|
+ var param = $('#ITP_FORM_MSTOCKMNG02010_LIST_SEARCH').serializeObject();
|
|
266
|
+ fn_ajax_call(API_POP_STOCK_MNG_LIST, JSON.stringify(param), callbackFn, 'POST');
|
|
267
|
+ },
|
|
268
|
+ action: function() {
|
|
269
|
+
|
|
270
|
+ },
|
|
271
|
+ close: function() {
|
|
272
|
+ this.rows.length = 0;
|
|
273
|
+ $('#ITP_POP_MSTOCKMNG02010_LIST_ITEM_AREA .panel-group').empty();
|
|
274
|
+ $('#ITP_FORM_MSTOCKMNG02010_POP_ITEM #ITP_FORM_MSTOCKMNG02010_POP_ITEM_KEYWORD').val('');
|
|
275
|
+ mobPopObj.hide(this.popId);
|
|
276
|
+ }
|
|
277
|
+ },
|
250
|
278
|
show: function(popId) {
|
251
|
279
|
$('button[id$="_CLOSE"]').off('click').on('click', function() {
|
252
|
|
- console.log($(this).attr('id'));
|
253
|
280
|
if($(this).hasClass('btn-pop-close')) {
|
254
|
281
|
mobPopObj.hide(popId);
|
255
|
282
|
}
|