浏览代码

모바일 구매요청 위시리스트 추가

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

+ 1 - 0
src/main/webapp/mobile/js/app/main.js

@@ -50,6 +50,7 @@ var mobMainObj = {
50
 		var _this = this;
50
 		var _this = this;
51
 		var getURL = function(id) {
51
 		var getURL = function(id) {
52
 			var rtnURL = '';
52
 			var rtnURL = '';
53
+			console.log(id);
53
 			$.each(AUTH_MENU_LIST, function(key, value) {
54
 			$.each(AUTH_MENU_LIST, function(key, value) {
54
 				if(value.menuId === id) {
55
 				if(value.menuId === id) {
55
 					rtnURL = value.connUrl;
56
 					rtnURL = value.connUrl;

+ 39 - 14
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -6,11 +6,13 @@ require(['config'], function() {
6
 });
6
 });
7
 
7
 
8
 /*API URL*/
8
 /*API URL*/
9
-const API_MOBILE_INIT_INFO	= '/api/pomng/init-pchReq';
10
-const API_MOBILE_SAVE		= '/api/pomng/save-pchReq';
11
-const API_POP_SEARCH_LIST	= '/api/whs/mng/pop-whs-search';
12
-const API_POP_ITEM_LIST 	= '/api/item/pop-grid-list';
13
-const API_MOBILE_BARCODE	= '/api/item/info-barcode-item';	// 바코드
9
+const API_MOBILE_INIT_INFO		= '/api/pomng/init-pchReq';
10
+const API_MOBILE_SAVE			= '/api/pomng/save-pchReq';
11
+const API_POP_SEARCH_LIST		= '/api/whs/mng/pop-whs-search';
12
+const API_POP_ITEM_LIST 		= '/api/item/pop-grid-list';
13
+const API_MOBILE_BARCODE		= '/api/item/info-barcode-item';	// 바코드
14
+const API_POP_WISH_LIST 		= '/api/item/wish-list';
15
+const API_POP_SEARCH_WISH_LIST 	= '/api/item/pop-grid-wishlist';
14
 
16
 
15
 const ID_ITP_POP_MPOMNG01010_REQ_AREA 	= "ITP_POP_MPOMNG01010_REQ_AREA";
17
 const ID_ITP_POP_MPOMNG01010_REQ_AREA 	= "ITP_POP_MPOMNG01010_REQ_AREA";
16
 const ID_ITP_POP_MPOMNG01010_WHS_AREA 	= "ITP_POP_MPOMNG01010_WHS_AREA";
18
 const ID_ITP_POP_MPOMNG01010_WHS_AREA 	= "ITP_POP_MPOMNG01010_WHS_AREA";
@@ -38,6 +40,7 @@ let mobPageObj = {
38
 			$('#ITP_MOBILE_MPOMNG01010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
40
 			$('#ITP_MOBILE_MPOMNG01010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
39
 			$('#ITP_FORM_MPOMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', itp_fn_date_add('D', 5));
41
 			$('#ITP_FORM_MPOMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', itp_fn_date_add('D', 5));
40
 
42
 
43
+			(fn_make_user_info.get('authTpCd') === '50') ? $('#ITP_BTN_MPOMNG01010_DETAIL_WISH').show() : $('#ITP_BTN_MPOMNG01010_DETAIL_WISH').hide();
41
 			// if(fn_make_user_info.get('authTpCd') === '50') {
44
 			// if(fn_make_user_info.get('authTpCd') === '50') {
42
 			// 	$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').attr('readonly', true);
45
 			// 	$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_WHS_NM').attr('readonly', true);
43
 			// 	$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM').attr('disabled', true);
46
 			// 	$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM').attr('disabled', true);
@@ -376,28 +379,49 @@ let mobPopObj = {
376
 		}
379
 		}
377
 	},
380
 	},
378
 	popWishList: {
381
 	popWishList: {
379
-		rows: [],
382
+		listPage: 1,
380
 		init: function () {
383
 		init: function () {
381
 			this.clear();
384
 			this.clear();
385
+			this.action();
382
 			this.load();
386
 			this.load();
383
 		},
387
 		},
388
+		action: function() {
389
+			var _this = this;
390
+			$('#ITP_FORM_MPOMNG01010_POP_WISH_LIST_KEYWORD').on('change', function() {
391
+				if($(this).val() === '') {
392
+					_this.rows.length = 0;
393
+					$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').children().remove();
394
+				} else {
395
+					_this.search($(this).val());
396
+				}
397
+			});
398
+			$('#ITP_BTN_MPOMNG01010_POP_WISH_LIST_ADD').off('click').on('click', function() {
399
+				_this.list.addItems();
400
+			});
401
+		},
384
 		load: function() {
402
 		load: function() {
385
 			var callbackFn = function(result) {
403
 			var callbackFn = function(result) {
386
 				console.log(result);
404
 				console.log(result);
405
+				fn_make_select_wish_list(result.wishList, 'ITP_FORM_MPOMNG01010_POP_WISH_LIST_KEYWORD', true, '선택');
387
 			};
406
 			};
388
-			let param = $('#ITP_FORM_MPOMNG01010_POPUP_ITEM').serializeObject();
389
-			fn_ajax_call(API_POP_ITEM_LIST, JSON.stringify(param), callbackFn, 'POST');
407
+			let param = { 'sStoreId' : fn_make_user_info.get('storeId') };
408
+			fn_ajax_call(API_POP_WISH_LIST, $.param(param), callbackFn, 'GET');
390
 		},
409
 		},
391
-		search: function() {
410
+		search: function(swishListMgntNo) {
392
 			$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').children().remove();
411
 			$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').children().remove();
393
 			var callbackFn = function(result) {
412
 			var callbackFn = function(result) {
394
 				console.log(result);
413
 				console.log(result);
395
 				mobPopObj.popWishList.list.addRows(result.gridRows);
414
 				mobPopObj.popWishList.list.addRows(result.gridRows);
396
 			};
415
 			};
397
-			let param = $('#ITP_FORM_MPOMNG01010_POPUP_ITEM').serializeObject();
398
-			fn_ajax_call(API_POP_ITEM_LIST, JSON.stringify(param), callbackFn, 'POST');
416
+			let param = {
417
+				'sbrandId' : fn_make_user_info.get('brandId'),
418
+				'sstoreId' : fn_make_user_info.get('storeId'),
419
+				'swishListMgntNo' : swishListMgntNo
420
+			};
421
+			fn_ajax_call(API_POP_SEARCH_WISH_LIST, JSON.stringify(param), callbackFn, 'POST');
399
 		},
422
 		},
400
 		list: {
423
 		list: {
424
+			rows: [],
401
 			addRows: function(rows) {
425
 			addRows: function(rows) {
402
 				var _this = this;
426
 				var _this = this;
403
 				$.each(rows, function (i, item) {
427
 				$.each(rows, function (i, item) {
@@ -437,6 +461,7 @@ let mobPopObj = {
437
 				$li.find('.fnOrdAmt').text(CommonObj.currency.add(Number(unitAmt ? unitAmt : 0) * Number(qty)));
461
 				$li.find('.fnOrdAmt').text(CommonObj.currency.add(Number(unitAmt ? unitAmt : 0) * Number(qty)));
438
 			},
462
 			},
439
 			addItems: function() {
463
 			addItems: function() {
464
+				var _this = this;
440
 				var items = [];
465
 				var items = [];
441
 				var chkMsg = '';
466
 				var chkMsg = '';
442
 				$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').find('input:checkbox').each(function() {
467
 				$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').find('input:checkbox').each(function() {
@@ -447,7 +472,7 @@ let mobPopObj = {
447
 							return false;
472
 							return false;
448
 						}
473
 						}
449
 						var index = $(this).closest('li').index();
474
 						var index = $(this).closest('li').index();
450
-						var item = mobPopObj.popWishList.rows[index];
475
+						var item = _this.rows[index];
451
 						item['pchReqQty'] = val;
476
 						item['pchReqQty'] = val;
452
 						items.push(item);
477
 						items.push(item);
453
 					}
478
 					}
@@ -461,11 +486,11 @@ let mobPopObj = {
461
 					return;
486
 					return;
462
 				}
487
 				}
463
 				mobContObj.list.attachRow(items);
488
 				mobContObj.list.attachRow(items);
464
-				mobPopObj.hide(id);
489
+				mobPopObj.hide('ITP_POP_MPOMNG01010_WISH_LIST_AREA');
465
 			}
490
 			}
466
 		},
491
 		},
467
 		clear: function() {
492
 		clear: function() {
468
-			this.rows.length = 0;
493
+			this.list.rows.length = 0;
469
 			$('#ITP_FORM_MPOMNG01010_POP_WISH_LIST_KEYWORD option').remove();
494
 			$('#ITP_FORM_MPOMNG01010_POP_WISH_LIST_KEYWORD option').remove();
470
 			$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').children().remove();
495
 			$('#ITP_LIST_MPOMNG01010_POP_WISH_LIST_ROWS').children().remove();
471
 		}
496
 		}

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

@@ -366,6 +366,20 @@ function fn_make_select_location(options, select_id, all_show_yn, all_name) { //
366
 	});
366
 	});
367
 };
367
 };
368
 
368
 
369
+function fn_make_select_wish_list(options, select_id, all_show_yn, all_name) { //위시리스트 셀렉트 박스 만들기
370
+	$select_id = $('#' + select_id);
371
+	$select_id.empty();
372
+	if(all_show_yn == true) {
373
+		$('<option/>', {'value': '', 'text': all_name}).prependTo($select_id);
374
+	}
375
+	$.each(options, function(key, value) {
376
+		$('<option/>', {
377
+			'value': value.wishListMgntNo,	// 위시리스트번호
378
+			'text': value.wishListNm	// 위시리스트명
379
+		}).appendTo($select_id);
380
+	});
381
+};
382
+
369
 function fnHashed(code) { //유니코드로 들어오는 해쉬키를 스트링으로 변환
383
 function fnHashed(code) { //유니코드로 들어오는 해쉬키를 스트링으로 변환
370
 	return decodeURIComponent(JSON.parse('"' + code.replace(/\"/g, '\\"') + '"'));
384
 	return decodeURIComponent(JSON.parse('"' + code.replace(/\"/g, '\\"') + '"'));
371
 }
385
 }