浏览代码

모바일 재고현황 수정

juney 2 年之前
父节点
当前提交
e2837cddba

+ 50 - 8
src/main/webapp/mobile/app/mstockmng/MSTOCKMNG01010.html

@@ -6,20 +6,25 @@
6
 		  <div class="content">
6
 		  <div class="content">
7
 			<div class="line">
7
 			<div class="line">
8
 			  <label>창고선택</label>
8
 			  <label>창고선택</label>
9
-			  <div class="search_wrap">
9
+				<div class="line_right">
10
+					<select name="swhsId" id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM">
11
+						<option value=""></option>
12
+					</select>
13
+				</div>
14
+			  <!--<div class="search_wrap">
10
 				  <div class="float_left">
15
 				  <div class="float_left">
11
-					<input id="ITP_FORM_MSTOCKMNG01010_LIST_WHS_NM" type="text" data-select-code="WHS_NM" data-check-required="empty" placeholder="A매장명">
16
+					<input id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_NM" type="text" placeholder="A매장명">
12
 				  </div>
17
 				  </div>
13
 				  <div class="float_left_btn">
18
 				  <div class="float_left_btn">
14
 					<button id="ITP_BTN_MSTOCKMNG01010_LIST_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
19
 					<button id="ITP_BTN_MSTOCKMNG01010_LIST_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
15
 					<button id="ITP_BTN_MSTOCKMNG01010_LIST_DETELE_WHS_NM"><img src="../img/delete.png" alt=""></button>
20
 					<button id="ITP_BTN_MSTOCKMNG01010_LIST_DETELE_WHS_NM"><img src="../img/delete.png" alt=""></button>
16
 				  </div>
21
 				  </div>
17
-			  </div>
22
+			  </div>-->
18
 			</div>
23
 			</div>
19
 			<div class="line">
24
 			<div class="line">
20
 			  <label>Location</label>
25
 			  <label>Location</label>
21
 			  <div class="line_right">
26
 			  <div class="line_right">
22
-				<select name="whsDvsn" id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_WHS_DVSN">
27
+				<select name="slocation" id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_LOCATION">
23
 				  <option value=""></option>
28
 				  <option value=""></option>
24
 				</select>
29
 				</select>
25
 			  </div>
30
 			  </div>
@@ -27,7 +32,7 @@
27
 			<div class="line">
32
 			<div class="line">
28
 			  <label>품목명</label>
33
 			  <label>품목명</label>
29
 			  <div class="search_wrap">
34
 			  <div class="search_wrap">
30
-				<input id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_ITEM_NM" name="itemNm" style="width: 262px;" type="text" placeholder="품목명">
35
+				<input id="ITP_FORM_MSTOCKMNG01010_LIST_SEARCH_ITEM_NM" name="sitemNm" style="width: 262px;" type="text" placeholder="품목명">
31
 			  </div>
36
 			  </div>
32
 			</div>
37
 			</div>
33
 			<div class="line" style="height:45px;">
38
 			<div class="line" style="height:45px;">
@@ -100,6 +105,43 @@
100
 	  </form>
105
 	  </form>
101
 	</div>
106
 	</div>
102
 	<div id="ITP_MOBILE_JS"></div>
107
 	<div id="ITP_MOBILE_JS"></div>
