Ver código fonte

모바일 재고실사 품목검색 작업

juney 2 anos atrás
pai
commit
aa176d8f72

+ 61 - 3
src/main/webapp/mobile/app/mstockmng/MSTOCKMNG02010.html

@@ -7,14 +7,15 @@
7 7
 			<div class="line">
8 8
 			  <label>재고실사일자</label>
9 9
 			  <div class="line_right">
10
-				<input id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_STCK_DT" name="sDt" class="date" type="date">
10
+				<input id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_STCK_DT" name="sDt" class="date" type="date" data-check-required="empty">
11 11
 			  </div>
12 12
 			</div>
13 13
 			<div class="line">
14 14
 			  <label>창고선택</label>
15 15
 			  <div class="search_wrap">
16 16
 				  <div class="float_left">
17
-					<input id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM" name="whsNm" type="text" placeholder="창고명">
17
+					<input id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_NM" name="whsNm" type="text" placeholder="창고명" data-check-required="empty" readonly>
18
+					  <input id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_WHS_ID" name="swhsId" type="hidden">
18 19
 				  </div>
19 20
 				  <div class="float_left_btn">
20 21
 					  <button id="ITP_BTN_MSTOCKMNG02010_LIST_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
@@ -25,7 +26,7 @@
25 26
 			<div class="line">
26 27
 			  <label>Location</label>
27 28
 			  <div class="line_right">
28
-				<select name="whsDvsn" id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_LOCATION">
29
+				<select name="slocation" id="ITP_FORM_MSTOCKMNG02010_LIST_SEARCH_LOCATION" data-check-required="empty">
29 30
 				  <option value=""></option>
30 31
 				</select>
31 32
 			  </div>
@@ -142,4 +143,61 @@
142 143
 			</div>
143 144
 		</div>
144 145
 	</div>
146
+	<div id="ITP_POP_MSTOCKMNG02010_ITEM_AREA" class="popup2 mobile-pop-close" style="display: none;">
147
+		<div class="pop">
148
+			<div class="header">
149
+				<div class="header_left">
150
+					<label>> 품목 검색</label>
151
+				</div>
152
+				<div class="header_right">
153
+					<button type="button" id="ITP_BTN_MSTOCKMNG02010_POP_ITEM_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
154
+				</div>
155
+			</div>
156
+			<form id="ITP_FORM_MSTOCKMNG02010_POPUP_ITEM" class="form-horizontal" onsubmit="return false;">
157
+				<input type="hidden" id="ITP_FORM_MSTOCKMNG02010_POPUP_ITEM_BRAND_ID" name="sbrandId" value="">
158
+				<input type="hidden" id="ITP_FORM_MSTOCKMNG02010_POPUP_ITEM_STORE_ID" name="sstoreId" value="">
159
+				<div class="search_bar">
160
+					<select id="ITP_FORM_BIZPOP_PO_STOCK_ITEM_ADD_ITEM_ST_CD" data-select-code="ST_CD" name="sitemStCd"></select>
161
+					<select id="ITP_FORM_BIZPOP_PO_STOCK_ITEM_ADD_ITEM_GUBUN" data-select-code="ITEM_GUBUN" name="sitemGubun"></select>
162
+					<select id="ITP_FORM_BIZPOP_PO_STOCK_ITEM_ADD_ITEM_TYPE" data-select-code="ITEM_TYPE" name="sitemType"></select>
163
+					<input id="ITP_FORM_MSTOCKMNG02010_POP_ITEM_KEYWORD" name="sitemNm" type="text" placeholder="품목명/품목번호" />
164
+					<button id="ITP_BTN_MSTOCKMNG02010_POP_ITEM_SEARCH"><img src="../img/search.png"></button>
165
+				</div>
166
+			</form>
167
+			<div id="ITP_LIST_MSTOCKMNG02010_POP_ITEM_AREA" class="popup_scroll">
168
+				<ul id="ITP_LIST_MSTOCKMNG02010_POP_ITEM_ROWS" class="panel-group"></ul>
169
+				<div id="ITP_LIST_MSTOCKMNG02010_POP_ITEM_ROWCOPY" style="display:none;">
170
+					<li class="row_2">
171
+						<div class="left" style="width:180px;">
172
+							<div class="check_box">
173
+                                <input type="checkbox" id="ITP_FORM_MSTOCKMNG02010_POP_ITEM_CHECKBOX" name="itemId" />
174
+                            </div>
175
+							<div class="thick">
176
+								<div class="fnItemId">품목번호</div>
177
+							</div>
178
+							<div class="thick">
179
+								<div class="fnItemNm">품목명</div>
180
+							</div>
181
+							<div class="thick" style="font-weight:100;">
182
+								<div class="space">단위 :</div>
183
+								<div class="fnUnit"></div>
184
+							</div>
185
+							<div class="thick" style="font-weight:100;">
186
+								<div class="space">현재고수량 :</div>
187
+								<div class="fnStckQty"></div>
188
+							</div>
189
+						</div>
190
+						<div class="right">
191
+							<button id="ITP_BTN_MSTOCKMNG02010_POP_ITEM_MINUS" class="POP_ITEM_MINUS">-</button>
192
+							<div class="num fnPchReqQty">1</div>
193
+							<button id="ITP_BTN_MSTOCKMNG02010_POP_ITEM_PLUS" class="POP_ITEM_PLUS">+</button>
194
+						</div>
195
+						<div class="add">
196
+							<button id="ITP_BTN_MSTOCKMNG02010_POP_ITEM_ADD" class="POP_ITEM_ADD">추가</button>
197
+						</div>
198
+					</li>
199
+				</div>
200
+			</div>
201
+		</div>
202
+	</div>
145 203
   </section>

+ 72 - 45
src/main/webapp/mobile/js/app/mstockmng/ITP_MSTOCKMNG02010.js

@@ -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
 			}