Sfoglia il codice sorgente

반품처리 개발중

marseyes 2 anni fa
parent
commit
0d5c6c3ae0

+ 25 - 22
src/main/webapp/app/rtnmng/RTNMNG05010.html

@@ -2,10 +2,10 @@
2 2
 	<div class="itp_cont">
3 3
 		<article class="itp_detail">
4 4
 			<div class="itp_det_head fix">
5
-				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i> <strong>반품처리-팝업있음</strong></h2>
5
+				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i> <strong>반품처리</strong></h2>
6 6
 				<div class="pull-right itp_cicon">
7 7
 					<button type="button" id="ITP_BTN_RTNMNG05010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8
-					<button type="button" id="ITP_BTN_RTNMNG05010_CANCELLIST" class="btn btn-warning btn-sm RPPO"><i class="glyphicon "></i> &nbsp;&nbsp;반품처리&nbsp;&nbsp;</button>
8
+					<button type="button" id="ITP_BTN_RTNMNG05010_RTN_PROC" class="btn btn-warning btn-sm SEB"><i class="glyphicon "></i> &nbsp;&nbsp;반품처리&nbsp;&nbsp;</button>
9 9
 				</div>
10 10
 			</div>
11 11
 			<div class="itp_det_in">
@@ -14,47 +14,50 @@
14 14
 						<div class="itp_srh_border fix">
15 15
 							<div class="col-xs-12">
16 16
 								<form id="ITP_FORM_RTNMNG05010_SEARCH" class="form-horizontal">
17
+									<input type="hidden" id="ITP_FORM_RTNMNG05010_SEARCH_SBRAND_ID" name="sbrandId" value="">
18
+									<input type="hidden" id="ITP_FORM_RTNMNG05010_SEARCH_SSTORE_ID" name="sstoreId" value="">
19
+									<input type="hidden" id="ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_ID" name="sspplyId" value="">		<!-- 공급업체 -->
20
+									<input type="hidden" id="ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID" name="srtnWhsId" value="">	<!-- 수거창고 -->
21
+									<input type="hidden" id="ITP_FORM_RTNMNG05010_SEARCH_SWHS_ID" name="swhsId" value="">			<!-- 반품입고창고 -->
22
+								
17 23
 									<div class="form-group">
18
-										<div class="col-xs-2 itp_ip itp_noMar">
19
-											<select id="ITP_FORM_RTNMNG05010_SERVICE_COL_REQ_DT" class="form-control itp_input" name="servicecolReqDt">
20
-												<option value="A">수거요청일*</option>											
24
+										<div class="col-xs-1 itp_ip itp_noMar" style="width:10.7%;">
25
+											<select id="ITP_FORM_RTNMNG05010_SERVICE_COL_DT" class="form-control itp_input">
26
+												<option value="A">수거요청일</option>											
21 27
 											</select>
22 28
 										</div>
23 29
 										<div class="col-xs-3 itp_ip itp_noMar">
24 30
 											<div class="input-daterange input-group date">
25
-												<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_COL_REQ_DT" class="form-control itp_input" name="colReqDt" value="">
31
+												<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="">
26 32
 												<span class="input-group-addon itp_date_to">~</span>
27
-												<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_COL_DT" class="form-control itp_input" name="colDt" value="">
33
+												<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="">
28 34
 											</div>
29 35
 										</div>
30 36
 										<div class="col-xs-2 itp_ip itp_noMar">
31
-											<select id="ITP_FORM_RTNMNG05010_SEARCH_BRAND_NM" class="form-control itp_input" name="sBrandNm">
32
-												<option value="A">브랜드*</option>											
33
-											</select>
34
-										</div>
35
-										<div class="col-xs-2 itp_ip itp_noMar">
36
-											<select id="ITP_FORM_RTNMNG05010_SEARCH_WHS_DVSN" class="form-control itp_input" name="sWhsDvsn">
37
-												<option value="A">반품입고창고</option>											
38
-											</select>
37
+											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_SWHS_NM" class="form-control itp_input" placeholder="반품입고창고" readonly="readonly" />
39 38
 										</div>