108
+	<div id="ITP_POP_MSTOCKMNG01010_WHS_AREA" class="popup2 mobile-pop-close" style="display: none;">
109
+		<div class="pop">
110
+			<div class="header">
111
+				<div class="header_left">
112
+					<label>> 납품장소</label>
113
+				</div>
114
+				<div class="header_right">
115
+					<button type="button" id="ITP_BTN_MSTOCKMNG01010_POP_WHS_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
116
+				</div>
117
+			</div>
118
+			<div class="search_bar">
119
+				<form id="ITP_FORM_MSTOCKMNG01010_POP_WHS" class="form-horizontal" onsubmit="return false;">
120
+					<input type="hidden" id="ITP_FORM_MSTOCKMNG01010_WHS_ITEM_BRAND_ID" name="sbrandId" value="">
121
+					<input type="hidden" id="ITP_FORM_MSTOCKMNG01010_WHS_ITEM_STORE_ID" name="sstoreId" value="">
122
+					<input id="ITP_FORM_MSTOCKMNG01010_POP_WHS_KEYWORD" type="text" name="swhsNm" placeholder="납품장소명">
123
+					<button id="ITP_BTN_MSTOCKMNG01010_POP_WHS_SEARCH"><img src="../img/search.png"></button>
124
+				</form>
125
+			</div>
126
+			<div class="search_bar">
127
+				<button id="ITP_BTN_MSTOCKMNG01010_POP_WHS_NM" class="btn_blue">납품장소▼</button>
128
+			</div>
129
+			<div id="ITP_LIST_MSTOCKMNG01010_POP_WHS_AREA" class="popup_scroll">
130
+				<ul id="ITP_LIST_MSTOCKMNG01010_POP_WHS_ROWS" class="panel-group itp_nav"></ul>
131
+				<div id="ITP_LIST_MSTOCKMNG01010_POP_WHS_ROWCOPY" style="display:none;">
132
+					<li class="list-row">
133
+						<div class="scroll_left">
134
+							<div class="fnWhsNm">브랜드 창고 명A</div>
135
+							<div class="fnLocationNm">(상세위치내용)</div>
136
+						</div>
137
+						<div class="scroll_right">
138
+							<button id="ITP_BTN_MSTOCKMNG01010_POP_WHS_CHOICE" class="fnWhsId" data-whs-id="">선택</button>
139
+						</div>
140
+					</li>
141
+				</div>
142
+			</div>
143
+		</div>
144
+	</div>
103
 	<div id="ITP_POP_MSTOCKMNG01010_ITEM_AREA" class="popup2 mobile-pop-close" style="display: none;">
145
 	<div id="ITP_POP_MSTOCKMNG01010_ITEM_AREA" class="popup2 mobile-pop-close" style="display: none;">
104
 		<div class="pop">
146
 		<div class="pop">
105
 			<div class="header">
147
 			<div class="header">
@@ -164,7 +206,7 @@
164
 					<label>창고선택</label>
206
 					<label>창고선택</label>
165
 				</div>
207
 				</div>
166
 			 	  <div class="line_right">
208
 			 	  <div class="line_right">
167
-					<select name="whsNm" id="ITP_FORM_MSTOCKMNG01010_POP_WHS_NM" data-select-code="WHS_NM" data-check-required="empty">
209
+					<select name="whsNm" id="ITP_FORM_MSTOCKMNG01010_POP_WHS_NM" data-check-required="empty">
168
 					  <option value=""></option>
210
 					  <option value=""></option>
169
 					</select>
211
 					</select>
170
 				  </div>
212
 				  </div>
@@ -174,7 +216,7 @@
174
 				  		<label>Location</label>
216
 				  		<label>Location</label>
175
 					</div>
217
 					</div>
176
 				  <div class="line_right">
218
 				  <div class="line_right">
177
-					<select name="whsDvsn" id="ITP_FORM_MSTOCKMNG01010_POP_WHS_DVSN" data-select-code="EMAIL_CD" data-check-required="empty">
219
+					<select name="location" id="ITP_FORM_MSTOCKMNG01010_POP_LOCATION" data-check-required="empty">
178
 					  <option value=""></option>
220
 					  <option value=""></option>
179
 					</select>
221
 					</select>
180
 				  </div>
222
 				  </div>
@@ -184,7 +226,7 @@
184
 						<label>이동 수량</label>
226
 						<label>이동 수량</label>
185
 					</div>
227
 					</div>
186
 					<div class="line_right">
228
 					<div class="line_right">
187
-						<input id="ITP_FORM_MSTOCKMNG01010_POP_QTY" type="text" data-select-code="QTY" data-check-required="empty" >
229
+						<input id="ITP_FORM_MSTOCKMNG01010_POP_QTY" type="text" data-check-required="empty" >
188
 					</div>
230
 					</div>
189
 				</div>
231
 				</div>
190
 			    <div class="search">
232
 			    <div class="search">

