Browse Source

팝업 수정

whakdo963 2 years ago
parent
commit
d6d7cf3e9f

+ 1 - 1
src/main/webapp/app/oper/OPER01010.html

@@ -93,7 +93,7 @@
93 93
 											<label class="col-xs-2 itp_lb">브랜드</label>
94 94
 											<div class="col-xs-4 itp_ip">
95 95
 												<div class="col-xs-7 itp_in">
96
-													<select id="ITP_FORM_OPER01010_DETAIL_BRAND_ID" class="form-control itp_input" name="brandId">
96
+													<select id="ITP_FORM_OPER01010_DETAIL_BRAND_NM" data-select-code="BRAND_NM" class="form-control itp_input" name="brandId">
97 97
 													</select>
98 98
 												</div>
99 99
 											</div>

+ 8 - 7
src/main/webapp/app/pomng/POMNG01010.html

@@ -18,7 +18,8 @@
18 18
 								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_STORE_ID" name="storeId" value="">
19 19
 								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN" name="loanDvsn" value="">
20 20
 								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_LOAN_MGNT_UNQ_NO" name="loanMgntUnqNo" value="">
21
-								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_pchReqDvsn" name="pchReqDvsn" value="">
21
+								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_PCH_REQ_DVSN" name="pchReqDvsn" value="">
22
+								<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_PCH_REQ_ST_CD" name="pchReqStCd" value="">
22 23
 					
23 24
 								<section class="itp_form_sec">
24 25
 									<h4 class="itp_form_tit">구매요청정보</h4>
@@ -56,22 +57,22 @@
56 57
 									</div>
57 58
 									<div class="itp_form_in">	
58 59
 										<div class="form-group">
59
-											<label class="col-xs-2 itp_lb">납기요청일</label>
60
+											<label class="col-xs-2 itp_lb">납기요청일 *</label>
60 61
 												<div class="col-xs-4 itp_ip">
61 62
 													<div class="col-xs-4 itp_in">
62 63
 														<div class="input-daterange input-group date">
63
-															<input type="text" id="ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT" class="form-control itp_input" name="dlvReqDt" value="">
64
+															<input type="text" id="ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT" data-check-required="empty" class="form-control itp_input" name="dlvReqDt" value="">
64 65
 														</div>
65 66
 													</div>
66 67
 												</div>
67
-											<label class="col-xs-2 itp_lb">납품장소</label>
68
+											<label class="col-xs-2 itp_lb">납품장소 *</label>
68 69
 											<div class="col-xs-4 itp_ip">
69 70
 												<div class="col-xs-4 itp_in">
70
-													<input type="text" id="ITP_FORM_POMNG01010_DETAIL_WHS_NM" class="form-control itp_input" name="whsNm" value="" />
71
+													<input type="text" id="ITP_FORM_POMNG01010_DETAIL_WHS_NM" data-check-required="empty" class="form-control itp_input" name="whsNm" value="" />
71 72
 													<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_WHS_ID" class="form-control itp_input" name="whsId" value="" />
72 73
 												</div>
73 74
 												<div class="col-xs-4 itp_in">
74
-													<input type="text" id="ITP_FORM_POMNG01010_DETAIL_LOCATION_NM" class="form-control itp_input" name="locationNm" value="" />
75
+													<input type="text" id="ITP_FORM_POMNG01010_DETAIL_LOCATION_NM" data-check-required="empty" class="form-control itp_input" name="locationNm" value="" />
75 76
 													<input type="hidden" id="ITP_FORM_POMNG01010_DETAIL_LOCATION" class="form-control itp_input" name="location" value="" />
76 77
 												</div>
77 78
 												<div class="col-xs-1 itp_in" style="width:23%; padding:0px;">
@@ -97,7 +98,7 @@
97 98
 										<div class="form-group">
98 99
 											<label class="col-xs-2 itp_lb">비고</label>
99 100
 											<div class="col-xs-10 itp_ip">
100
-												<input type="text" id="ITP_FORM_POMNG01010_DETAIL_NOTE" class="form-control itp_input" name="fnNote" value="" />
101
+												<input type="text" id="ITP_FORM_POMNG01010_DETAIL_NOTE" class="form-control itp_input" name="note" value="" />
101 102
 											</div>
102 103
 										</div>
103 104
 									</div>

+ 41 - 0
src/main/webapp/app/popup/biz/BIZPOP_NEW_ITEM.html

@@ -0,0 +1,41 @@
1
+<div id="ITP_BIZPOP_NEW_ITEM" class="modal itp_modal">
2
+	<div class="modal-dialog">
3
+		<div class="modal-content">
4
+			<form id="ITP_FORM_BIZPOP_NEW_ITEM">
5
+				<input type="hidden" id="ITP_FORM_BIZPOP_NEW_ITEM_BRAND_ID" name="sbrandId" value="">
6
+				<input type="hidden" id="ITP_FORM_BIZPOP_NEW_ITEM_STORE_ID" name="sstoreId" value="">
7
+				<div class="modal-header">
8
+					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
9
+					<h5 class="modal-title">품목 검색</h5>
10
+				</div>
11
+				<div class="modal-body">
12
+					<div class="itp_form fix">
13
+						<div class="col-xs-12 itp_form_inline">
14
+							<div class="form-horizontal fix">
15
+								<div class="col-xs-4 itp_ip itp_pr">
16
+									<input type="text" name="sitemNm" id="ITP_FORM_BIZPOP_NEW_ITEM_NM" class="form-control itp_input" placeholder="품목코드,품목명">
17
+								</div>
18
+								<div class="col-xs-4 itp_ip itp_noMar">
19
+									<select id="ITP_FORM_BIZPOP_STORE_PODR_PSSBL_DVSN" data-select-code="PODR_PSSBL_DVSN" class="form-control itp_input" name="spodrPssblDvsn">
20
+									</select>
21
+								</div>
22
+								<div class="pull-right itp_cicon">
23
+									<button type="button" class="btn btn-success btn-sm" id="ITP_BIZPOP_NEW_ITEM_BTN_SEARCH" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i> 조회</button>
24
+									<button type="button" class="btn btn-primary btn-sm" id="ITP_BIZPOP_NEW_ITEM_BTN_SELECT"><i class="glyphicon glyphicon-ok"></i> 선택</button>
25
+								</div>
26
+							</div>
27
+						</div>
28
+					</div>
29
+					<div id="ITP_BIZPOP_NEW_ITEM_jqGrid_list" class="itp_tb_list" data-total-cnt="">
30
+						<div id="ITP_BIZPOP_NEW_ITEM_jqGridView" class="itp_views fix"></div>
31
+						<table id="ITP_BIZPOP_NEW_ITEM_jqGrid"></table>
32
+						<div id="ITP_BIZPOP_NEW_ITEM_jqGridPager"></div>
33
+						<div id="ITP_BIZPOP_NEW_ITEM_jqGridEmpty" class="itp_no_data"></div>
34
+					</div>
35
+				</div>
36
+			</form>
37
+		</div>
38
+	</div>
39
+
40
+	<div id="ITP_POPUP_JS"></div>
41
+</div>

+ 2 - 2
src/main/webapp/app/stinfo/STINFO02011.html

@@ -2,13 +2,13 @@
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_STINFO02011_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8 8
 					<button type="button" id="ITP_BTN_STINFO02011_MODIFY" class="btn btn-success btn-sm UPB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;수정&nbsp;&nbsp;</button>
9 9
 					<button type="button" id="ITP_BTN_STINFO02011_NEWREG" class="btn btn-primary btn-sm NEB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;신규등록&nbsp;&nbsp;</button>
10 10
 					<button type="button" id="ITP_BTN_STINFO02011_SAVE" class="btn btn-success btn-sm SAB"><i class="glyphicon"></i>&nbsp;&nbsp;저장&nbsp;&nbsp;</button>
11
-					<button type="button" id="ITP_BTN_STINFO02011_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon"></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
11
+					<button type="button" id="ITP_BTN_STINFO02011_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon"></i>&nbsp;&nbsp;취소&nbsp;&nbsp;</button>
12 12
 				</div>
13 13
 			</div>
14 14
 			<div class="itp_det_in">

+ 2 - 2
src/main/webapp/app/stinfo/STINFO03010.html

@@ -174,10 +174,10 @@
174 174
 													<input type="text" id="ITP_FORM_STINFO03010_DETAIL_MBL_NO" class="form-control itp_input" name="mgrMblNo" value="">
175 175
 												</div>
176 176
 											</div>
177
-											<label class="col-xs-2 itp_lb">이메일</label>
177
+											<label class="col-xs-2 itp_lb">이메일 *</label>
178 178
 											<div class="col-xs-4 itp_ip">
179 179
 												<div class="col-xs-8 itp_in">
180
-								                	<input type="text" id="ITP_FORM_STINFO03010_DETAIL_EMAL_ADDR" class="form-control itp_input" name="mgrEmal" value="">
180
+								                	<input type="text" id="ITP_FORM_STINFO03010_DETAIL_EMAL_ADDR" data-check-required="empty" class="form-control itp_input" name="mgrEmal" value="">
181 181
 												</div>
182 182
 											</div>
183 183
 										</div>

+ 1 - 1
src/main/webapp/app/stinfo/STINFO05010.html

@@ -188,7 +188,7 @@
188 188
 										<div class="form-group">
189 189
 											<label class="col-xs-2 itp_lb">단위 *</label>
190 190
 											<div class="col-xs-2 itp_ip itp_noMar">
191
-								                <select id="ITP_FORM_STINFO05010_DETAIL_UNIT" data-select-code="DSTRBT_COST_UNIT" data-check-required="empty" class="form-control itp_input" name="unit"></select>
191
+								                <select id="ITP_FORM_STINFO05010_DETAIL_UNIT" data-select-code="DSTRBT_COST_UNIT" data-check-required="empty" class="form-control itp_input" name="unit" disabled></select>
192 192
 											</div>
193 193
 											<div class="col-xs-2 itp_ip"></div>
194 194
 											<label class="col-xs-2 itp_lb">기준수량 *</label>

+ 2 - 3
src/main/webapp/js/app/ordmng/ITP_ORDMNG01010.js

@@ -184,11 +184,10 @@ let pageObj = {
184 184
 			// 조회일자 지정	
185 185
 			var now = new Date();
186 186
 			var defaultToDate = new Date(now);
187
-			console.log(now.getDate());
187
+			defaultToDate.setDate(now.getDate()+7);
188 188
 			$('#ITP_TAB_ORDMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
189
-		
190 189
 			$('#ITP_FORM_ORDMNG01010_SEARCH_FROM_DT').datepicker('setDate', now);
191
-			$('#ITP_FORM_ORDMNG01010_SEARCH_TO_DT').datepicker('setDate', defaultToDate.setDate(now.getDate() + 7));
190
+			$('#ITP_FORM_ORDMNG01010_SEARCH_TO_DT').datepicker('setDate', defaultToDate);
192 191
 		},
193 192
 		grid: function() {
194 193
 			itp_fn_jqgrid_resize(ORDMNG01010_GRID_ID, ORDMNG01010_GRID_LIST, 'lg');

+ 83 - 54
src/main/webapp/js/app/pomng/ITP_POMNG01010.js

@@ -5,7 +5,6 @@ require(['config'], function() {
5 5
 	});
6 6
 });
7 7
 
8
-
9 8
 /********************************************************
10 9
  --------------------------------------------------------
11 10
  - Object 목록								            -
@@ -157,6 +156,7 @@ let pageObj = {
157 156
 				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val(rowDataPop.locationNm);
158 157
 				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION').val(rowDataPop.location);
159 158
 			}
159
+			
160 160
 		}
161 161
 	},
162 162
 	itp_POMNG01010_param: {},  // ==>dwkim 
@@ -179,20 +179,17 @@ let pageObj = {
179 179
 			});
180 180
 
181 181
 			// 조회일자 지정
182
+			//var now = new Date(date.getDate() + 5);
182 183
 			var now = new Date();
183
-			$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('dlvReqDt', new Date(now.setDate(now.getDate() + 5)));
184
+			$('#ITP_TAB_POMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
185
+			$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
186
+			
187
+			
184 188
 			
185 189
 			//납품장소 필드 readonly
186 190
 			$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').attr('readonly', true);
187 191
 			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').attr('readonly', true);
188
-			// form alert message 주입
189
-			/*
190
-			$('input[data-alert-required="ONLYCHK"]').each(function() {
191
-				if($(this).data('alert-msg') === 'address') {
192
-					$(this).data('alert-msg', ITP_MSG_LOCALE.message.form.emptyAddr);
193
-				}
194
-			});
195
-			*/
192
+			
196 193
 		},
