Переглянути джерело

모바일 반품처리 수정

isna 2 роки тому
батько
коміт
1927efb22d

+ 1 - 1
src/main/webapp/mobile/app/mrtnmng/MRTNMNG04011.html

@@ -60,7 +60,7 @@
60 60
 					<label class="col_6">반품요청번호</label>
61 61
 					<span>:</span>
62 62
 					<div class="btn fnRtnReqUnqNo"></div>
63
-					<button style="margin-right: 5px;width: 90px;font-size: 12pt;height: 45px;" id="ITP_BTN_MRTNMNG04011_DETAIL_PODR" class="btn-primary REQ">발주처리</button>
63
+					<button style="margin-right: 5px;width: 90px;font-size: 12pt;height: 45px;" id="ITP_BTN_MRTNMNG04011_DETAIL_PODR" class="btn-primary REQ" onclick="reqRtnPo(this)">발주처리</button>
64 64
 				  </div>
65 65
 				</div>
66 66
 				<div class="left">

+ 18 - 17
src/main/webapp/mobile/js/app/mrtnmng/ITP_MRTNMNG04011.js

@@ -11,6 +11,19 @@ const API_MOBILE_INFO 				= '/api/pomng/po/info-pchOdr';		// 상세
11 11
 const API_POP_SEARCH_LIST			= '/api/whs/mng/pop-whs-search';
12 12
 const API_MOBILE_SAVE				= '/api/rtnmng/rtn/save-rtnSteamlinePo';
13 13
 
14
+function reqRtnPo(btn) {
15
+	const rtnReqUnqNo=$(btn).attr('rtnReqUnqNo')
16
+	/*console.log(item);*/
17
+	var callbackFn = function(result) {
18
+		mobContObj.list.search();
19
+	};
20
+	var gridInsertData = [{rtnReqUnqNo}];	
21
+	let param = { 'viewCd' :'C', 'brandId' : fn_make_user_info.get('brandId') };
22
+	param['gridInsertData'] = gridInsertData;
23
+	// console.log("xxxxxxxxxx save xxxxxxxxxxxxxx", param);
24
+	fn_ajax_call(API_MOBILE_SAVE, JSON.stringify(param), callbackFn, 'POST');
25
+}
26
+
14 27
 let mobPageObj = {
15 28
 	init: function () {
16 29
 		this.ui.init();
@@ -84,7 +97,8 @@ let mobContObj = {
84 97
 						var $headerLi = $('#ITP_LIST_MRTNMNG04011_ITEM_AREA .panel-group > .item-row:last');
85 98
 						$headerLi.find('.fnRtnReqUnqNo').text(item.rtnReqUnqNo);
86 99
 						$headerLi.find('.fnRtnWhsNm').text(item.rtnWhsNm);
87
-						$('#ITP_LIST_MRTNMNG04011_DETAIL_ROWS li button')[$headerLi.index()].addEventListener('click', function() { _this.save(item); });
100
+						$headerLi.find('button').attr('rtnReqUnqNo', item.rtnReqUnqNo);
101
+						// $('#ITP_LIST_MRTNMNG04011_DETAIL_ROWS li button')[$headerLi.index()].addEventListener('click', function() { _this.save(item); });
88 102
 						rtnReqUnqNo = item.rtnReqUnqNo;
89 103
 					}
90 104
 					var div = $('#ITP_LIST_MRTNMNG04011_DETAIL_ITEMCOPY').html();
@@ -103,28 +117,15 @@ let mobContObj = {
103 117
 			/*console.log(JSON.stringify(param));*/
104 118
 			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST');
105 119
 		},
106
-		save: function(item) {
107
-			/*console.log(item);*/
108
-			var callbackFn = function(result) {
109
-				mobContObj.list.search();
110
-			};
111
-			var gridInsertData = [];
112
-			$.each(this.rows, function (i, row) {
113
-				if(item.rtnReqUnqNo === row.rtnReqUnqNo) {
114
-					gridInsertData.push({ 'rtnReqUnqNo' : row.rtnReqUnqNo})
115
-				}
116
-			});
117
-			let param = { 'viewCd' :'C', 'brandId' : fn_make_user_info.get('brandId') };
118
-			param['gridInsertData'] = gridInsertData;
119
-			/*console.log(param);*/
120
-			fn_ajax_call(API_MOBILE_SAVE, JSON.stringify(param), callbackFn, 'POST');
121
-		}
120
+		
122 121
 	}, 
123 122
 	cancel: function () {	
124 123
 		$(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html');
125 124
 	}
126 125
 };
127 126
 
127
+
128
+
128 129
 let mobPopObj = {
129 130
 	popWhsNm: {
130 131
 		popId: 'ITP_POP_MRTNMNG04011_WHS_AREA',