39
+										<div class="col-xs-1 itp_in" style="width:11%; padding:0px;">
40
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_POP_SWHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
41
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_DEL_SWHS_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
42
+						                </div>
40 43
 									</div>
41 44
 									<div class="form-group" style="padding-top: 10px; border-top: 1px dotted #ccc;">
42 45
 										<div class="col-xs-2 itp_ip itp_noMar">
43
-											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_SPPLY_NM" class="form-control itp_input" name="sSpplyNm" placeholder="공급업체" />
46
+											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_NM" class="form-control itp_input" placeholder="공급업체" readonly="readonly" />
44 47
 										</div>
45 48
 										<div class="col-xs-1 itp_in" style="width:8%; padding:0px;">
46
-											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
47
-											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
49
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_POP_SSPPLY_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
50
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_DEL_SSPPLY_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
48 51
 						                </div>
49 52
 										<div class="col-xs-2 itp_ip itp_noMar">
50
-											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_STORE_NM" class="form-control itp_input" name="sStoreNm" placeholder="매장/창고" />
53
+											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM" class="form-control itp_input" placeholder="수거창고" readonly="readonly" />
51 54
 										</div>
52 55
 										<div class="col-xs-1 itp_in" style="width:11%; padding:0px;">
53
-											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
54
-											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
56
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_POP_SRTN_WHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
57
+											<button type="button" id="ITP_BTN_RTNMNG05010_SEARCH_DEL_SRTN_WHS_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
55 58
 						                </div>
56 59
 										<div class="col-xs-5 itp_ip itp_noMar">
57
-											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="품목번호 or 품목명" />
60
+											<input type="text" id="ITP_FORM_RTNMNG05010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목번호 or 품목명" />
58 61
 										</div>
59 62
 									</div>
60 63
 								</form>

+ 1 - 1
src/main/webapp/app/rtnmng/RTNMNG06010.html

@@ -56,7 +56,7 @@
56 56
 											<button type="button" id="ITP_BTN_RTNMNG06010_SEARCH_DEL_SRTN_WHS_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
57 57
 						                </div>
58 58
 										<div class="col-xs-5 itp_ip itp_noMar">
59
-											<input type="text" id="ITP_FORM_RTNMNG06010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="품목번호 or 품목명" />
59
+											<input type="text" id="ITP_FORM_RTNMNG06010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목번호 or 품목명" />
60 60
 										</div>
61 61
 									</div>
62 62
 								</form>

+ 5 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG01010.js

@@ -222,6 +222,11 @@ let pageObj = {
222 222
 			$('#ITP_FORM_RTNMNG01010_DETAIL_WHS_NM').attr('readonly', true);
223 223
 			$('#ITP_FORM_RTNMNG01010_DETAIL_LOCATION_NM').attr('readonly', true);
224 224
 			
225
+			// 매장에서 로그인하는 경우
226
+			if(fn_make_user_info.get('storeId') != '') {
227
+				$('#ITP_FORM_RTNMNG01010_SEARCH_WHS_NM').hide();
228
+				$('#ITP_FORM_RTNMNG01010_DELETE_WHS_NM').hide();
229
+			}			
225 230
 		},
