yhl88 2 years ago
parent
commit
2405840dcd

+ 5 - 4
src/main/webapp/app/ordmng/ORDMNG01010.html

@@ -38,14 +38,15 @@
38
 											</select>
38
 											</select>
39
 										</div>
39
 										</div>
40
 										<div class="col-xs-3 itp_ip itp_noMar">
40
 										<div class="col-xs-3 itp_ip itp_noMar">
41
-											<input type="text" id="ITP_FORM_ORDMNG01010_SEARCH_DLV_PLACE" class="form-control itp_input" name="sDlvPlace" placeholder="납품장소 (매장/창고)" />
41
+											<input type="text" id="ITP_FORM_ORDMNG01010_DETAIL_WHS_NM" class="form-control itp_input" name="swhsNm" placeholder="납품장소 (매장/창고)" />
42
+											<input type="hidden" id="ITP_FORM_ORDMNG01010_DETAIL_WHS_ID" class="form-control itp_input" name="swhsId"/>
42
 										</div>
43
 										</div>
43
 										<div class="col-xs-1 itp_in" style="padding-left: 5px; width:10%;">
44
 										<div class="col-xs-1 itp_in" style="padding-left: 5px; width:10%;">
44
-											<button type="button" id="ITP_BTN_ORDMNG01010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
45
-											<button type="button" id="ITP_BTN_ORDMNG01010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
45
+											<button type="button" id="ITP_BTN_ORDMNG01010_SEARCH_WHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
46
+											<button type="button" id="ITP_BTN_ORDMNG01010_DELETE_WHS_NM" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
46
 						                </div>
47
 						                </div>
47
 										<div class="col-xs-5 itp_ip itp_noMar">
48
 										<div class="col-xs-5 itp_ip itp_noMar">
48
-											<input type="text" id="ITP_FORM_ORDMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="발주번호/품목번호/품목명" />
49
+											<input type="text" id="ITP_FORM_ORDMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="발주번호/품목번호/품목명" />
49
 										</div>
50
 										</div>
50
 									</div>
51
 									</div>
51
 								</form>
52
 								</form>

+ 46 - 7
src/main/webapp/js/app/ordmng/ITP_ORDMNG01010.js

@@ -19,6 +19,14 @@ const ORDMNG01010_VIEW_GRID_EMPTY = '#ITP_ORDMNG01010_VIEW_jqGridEmpty';
19
 
19
 
20
 let ITP_COMMON_PCH_ODR_ST_CD = fn_make_common_cd_list(CODE_LIST, 'PCH_ODR_ST_CD', true, '발주상태코드');
20
 let ITP_COMMON_PCH_ODR_ST_CD = fn_make_common_cd_list(CODE_LIST, 'PCH_ODR_ST_CD', true, '발주상태코드');
21
 
21
 
22
+// 그리드 전화번호 '-' 함수
23
+function convertTel(value){
24
+	answer = (value.startsWith('0')) ? value.replace(/[^0-9]/g, "")
25
+			.replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
26
+			.replace("--", "-") : '';
27
+	return answer;
28
+}
29
+
22
 //API URL
30
 //API URL
23
 let API_POMNG_PO_SPPLY_PO_GRID_LIST = '/api/pomng/po/spply-po-grid-list';
31
 let API_POMNG_PO_SPPLY_PO_GRID_LIST = '/api/pomng/po/spply-po-grid-list';
24
 let API_POMNG_PO_INFO_SPPLY_PCHORD = '/api/pomng/po/info-spply-pchOdr';
32
 let API_POMNG_PO_INFO_SPPLY_PCHORD = '/api/pomng/po/info-spply-pchOdr';