+ 81 - 98
src/main/webapp/mobile/js/app/mstockmng/ITP_MSTOCKMNG01010.js

@@ -6,9 +6,11 @@ require(['config'], function() {
6
 });
6
 });
7
 
7
 
8
 /*API URL*/
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
 const API_POP_SEARCH_LIST			= '/api/store/pop-grid-list';
14
 const API_POP_SEARCH_LIST			= '/api/store/pop-grid-list';
13
 
15
 
14
 const PAGE_MODE_LIST				= "LIST";
16
 const PAGE_MODE_LIST				= "LIST";
@@ -27,16 +29,6 @@ let mobPageObj = {
27
 			this.info();
29
 			this.info();
28
 		},
30
 		},
29
 		view: function() {
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
 		info: function() {
33
 		info: function() {
42
 			$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
34
 			$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
@@ -45,14 +37,14 @@ let mobPageObj = {
45
 	},
37
 	},
46
 	event: {
38
 	event: {
47
 		init: function() {
39
 		init: function() {
48
-			this.button();
40
+			this.action();
49
 		},
41
 		},
50
-		button: function() {
42
+		action: function() {
51
 			$('button[id^="ITP_BTN_MSTOCKMNG01010_LIST"]').on('click', function() {
43
 			$('button[id^="ITP_BTN_MSTOCKMNG01010_LIST"]').on('click', function() {
52
 				var id = $(this).attr('id');
44
 				var id = $(this).attr('id');
53
 				switch (id) {
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
 					case 'ITP_BTN_MSTOCKMNG01010_LIST_SEARCH'			: mobContentObj.list.search();		break;
48
 					case 'ITP_BTN_MSTOCKMNG01010_LIST_SEARCH'			: mobContentObj.list.search();		break;
57
 				}
49
 				}
58
 				return false;
50
 				return false;
@@ -67,12 +59,16 @@ let mobPageObj = {
67
 				return false;
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
 			$(document).on('click', '#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWS li', function() {
66
 			$(document).on('click', '#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWS li', function() {
71
 				var item = mobContentObj.list.rows[$(this).index()];
67
 				var item = mobContentObj.list.rows[$(this).index()];
72
 				mobContentObj.view.init(item);
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
 				mobPopObj.popWhsNm.choice($(this));
72
 				mobPopObj.popWhsNm.choice($(this));
77
 			});
73
 			});
78
 		}
74
 		}
@@ -120,7 +116,8 @@ let mobContentObj = {
120
 		rows: [],
116
 		rows: [],
121
 		init: function() {
117
 		init: function() {
122
 			mobPageObj.switchScreen(PAGE_MODE_LIST);
118
 			mobPageObj.switchScreen(PAGE_MODE_LIST);
123
-			this.search();
119
+			// this.search();
120
+			this.whsList();
124
 		},
121
 		},
125
 		search: function() {
122
 		search: function() {
126
 			this.listPage = 0;
123
 			this.listPage = 0;
@@ -140,27 +137,45 @@ let mobContentObj = {
140
 					$('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWCOPY').html());
137
 					$('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_ROWCOPY').html());
141
 					var $li = $('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group > .list-row:last');
138
 					var $li = $('#ITP_LIST_MSTOCKMNG01010_LIST_ITEM_AREA .panel-group > .list-row:last');
142
 					$li.find('.fnStoreNm').text(item.storeNm);
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
 					_this.rows.push(item);
140
 					_this.rows.push(item);
156
 				});
141
 				});
157
 			};
142
 			};
158
 			var errFn = function() { _this.isSearch = false;};
143
 			var errFn = function() { _this.isSearch = false;};
159
 			const param = $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH').serializeObject();
144
 			const param = $('#ITP_FORM_MSTOCKMNG01010_LIST_SEARCH').serializeObject();
160
 			param.gridPage = ++this.listPage;
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
 			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
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
 	view: {
181
 	view: {
@@ -199,51 +214,6 @@ let mobContentObj = {
199
 			$(id).find('.fnUseAmtTotal').text(CommonObj.currency.add(result.useAmtTotal));
214
 			$(id).find('.fnUseAmtTotal').text(CommonObj.currency.add(result.useAmtTotal));
200
 			_this.history.init(result.loanMgntUnqNo);
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
 		cancel: function () {
217
 		cancel: function () {
248
 			var id = '#ITP_AJAX_MSTOCKMNG01010_VIEW_CONTAINER';
218
 			var id = '#ITP_AJAX_MSTOCKMNG01010_VIEW_CONTAINER';
249
 			$(id).find('.fnItemid').text('');
219
 			$(id).find('.fnItemid').text('');
@@ -261,8 +231,8 @@ let mobContentObj = {
261
 };
231
 };
262
 
232
 
263
 let mobPopObj = {
233
 let mobPopObj = {
264
-	popStoreNm: {
265
-		popId: 'ITP_POP_MSTOCKMNG01010_STORE_AREA',
234
+	popWhsNm: {
235
+		popId: 'ITP_POP_MSTOCKMNG01010_WHS_AREA',
266
 		rows: [],
236
 		rows: [],
267
 		init: function () {
237
 		init: function () {
268
 			this.rows.length = 0;
238
 			this.rows.length = 0;
@@ -272,56 +242,69 @@ let mobPopObj = {
272
 		},
242
 		},
273
 		search: function () {
243
 		search: function () {
274
 			var _this = this;
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
 			var callbackFn = function(result) {
246
 			var callbackFn = function(result) {
277
 				console.log(result);
247
 				console.log(result);
278
 				_this.view(result.gridRows);
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
 			fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
252
 			fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
282
 		},
253
 		},
283
 		view: function(gridRows) {
254
 		view: function(gridRows) {
284
 			this.rows = gridRows;
255
 			this.rows = gridRows;
285
 			$.each(gridRows, function (i, item) {
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
 		choice: function(elem) {
264
 		choice: function(elem) {
294
 			var _this = this;
265
 			var _this = this;
295
-			var storeId = $(elem).data('store-id');
266
+			var whsId = $(elem).data('whs-id');
296
 			$.each(this.rows, function (i, item) {
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
 					_this.close();
271
 					_this.close();
272
+					_this.location(item.whsId);
301
 					return false;
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
 		action: function() {
288
 		action: function() {
306
 			var _this = this;
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
 				var id = $(this).attr('id');
291
 				var id = $(this).attr('id');
309
 				switch (id) {
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
 				return false;
297
 				return false;
315
 			});
298
 			});
316
 		},
299
 		},
317
 		delete: function() {
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
 		close: function() {
304
 		close: function() {
322
 			this.rows.length = 0;
305
 			this.rows.length = 0;
323
 			$('#ITP_POP_MSTOCKMNG01010_LIST_WHS_AREA .panel-group').empty();
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
 			mobPopObj.hide(this.popId);
308
 			mobPopObj.hide(this.popId);
326
 		}
309
 		}
327
 	},
310
 	},

+ 14 - 0
src/main/webapp/mobile/js/config.js

@@ -312,6 +312,20 @@ function fn_make_select_store(options, select_id, all_show_yn, all_name, all_val
312
 	});
312
 	});
313
 }
313
 }
314
 
314
 
315
+function fn_make_select_whs(options, select_id, all_show_yn, all_name) { //창고 셀렉트 박스 만들기
316
+	$select_id = $('#' + select_id);
317
+	$select_id.empty();
318
+	if(all_show_yn == true) {
319
+		$('<option/>', {'value': '', 'text': all_name}).prependTo($select_id);
320
+	}
321
+	$.each(options, function(key, value) {
322
+		$('<option/>', {
323
+			'value': value.whsId,	// 창고아이디
324
+			'text': value.whsNm		// 창고명
325
+		}).appendTo($select_id);
326
+	});
327
+};
328
+
315
 function fn_make_select_location(options, select_id, all_show_yn, all_name) { //위치 셀렉트 박스 만들기
329
 function fn_make_select_location(options, select_id, all_show_yn, all_name) { //위치 셀렉트 박스 만들기
316
 	$select_id = $('#' + select_id);
330
 	$select_id = $('#' + select_id);
317
 	$select_id.empty();
331
 	$select_id.empty();