226 231
 		grid: function() {
227 232
 			itp_fn_jqgrid_resize(RTNMNG01010_DETAIL_GRID_ID, RTNMNG01010_DETAIL_GRID_LIST, 'lg');

+ 492 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG05010.js

@@ -0,0 +1,492 @@
1
+require(['config'], function() {
2
+	require([], function($) {
3
+		listObj.init();
4
+	});
5
+});
6
+
7
+/********************************************************
8
+ --------------------------------------------------------
9
+ - Object 목록								            -
10
+ --------------------------------------------------------
11
+ * const gridColModel = {}	: 화면 Grid Object			*
12
+ * let pageObj = {}			: 화면공통 Object			*
13
+ * let listObj = {}			: 목록화면 Object			*
14
+ * let viewObj = {}			: 상세화면 Object			*
15
+ * let modifyObj = {}		: 수정화면 Object			*
16
+ * let createObj = {}		: 신규화면 Object			*
17
+ *******************************************************/
18
+
19
+/*화면 변수*/
20
+const RTNMNG05010_GRID_ID = '#ITP_RTNMNG05010_jqGrid';
21
+const RTNMNG05010_GRID_LIST = '#ITP_RTNMNG05010_jqGrid_list';
22
+const RTNMNG05010_GRID_PAGER = '#ITP_RTNMNG05010_jqGridPager';
23
+const RTNMNG05010_GRID_EMPTY = '#ITP_RTNMNG05010_jqGridEmpty';
24
+
25
+let ITP_FORM_RTNMNG05010_DETAIL_IS_WRITING = false;
26
+let RTNMNG05010_LAST_ROW_ID;
27
+
28
+
29
+/*API URL*/
30
+let API_DETAIL_GRID_LIST = '/api/rtnmng/inoutmng/retstock-target-grid-list';	// 목록
31
+let API_DETAIL_SAVE 	 = '/api/rtnmng/inoutmng/save-retstock';				// 반품처리
32
+
33
+
34
+/*화면 Grid ColModel*/
35
+const gridColModel = {
36
+	list: [
37
+		{
38
+			index: 'BRAND_ID', name: 'brandId',
39
+			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
40
+			width: '10', fixed: false, align: 'center',
41
+			sortable: false, hidden: true
42
+		},
43
+		{
44
+			index: 'BRAND_NM', name: 'brandNm',
45
+			label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
46
+			width: '10', fixed: false, align: 'left',
47
+			sortable: false, hidden: false
48
+		},
49
+		{
50
+			index: 'COL_PICK_UNQ_NO', name: 'colPickUnqNo',
51
+			label: '수거서번호', 
52
+			width: '10', fixed: false, align: 'center',
53
+			sortable: false, hidden: true
54
+		},
55
+		{
56
+			index: 'COL_PICK_DTL_NO', name: 'colPickDtlNo',
57
+			label: '수거서항번', 
58
+			width: '5', fixed: false, align: 'center',
59
+			sortable: false, hidden: true
60
+		},		
61
+		{
62
+			index: 'RTN_PODR_UNQ_NO', name: 'rtnPodrUnqNo',
63
+			label: '반품발주번호', 
64
+			width: '12', fixed: false, align: 'center',
65
+			sortable: false, hidden: false
66
+		},
67
+		{
68
+			index: 'RTN_PODR_DTL_NO', name: 'rtnPodrDtlNo',
69
+			label: '항번', 
70
+			width: '5', fixed: false, align: 'center',
71
+			sortable: false, hidden: false
72
+		},
73
+		{
74
+			index: 'ITEM_ID', name: 'itemId',
75
+			label: ITP_MSG_LOCALE.label.itemId, //품목아이디
76
+			width: '13', fixed: false, align: 'center',
77
+			sortable: false, hidden: false
78
+		},
79
+		{
80
+			index: 'ITEM_NM', name: 'itemNm',
81
+			label: ITP_MSG_LOCALE.label.itemNm, //품목명
82
+			width: '10', fixed: false, align: 'left',
83
+			sortable: false, hidden: false
84
+		},
85
+		{
86
+			index: 'COL_QTY', name: 'colQty',
87
+			label: '수거수량', 
88
+			width: '8', fixed: false, align: 'right',
89
+			sortable: true, editable: true, edittype: 'text',
90
+			editrules: { required: false, number: true },
91
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
92
+		},
93
+		{
94
+			index: 'COL_REQ_QTY', name: 'colReqQty',
95
+			label: '수거요청수량', 
96
+			width: '8', fixed: false, align: 'right',
97
+			sortable: false, hidden: false,
98
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
99
+		},
100
+		{
101
+			index: 'RODR_QTY', name: 'rodrQty',
102
+			label: '반품발주수량', 
103
+			width: '8', fixed: false, align: 'right',
104
+			sortable: false, hidden: true,
105
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
106
+		},
107
+		{
108
+			index: 'COL_AMT', name: 'colAmt',
109
+			label: '수거금액', 
110
+			width: '10', fixed: false, align: 'right',
111
+			sortable: false, hidden: false, 
112
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
113
+		},
114
+		{
115
+			index: 'WHS_ID', name: 'whsId',
116
+			label: '반품입고창고', 
117
+			width: '10', fixed: false, align: 'center',
118
+			sortable: false, hidden: true
119
+		},
120
+		{
121
+			index: 'LOCATION', name: 'location',
122
+			label: '반품입고창고location', 
123
+			width: '10', fixed: false, align: 'center',
124
+			sortable: false, hidden: true
125
+		},
126
+		{
127
+			index: 'WHS_NM', name: 'whsNm',
128
+			label: '반품입고창고', 
129
+			width: '10', fixed: false, align: 'center',
130
+			sortable: false, hidden: false
131
+		},
132
+		{
133
+			index: 'RTN_WHS_ID', name: 'rtnWhsId',
134
+			label: '수거창고', 
135
+			width: '10', fixed: false, align: 'center',
136
+			sortable: false, hidden: true
137
+		},
138
+		{
139
+			index: 'RTN_LOCATION', name: 'rtnLocation',
140
+			label: '수거LOCATION', 
141
+			width: '10', fixed: false, align: 'center',
142
+			sortable: false, hidden: true
143
+		},
144
+		{
145
+			index: 'RTN_WHS_NM', name: 'rtnWhsNm',
146
+			label: '수거창고명', 
147
+			width: '10', fixed: false, align: 'center',
148
+			sortable: false, hidden: false
149
+		},
150
+		{
151
+			index: 'COL_SCH_DT', name: 'colSchDt',
152
+			label: '수거예정일', 
153
+			width: '8', fixed: false, align: 'center',
154
+			sortable: false, hidden: false
155
+		},
156
+		{
157
+			index: 'PICK_MGR_NM', name: 'pickMgrNm',
158
+			label: '수거담당자명', 
159
+			width: '10', fixed: false, align: 'center',
160
+			sortable: false, hidden: false
161
+		},
162
+		{
163
+			index: 'PICK_MGR_TEL_NO', name: 'pickMgrTelNo',
164
+			label: '수거담당자연락처', 
165
+			width: '10', fixed: false, align: 'center',
166
+			sortable: false, hidden: false
167
+		},
168
+		{
169
+			index: 'SPPLY_ID', name: 'spplyId',
170
+			label: '공급사아이디', 
171
+			width: '10', fixed: false, align: 'center',
172
+			sortable: false, hidden: true
173
+		},
174
+		{
175
+			index: 'SPPLY_NM', name: 'spplyNm',
176
+			label: '공급사명', 
177
+			width: '10', fixed: false, align: 'center',
178
+			sortable: false, hidden: true
179
+		}
180
+	]
181
+};
182
+
183
+
184
+/*목록화면 Object*/
185
+let listObj = {
186
+	init: function() {
187
+		this.view();
188
+		this.action();
189
+		this.event.init();
190
+		this.grid.init();
191
+	},
192
+	view: function() {
193
+		// 버튼 권한설정
194
+		fn_proc_btn_auth('RTNMNG05010');
195
+
196
+		// 공통코드 표시
197
+		$('select').each(function() {
198
+			if ($(this).data('select-code')) {
199
+				fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
200
+			}
201
+		});
202
+
203
+		var now = new Date();
204
+		$('#ITP_TAB_RTNMNG05010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
205
+		$('#ITP_FORM_RTNMNG05010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
206
+		$('#ITP_FORM_RTNMNG05010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
207
+		
208
+		$('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val('xxx'); // 임시
209
+	},
210
+	itp_RTNMNG05010_search: false,
211
+	button: {
212
+		search: function() {
213
+			// console.log("search event");
214
+			listObj.itp_RTNMNG05010_search = true;
215
+			let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
216
+			param.gridSize = $.jgrid.defaults.rowNum;
217
+			param.gridPage = $.jgrid.defaults.page;
218
+			param.sbrandId = fn_make_user_info.get('brandId');
219
+			param.sstoreId = fn_make_user_info.get('storeId');
220
+			
221
+			// if (param.swhsId == "") {
222
+			if ($('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val() == "") {
223
+				itp_fn_modal_alert("수거창고를 지정해주세요!");
224
+				return;
225
+			}
226
+			
227
+			if (param.fromDt == '' || param.toDt == '') {
228
+				itp_fn_modal_alert("수거요청일 기간을 지정해주세요!");
229
+				return;
230
+			}
231
+			
232
+			$(RTNMNG05010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
233
+		},
234
+		save: function() {
235
+			
236
+			$('body').trigger('click');
237
+			
238
+			const rowKey = $(RTNMNG05010_GRID_ID).getGridParam('selrow');
239
+			if (!rowKey) {
240
+				itp_fn_modal_alert( "반품처리할 품목을 선택하세요.");
241
+				return;
242
+		    }
243
+			
244
+			var selectedIds = $(RTNMNG05010_GRID_ID).getGridParam('selarrrow');
245
+			
246
+		    for (var i=selectedIds.length-1; i>=0; i--) {
247
+				// gridUpdateData.push($(RTNMNG05010_GRID_ID).jqGrid('getRowData', selectedIds[i]));
248
+				
249
+				const rowData = $(RTNMNG05010_GRID_ID).jqGrid('getRowData', selectedIds[i]);
250
+				
251
+				console.log(JSON.stringify(rowData));	
252
+			}
253
+			
254
+			
255
+			
256
+				var modalFn = {
257
+					callBack: () => {
258
+						//itp_fn_form_event.removeChar('#ITP_FORM_OPER03010_DETAIL');
259
+						var chkQtyYn1 = true;
260
+						var chkQtyYn2 = true;
261
+						let gridInsertData = [];
262
+						const rowData = $(RTNMNG05010_GRID_ID).getRowData();
263
+						var cwhsId = "";
264
+						
265
+						$.each(rowData, function(key, value) {							
266
+							if (value.whsQty != '') {
267
+								if (parseInt(value.colQty) > parseInt(value.colReqQty)) {									
268
+									chkQtyYn1 = false;
269
+								}								
270
+								if (cwhsId != "" && cwhsId != value.rtnWhsId) {
271
+									chkQtyYn2 = false;
272
+								}
273
+								cwhsId = value.rtnWhsId;
274
+								gridInsertData.push(value);
275
+							}							
276
+						});
277
+						
278
+						if (chkQtyYn1 == false) {
279
+							itp_fn_modal_alert("수거요청수량보다 수거수량이 더 많습니다.");
280
+							return;	
281
+						}
282
+						if (chkQtyYn2 == false) {
283
+							itp_fn_modal_alert("서로 다른 반품창고 품목은 처리할 수 없습니다.");
284
+							return;	
285
+						}						
286
+						
287
+						if (gridInsertData.length == 0) {
288
+							itp_fn_modal_alert("반품처리할 품목을 없습니다.");
289
+							return ;
290
+						}
291
+						
292
+						let param = {};
293
+						param.viewCd = "C";
294
+						param.whsId = cwhsId;
295
+						param.brandId = fn_make_user_info.get('brandId');
296
+						param.storeId = fn_make_user_info.get('storeId');
297
+						// param.dlvCnfmDocFileNo = "";
298
+						param.gridInsertData = gridInsertData;
299
+						console.log(JSON.stringify(param));
300
+						var searhFn = function () {
301
+							//ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
302
+							listObj.button.search();
303
+						}
304
+						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
305
+					}
306
+				};
307
+			
308
+				itp_fn_modal_confirm('반품처리 하시겠습니까?', modalFn);
309
+			
310
+		}
311
+	},
312
+	action: function() {
313
+		var _this = this;
314
+		
315
+		// 공급업체 조회 버튼 클릭
316
+		$('#ITP_BTN_RTNMNG05010_SEARCH_POP_SSPPLY_NM').on('click', function() {
317
+			_this.popup('spply');
318
+		});
319
+		// 공급업체 텍스트 삭제 버튼 클릭
320
+		$('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SSPPLY_NM').on('click', function() {
321
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_NM').val('');
322
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_ID').val('');
323
+		});
324
+		
325
+		// 매장/창고 조회 버튼 클릭
326
+		$('#ITP_BTN_RTNMNG05010_SEARCH_POP_SWHS_NM').on('click', function() {
327
+			_this.popup('whs');
328
+		});
329
+		// 매장/창고 텍스트 삭제 버튼 클릭
330
+		$('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SWHS_NM').on('click', function() {
331
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_NM').val('');
332
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_ID').val('');
333
+		});
334
+		
335
+		// 매장/창고 조회 버튼 클릭
336
+		$('#ITP_BTN_RTNMNG05010_SEARCH_POP_SRTN_WHS_NM').on('click', function() {
337
+			_this.popup('rwhs');
338
+		});
339
+		// 매장/창고 텍스트 삭제 버튼 클릭
340
+		$('#ITP_BTN_RTNMNG05010_SEARCH_DEL_SRTN_WHS_NM').on('click', function() {
341
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val('');
342
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val('');
343
+		});
344
+
345
+	},
346
+	popup: function(arg) {
347
+		var whsDvsn = "";		
348
+		if (fn_make_user_info.get('storeId') == "") {
349
+			whsDvsn = "W01";
350
+		} else { 
351
+			whsDvsn = "W02";
352
+		}
353
+		
354
+		if(arg === 'spply'){
355
+			var popFn = this.callback.supply;			
356
+			const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
357
+			fn_call_popup('biz', 'BIZPOP_STORE_SPPLY', '#ITP_ASIDE', popFn, key, 'S');			
358
+		} else if(arg === 'whs'){
359
+			var popFn = this.callback.whs;
360
+			const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:whsDvsn};
361
+			fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
362
+		} else if(arg === 'rwhs'){
363
+			var popFn = this.callback.rwhs;
364
+			const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:"W02"};
365
+			fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
366
+		}
367
+		
368
+	},
369
+	callback: {
370
+		supply: function(rowDataPop) {
371
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_NM').val(rowDataPop.spplyNm);
372
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SSPPLY_ID').val(rowDataPop.spplyId);
373
+		},
374
+		whs: function(rowDataPop) {
375
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
376
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
377
+		}, 
378
+		rwhs: function(rowDataPop) {
379
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_NM').val(rowDataPop.whsNm);
380
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SRTN_WHS_ID').val(rowDataPop.whsId);
381
+		}		
382
+	},
383
+	event: {
384
+		init: function() {
385
+			this.button();
386
+		},
387
+		button: function() {
388
+			// 버튼 클릭 이벤트
389
+			$('button').each(function() {
390
+				var id = $(this).attr('id');
391
+				$(this).on('click', function() {
392
+					// console.log("button");
393
+					// console.log(id);
394
+					switch (id) {
395
+						case 'ITP_BTN_RTNMNG05010_SRH'		: listObj.button.search(); 	break;	// 조회 버튼 클릭
396
+						case 'ITP_BTN_RTNMNG05010_RTN_PROC'	: listObj.button.save(); 	break;	// 입고처리 버튼
397
+
398
+					}
399
+				});
400
+			});
401
+
402
+			$('body').on('click', function(e) {
403
+				var gridId = RTNMNG05010_GRID_ID.replace('#', '');
404
+				var rids = $(RTNMNG05010_GRID_ID).jqGrid('getDataIDs');
405
+				var last_row_id = rids[rids.length - 1];
406
+
407
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'RTNMNG05010');
408
+			});
409
+
410
+
411
+		}
412
+	},
413
+	empty: {
414
+		init: function() {
415
+			var _this = this;
416
+			this.push();
417
+			$(RTNMNG05010_GRID_EMPTY).on('click', function() {
418
+				_this.back();
419
+				_this.itp_RTNMNG05010_param.gridSize = $.jgrid.defaults.rowNum;
420
+				$(RTNMNG05010_GRID_ID).setGridParam({ 'postData': JSON.stringify(_this.itp_RTNMNG05010_param) }).trigger('reloadGrid');
421
+			});
422
+		},
423
+		itp_RTNMNG05010_param: {},
424
+		push: function() {
425
+			let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
426
+			listObj.itp_RTNMNG05010_param = param;
427
+		},
428
+		back: function() {
429
+			$('#ITP_FORM_RTNMNG05010_SEARCH_FROM_DT').val(this.itp_RTNMNG05010_param.fromDt);
430
+			$('#ITP_FORM_RTNMNG05010_SEARCH_TO_DT').val(this.itp_RTNMNG05010_param.toDt);
431
+			$('#ITP_FORM_RTNMNG05010_SEARCH_DLV_STTMT_UNQ_NO').val(this.itp_RTNMNG05010_param.sDlvSttmtUnqNo);
432
+			$('#ITP_FORM_RTNMNG05010_SEARCH_SPPLY_ID').val(this.itp_RTNMNG05010_param.sSpplyId);
433
+			$('#ITP_FORM_RTNMNG05010_SEARCH_WHS_ID').val(this.itp_RTNMNG05010_param.sWhsId);
434
+			$('#ITP_FORM_RTNMNG05010_SEARCH_ITEM_NM').val(this.itp_RTNMNG05010_param.sItemNm);
435
+		}
436
+	},
437
+	grid: {
438
+		init: function() {
439
+			// 데이터 없을때
440
+			listObj.empty.push();
441
+			itp_fn_jqgrid_resize(RTNMNG05010_GRID_ID, RTNMNG05010_GRID_LIST, 'lg');
442
+			itp_fn_fire_window_resize();
443
+			this.search();
444
+
445
+		},
446
+		colModel: gridColModel.list,
447
+		search: function() {
448
+			this.unload();
449
+			this.load();
450
+		},
451
+		load: function() {
452
+			let param = $('#ITP_FORM_RTNMNG05010_SEARCH').serializeObject();
453
+			param.gridSize = $.jgrid.defaults.rowNum;
454
+			param.sbrandId = fn_make_user_info.get('brandId');
455
+			param.sstoreId = fn_make_user_info.get('storeId');
456
+			// param.swhsId = "Order";
457
+			var option = {
458
+				multiselect: true,
459
+				autowidth: true,
460
+				gridId: RTNMNG05010_GRID_ID,
461
+				colModel: gridColModel.list,
462
+				param: param,
463
+				url: DOMAIN + API_DETAIL_GRID_LIST,
464
+				pager: RTNMNG05010_GRID_PAGER,
465
+				onCellSelect: function(rowid, cellIdx, cellValue) {
466
+					RTNMNG05010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, RTNMNG05010_LAST_ROW_ID, RTNMNG05010_GRID_ID, ['pchPodrUnqNo']);
467
+				},
468
+				loadComplete: function(data) {
469
+					itp_fn_grid_load_complete(data, RTNMNG05010_GRID_ID, true, 'number', 'RTNMNG05010', listObj.itp_RTNMNG05010_search, listObj.empty, true, data.gridRecords, true);
470
+				},
471
+				onPaging: function(action) {
472
+					itp_fn_grid_paging(RTNMNG05010_GRID_ID, action, param);
473
+				}
474
+			};
475
+			itp_fn_grid_make_remote(option);
476
+		},
477
+		button: {
478
+		},
479
+		unload: function() {
480
+			$.jgrid.gridUnload(RTNMNG05010_GRID_ID);
481
+		},
482
+		clearData: function() {
483
+			$(RTNMNG05010_GRID_ID).jqGrid('clearGridData', true);
484
+			$(RTNMNG05010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
485
+			$(RTNMNG05010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
486
+			$(RTNMNG05010_GRID_EMPTY).show();
487
+		}
488
+		
489
+	}
490
+};
491
+
492
+