@@ -225,6 +233,8 @@ let pageObj = {
225
             fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_SRH', '#ITP_BTN_ORDMNG01010_NEWREG']);
233
             fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_SRH', '#ITP_BTN_ORDMNG01010_NEWREG']);
226
             $('#ITP_AJAX_ORDMNG01010_LIST_CONTAINER').show();
234
             $('#ITP_AJAX_ORDMNG01010_LIST_CONTAINER').show();
227
             $('#ITP_FORM_ORDMNG01010_SEARCH #ITP_FORM_ORDMNG01010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
235
             $('#ITP_FORM_ORDMNG01010_SEARCH #ITP_FORM_ORDMNG01010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
236
+            $('#ITP_BTN_ORDMNG01010_SEARCH_WHS_NM').show();
237
+            $('#ITP_BTN_ORDMNG01010_DELETE_WHS_NM').show();
228
         } else if(mode == 'ADD') { // 등록
238
         } else if(mode == 'ADD') { // 등록
229
             $('#ITP_AJAX_ORDMNG01010_DETAIL_CONTAINER').show();
239
             $('#ITP_AJAX_ORDMNG01010_DETAIL_CONTAINER').show();
230
             fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_CANCELLIST', '#ITP_BTN_ORDMNG01010_SAVE']);
240
             fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_CANCELLIST', '#ITP_BTN_ORDMNG01010_SAVE']);
@@ -279,6 +289,7 @@ let pageObj = {
279
 let listObj = {
289
 let listObj = {
280
 	init: function() {
290
 	init: function() {
281
 		this.grid.init();
291
 		this.grid.init();
292
+		this.action();
282
 	},
293
 	},
283
 	itp_ORDMNG01010_param: {},
294
 	itp_ORDMNG01010_param: {},
284
 	itp_ORDMNG01010_search: false,
295
 	itp_ORDMNG01010_search: false,
@@ -307,6 +318,9 @@ let listObj = {
307
         push: function() {
318
         push: function() {
308
             let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
319
             let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
309
             listObj.itp_ORDMNG01010_param = param;
320
             listObj.itp_ORDMNG01010_param = param;
321
+            listObj.itp_ORDMNG01010_param.sbrandId = LOGIN_USER_INFO.brandId;
322
+            listObj.itp_ORDMNG01010_param.sspplyId = LOGIN_USER_INFO.spplyId;
323
+            listObj.itp_ORDMNG01010_param.sidx = '0';
310
         },
324
         },
311
         back: function() {
325
         back: function() {
312
             $('#ITP_FORM_ORDMNG01010_SERVICE_BRAND_TYPE').val(listObj.itp_ORDMNG01010_param.brandType);
326
             $('#ITP_FORM_ORDMNG01010_SERVICE_BRAND_TYPE').val(listObj.itp_ORDMNG01010_param.brandType);
@@ -331,7 +345,6 @@ let listObj = {
331
 		load: function() {
345
 		load: function() {
332
             let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
346
             let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
333
             param.gridSize = $.jgrid.defaults.rowNum;
347
             param.gridSize = $.jgrid.defaults.rowNum;
334
-            //param.sbrandId = LOGIN_USER_INFO.brandId;
335
             param.sspplyId = LOGIN_USER_INFO.spplyId;
348
             param.sspplyId = LOGIN_USER_INFO.spplyId;
336
             param.sidx = '0';
349
             param.sidx = '0';
337
             console.log(JSON.stringify(param));
350
             console.log(JSON.stringify(param));
@@ -376,6 +389,38 @@ let listObj = {
376
 		unload: function() {
389
 		unload: function() {
377
 			$.jgrid.gridUnload(ORDMNG01010_GRID_ID);
390
 			$.jgrid.gridUnload(ORDMNG01010_GRID_ID);
378
 		}
391
 		}
392
+	},
393
+    action: function() {
394
+		var _this = this;
395
+		// 납품장소 조회 버튼 클릭
396
+		$('#ITP_BTN_ORDMNG01010_SEARCH_WHS_NM').on('click', function() {
397
+			_this.popup();
398
+		});
399
+		// 납품장소 텍스트 삭제 버튼 클릭
400
+		$('#ITP_BTN_ORDMNG01010_DELETE_WHS_NM').on('click', function() {
401
+			$('#ITP_FORM_ORDMNG01010_DETAIL_WHS_NM').val('');
402
+			$('#ITP_FORM_ORDMNG01010_DETAIL_WHS_ID').val('');
403
+		});
404
+	},
405
+	popup: function() {
406
+		// 팝업
407
+		var popFn = this.callback.create;
408
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
409
+		console.log('here');
410
+		console.log(LOGIN_USER_INFO);
411
+		console.log(key);
412
+		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
413
+		console.log('here3');
414
+	},
415
+	callback: {
416
+		create: function(rowDataPop) {
417
+			console.log('here2');
418
+			console.log(rowDataPop);
419
+			if(rowDataPop) {
420
+				$('#ITP_FORM_ORDMNG01010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
421
+				$('#ITP_FORM_ORDMNG01010_DETAIL_WHS_ID').val(rowDataPop.whsId);
422
+			}
423
+		}
379
 	}
424
 	}
380
 };
425
 };
381
 
426
 
@@ -418,12 +463,6 @@ let viewObj = {
418
 	callback: function(result) {
463
 	callback: function(result) {
419
 		console.log(result);
464
 		console.log(result);
420
 		
465
 		
421
-		function convertTel(value){
422
-			answer = (value.startsWith('0')) ? value.replace(/[^0-9]/g, "")
423
-					.replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
424
-					.replace("--", "-") : '';
425
-			return answer;
426
-		}
427
 		let telNo = convertTel(result.podrMgrTelNo);
466
 		let telNo = convertTel(result.podrMgrTelNo);
428
 		
467
 		
429
 		pageObj.switchScreen('VIEW');
468
 		pageObj.switchScreen('VIEW');