197 194
 		grid: function() {
198 195
 			itp_fn_jqgrid_resize(POMNG01010_DETAIL_GRID_ID, POMNG01010_DETAIL_GRID_LIST, 'lg');
@@ -213,8 +210,8 @@ let pageObj = {
213 210
 				var id = $(this).attr('id');
214 211
 				$(this).on('click', function() {
215 212
 					switch (id) {
216
-						case 'ITP_BTN_POMNG01010_SRH': modifyObj.button.save(); break;	// 구매요청
217
-						case 'ITP_BTN_POMNG01010_NEWREG': modifyObj.button.newReg(); break;	// 임시저장
213
+						case 'ITP_BTN_POMNG01010_SRH': createObj.button.save("PR20"); break;	// 구매요청
214
+						case 'ITP_BTN_POMNG01010_NEWREG': createObj.button.save("PR00"); break;	// 임시저장
218 215
 						case 'ITP_BTN_POMNG01010_DETAIL_ADDROW': pageObj.grid.button.addRow(); break;	// 품목추가
219 216
 						case 'ITP_BTN_POMNG01010_DETAIL_DELROW': pageObj.grid.button.delRow(); break;	// 품목삭제
220 217
 					}
@@ -245,12 +242,10 @@ let pageObj = {
245 242
 					var exists = '';
246 243
 					const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
247 244
 					$.each(rowData, function(key, value) {
248
-						//exists = exists + value.itemId + ';';
249 245
 						exists = exists + value.brandUnitUnqNo + ';';
250 246
 					});
251 247
 
252 248
 					$.each(rowDataPop, function(key, value) {
253
-						// if (exists.indexOf(value.itemId) < 0 && value.podrPssblDvsn == 'PO01') {
254 249
 						if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
255 250
 							value['viewCd'] = "C";
256 251
 							$(POMNG01010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
@@ -264,7 +259,7 @@ let pageObj = {
264 259
 			delRow: function() {
265 260
 				itp_fn_grid_del_row(POMNG01010_DETAIL_GRID_ID);
266 261
 				// 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
267
-				this.load.recal();  //==>dwkim 왜 호출이 안될까요
262
+				pageObj.grid.recal();  //==>dwkim 왜 호출이 안될까요
268 263
 			}
269 264
 		},
270 265
 		load: function(gridData) {  // ==>dwkim  오픈시 데이타 가져오는 부분 넣으면 되는건지 여부 gird가 아님
@@ -322,56 +317,85 @@ let createObj = {
322 317
 		//let param = 'brandId=' + LOGIN_USER_INFO.brandId + "&spplyId=" + LOGIN_USER_INFO.spplyId;
323 318
 		this.load();
324 319
 	},
320
+	newinit: function() {
321
+		$('#ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
322
+		$('#ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(fn_make_user_info.get('storeId'));
323
+		$('#ITP_FORM_POMNG01010_DETAIL_PCH_REQ_NM').val('');
324
+		$('#ITP_FORM_POMNG01010_DETAIL_NOTE').val('');
325
+		var now = new Date();
326
+		$('#ITP_TAB_POMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
327
+		$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
328
+		
329
+		
330
+		this.load();  //==>dwkim 초기화 하여 다시 초기 데이타 가져와 뿌려줌
331
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
332
+		fn_ajax_call(API_DETAIL_INIT_INFO, key, this.callback, 'GET');
333
+	},
325 334
 	button: {
326
-		save: function() {
335
+		save: function(arg) {
327 336
 			const formId = '#ITP_FORM_POMNG01010_DETAIL';
328 337
 			itp_fn_form_clear_validate(null, formId);
338
+			$('#ITP_FORM_POMNG01010_DETAIL_PCH_REQ_ST_CD').val(arg);
339
+			
340
+			//정산 타입이 무정산이면 스킵
341
+			var loanDvsn = $('#ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val();
342
+			
343
+			if (loanDvsn != 'LD03' && arg == 'PR20' ) {
344
+				var pchActAtm = $('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text();
345
+				var pchReqAtm = $('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text();
346
+				
347
+				if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
348
+					alert(ITP_MSG_LOCALE.message.ajax.lackReqAmt);
349
+					return;
350
+				}
351
+			}            
329 352
 
330
-			// if (vali_cmpyCd && vali_cmpyStatCd && vali_cmpyTypeCd && vali_cmpyNm && vali_bossNm && vali_mainTel && vali_mainEmail) {
331 353
 			if (itp_fn_form_event.isValid(formId)) {
332
-
333
-				// if($('#ITP_FORM_POMNG01010_DETAIL_CMPY_ZIPNO').val() === '' || $('#ITP_FORM_POMNG01010_DETAIL_CMPY_ADRES').val() === '') {
334
-				// 	itp_fn_modal_alert('주소 검색을 통해 회사 주소를 입력하세요.');
335
-				// 	return;
336
-				// }
337
-
338
-				if (ITP_FORM_POMNG01010_DETAIL_IS_DUPLICATE) {
339
-					itp_fn_modal_duplicate('회사코드 중복체크를 해주세요.', formId + '_AFFL_SHOP_ID');
340
-				} else {
341
-					let gridInsertData = [];
342
-					let gridUpdateData = [];
343
-					let gridDeleteData = [];
344
-					const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
345
-					const keyValue = $(formId + '_AFFL_SHOP_ID').val();
346
-					$.each(rowData, function(key, value) {
347
-						if (value.viewCd !== 'R') {
348
-							value.afflShopId = keyValue;
349
-							if (value.viewCd === 'C') {
350
-								gridInsertData.push(value);
351
-							} else if (value.viewCd === 'U') {
352
-								gridUpdateData.push(value);
353
-							} else if (value.viewCd === 'D') {
354
-								gridDeleteData.push(value);
354
+				var saveReq = {
355
+				callBack: function(args) {
356
+						$(formId).val(arg);
357
+						let gridInsertData = [];
358
+						let gridUpdateData = [];
359
+						let gridDeleteData = [];
360
+						const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
361
+						
362
+						$.each(rowData, function(key, value) {
363
+							if (value.viewCd !== 'R') {
364
+								if (value.viewCd === 'C') {
365
+									gridInsertData.push(value);
366
+								} else if (value.viewCd === 'U') {
367
+									gridUpdateData.push(value);
368
+								} else if (value.viewCd === 'D') {
369
+									gridDeleteData.push(value);
370
+								}
355 371
 							}
356
-						}
357
-					});
358
-
359
-					let param = $(formId).serializeObject();
360
-					param.gridInsertData = gridInsertData;
361
-					param.gridUpdateData = gridUpdateData;
362
-					param.gridDeleteData = gridDeleteData;
363
-					console.log(JSON.stringify(param));
364
-					var searhFn = function() {
365
-						ITP_FORM_POMNG01010_DETAIL_IS_WRITING = false;
366
-						viewObj.init();
367
-					};
368
-					fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
372
+						});
373
+		
374
+						let param = $(formId).serializeObject();
375
+						param.gridInsertData = gridInsertData;
376
+						param.gridUpdateData = gridUpdateData;
377
+						param.gridDeleteData = gridDeleteData;
378
+						console.log(JSON.stringify(param));
379
+						var searhFn = function() {
380
+							createObj.newinit();
381
+						};
382
+						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');				
383
+					}
384
+				};
385
+				if (arg == 'PR20') {
386
+					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.reqSave, saveReq, null);
387
+				} else {
388
+					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveReq, null);
369 389
 				}
390
+				
391
+				
392
+				
370 393
 			}
371 394
 		}
372 395
 	},
373 396
 	load: function() {
374
-		fn_ajax_call(API_DETAIL_INIT_INFO, '', this.callback, 'GET');
397
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
398
+		fn_ajax_call(API_DETAIL_INIT_INFO, key, this.callback, 'GET');
375 399
 	},
376 400
 	callback: function(result) {
377 401
 		console.log(result);
@@ -383,12 +407,17 @@ let createObj = {
383 407
 		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val(result.loanDvsn);
384 408
 		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
385 409
 		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
410
+		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_WHS_ID').val(result.whsId);
411
+		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_WHS_NM').val(result.whsNm);
412
+		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOCATION').val(result.location);
413
+		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val(result.locationNm);
386 414
 		$('#ITP_FORM_POMNG01010_DETAIL .fnBrandNm').text(result.brandNm);
387 415
 		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqDept').text(result.reqDept);
388 416
 		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqMgrNm').text(result.userNm);
389 417
 		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text("0");
390 418
 		$('#ITP_FORM_POMNG01010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
391 419
 		$('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text(result.ordUseAmt);
420
+		
392 421
 
393 422
 		pageObj.grid.init();
394 423
 	}

+ 0 - 424
src/main/webapp/js/app/pomng/ITP_POMNG01010.js12

@@ -1,424 +0,0 @@
1
-require(['config'], function() {
2
-	require([
3
-	], function($) {
4
-		pageObj.init();
5
-	});
6
-});
7
-   
8
-/********************************************************
9
- --------------------------------------------------------
10
- - Object 목록								            -
11
- --------------------------------------------------------
12
- * const gridColModel = {}	: 화면 Grid Object			*
13
- * let pageObj = {}			: 화면공통 Object			*
14
- * let listObj = {}			: 목록화면 Object			*
15
- * let viewObj = {}			: 상세화면 Object			*
16
- * let modifyObj = {}		: 수정화면 Object			*
17
- * let createObj = {}		: 신규화면 Object			*
18
- *******************************************************/
19
-
20
-/*화면 변수*/
21
-/*
22
-const POMNG01010_GRID_ID = '#ITP_POMNG01010_jqGrid';
23
-const POMNG01010_GRID_LIST = '#ITP_POMNG01010_jqGrid_list';
24
-const POMNG01010_GRID_PAGER = '#ITP_POMNG01010_jqGridPager';
25
-const POMNG01010_GRID_EMPTY = '#ITP_POMNG01010_jqGridEmpty';
26
-
27
-const POMNG01010_VIEW_GRID_ID = '#ITP_POMNG01010_VIEW_jqGrid';
28
-const POMNG01010_VIEW_GRID_LIST = '#ITP_POMNG01010_VIEW_jqGrid_list';
29
-const POMNG01010_VIEW_GRID_PAGER = '#ITP_POMNG01010_VIEW_jqGridPager';
30
-const POMNG01010_VIEW_GRID_EMPTY = '#ITP_POMNG01010_VIEW_jqGridEmpty';
31
-*/
32
-const POMNG01010_DETAIL_GRID_ID = '#ITP_POMNG01010_DETAIL_jqGrid';
33
-const POMNG01010_DETAIL_GRID_LIST = '#ITP_POMNG01010_DETAIL_jqGrid_list';
34
-const POMNG01010_DETAIL_GRID_PAGER = '#ITP_POMNG01010_DETAIL_jqGridPager';
35
-const POMNG01010_DETAIL_GRID_EMPTY = '#ITP_POMNG01010_DETAIL_jqGridEmpty';  // ==>dwkim html확인필요
36
-
37
-/*
38
-let ITP_FORM_POMNG01010_DETAIL_IS_DUPLICATE = false;
39
-let ITP_FORM_POMNG01010_DETAIL_IS_WRITING = false;
40
-*/
41
-
42
-/*API URL*/
43
-let API_DETAIL_INIT_INFO = '/api/pomng/init-pchReq'
44
-//let API_DETAIL_GRID_LIST = '/api/affl/detail-grid-list';
45
-//let API_DETAIL_INFO = '/api/affl/info-affl';
46
-//let COMPANY_INFO_COMPANY = '/api/affl/info-affl';
47
-let API_DETAIL_SAVE = '/api/pomng/save-pchReq';
48
-//let API_CHECK_DUPLICATE = '/api/affl/check-duplicate';
49
-//let API_INTI_USERPW = '/api/user/inti-userpw';
50
-
51
-/*화면 Grid ColModel   ==>선택박스 항목 추가 부분  */
52
-const gridColModel = {
53
-	detail: [
54
-		{
55
-			index: 'VIEW_CD', name: 'viewCd',
56
-			label: ITP_MSG_LOCALE.label.viewCd,
57
-			width: '10', fixed: false, align: 'center',
58
-			sortable: false, hidden: true
59
-		},
60
-		{
61
-			index: 'ITEM_ID', name: 'itemId',
62
-			label: ITP_MSG_LOCALE.label.itemId,
63
-			width: '20', fixed: false, align: 'center',
64
-			sortable: false, editable: false, edittype: 'text',
65
-			editrules: { required: true }
66
-		},
67
-		{
68
-			index: 'ITEM_NM', name: 'itemNm',
69
-			label: ITP_MSG_LOCALE.label.itemNm,
70
-			width: '30', fixed: false, align: 'center',
71
-			sortable: true, editable: false, edittype: 'text',
72
-			editrules: { required: true }
73
-		},
74
-		{
75
-			index: 'UNIT', name: 'unit',
76
-			label: ITP_MSG_LOCALE.label.unit,
77
-			width: '10', fixed: false, align: 'center',
78
-			sortable: false, editable: false, edittype: 'text'
79
-		},
80
-		{
81
-			index: 'UNIT_AMT', name: 'unitAmt',
82
-			label: ITP_MSG_LOCALE.label.unitAmt,
83
-			width: '10', fixed: false, align: 'center',
84
-			sortable: false, editable: false, edittype: 'text', hidden: false
85
-		},
86
-		{
87
-			index: 'PCH_REQ_QTY', name: 'pchReqQty',
88
-			label: ITP_MSG_LOCALE.label.pchReqQty, //단가
89
-			width: '10', fixed: false, align: 'right',
90
-			sortable: true, editable: true, edittype: 'text',
91
-			editrules: { number:true}
92
-		},
93
-		{
94
-			index: 'PCH_REQ_AMT', name: 'pchReqAmt',
95
-			label: ITP_MSG_LOCALE.label.pchReqAmt,
96
-			width: '10', fixed: false, align: 'right',
97
-			sortable: false, editable: false, edittype: 'text', hidden: false
98
-		},
99
-
100
-		{
101
-			index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
102
-			label: ITP_MSG_LOCALE.label.brandUnitUnqNo,
103
-			width: '10', fixed: false, align: 'center',
104
-			sortable: false, editable: false, edittype: 'text', hidden: true
105
-		},
106
-		{
107
-			index: 'STORE_UNIT_UNQ_NO', name: 'storeUnitUnqNo',
108
-			label: ITP_MSG_LOCALE.label.storeUnitUnqNo,
109
-			width: '10', fixed: false, align: 'center',
110
-			sortable: false, editable: false, edittype: 'text', hidden: true
111
-		},
112
-		{
113
-			index: 'UNIT_GUBUN', name: 'unitGubun',
114
-			label: ITP_MSG_LOCALE.label.unitGubun,
115
-			width: '10', fixed: false, align: 'center',
116
-			sortable: false, editable: false, edittype: 'text', hidden: true
117
-		}
118
-	]
119
-};
120
-
121
-/*화면공통 Object*/
122
-let pageObj = {
123
-	init: function() {
124
-		this.ui.init();
125
-		this.event.init();
126
-		this.action();
127
-	},
128
-	action: function () {
129
-		var _this = this;
130
-		// 납품장소 조회 버튼 클릭
131
-		$('#ITP_FORM_POMNG01010_SEARCH_WHS_NM').on('click', function() {
132
-			_this.popup();
133
-		});
134
-		// 납품장소 텍스트 삭제 버튼 클릭
135
-		$('#ITP_FORM_POMNG01010_DELETE_WHS_NM').on('click', function() {
136
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').val('');
137
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_ID').val('');
138
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val('');
139
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION').val('');
140
-			
141
-		});
142
-	},
143
-	popup: function () {
144
-		// 팝업
145
-		var popFn = this.callback.create;
146
-		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
147
-		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
148
-		
149
-	},
150
-	callback: {
151
-		create: function(rowDataPop) {
152
-			console.log(rowDataPop);
153
-			if(rowDataPop) {
154
-				$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
155
-				$('#ITP_FORM_POMNG01010_DETAIL_WHS_ID').val(rowDataPop.whsId);
156
-				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val(rowDataPop.locationNm);
157
-				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION').val(rowDataPop.location);
158
-			}
159
-			
160
-		}
161
-	},
162
-	itp_POMNG01010_param: {},  // ==>dwkim 
163
-	itp_POMNG01010_search: false,  // ==>dwkim 
164
-	ui: {
165
-		init: function() {
166
-			this.view();
167
-			this.grid();
168
-			this.ready();
169
-		},
170
-		view: function() {
171
-			// 버튼 권한설정
172
-			fn_proc_btn_auth('POMNG01010');
173
-			
174
-			// 공통코드 표시
175
-			$('select').each(function() {
176
-				if ($(this).data('select-code')) {
177
-					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
178
-				}
179
-			});
180
-
181
-			// 조회일자 지정
182
-			//var now = new Date(date.getDate() + 5);
183
-			var now = new Date();
184
-			$('#ITP_TAB_POMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
185
-			$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
186
-			
187
-			
188
-			
189
-			//납품장소 필드 readonly
190
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').attr('readonly', true);
191
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').attr('readonly', true);
192
-			
193
-		},
194
-		grid: function() {
195
-			itp_fn_jqgrid_resize(POMNG01010_DETAIL_GRID_ID, POMNG01010_DETAIL_GRID_LIST, 'lg');
196
-			//listObj.empty.init();
197
-			itp_fn_fire_window_resize();
198
-		},
199
-		ready: function() {
200
-			createObj.init();
201
-		}
202
-	},
203
-	event: {
204
-		init: function() {
205
-			this.button();
206
-		},
207
-		button: function() {
208
-			// 버튼 클릭 이벤트
209
-			$('button').each(function() {
210
-				var id = $(this).attr('id');
211
-				$(this).on('click', function() {
212
-					switch (id) {
213
-						case 'ITP_BTN_POMNG01010_SRH': createObj.button.save("PR20"); break;	// 구매요청
214
-						case 'ITP_BTN_POMNG01010_NEWREG': createObj.button.save("PR00"); break;	// 임시저장
215
-						case 'ITP_BTN_POMNG01010_DETAIL_ADDROW': pageObj.grid.button.addRow(); break;	// 품목추가
216
-						case 'ITP_BTN_POMNG01010_DETAIL_DELROW': pageObj.grid.button.delRow(); break;	// 품목삭제
217
-					}
218
-				});
219
-			});
220
-
221
-			$('body').on('click', function(e) {
222
-				// afflUserObj.grid.resetGrid(e);
223
-			});
224
-
225
-		}
226
-	},
227
-	grid: {
228
-		init: function(mode, gridData) {
229
-			this.mode = mode;
230
-			this.gridId = POMNG01010_DETAIL_GRID_ID;
231
-			this.unload();  // ==>dwkim 
232
-			this.load(gridData);
233
-		},
234
-		mode: 'DETAIL',
235
-		gridId: '',
236
-		button: {
237
-			addRow: function() {
238
-				// 팝업
239
-				var popFn = function(rowDataPop) {
240
-					console.log(rowDataPop);
241
-					// 기존등록 데이터
242
-					var exists = '';
243
-					const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
244
-					$.each(rowData, function(key, value) {
245
-						exists = exists + value.brandUnitUnqNo + ';';
246
-					});
247
-
248
-					$.each(rowDataPop, function(key, value) {
249
-						if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
250
-							value['viewCd'] = "C";
251
-							$(POMNG01010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
252
-						}
253
-					});
254
-					$(POMNG01010_DETAIL_GRID_EMPTY).hide();
255
-				};
256
-				const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
257
-				fn_call_popup('biz', 'BIZPOP_ITEM', '#ITP_ASIDE', popFn, key, 'S');  // ==>dwkim 추후 작업 진행  파라메타 설명필요
258
-			},
259
-			delRow: function() {
260
-				itp_fn_grid_del_row(POMNG01010_DETAIL_GRID_ID);
261
-				// 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
262
-				pageObj.grid.recal();  //==>dwkim 왜 호출이 안될까요
263
-			}
264
-		},
265
-		load: function(gridData) {  // ==>dwkim  오픈시 데이타 가져오는 부분 넣으면 되는건지 여부 gird가 아님
266
-			var _this = this;
267
-			var option = {
268
-				gridId: this.gridId,
269
-				colModel: gridColModel.detail,
270
-				data: gridData,
271
-				multiselect: true,
272
-				cellEdit: true,
273
-				loadComplete: function(data) {
274
-					_this.clearData();
275
-				},
276
-				afterSaveCell: function(rowid,name,val,iRow,iCol) {
277
-					// 구매요청금액 계산 (기존금액과 )
278
-					var unitAmt = jQuery(POMNG01010_DETAIL_GRID_ID).jqGrid('getCell',rowid,iCol-1);
279
-					jQuery(POMNG01010_DETAIL_GRID_ID).jqGrid('setRowData',rowid,{pchReqAmt: parseInt(val)*parseInt(unitAmt)});
280
-					// 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
281
-					_this.recal();
282
-				}
283
-			};
284
-			itp_fn_grid_make_local(option);
285
-		},
286
-		clearData: function() {
287
-			console.log(this.gridId);
288
-			$(POMNG01010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
289
-			$(POMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
290
-			$(POMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
291
-			$(POMNG01010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
292
-			$(POMNG01010_DETAIL_GRID_EMPTY).show();
293
-		},
294
-		recal: function() {
295
-			//PCH_REQ_AMT
296
-			const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
297
-			var pchReqAmt = 0 ;
298
-			$.each(rowData, function(key, value) {
299
-				if (value.pchReqAmt != null && value.pchReqAmt != "") {
300
-					pchReqAmt = pchReqAmt + parseInt(value.pchReqAmt) ;
301
-				}
302
-				
303
-			});
304
-			$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text(pchReqAmt);
305
-		},
306
-		unload: function() {
307
-			$.jgrid.gridUnload(this.gridId);
308
-		}
309
-	}
310
-};
311
-
312
-/*신규화면 Object*/
313
-let createObj = {
314
-	init: function() {
315
-		$('#ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
316
-		$('#ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(fn_make_user_info.get('storeId'));
317
-		//let param = 'brandId=' + LOGIN_USER_INFO.brandId + "&spplyId=" + LOGIN_USER_INFO.spplyId;
318
-		this.load();
319
-	},
320
-	newinit: function() {
321
-		$('#ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
322
-		$('#ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(fn_make_user_info.get('storeId'));
323
-		$('#ITP_FORM_POMNG01010_DETAIL_PCH_REQ_NM').val('');
324
-		$('#ITP_FORM_POMNG01010_DETAIL_NOTE').val('');
325
-		var now = new Date();
326
-		$('#ITP_TAB_POMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
327
-		$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 5)));
328
-		
329
-		
330
-		this.load();  //==>dwkim 초기화 하여 다시 초기 데이타 가져와 뿌려줌
331
-		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
332
-		fn_ajax_call(API_DETAIL_INIT_INFO, key, this.callback, 'GET');
333
-	},
334
-	button: {
335
-		save: function(arg) {
336
-			const formId = '#ITP_FORM_POMNG01010_DETAIL';
337
-			itp_fn_form_clear_validate(null, formId);
338
-			$('#ITP_FORM_POMNG01010_DETAIL_PCH_REQ_ST_CD').val(arg);
339
-			
340
-			//정산 타입이 무정산이면 스킵
341
-			var loanDvsn = $('#ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val();
342
-			
343
-			if (loanDvsn != 'LD03' && arg == 'PR20' ) {
344
-				var pchActAtm = $('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text();
345
-				var pchReqAtm = $('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text();
346
-				
347
-				if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
348
-					alert(ITP_MSG_LOCALE.message.ajax.lackReqAmt);
349
-					return;
350
-				}
351
-			}            
352
-
353
-			if (itp_fn_form_event.isValid(formId)) {
354
-				var saveReq = {
355
-				callBack: function(args) {
356
-						$(formId).val(arg);
357
-						let gridInsertData = [];
358
-						let gridUpdateData = [];
359
-						let gridDeleteData = [];
360
-						const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
361
-						
362
-						$.each(rowData, function(key, value) {
363
-							if (value.viewCd !== 'R') {
364
-								if (value.viewCd === 'C') {
365
-									gridInsertData.push(value);
366
-								} else if (value.viewCd === 'U') {
367
-									gridUpdateData.push(value);
368
-								} else if (value.viewCd === 'D') {
369
-									gridDeleteData.push(value);
370
-								}
371
-							}
372
-						});
373
-		
374
-						let param = $(formId).serializeObject();
375
-						param.gridInsertData = gridInsertData;
376
-						param.gridUpdateData = gridUpdateData;
377
-						param.gridDeleteData = gridDeleteData;
378
-						console.log(JSON.stringify(param));
379
-						var searhFn = function() {
380
-							createObj.newinit();
381
-						};
382
-						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');				
383
-					}
384
-				};
385
-				if (arg == 'PR20') {
386
-					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.reqSave, saveReq, null);
387
-				} else {
388
-					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.tmpSave, saveReq, null);
389
-				}
390
-				
391
-				
392
-				
393
-			}
394
-		}
395
-	},
396
-	load: function() {
397
-		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
398
-		fn_ajax_call(API_DETAIL_INIT_INFO, key, this.callback, 'GET');
399
-	},
400
-	callback: function(result) {
401
-		console.log(result);
402
-
403
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_VIEW_CD').val('C');
404
-
405
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(result.brandId);
406
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(result.storeId);
407
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val(result.loanDvsn);
408
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
409
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
410
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_WHS_ID').val(result.whsId);
411
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_WHS_NM').val(result.whsNm);
412
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOCATION').val(result.location);
413
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val(result.locationNm);
414
-		$('#ITP_FORM_POMNG01010_DETAIL .fnBrandNm').text(result.brandNm);
415
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqDept').text(result.reqDept);
416
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqMgrNm').text(result.userNm);
417
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text("0");
418
-		$('#ITP_FORM_POMNG01010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
419
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text(result.ordUseAmt);
420
-		
421
-
422
-		pageObj.grid.init();
423
-	}
424
-};

+ 699 - 0
src/main/webapp/js/app/pomng/ITP_POMNG02010.js

@@ -0,0 +1,699 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		pageObj.init();
5
+	});
6
+});
7
+
8
+/********************************************************
9
+ --------------------------------------------------------
10
+ - Object 목록								            -
11
+ --------------------------------------------------------
12
+ * const gridColModel = {}	: 화면 Grid Object			*
13
+ * let pageObj = {}			: 화면공통 Object			*
14
+ * let listObj = {}			: 목록화면 Object			*
15
+ * let viewObj = {}			: 상세화면 Object			*
16
+ * let modifyObj = {}		: 수정화면 Object			*
17
+ * let createObj = {}		: 신규화면 Object			*
18
+ * let sfflyObj = {}		: 공급업체담당자 Object		*
19
+ *******************************************************/
20
+
21
+/*화면 변수*/
22
+const POMNG02010_GRID_ID = '#ITP_POMNG02010_jqGrid';
23
+const POMNG02010_GRID_LIST = '#ITP_POMNG02010_jqGrid_list';
24
+const POMNG02010_GRID_PAGER = '#ITP_POMNG02010_jqGridPager';
25
+const POMNG02010_GRID_EMPTY = '#ITP_POMNG02010_jqGridEmpty';
26
+
27
+const POMNG02010_VIEW_GRID_ID = '#ITP_POMNG02010_VIEW_jqGrid';
28
+const POMNG02010_VIEW_GRID_LIST = '#ITP_POMNG02010_VIEW_jqGrid_list';
29
+const POMNG02010_VIEW_GRID_PAGER = '#ITP_POMNG02010_VIEW_jqGridPager';
30
+const POMNG02010_VIEW_GRID_EMPTY = '#ITP_POMNG02010_VIEW_jqGridEmpty';
31
+
32
+const POMNG02010_DETAIL_GRID_ID = '#ITP_POMNG02010_DETAIL_jqGrid';
33
+const POMNG02010_DETAIL_GRID_LIST = '#ITP_POMNG02010_DETAIL_jqGrid_list';
34
+const POMNG02010_DETAIL_GRID_PAGER = '#ITP_POMNG02010_DETAIL_jqGridPager';
35
+const POMNG02010_DETAIL_GRID_EMPTY = '#ITP_POMNG02010_DETAIL_jqGridEmpty';
36
+
37
+//let ITP_FORM_POMNG02010_DETAIL_IS_DUPLICATE = false;
38
+let ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
39
+
40
+let POMNG02010_GRID_LAST_ROW_ID;
41
+
42
+//let ITP_COMMON_ASSGN_TASK = fn_make_common_cd_list(CODE_LIST, 'ASSGN_TASK', true, '담당업무');
43
+
44
+/*API URL*/
45
+let API_DETAIL_GRID_LIST 	= '/api/pomng/detail-grid-list';	// 목록
46
+let API_DETAIL_INFO 		= '/api/pomng/info-pchReq';			// 상세
47
+let API_DETAIL_SAVE 		= '/api/pomng/save-pchReq';			// 저장
48
+//let API_INTI_PW				= '/api/spply/inti-spplyPw';		// 패스워드 초기화
49
+//let API_POP_GRID_LIST 		= '/api/spply/pop-grid-list';		// 공급사 팝업 그리드 리스트
50
+
51
+/*화면 Grid ColModel*/
52
+const gridColModel = {
53
+	list: [
54
+		{
55
+			index: 'PCH_REQ_UNQ_NO', name: 'pchReqUnqNo',
56
+			label: ITP_MSG_LOCALE.label.pchReqUnqNo
57
+			, //공급업체번호
58
+			width: '10', fixed: false, align: 'center',
59
+			sortable: false, hidden: true
60
+		},
61
+		{
62
+			index: 'BRAND_ID', name: 'brandId',
63
+			label: ITP_MSG_LOCALE.label.brandId, //브랜드ID
64
+			width: '10', fixed: false, align: 'center',
65
+			sortable: false, hidden: true
66
+		},
67
+		{
68
+			index: 'BRAND_NM', name: 'brandNm',
69
+			label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
70
+			width: '10', fixed: false, align: 'center',
71
+			sortable: false, hidden: false
72
+		},
73
+		{
74
+			index: 'STORE_ID', name: 'storeId',
75
+			label: ITP_MSG_LOCALE.label.storeId, //공급업체명
76
+			width: '13', fixed: false, align: 'center',
77
+			sortable: false, hidden: false
78
+		},
79
+		
80
+		{
81
+			index: 'PCH_REQ_NM', name: 'pchReqNm',
82
+			label: ITP_MSG_LOCALE.label.pchReqNm, //사업자등록번호
83
+			width: '13', fixed: false, align: 'center',
84
+			sortable: false, hidden: false
85
+		},
86
+		{
87
+			index: 'PCH_REQ_ST_CD', name: 'pchReqStCd',
88
+			label: ITP_MSG_LOCALE.label.pchReqStCd, //대표자명
89
+			width: '15', fixed: false, align: 'center',
90
+			sortable: false, hidden: true
91
+		},
92
+		{
93
+			index: 'PCH_REQ_ST_NM', name: 'pchReqStNm',
94
+			label: ITP_MSG_LOCALE.label.pchReqStNm, //상태
95
+			width: '6', fixed: false, align: 'center',
96
+			sortable: false, hidden: false
97
+		},
98
+		{
99
+			index: 'PCH_REQ_DT', name: 'pchReqDt',
100
+			label: ITP_MSG_LOCALE.label.pchReqDt, //최초등록일
101
+			width: '10', fixed: false, align: 'center',
102
+			sortable: false, hidden: false
103
+		},
104
+		{
105
+			index: 'PCH_REQ_ITEM_QTY', name: 'pchReqItemQty',
106
+			label: ITP_MSG_LOCALE.label.pchReqItemQty, //최초등록일
107
+			width: '10', fixed: false, align: 'center',
108
+			sortable: false, hidden: false
109
+		},
110
+		{
111
+			index: 'PCH_REQ_TOTAL_AMT', name: 'pchReqTotalAmt',
112
+			label: ITP_MSG_LOCALE.label.pchReqTotalAmt, //최초등록일
113
+			width: '10', fixed: false, align: 'center',
114
+			sortable: false, hidden: false
115
+		},
116
+		{
117
+			index: 'PCH_REQ_RJCT_DT', name: 'pchReqRjctDt',
118
+			label: ITP_MSG_LOCALE.label.pchReqRjctDt, //최초등록일
119
+			width: '10', fixed: false, align: 'center',
120
+			sortable: false, hidden: false
121
+		},
122
+		{
123
+			index: 'PCH_REQ_RJCT_NM', name: 'pchReqRjctNm',
124
+			label: ITP_MSG_LOCALE.label.pchReqRjctNm, //최초등록일
125
+			width: '10', fixed: false, align: 'center',
126
+			sortable: false, hidden: false
127
+		},
128
+		{
129
+			index: 'PCH_REQ_MGR_NM', name: 'pchReqMgrNm',
130
+			label: ITP_MSG_LOCALE.label.pchReqMgrNm, //최초등록일
131
+			width: '10', fixed: false, align: 'center',
132
+			sortable: false, hidden: false
133
+		},
134
+		{
135
+			index: 'DLV_REQ_DT', name: 'dlvReqDt',
136
+			label: ITP_MSG_LOCALE.label.dlvReqDt, //최초등록일
137
+			width: '10', fixed: false, align: 'center',
138
+			sortable: false, hidden: false
139
+		},
140
+		{
141
+			index: 'WHS_LOCATION_NM', name: 'whsLocationNm',
142
+			label: ITP_MSG_LOCALE.label.whsLocationNm, //최초등록일
143
+			width: '10', fixed: false, align: 'center',
144
+			sortable: false, hidden: false
145
+		}
146
+	],
147
+	detail: [
148
+		{
149
+			index: 'VIEW_CD', name: 'viewCd',
150
+			label: ITP_MSG_LOCALE.label.viewCd,
151
+			width: '10', fixed: false, align: 'center',
152
+			sortable: false, hidden: true
153
+		},
154
+		{
155
+			index: 'SPPLY_ID', name: 'spplyId',
156
+			label: ITP_MSG_LOCALE.label.spplyId,
157
+			width: '10', fixed: false, align: 'center',
158
+			sortable: false, hidden: true
159
+		},
160
+		{
161
+			index: 'SPPLY_MGR_ID', name: 'spplyMgrId',
162
+			label: ITP_MSG_LOCALE.label.spplyMgrId,
163
+			width: '10', fixed: false, align: 'center',
164
+			sortable: false, hidden: true
165
+		},
166
+		{
167
+			index: 'ASSGN_TASK_NM', name: 'spplyMgrNm',
168
+			label: ITP_MSG_LOCALE.label.spplyMgrNm, //담당자명
169
+			width: '20', fixed: false, align: 'center',
170
+			sortable: false, editable: true, edittype: 'text',
171
+			editrules: {required: true}
172
+		},
173
+		{
174
+			index: 'POSITION', name: 'position',
175
+			label: ITP_MSG_LOCALE.label.position, //직위
176
+			width: '30', fixed: false, align: 'center',
177
+			sortable: true, editable: true, edittype: 'text',
178
+			editrules: {required: true}
179
+		},
180
+		{
181
+			index: 'RPRST_EMAIL', name: 'rprstEmal',
182
+			label: ITP_MSG_LOCALE.label.rprstEmal, //이메일
183
+			width: '10', fixed: false, align: 'center',
184
+			sortable: false, editable: true, edittype: 'text'
185
+		},
186
+		{
187
+			index: 'RPRST_TEL_NO', name: 'rprstTelNo',
188
+			label: ITP_MSG_LOCALE.label.rprstMblNo, //핸드폰번호
189
+			width: '10', fixed: false, align: 'center',
190
+			sortable: false, editable: true, edittype: 'text'
191
+		},
192
+		{
193
+			index: 'ASSGN_TASK', name: 'assgnTask',
194
+			label: ITP_MSG_LOCALE.label.assgnTaskNm, //담당업무
195
+			width: '10', fixed: false, align: 'center',
196
+			sortable: false, editable: true, formatter: 'select', edittype: 'select',
197
+			editoptions: {value: ITP_COMMON_ASSGN_TASK},
198
+			editrules: {required: false}
199
+		}/*,
200
+		{
201
+			index: 'ASSGN_TASK_NM', name: 'assgnTaskNm',
202
+			label: ITP_MSG_LOCALE.label.assgnTaskNm, //담당업무
203
+			width: '10', fixed: false, align: 'center',
204
+			sortable: false, editable: true, edittype: 'text'
205
+		}*/
206
+	]
207
+};
208
+
209
+/*화면공통 Object*/
210
+let pageObj = {
211
+	init: function () {
212
+		this.ui.init();
213
+		this.event.init();
214
+		this.fileUpload();
215
+	},
216
+	ui: {
217
+		init: function () {
218
+			this.view();
219
+			this.grid();
220
+			this.ready();
221
+		},
222
+		view: function() {
223
+			// 버튼 권한설정
224
+			fn_proc_btn_auth('POMNG02010');
225
+
226
+			// 공통코드 표시
227
+			$('select').each(function() {
228
+				if($(this).data('select-code')) {
229
+					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
230
+				}
231
+			});
232
+		},
233
+		grid: function() {
234
+			itp_fn_jqgrid_resize(POMNG02010_GRID_ID, POMNG02010_GRID_LIST, 'lg');
235
+			listObj.empty.init();
236
+			itp_fn_fire_window_resize();
237
+		},
238
+		ready: function() {
239
+			listObj.init();
240
+		}
241
+	},
242
+	event: {
243
+		init: function () {
244
+			this.button();
245
+		},
246
+		button: function () {
247
+			// 버튼 클릭 이벤트
248
+			$('button').each(function() {
249
+				var id = $(this).attr('id');
250
+				$(this).on('click', function() {
251
+					switch (id) {
252
+						case 'ITP_BTN_POMNG02010_SRH'					: listObj.button.search();		break;	// 조회 버튼 클릭
253
+						case 'ITP_BTN_POMNG02010_NEWREG'				: listObj.button.create(); 		break;	// 신규등록 버튼
254
+						case 'ITP_BTN_POMNG02010_MODIFY'				: modifyObj.button.modify();	break;	// 수정 버튼
255
+						case 'ITP_BTN_POMNG02010_CANCELLIST'			: createObj.button.cancel(); 	break;	// 취소/목록 버튼
256
+						case 'ITP_BTN_POMNG02010_DELETE'				: 								break;	// 삭제 버튼
257
+						case 'ITP_BTN_POMNG02010_SAVE'					: createObj.button.save(); 		break;	// 저장 버튼
258
+						case 'ITP_BTN_POMNG02010_DETAIL_ADDROW'		: createObj.button.addRow();	break;	// 행추가
259
+						case 'ITP_BTN_POMNG02010_DETAIL_DELROW'		: createObj.button.delRow();	break;	// 행삭제
260
+						case 'ITP_FORM_POMNG02010_DETAIL_ADRES_SCH'	: createObj.button.address();	break;	// 신규등록 주소 찾기
261
+					}
262
+				});
263
+			});
264
+
265
+			$('body').on('click', function(e) {
266
+				var gridId = POMNG02010_DETAIL_GRID_ID.replace('#', '');
267
+				var rids = $(POMNG02010_DETAIL_GRID_ID).jqGrid('getDataIDs');
268
+				var last_row_id = rids[rids.length - 1];
269
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'POMNG02010_DETAIL');
270
+			});
271
+
272
+		}
273
+	},
274
+	fileUpload: function() {
275
+		//파일업로드(등록/수정화면)
276
+		var id = 'POMNG02010';
277
+		var acctScrId = 'POMNG02010_ACCT';
278
+		$('#ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD').empty();
279
+		const acctFileArgs = {
280
+			'fileNo': $('#ITP_FORM_' + id + '_DETAIL_ACCT_FILE_NO').val(),
281
+			'viewCd': $('#ITP_FORM_' + id + '_DETAIL_VIEW_CD').val(),
282
+			'showYn': $('#ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD').attr('data-show-yn'),
283
+			'fileId': '#ITP_FORM_' + id + '_DETAIL_ACCT_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
284
+		};
285
+		itp_fn_set_file_upload('ITP_' + id + '_DETAIL_ACCT_FILE_UPLOAD', 'notice', true, false, acctScrId, acctFileArgs);
286
+
287
+		var corpScrId = 'POMNG02010_CORP';
288
+		$('#ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD').empty();
289
+		const corpFileArgs = {
290
+			'fileNo': $('#ITP_FORM_' + id + '_DETAIL_CORP_FILE_NO').val(),
291
+			'viewCd': $('#ITP_FORM_' + id + '_DETAIL_VIEW_CD').val(),
292
+			'showYn': $('#ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD').attr('data-show-yn'),
293
+			'fileId': '#ITP_FORM_' + id + '_DETAIL_CORP_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
294
+		};
295
+		itp_fn_set_file_upload('ITP_' + id + '_DETAIL_CORP_FILE_UPLOAD', 'notice', true, false, corpScrId, corpFileArgs);
296
+	},
297
+	switchScreen: function(mode) {
298
+		$('.itp_det_head').find('button[id^="ITP_BTN_POMNG02010_"]').each(function(i) {
299
+			$(this).hide();
300
+		});
301
+		$('#ITP_TAB_POMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
302
+			$(this).hide();
303
+		});
304
+		if(mode == 'LIST') { // 목록
305
+			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_SRH', '#ITP_BTN_POMNG02010_NEWREG']);
306
+			$('#ITP_AJAX_POMNG02010_LIST_CONTAINER').show();
307
+			$('#ITP_FORM_POMNG02010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
308
+		} else if(mode == 'ADD') { // 등록
309
+			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_CANCELLIST', '#ITP_BTN_POMNG02010_SAVE']);
310
+			$('#ITP_AJAX_POMNG02010_DETAIL_CONTAINER').show();
311
+
312
+			$('#ITP_FORM_POMNG02010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
313
+				$(this).attr('id') === 'ITP_FORM_POMNG02010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
314
+				if(elem.type === 'select') {
315
+					$(this).val('').prop('selected', true);
316
+				}
317
+			});
318
+
319
+			// 가맹점 정보 설정
320
+			$('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
321
+			$('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
322
+			$('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
323
+			$('#ITP_FORM_POMNG02010_DETAIL .fnSpplyId').text('(자동부여) (비밀번호는 사업자번호로 초기화 됩니다.)');
324
+			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').hide();
325
+			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').show();
326
+
327
+			$('#ITP_BTN_POMNG02010_RESET_PW').hide();
328
+			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
329
+			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
330
+		} else if(mode == 'MODIFY') { // 수정
331
+			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_CANCELLIST', '#ITP_BTN_POMNG02010_SAVE', '#ITP_BTN_POMNG02010_RESET_PW']);
332
+			$('#ITP_AJAX_POMNG02010_DETAIL_CONTAINER').show();
333
+			$('#ITP_BTN_POMNG02010_RESET_PW').show();
334
+			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_info').show();
335
+			$('#ITP_FORM_POMNG02010_DETAIL .itp_form_change').hide();
336
+
337
+			$('#ITP_FORM_POMNG02010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
338
+			$('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
339
+			$('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(fn_make_user_info.get('brandNm'));
340
+			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_ACCT_FILE_UPLOAD");
341
+			$.bootstrapFileUpload('resetUpload', "ITP_POMNG02010_DETAIL_CORP_FILE_UPLOAD");
342
+		} else if(mode == 'VIEW') { // 보기
343
+			fn_show_btn_auth_array(['#ITP_BTN_POMNG02010_MODIFY', '#ITP_BTN_POMNG02010_CANCELLIST']);
344
+			$('#ITP_AJAX_POMNG02010_VIEW_CONTAINER').show();
345
+		}
346
+	},
347
+	grid: {
348
+		init: function(mode, gridRows) {
349
+			this.gridId = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_ID : POMNG02010_DETAIL_GRID_ID;
350
+			this.gridList = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_LIST : POMNG02010_DETAIL_GRID_LIST;
351
+			this.gridEmpty = (mode === 'VIEW') ? POMNG02010_VIEW_GRID_EMPTY : POMNG02010_DETAIL_GRID_EMPTY;
352
+			this.gridRows = gridRows;
353
+			this.unload();
354
+			this.load(mode, gridRows);
355
+		},
356
+		gridId: '',
357
+		gridList: '',
358
+		gridEmpty: '',
359
+		gridRows: '',
360
+		load: function(mode, gridRows) {
361
+			var _this = this;
362
+			var option = {
363
+				gridId: _this.gridId,
364
+				colModel: gridColModel.detail,
365
+				data: gridRows,
366
+				multiselect: (mode !== 'VIEW'),
367
+				// cellEdit: (mode !== 'VIEW'),
368
+				loadComplete: function(data) {
369
+					$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
370
+					(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
371
+				},
372
+				onCellSelect: function(rowid, cellIdx, cellValue) {
373
+					console.log('mode ===> ' + mode);
374
+					if(mode !== 'VIEW') {
375
+						POMNG02010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, POMNG02010_GRID_LAST_ROW_ID, _this.gridId, ['actionId']);
376
+					}
377
+				}
378
+				/*,
379
+				afterSaveCell: function(rowid,name,val,iRow,iCol) {
380
+					if(mode !== 'VIEW') {
381
+						console.log(rowid);
382
+						console.log(name);
383
+						console.log(val);
384
+						console.log(iRow);
385
+						console.log(iCol);
386
+					}
387
+				},
388
+				afterEditCell: function (rowid, cellname, val, iRow, iCol){
389
+					if(mode !== 'VIEW') {
390
+						$("#" + rowid + "_" + cellname).blur(function(){
391
+							$("#grid").jqGrid("saveCell",iRow,iCol);
392
+						});
393
+					}
394
+				}*/
395
+			};
396
+			itp_fn_grid_make_local(option);
397
+		},
398
+		unload : function() {
399
+			$.jgrid.gridUnload(this.gridId);
400
+		},
401
+		changeRows: function(gridRows) {
402
+			var modifyRows = [];
403
+			var chkColumns = ['spplyMgrNm', 'position', 'rprstEmal', 'rprstTelNo', 'assgnTask'];
404
+			$.each(this.gridRows, function(index, item) {
405
+				var row = gridRows[index];
406
+				if(row.viewCd === 'C') {
407
+					modifyRows.push(item);
408
+				} else {
409
+					if(row.itemId === item.itemId) {
410
+						$.each(chkColumns, function(index, column) {
411
+							if(row[column].toString() !== item[column].toString()) {
412
+								row.viewCd = 'U';
413
+								modifyRows.push(row);
414
+								return false;
415
+							}
416
+						});
417
+					}
418
+				}
419
+			});
420
+			return modifyRows;
421
+		}
422
+	}
423
+};
424
+
425
+/*목록화면 Object*/
426
+let listObj = {
427
+	init: function () {
428
+		this.grid.init();
429
+	},
430
+	itp_POMNG02010_search: false,
431
+	button: {
432
+		search: function() {
433
+			listObj.itp_POMNG02010_search = true;
434
+			let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
435
+			param.gridSize = $.jgrid.defaults.rowNum;
436
+			param.gridPage = $.jgrid.defaults.page;
437
+			$(POMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
438
+		},
439
+		create: function() {
440
+			if(!fn_make_user_info.isEmpty()) {
441
+				createObj.init();
442
+			}
443
+		}
444
+	},
445
+	empty: {
446
+		init: function() {
447
+			var _this = this;
448
+			this.push();
449
+			$(POMNG02010_GRID_EMPTY).on('click', function() {
450
+				_this.back();
451
+				_this.itp_POMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
452
+				$(POMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_POMNG02010_param)}).trigger('reloadGrid');
453
+			});
454
+		},
455
+		itp_POMNG02010_param: {},
456
+		push: function() {
457
+			let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
458
+			listObj.itp_POMNG02010_param = param;
459
+		},
460
+		back: function() {
461
+			$('#ITP_FORM_POMNG02010_SERVICE_ST_DT').val(this.itp_POMNG02010_param.serviceStDt);
462
+			$('#ITP_FORM_POMNG02010_SEARCH_BSNS_REG_NO').val(this.itp_POMNG02010_param.sbsnsRegNo);
463
+			$('#ITP_FORM_POMNG02010_SEARCH_SPPLY_NM').val(this.itp_POMNG02010_param.sspplyNm);
464
+		}
465
+	},
466
+	grid: {
467
+		init: function () {
468
+			// 데이터 없을때
469
+			listObj.empty.push();
470
+			this.search();
471
+		},
472
+		colModel: gridColModel.list,
473
+		search: function() {
474
+			pageObj.switchScreen('LIST');
475
+			this.unload();
476
+			this.load();
477
+		},
478
+		load: function() {
479
+			let param = $('#ITP_FORM_POMNG02010_SEARCH').serializeObject();
480
+			param.gridSize = $.jgrid.defaults.rowNum;
481
+			param.sbrandId = fn_make_user_info.get('brandId');
482
+
483
+			var option = {
484
+				gridId: POMNG02010_GRID_ID,
485
+				colModel: gridColModel.list,
486
+				param: param,
487
+				url: DOMAIN + API_DETAIL_GRID_LIST,
488
+				pager: POMNG02010_GRID_PAGER,
489
+				onCellSelect: function(rowId, cellIdx, cellValue) {
490
+					var cm = $(this).jqGrid('getGridParam', 'colModel');
491
+					var colNm = cm[cellIdx].name;
492
+					if (colNm == 'spplyId') {
493
+						const selectVal = $(this).jqGrid('getCell', rowId, 'spplyId');
494
+						const key = {brandId:fn_make_user_info.get('brandId'), spplyId: selectVal, viewCd: 'R'};
495
+						var param = $.param(key);
496
+						viewObj.init(param);
497
+					}
498
+				},
499
+				loadComplete: function(data) {
500
+					console.log(data);
501
+					itp_fn_grid_load_complete(data, POMNG02010_GRID_ID, true, 'number', 'POMNG02010', listObj.itp_POMNG02010_search, listObj.empty, true, data.gridRecords, true);
502
+					var ids = $(POMNG02010_GRID_ID).getDataIDs();
503
+					$.each(ids, function(idx, rowId) {
504
+						$(POMNG02010_GRID_ID).jqGrid('setCell', rowId, 'spplyId', '', ITP_GRID_COL_STYLE.link);
505
+					});
506
+				},
507
+				onPaging: function(action) {
508
+					itp_fn_grid_paging(POMNG02010_GRID_ID, action, param);
509
+				}
510
+			};
511
+			itp_fn_grid_make_remote(option);
512
+		},
513
+		clearData : function() {
514
+			$(POMNG02010_GRID_ID).jqGrid('clearGridData', true);
515
+			$(POMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
516
+			$(POMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
517
+			$(POMNG02010_GRID_EMPTY).show();
518
+		},
519
+		unload : function() {
520
+			$.jgrid.gridUnload(POMNG02010_GRID_ID);
521
+		}
522
+	}
523
+};
524
+
525
+/*상세화면 Object*/
526
+let viewObj = {
527
+	init: function (param) {
528
+		this.load(param);
529
+	},
530
+	load: function(param) {
531
+		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
532
+	},
533
+	callback: function (result) {
534
+		console.log(result);
535
+		pageObj.switchScreen('VIEW');
536
+		$('#ITP_FORM_POMNG02010_VIEW #ITP_FORM_POMNG02010_VIEW_SPPLY_ID').val(result.spplyId);
537
+		$('#ITP_FORM_POMNG02010_VIEW .fnBrandNm').text(result.brandNm);
538
+		$('#ITP_FORM_POMNG02010_VIEW .fnStCd').text(result.stNm);
539
+		$('#ITP_FORM_POMNG02010_VIEW .fnSpplyId').text(result.spplyId);
540
+		$('#ITP_FORM_POMNG02010_VIEW .fnCorpType').text(result.corpTypeNm);
541
+		$('#ITP_FORM_POMNG02010_VIEW .fnSpplyNm').text(result.spplyNm);
542
+		$('#ITP_FORM_POMNG02010_VIEW .fnBsnsCndt').text(result.bsnsCndt);
543
+		$('#ITP_FORM_POMNG02010_VIEW .fnBsnsRegNo').text(result.bsnsRegNo);
544
+		$('#ITP_FORM_POMNG02010_VIEW .fnCtgrBsns').text(result.ctgrBsns);
545
+		$('#ITP_FORM_POMNG02010_VIEW .fnCorpRegNo').text(result.corpRegNo);
546
+		$('#ITP_FORM_POMNG02010_VIEW .fnTelNo').text(result.mgrTelNo);
547
+		$('#ITP_FORM_POMNG02010_VIEW .fnOwnerNm').text(result.ownerNm);
548
+		$('#ITP_FORM_POMNG02010_VIEW .fnFaxNo').text(result.faxNo);
549
+		$('#ITP_FORM_POMNG02010_VIEW .fnMblNo').text(result.mgrMblNo);
550
+		$('#ITP_FORM_POMNG02010_VIEW .fnEmalAddr').text(result.mgrEmal);
551
+		$('#ITP_FORM_POMNG02010_VIEW .fnAreaCd').text(result.areaNm);
552
+		$('#ITP_FORM_POMNG02010_VIEW .fnBnkCd').text(result.bnkNm);
553
+		$('#ITP_FORM_POMNG02010_VIEW .fnAcctNo').text(result.acctNo);
554
+		$('#ITP_FORM_POMNG02010_VIEW .fnOwacNm').text(result.owacNm);
555
+		// 통장사본 fileBookCopyNoList
556
+		//$('#ITP_FORM_POMNG02010_VIEW .fnFilePath').text(result.fileBookCopyNoList);
557
+		// 사업자등록파일 fileBsnsRegNoList
558
+		//$('#ITP_FORM_POMNG02010_VIEW .fnFilePath').text(result.fileBsnsRegNoList);
559
+		$('#ITP_FORM_POMNG02010_VIEW .fnZipNo').text(result.zipNo);
560
+		$('#ITP_FORM_POMNG02010_VIEW .fnLoadAddr').text(result.addr1);
561
+		$('#ITP_FORM_POMNG02010_VIEW .fnDtlAddr').text(result.addr2);
562
+		// $('#ITP_FORM_POMNG02010_VIEW .fnRegDt').text(result.openDt);
563
+		// $('#ITP_FORM_POMNG02010_VIEW .fnCloseDt').text(result.openDt);
564
+
565
+		itp_fn_attach_file.view('ITP_POMNG02010_VIEW_ACCT_FILE', result.fileBookCopyNoList
566
+			, 'form-control itp_input', 'border:none; top:12px; left:12px; height:100px; width:125px; position:absolute;');
567
+
568
+		itp_fn_attach_file.view('ITP_POMNG02010_VIEW_REG_NO_FILE', result.fileBsnsRegNoList
569
+			, 'form-control itp_input', 'border:none; top:12px; left:12px; height:100px; width:125px; position:absolute;');
570
+
571
+		// 담당자정보  리스트 조회
572
+		pageObj.grid.init('VIEW', result.spplyMgrList);
573
+		// viewObj.grid.load(result.spplyMgrList);
574
+	}
575
+};
576
+
577
+/*수정화면 Object*/
578
+let modifyObj = {
579
+	init: function () {
580
+	},
581
+	button: {
582
+		modify: function (param) {
583
+			itp_fn_form_clear_validate(null, '#ITP_FORM_POMNG02010_DETAIL');
584
+			const selectVal = $('#ITP_FORM_POMNG02010_VIEW_SPPLY_ID').val();
585
+			const key = {brandId:fn_make_user_info.get('brandId'), spplyId: selectVal, viewCd: 'R'};
586
+			var param = $.param(key);
587
+			modifyObj.load(param);
588
+		}
589
+	},
590
+	load: function(param) {
591
+		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
592
+	},
593
+	callback: function (result) {
594
+		console.log(result);
595
+		pageObj.switchScreen('MODIFY');
596
+
597
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_VIEW_CD').val('U');
598
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_STORE_ID').val(result.storeId);
599
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
600
+		$('#ITP_FORM_POMNG02010_DETAIL .fnBrandNm').text(result.brandNm);
601
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ST_CD').val(result.stCd);
602
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_SPPLY_ID').val(result.spplyId);
603
+		$('#ITP_FORM_POMNG02010_DETAIL .fnSpplyId').text(result.spplyId);
604
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CORP_TYPE').val(result.corpType);
605
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_SPPLY_NM').val(result.spplyNm);
606
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BSNS_CNDT').val(result.bsnsCndt);
607
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BSNS_REG_NO').val(result.bsnsRegNo);
608
+		$('#ITP_FORM_POMNG02010_DETAIL .fnBsnsRegNo').text(result.bsnsRegNo);
609
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CTGR_BSNS').val(result.ctgrBsns);
610
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_CORP_REG_NO').val(result.corpRegNo);
611
+		$('#ITP_FORM_POMNG02010_DETAIL .fnCorpRegNo').text(result.corpRegNo);
612
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_TEL_NO').val(result.mgrTelNo);
613
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_OWNER_NM').val(result.ownerNm);
614
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_FAX_NO').val(result.faxNo);
615
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_MBL_NO').val(result.mgrMblNo);
616
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_EMAL_ADDR').val(result.mgrEmal);
617
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_AREA_CD').val(result.areaCd);
618
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_BNK_CD').val(result.bnkCd);
619
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ACCT_NO').val(result.acctNo);
620
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_OWAC_NM').val(result.owacNm);
621
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_FROM_DT').val(result.openDt);
622
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ZIPNO').val(result.zipNo);
623
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ADRES').val(result.addr1);
624
+		$('#ITP_FORM_POMNG02010_DETAIL #ITP_FORM_POMNG02010_DETAIL_ADRES_DTL').val(result.addr2);
625
+
626
+		$('#ITP_FORM_POMNG02010_DETAIL .fnRegId').text(result.sysRegId);
627
+		$('#ITP_FORM_POMNG02010_DETAIL .fnRegDt').text(result.sysRegDttm);
628
+		$('#ITP_FORM_POMNG02010_DETAIL .fnChgId').text(result.sysChgId);
629
+		$('#ITP_FORM_POMNG02010_DETAIL .fnChgDt').text(result.sysChgDttm);
630
+
631
+		// 담당자정보  리스트 조회
632
+		pageObj.grid.init('DETAIL', result.spplyMgrList);
633
+		// modifyObj.grid.load(result.spplyMgrList);
634
+	}
635
+};
636
+
637
+/*신규화면 Object*/
638
+let createObj = {
639
+	init: function () {
640
+		pageObj.switchScreen('ADD');
641
+		itp_fn_form_clear_validate(null, '#ITP_FORM_POMNG02010_DETAIL');
642
+		$('#ITP_FORM_POMNG02010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
643
+		pageObj.grid.init('DETAIL', []);
644
+	},
645
+	button: {
646
+		cancel: function() {
647
+			listObj.grid.search();
648
+		},
649
+		address: function() {
650
+			kakaoMap.simpleAddress('ITP_FORM_POMNG02010_DETAIL');
651
+		},
652
+		addRow: function() {
653
+			itp_fn_grid_add_row(POMNG02010_DETAIL_GRID_ID, undefined, ['spplyId'], 'POMNG02010_DETAIL');
654
+		},
655
+		delRow: function() {
656
+			itp_fn_grid_del_row(POMNG02010_DETAIL_GRID_ID);
657
+		},
658
+		save: function() {
659
+			const formId = '#ITP_FORM_POMNG02010_DETAIL';
660
+			itp_fn_form_clear_validate(null, formId);
661
+
662
+			if (itp_fn_form_event.isValid(formId)) {
663
+				itp_fn_grid_save_rows(POMNG02010_DETAIL_GRID_ID);
664
+				let gridInsertData = [];
665
+				// let gridUpdateData = [];
666
+				let gridDeleteData = [];
667
+				for(var i=0; i<$(POMNG02010_DETAIL_GRID_ID).getGridParam('reccount'); i++) {
668
+					$(POMNG02010_DETAIL_GRID_ID).jqGrid('saveCell', i+1, 2)
669
+				}
670
+				const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
671
+				console.log(rowData);
672
+				var gridUpdateData = pageObj.grid.changeRows(rowData);
673
+				$.each(rowData, function(key, value) {
674
+					if (value.viewCd !== 'R') {
675
+						if (value.viewCd === 'C') {
676
+							value.spplyId = $(formId + '_SPPLY_ID').val();
677
+							gridInsertData.push(value);
678
+						} else if (value.viewCd === 'U') {
679
+							gridUpdateData.push(value);
680
+						} else if (value.viewCd === 'D') {
681
+							gridDeleteData.push(value);
682
+						}
683
+					}
684
+				});
685
+				itp_fn_form_event.removeChar(formId);
686
+				let param = $(formId).serializeObject();
687
+				param.gridInsertData = gridInsertData;
688
+				param.gridUpdateData = gridUpdateData;
689
+				param.gridDeleteData = gridDeleteData;
690
+				console.log(JSON.stringify(param));
691
+				var searhFn = function() {
692
+					ITP_FORM_POMNG02010_DETAIL_IS_WRITING = false;
693
+					listObj.grid.search();
694
+				};
695
+				// fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
696
+			}
697
+		}
698
+	}
699
+};

+ 1 - 1
src/main/webapp/js/app/popup/biz/ITP_BIZPOP_ITEM.js

@@ -141,7 +141,7 @@ function itp_fn_BIZPOP_ITEM(parentPopFn, args, returnType) {
141 141
 				label: '매장단가고유번호', //
142 142
 				width: '10', fixed: false, align: 'center',
143 143
 				sortable: false, hidden: true
144
-			},
144
+			},   
145 145
 			{
146 146
 				index: 'WHS_PASS_QTY', name: 'whsPassQty',
147 147
 				label: '출고가능수량', //

+ 176 - 0
src/main/webapp/js/app/popup/biz/ITP_BIZPOP_NEW_ITEM.js

@@ -0,0 +1,176 @@
1
+require(['config'], function() {
2
+	require([
3
+		'jquery'
4
+	], function($) {
5
+
6
+	});
7
+});
8
+
9
+let API_POP_GRID_LIST = '/api/item/pop-new-grid-list';
10
+
11
+function itp_fn_BIZPOP_NEW_ITEM(parentPopFn, args, returnType) {
12
+	console.log(args);
13
+	let itp_BIZPOP_NEW_ITEM_param = {};
14
+	let itp_BIZPOP_NEW_ITEM_search = false;
15
+
16
+	const THIS_FORM_ID = '#ITP_FORM_BIZPOP_NEW_ITEM';
17
+	const THIS_GIRD_ID = '#ITP_BIZPOP_NEW_ITEM_jqGrid';
18
+	const THIS_GIRD_PAGER = '#ITP_BIZPOP_NEW_ITEM_jqGridPager';
19
+
20
+	$('#ITP_FORM_BIZPOP_NEW_ITEM_BRAND_ID').val(fn_make_user_info.get('brandId'));
21
+	$('#ITP_FORM_BIZPOP_NEW_ITEM_STORE_ID').val(fn_make_user_info.get('storeId'));
22
+
23
+	// 공통코드 표시
24
+	$('select').each(function() {
25
+		if($(this).data('select-code')) {
26
+			fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
27
+		}
28
+	});
29
+
30
+	$('#ITP_BIZPOP_NEW_ITEM').one('shown.bs.modal', function(e) {
31
+		itp_fn_jqgrid_resize(THIS_GIRD_ID, '#ITP_BIZPOP_NEW_ITEM_jqGrid_list', '');
32
+		itp_fn_fire_window_resize();
33
+	}).one('hidden.bs.modal', function(e) {
34
+		$('#ITP_BIZPOP_NEW_ITEM').remove();
35
+	}).modal('show');
36
+
37
+	$('#ITP_BIZPOP_NEW_ITEM_BTN_SEARCH').on('click', function() {
38
+		itp_BIZPOP_NEW_ITEM_search = true;
39
+		let param = $(THIS_FORM_ID).serializeObject();
40
+		param.gridSize = 10;
41
+		param.gridPage = $.jgrid.defaults.page;
42
+		$(THIS_GIRD_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
43
+	});
44
+	
45
+	$('#ITP_BIZPOP_NEW_ITEM_BTN_SELECT').on('click', function() {		
46
+		
47
+		const rowKey = $(THIS_GIRD_ID).getGridParam('selrow');
48
+	    if (!rowKey) {
49
+	    	return; 
50
+	    }
51
+	
52
+		var list = [];
53
+	    var selectedIds = $(THIS_GIRD_ID).getGridParam('selarrrow');
54
+
55
+		if(selectedIds.length > 1) { // 1개만 선택
56
+			 itp_fn_modal_alert('하나의 품목만 선택해주세요.');
57
+			 return;
58
+		}
59
+		
60
+		const selRow = $(THIS_GIRD_ID).getRowData(rowKey);
61
+		parentPopFn(selRow);
62
+		$('#ITP_BIZPOP_NEW_ITEM').modal('hide'); // 팝업닫기
63
+		/*
64
+	    for (var i=selectedIds.length-1; i>=0; i--) {
65
+			list.push($(THIS_GIRD_ID).jqGrid('getRowData', selectedIds[i]));	
66
+		}
67
+		parentPopFn(list);
68
+		$('#ITP_BIZPOP_NEW_ITEM').modal('hide'); // 팝업닫기
69
+		*/
70
+	});
71
+
72
+	$('#ITP_BIZPOP_NEW_ITEM_jqGridEmpty').on('click', function() {
73
+		itp_fn_BIZPOP_NEW_ITEM_empty.back();
74
+		itp_BIZPOP_NEW_ITEM_param.gridSize = 10;
75
+		$(THIS_GIRD_ID).setGridParam({'postData': JSON.stringify(itp_BIZPOP_NEW_ITEM_param)}).trigger('reloadGrid');
76
+	});
77
+
78
+	var itp_fn_BIZPOP_NEW_ITEM_empty = {
79
+		push: function() {
80
+			let param = $(THIS_FORM_ID).serializeObject();
81
+			itp_BIZPOP_NEW_ITEM_param = param;
82
+		},
83
+		back: function() {
84
+			$(THIS_FORM_ID + '_BRAND_ID').val(itp_BIZPOP_NEW_ITEM_param.sbrandId);
85
+			$(THIS_FORM_ID + '_STROE_ID').val(itp_BIZPOP_NEW_ITEM_param.sstoreId);
86
+		}
87
+	};
88
+
89
+	itp_fn_BIZPOP_NEW_ITEM_empty.push();
90
+	let param = $('#ITP_FORM_BIZPOP_NEW_ITEM').serializeObject();
91
+	param.gridSize = 10;
92
+	console.log(JSON.stringify(param));
93
+
94
+	$(THIS_GIRD_ID).jqGrid({
95
+		colModel: [
96
+			{
97
+				index: 'ITEM_ID', name: 'itemId',
98
+				label: '품목ID', //
99
+				width: '10', fixed: false, align: 'center',
100
+				sortable: false, hidden: false
101
+			},
102
+			{
103
+				index: 'ITEM_NM', name: 'itemNm',
104
+				label: '품목명', //
105
+				width: '12', fixed: false, align: 'left',
106
+				sortable: false, hidden: false
107
+			},
108
+			{
109
+				index: 'UNIT', name: 'unit',
110
+				label: '단위', //
111
+				width: '6', fixed: false, align: 'center',
112
+				sortable: false, hidden: false
113
+			},
114
+			{
115
+				index: 'UNIT_AMT', name: 'unitAmt',
116
+				label: '단가', //
117
+				width: '6', fixed: false, align: 'right',
118
+				sortable: false, hidden: false
119
+			},
120
+			{
121
+				index: 'PODR_PSSBL_DVSN_NM', name: 'podrPssblDvsnNm',
122
+				label: '발주가능여부명', //
123
+				width: '6', fixed: false, align: 'center',
124
+				sortable: false, hidden: false
125
+			},
126
+			{
127
+				index: 'PODR_PSSBL_DVSN', name: 'podrPssblDvsn',
128
+				label: '발주가능여부', //
129
+				width: '6', fixed: false, align: 'center',
130
+				sortable: false, hidden: true
131
+			},
132
+			{
133
+				index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
134
+				label: '브랜드단가고유번호', //
135
+				width: '10', fixed: false, align: 'center',
136
+				sortable: false, hidden: true
137
+			},
138
+			{
139
+				index: 'UNIT_GUBUN', name: 'unitGubun',
140
+				label: '단가구분', //
141
+				width: '10', fixed: false, align: 'center',
142
+				sortable: false, hidden: true
143
+			},
144
+			{
145
+				index: 'STORE_UNIT_UNQ_NO', name: 'storeUnitUnqNo',
146
+				label: '매장단가고유번호', //
147
+				width: '10', fixed: false, align: 'center',
148
+				sortable: false, hidden: true
149
+			},
150
+			{
151
+				index: 'WHS_PASS_QTY', name: 'whsPassQty',
152
+				label: '출고가능수량', //
153
+				width: '10', fixed: false, align: 'center',
154
+				sortable: false, hidden: true
155
+			}
156
+		],
157
+		loadBeforeSend: function(jqXHR) {
158
+		    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
159
+		},
160
+		postData: JSON.stringify(param),
161
+		url: DOMAIN + API_POP_GRID_LIST,
162
+		pager: THIS_GIRD_PAGER,
163
+		multiselect: true,
164
+		rownumbers: false,
165
+		loadComplete: function(data) {
166
+			console.log(data);
167
+			itp_fn_grid_load_complete(data, THIS_GIRD_ID, true, undefined, 'BIZPOP_NEW_ITEM', itp_BIZPOP_NEW_ITEM_search, itp_fn_BIZPOP_NEW_ITEM_empty, true, data.gridRecords, false);
168
+	    },
169
+	    loadError: function(jqXHR, textStatus, errorThrown) {
170
+	    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
171
+	    },
172
+	    onPaging: function(action) {
173
+	    	itp_fn_grid_paging(THIS_GIRD_ID, action, param);
174
+	    }
175
+	}).navGrid(THIS_GIRD_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
176
+};

+ 1 - 1
src/main/webapp/js/app/popup/biz/ITP_BIZPOP_WHS_LOCATION.js

@@ -40,7 +40,7 @@ function itp_fn_BIZPOP_WHS_LOCATION(parentPopFn, args, returnType) {
40 40
 		
41 41
 		const rowKey = $(THIS_GIRD_ID).getGridParam('selrow');
42 42
 	    if (!rowKey) {
43
-	    	return; 
43
+	    	return;
44 44
 	    }
45 45
 	
46 46
 		const selRow = $(THIS_GIRD_ID).getRowData(rowKey);

+ 22 - 156
src/main/webapp/js/app/stinfo/ITP_STINFO01011.js

@@ -154,108 +154,6 @@ let pageObj = {
154 154
     }
155 155
 };
156 156
 
157
-/*목록화면 Object*/
158
-let listObj = {
159
-    init: function () {
160
-        afflShopObj.init();
161
-        this.grid.init();
162
-    },
163
-    itp_STINFO01011_param: {},
164
-    itp_STINFO01011_search: false,
165
-    button: {
166
-        search: function() {
167
-            listObj.itp_STINFO01011_search = true;
168
-            let param = $('#ITP_FORM_STINFO01011_SEARCH').serializeObject();
169
-            param.gridSize = $.jgrid.defaults.rowNum;
170
-            param.gridPage = $.jgrid.defaults.page;
171
-            console.log(JSON.stringify(param));
172
-            $(STINFO01011_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
173
-        },
174
-        create: function() {
175
-            pageObj.switchScreen('ADD');
176
-            itp_fn_form_clear_validate(null, '#ITP_FORM_STINFO01011_DETAIL');
177
-            // 권한정보 리스트 조회
178
-            createObj.init();
179
-        }
180
-    },
181
-    empty: {
182
-        init: function() {
183
-            var _this = this;
184
-            this.push();
185
-            $(STINFO01011_GRID_EMPTY).on('click', function() {
186
-                _this.back();
187
-                listObj.itp_STINFO01011_param.gridSize = $.jgrid.defaults.rowNum;
188
-                $(STINFO01011_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_STINFO01011_param)}).trigger('reloadGrid');
189
-            });
190
-        },
191
-        push: function() {
192
-            let param = $('#ITP_FORM_STINFO01011_SEARCH').serializeObject();
193
-            listObj.itp_STINFO01011_param = param;
194
-        },
195
-        back: function() {
196
-            $('#ITP_FORM_STINFO01011_SERVICE_BRAND_TYPE').val(listObj.itp_STINFO01011_param.brandType);
197
-            $('#ITP_FORM_STINFO01011_SERVICE_ST_CD').val(listObj.itp_STINFO01011_param.stCd);
198
-            $('#ITP_FORM_STINFO01011_SEARCH_BRAND_NM').val(listObj.itp_STINFO01011_param.brandNm);
199
-        }
200
-    },
201
-    grid: {
202
-        init: function () {
203
-            // 데이터 없을때
204
-            listObj.empty.push();
205
-            this.search();
206
-        },
207
-        colModel: gridColModel.list,
208
-        search: function() {
209
-            pageObj.switchScreen('LIST');
210
-            this.unload();
211
-            this.load();
212
-        },
213
-        load: function() {
214
-            let param = $('#ITP_FORM_STINFO01011_SEARCH').serializeObject();
215
-            param.gridSize = $.jgrid.defaults.rowNum;
216
-
217
-            var option = {
218
-                gridId: STINFO01011_GRID_ID,
219
-                colModel: gridColModel.list,
220
-                param: param,
221
-                url: DOMAIN + API_DETAIL_GRID_LIST,
222
-                pager: STINFO01011_GRID_PAGER,
223
-                onCellSelect: function(rowId, cellIdx, cellValue) {
224
-                    var cm = $(this).jqGrid('getGridParam', 'colModel');
225
-                    var colNm = cm[cellIdx].name;
226
-                    if (colNm === 'brandId') {
227
-                        const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
228
-                        const key = {brandId: brandIdVal, viewCd: 'R'};
229
-                        var param = $.param(key);
230
-                        viewObj.init(param);
231
-                    }
232
-                },
233
-                loadComplete: function(data) {
234
-                    console.log(data);
235
-                    itp_fn_grid_load_complete(data, STINFO01011_GRID_ID, true, 'number', 'STINFO01011', listObj.itp_STINFO01011_search, listObj.empty, true, data.gridRecords, true);
236
-                    var ids = $(STINFO01011_GRID_ID).getDataIDs();
237
-                    $.each(ids, function(idx, rowId) {
238
-                        $(STINFO01011_GRID_ID).jqGrid('setCell', rowId, 'brandId', '', ITP_GRID_COL_STYLE.link);
239
-                    });
240
-                },
241
-                onPaging: function(action) {
242
-                    itp_fn_grid_paging(STINFO01011_GRID_ID, action, param);
243
-                }
244
-            };
245
-            itp_fn_grid_make_remote(option);
246
-        },
247
-        clearData : function() {
248
-            $(STINFO01011_GRID_ID).jqGrid('clearGridData', true);
249
-            $(STINFO01011_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
250
-            $(STINFO01011_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
251
-            $(STINFO01011_GRID_EMPTY).show();
252
-        },
253
-        unload : function() {
254
-            $.jgrid.gridUnload(STINFO01011_GRID_ID);
255
-        }
256
-    }
257
-};
258
-
259 157
 /*상세화면 Object*/
260 158
 let viewObj = {
261 159
     init: function (param) {
@@ -315,6 +213,28 @@ let modifyObj = {
315 213
             const key = {brandId: brandIdVal, viewCd: 'R'};
316 214
             var param = $.param(key);
317 215
             modifyObj.load(param);
216
+        },
217
+        address: function() {
218
+            kakaoMap.address('ITP_FORM_STINFO01011_DETAIL');
219
+        },
220
+        save: function() {
221
+            const formId = '#ITP_FORM_STINFO01011_DETAIL';
222
+            itp_fn_form_event.removeChar('#ITP_FORM_STINFO01011_DETAIL');
223
+            itp_fn_form_clear_validate(null, formId);
224
+
225
+            if (itp_fn_form_event.isValid(formId)) {
226
+                let param = $(formId).serializeObject();
227
+                console.log(JSON.stringify(param));
228
+
229
+                var searhFn = function() {
230
+                    ITP_FORM_STINFO01011_DETAIL_IS_WRITING = false;
231
+                    viewObj.init();
232
+                };
233
+                fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
234
+            }
235
+        },
236
+        cancel: function () {
237
+            viewObj.init();
318 238
         }
319 239
     },
320 240
     load: function(param) {
@@ -365,60 +285,6 @@ let modifyObj = {
365 285
     }
366 286
 };
367 287
 
368
-/*신규화면 Object*/
369
-let createObj = {
370
-    init: function () {
371
-        this.button.init();
372
-        pageObj.fileUpload();
373
-        kakaoMap.init('ITP_FORM_STINFO01011_DETAIL', '');
374
-    },
375
-    button: {
376
-        init: function() {
377
-            // 가맹점 조회 버튼 클릭
378
-            $('#ITP_FORM_STINFO01011_DETAIL_SEARCH_AFFL_SHOP').one('click', function() {
379
-                createObj.popup();
380
-            });
381
-            // 가맹점 텍스트 삭제 버튼 클릭
382
-            $('#ITP_FORM_STINFO01011_DETAIL_DELETE_AFFL_SHOP').one('click', function() {
383
-                $('#ITP_FORM_STINFO01011_DETAIL_AFFL_SHOP_ID').val('');
384
-                $('#ITP_FORM_STINFO01011_DETAIL_AFFL_SHOP_NM').val('');
385
-            });
386
-        },
387
-        address: function() {
388
-            kakaoMap.address('ITP_FORM_STINFO01011_DETAIL');
389
-        },
390
-        save: function() {
391
-            const formId = '#ITP_FORM_STINFO01011_DETAIL';
392
-            itp_fn_form_event.removeChar('#ITP_FORM_STINFO01011_DETAIL');
393
-            itp_fn_form_clear_validate(null, formId);
394
-
395
-            if (itp_fn_form_event.isValid(formId)) {
396
-                let param = $(formId).serializeObject();
397
-                console.log(JSON.stringify(param));
398
-
399
-                var searhFn = function() {
400
-                    ITP_FORM_STINFO01011_DETAIL_IS_WRITING = false;
401
-                    listObj.grid.search();
402
-                };
403
-                fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
404
-            }
405
-        },
406
-        cancel: function () {
407
-            listObj.grid.search();
408
-        }
409
-    },
410
-    popup: function() {
411
-        var popFn = function(rowDataPop) {
412
-            // console.log(rowDataPop);
413
-            if(rowDataPop.AFFL_SHOP) {
414
-                $('#ITP_FORM_STINFO01011_DETAIL_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
415
-                $('#ITP_FORM_STINFO01011_DETAIL_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
416
-            }
417
-        };
418
-        fn_call_popup('biz', 'BIZPOP_AFFL_SHOP', '#ITP_ASIDE', popFn, null, 'S');
419
-    }
420
-};
421
-
422 288
 /*가맹점 Object*/
423 289
 let afflShopObj = {
424 290
     init: function () {

+ 1 - 2
src/main/webapp/js/app/stinfo/ITP_STINFO03010.js

@@ -627,7 +627,6 @@ let createObj = {
627 627
 					$(STINFO03010_DETAIL_GRID_ID).jqGrid('saveCell', i+1, 2)
628 628
 				}
629 629
 				const rowData = $(STINFO03010_DETAIL_GRID_ID).getRowData();
630
-				console.log(rowData);
631 630
 				var gridUpdateData = pageObj.grid.changeRows(rowData);
632 631
 				$.each(rowData, function(key, value) {
633 632
 					if (value.viewCd !== 'R') {
@@ -651,7 +650,7 @@ let createObj = {
651 650
 					ITP_FORM_STINFO03010_DETAIL_IS_WRITING = false;
652 651
 					listObj.grid.search();
653 652
 				};
654
-				// fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
653
+				fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
655 654
 			}
656 655
 		}
657 656
 	}

+ 3 - 2
src/main/webapp/js/app/stinfo/ITP_STINFO05010.js

@@ -564,9 +564,9 @@ var popSearch = {
564 564
 		(id.lastIndexOf('DELETE') > -1 ? this.delete(id) : this.popup(id));
565 565
 	},
566 566
 	popup: function(id) {
567
-		var popId = id.lastIndexOf('ITEM') > -1 ? 'BIZPOP_STORE_ITEM' : 'BIZPOP_STORE_SPPLY';
567
+		var popId = id.lastIndexOf('ITEM') > -1 ? 'BIZPOP_NEW_ITEM' : 'BIZPOP_STORE_SPPLY';
568 568
 		var popFn = function(rowDataPop) {
569
-			console.log(rowDataPop);
569
+			
570 570
 			$.each(rowDataPop, function(key, value) {
571 571
 				if(id.indexOf('SEARCH') > -1) {
572 572
 					$('#ITP_FORM_STINFO05010_SEARCH_SPPLY_NM').val(rowDataPop.spplyNm);
@@ -576,6 +576,7 @@ var popSearch = {
576 576
 						$('#ITP_FORM_STINFO05010_DETAIL_ITEM_NM').val(rowDataPop.itemNm);
577 577
 						$('#ITP_FORM_STINFO05010_DETAIL_SCH_ITEM_ID').val(rowDataPop.itemId);
578 578
 						$('#ITP_FORM_STINFO05010_DETAIL_SCH_ITEM_NM').val(rowDataPop.itemNm);
579
+						$('#ITP_FORM_STINFO05010_DETAIL_UNIT').val(rowDataPop.unit);
579 580
 					} else {
580 581
 						$('#ITP_FORM_STINFO05010_DETAIL_SPPLY_ID').val(rowDataPop.spplyId);
581 582
 						$('#ITP_FORM_STINFO05010_DETAIL_SPPLY_NM').val(rowDataPop.spplyNm);

+ 1 - 1
src/main/webapp/mobile/app/mpomng/MPOMNG01010.html

@@ -132,7 +132,7 @@
132 132
         <div class="line">
133 133
           <label>구매요청금액</label>
134 134
           <div class="line_right">
135
-            <div class="fnPchReqAmt">0원</div
135
+            <div class="fnPchReqAmt">0원</div>
136 136
           </div>
137 137
         </div>
138 138
         <div class="line">

+ 15 - 13
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -78,6 +78,7 @@ let contPopObj = {
78 78
 	list: {
79 79
 		addRow: function() {
80 80
 			var _this = this;
81
+			$('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWS').empty();
81 82
 			var callbackFn = function(result) {
82 83
 				mobPopObj.addRow.init(result);
83 84
 			};
@@ -95,24 +96,25 @@ let mobPopObj = {
95 96
 	addRow: {
96 97
 		rows: [],
97 98
 		init: function(rows) {
98
-			this.rows = rows;
99
+			this.rows = rows.gridRows;
99 100
 			mobPopObj.show('ITP_POP_MPOMNG01010_ITEM_NM');
100 101
 			this.view();
101 102
 		},
102 103
 		view: function() {
103 104
 			$.each(this.rows, function (i, item) {
104
-				$('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWS').append($('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY').html());
105
-				var li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWS .panel-group > .row_2:last');
106
-				$(li).find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
107
-				$(li).find('.fnItemNm').text(item.itemNm);
108
-				$(li).data('brandUnitUnqNo', item.brandUnitUnqNo);
109
-				$(li).data('podrPssblDvsn', item.podrPssblDvsn);
110
-				$(li).data('spplyId', item.spplyId);
111
-				$(li).data('stddQty', item.stddQty);
112
-				$(li).data('storeUnitUnqNo', item.storeUnitUnqNo);
113
-				$(li).data('unit', item.unit);
114
-				$(li).data('unitAmt', item.unitAmt);
115
-				$(li).data('unitGubun', item.unitGubun);
105
+				$('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY').html());
106
+				var $li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group > .row_2:last');
107
+				$li.data('brandUnitUnqNo', item.brandUnitUnqNo);
108
+				$li.data('podrPssblDvsn', item.podrPssblDvsn);
109
+				$li.data('spplyId', item.spplyId);
110
+				$li.data('stddQty', item.stddQty);
111
+				$li.data('storeUnitUnqNo', item.storeUnitUnqNo);
112
+				$li.data('unit', item.unit);
113
+				$li.data('unitAmt', item.unitAmt);
114
+				$li.data('unitGubun', item.unitGubun);
115
+				$li.find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
116
+				$li.find('.fnItemNm').text(item.itemNm);
117
+				$li.find('.fnItemNm').text(item.unitAmt);
116 118
 			});
117 119
 		},
118 120
 		search: function() {