浏览代码

운영관리 > 사용자관리/공지사항관리 수

juney 2 年之前
父节点
当前提交
6ffb9f4a67

+ 5 - 5
src/main/webapp/app/oper/OPER02010.html

@@ -24,8 +24,8 @@
24
 											<input type="text" id="ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM" class="form-control itp_input" name="safflShopNm" placeholder="가맹점" />
24
 											<input type="text" id="ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM" class="form-control itp_input" name="safflShopNm" placeholder="가맹점" />
25
 										</div>
25
 										</div>
26
 										<div class="col-xs-1 itp_in" style="width:8%; padding:0px;">
26
 										<div class="col-xs-1 itp_in" style="width:8%; padding:0px;">
27
-											<button type="button" id="ITP_FORM_OPER02010_SEARCH_AFFL_SHOP" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
28
-											<button type="button" id="ITP_FORM_OPER02010_DELETE_AFFL_SHOP" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
27
+											<button type="button" id="ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_BTN" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
28
+											<button type="button" id="ITP_FORM_OPER02010_DELETE_AFFL_SHOP_BTN" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
29
 										</div>
29
 										</div>
30
 										<div class="col-xs-2 itp_ip itp_noMar">
30
 										<div class="col-xs-2 itp_ip itp_noMar">
31
 											<select id="ITP_FORM_OPER02010_SEARCH_BRAND_ID" class="form-control itp_input" name="sbrandId"></select>
31
 											<select id="ITP_FORM_OPER02010_SEARCH_BRAND_ID" class="form-control itp_input" name="sbrandId"></select>
@@ -68,7 +68,7 @@
68
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_VIEW_CD" name="viewCd" value="C">
68
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_VIEW_CD" name="viewCd" value="C">
69
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_NTICE_NO" name="nticeNo" value="">
69
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_NTICE_NO" name="nticeNo" value="">
70
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_FILE_NO" name="fileNo" value="">
70
 								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_FILE_NO" name="fileNo" value="">
71
-								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_ID" name="afflShopId" value="">
71
+								<input type="hidden" id="ITP_FORM_OPER02010_DETAIL_AFFL_SHOP_ID" name="afflShopId" value="">
72
 
72
 
73
 								<section class="itp_form_sec">
73
 								<section class="itp_form_sec">
74
 									<h4 class="itp_form_tit">공지정보</h4>
74
 									<h4 class="itp_form_tit">공지정보</h4>
@@ -77,7 +77,7 @@
77
 											<label class="col-xs-2 itp_lb">가맹점</label>
77
 											<label class="col-xs-2 itp_lb">가맹점</label>
78
 											<div class="col-xs-4 itp_ip">
78
 											<div class="col-xs-4 itp_ip">
79
 												<div class="col-xs-6 itp_in" style="padding-right:5px;">
79
 												<div class="col-xs-6 itp_in" style="padding-right:5px;">
80
-													<input type="text" name="afflShopNm" id="ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM" class="form-control itp_input" placeholder="가맹점명">
80
+													<input type="text" name="afflShopNm" id="ITP_FORM_OPER02010_DETAIL_AFFL_SHOP_NM" class="form-control itp_input" placeholder="가맹점명">
81
 												</div>
81
 												</div>
82
 												<div class="col-xs-3 itp_in">
82
 												<div class="col-xs-3 itp_in">
83
 													<button type="button" id="ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP" class="btn btn-success btn-sm SEB"><i class="glyphicon glyphicon-search"></i></button>
83
 													<button type="button" id="ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP" class="btn btn-success btn-sm SEB"><i class="glyphicon glyphicon-search"></i></button>
@@ -87,7 +87,7 @@
87
 											<label class="col-xs-2 itp_lb">브랜드</label>
87
 											<label class="col-xs-2 itp_lb">브랜드</label>
88
 											<div class="col-xs-4 itp_ip">
88
 											<div class="col-xs-4 itp_ip">
89
 												<div class="col-xs-7 itp_in">
89
 												<div class="col-xs-7 itp_in">
90
-													<select id="ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID" class="form-control itp_input" name="brandId">
90
+													<select id="ITP_FORM_OPER02010_DETAIL_BRAND_ID" class="form-control itp_input" name="brandId">
91
 													</select>
91
 													</select>
92
 												</div>
92
 												</div>
93
 											</div>
93
 											</div>

+ 8 - 6
src/main/webapp/app/oper/OPER03010.html

@@ -32,10 +32,10 @@
32
 											</div>
32
 											</div>
33
 										</div>
33
 										</div>
34
 										<div class="col-xs-4 itp_ip itp_noMar">
34
 										<div class="col-xs-4 itp_ip itp_noMar">
35
-											<input type="text" id="ITP_FORM_OPER03010_SEARCH_AFFL_SHOP_NM" class="form-control itp_input" name="sAfflShopNm" placeholder="가맹점 명" />
35
+											<input type="text" id="ITP_FORM_OPER03010_SEARCH_AFFL_SHOP_NM" class="form-control itp_input" name="safflShopNm" placeholder="가맹점 명" />
36
 										</div>
36
 										</div>
37
 										<div class="col-xs-2 itp_ip itp_noMar">
37
 										<div class="col-xs-2 itp_ip itp_noMar">
38
-											<select id="ITP_FORM_OPER03010_SEARCH_ST_CD" class="form-control itp_input" name="sStCd"></select>
38
+											<select id="ITP_FORM_OPER03010_SEARCH_ST_CD" class="form-control itp_input" name="sstCd"></select>
39
 										</div>									
39
 										</div>									
40
 									</div>
40
 									</div>
41
 								</form>
41
 								</form>
@@ -65,7 +65,7 @@
65
 										<div class="form-group">
65
 										<div class="form-group">
66
 											<label class="col-xs-2 itp_lb">가맹점 아이디</label>
66
 											<label class="col-xs-2 itp_lb">가맹점 아이디</label>
67
 											<div class="col-xs-4 itp_ip">
67
 											<div class="col-xs-4 itp_ip">
68
-												<div class="col-xs-6 itp_in fnAfflShopId"></div>
68
+												<div class="col-xs-6 itp_in fnAfflShopId">(자동부여)</div>
69
 											</div>
69
 											</div>
70
 											<label class="col-xs-2 itp_lb">상태(*)</label>
70
 											<label class="col-xs-2 itp_lb">상태(*)</label>
71
 											<div class="col-xs-4 itp_ip">
71
 											<div class="col-xs-4 itp_ip">
@@ -77,7 +77,9 @@
77
 										<div class="form-group">
77
 										<div class="form-group">
78
 											<label class="col-xs-2 itp_lb">가맹점 명 *</label>
78
 											<label class="col-xs-2 itp_lb">가맹점 명 *</label>
79
 											<div class="col-xs-4 itp_ip">
79
 											<div class="col-xs-4 itp_ip">
80
-												<div class="col-xs-7 itp_in fnAfflShopNm"></div>
80
+												<div class="col-xs-7 itp_in">
81
+													<input type="text" id="ITP_FORM_OPER03010_DETAIL_AFFL_SHOP_NM" class="form-control itp_input" name="afflShopNm" value="">
82
+												</div>
81
 											</div>
83
 											</div>
82
 											<label class="col-xs-2 itp_lb">가맹점 KEY *<br>사용자 계정 추가-3자리</label>
84
 											<label class="col-xs-2 itp_lb">가맹점 KEY *<br>사용자 계정 추가-3자리</label>
83
 											<div class="col-xs-4 itp_ip">
85
 											<div class="col-xs-4 itp_ip">
@@ -218,10 +220,10 @@
218
 													<button type="button" id="ITP_FORM_OPER03010_DETAIL_ADRES_SCH" class="btn btn-primary btn-sm SHOW" style="margin: -1px 0px 0px 3px;">&nbsp;&nbsp;주소검색&nbsp;&nbsp;</button>
220
 													<button type="button" id="ITP_FORM_OPER03010_DETAIL_ADRES_SCH" class="btn btn-primary btn-sm SHOW" style="margin: -1px 0px 0px 3px;">&nbsp;&nbsp;주소검색&nbsp;&nbsp;</button>
219
 												</div>
221
 												</div>
220
 												<div class="col-xs-4 itp_in" style="margin-right: 5px; margin-left:20px;">
222
 												<div class="col-xs-4 itp_in" style="margin-right: 5px; margin-left:20px;">
221
-													<input type="text" id="ITP_FORM_OPER03010_DETAIL_LOAD_ADDR" class="form-control itp_input" name="loadAddr" value="" readonly placeholder="기본주소">													
223
+													<input type="text" id="ITP_FORM_OPER03010_DETAIL_ADRES" class="form-control itp_input" name="loadAddr" value="" readonly placeholder="기본주소">
222
 												</div>
224
 												</div>
223
 												<div class="col-xs-4 itp_in">
225
 												<div class="col-xs-4 itp_in">
224
-													<input type="text" id="ITP_FORM_OPER03010_DETAIL_DTL_ADDR" class="form-control itp_input" name="dtlAddr" value="" placeholder="상세주소">													
226
+													<input type="text" id="ITP_FORM_OPER03010_DETAIL_ADRES_DTL" class="form-control itp_input" name="dtlAddr" value="" placeholder="상세주소">
225
 												</div>
227
 												</div>
226
 												
228
 												
227
 												<!-- 주소 맵 -->
229
 												<!-- 주소 맵 -->

+ 126 - 240
src/main/webapp/js/app/oper/ITP_OPER02010.js

@@ -21,11 +21,6 @@ const OPER02010_DETAIL_GRID_LIST = '#ITP_OPER02010_DETAIL_jqGrid_list';
21
 const OPER02010_DETAIL_GRID_PAGER = '#ITP_OPER02010_DETAIL_jqGridPager';
21
 const OPER02010_DETAIL_GRID_PAGER = '#ITP_OPER02010_DETAIL_jqGridPager';
22
 const OPER02010_DETAIL_GRID_EMPTY = '#ITP_OPER02010_DETAIL_jqGridEmpty';
22
 const OPER02010_DETAIL_GRID_EMPTY = '#ITP_OPER02010_DETAIL_jqGridEmpty';
23
 
23
 
24
-const OPER02010_BRAND_GRID_ID = '#ITP_OPER02010_BRAND_jqGrid';
25
-const OPER02010_BRAND_GRID_LIST = '#ITP_OPER02010_BRAND_jqGrid_list';
26
-const OPER02010_BRAND_GRID_PAGER = '#ITP_OPER02010_BRAND_jqGridPager';
27
-const OPER02010_BRAND_GRID_EMPTY = '#ITP_OPER02010_BRAND_jqGridEmpty';
28
-
29
 let ITP_FORM_OPER02010_DETAIL_IS_WRITING = false;
24
 let ITP_FORM_OPER02010_DETAIL_IS_WRITING = false;
30
 
25
 
31
 let NTICE_SAVE_NTICE = '/api/ntice/save-ntice';
26
 let NTICE_SAVE_NTICE = '/api/ntice/save-ntice';
@@ -86,33 +81,6 @@ const gridColModel = {
86
 			sortable: false, hidden: false
81
 			sortable: false, hidden: false
87
 		}
82
 		}
88
 	],
83
 	],
89
-	// 상세
90
-	view: [
91
-		{
92
-			index: 'VIEW_CD', name: 'viewCd',
93
-			label: ITP_MSG_LOCALE.label.viewCd,
94
-			width: '10', fixed: false, align: 'center',
95
-			sortable: false, hidden: true
96
-		},
97
-		{
98
-			index: 'NTICE_NO', name: 'nticeNo',
99
-			label: ITP_MSG_LOCALE.label.notiNo,
100
-			width: '10', fixed: false, align: 'center',
101
-			sortable: false, hidden: true
102
-		},
103
-		{
104
-			index: 'BRAND_ID', name: 'userId',
105
-			label: ITP_MSG_LOCALE.label.userId,
106
-			width: '20', fixed: false, align: 'center',
107
-			sortable: false, editable: false, edittype: 'text'
108
-		},
109
-		{
110
-			index: 'BRAND_NM', name: 'userNm',
111
-			label: ITP_MSG_LOCALE.label.userName,
112
-			width: '30', fixed: false, align: 'center',
113
-			sortable: false, editable: false, edittype: 'text'
114
-		}
115
-	],
116
 	detail: [
84
 	detail: [
117
 		{
85
 		{
118
 			index: 'VIEW_CD', name: 'viewCd',
86
 			index: 'VIEW_CD', name: 'viewCd',
@@ -200,6 +168,8 @@ let pageObj = {
200
 		},
168
 		},
201
 		ready: function () {
169
 		ready: function () {
202
 			listObj.init();
170
 			listObj.init();
171
+			// 가맹점 조회
172
+			afflShopObj.init();
203
 		}
173
 		}
204
 	},
174
 	},
205
 	event: {
175
 	event: {
@@ -298,77 +268,65 @@ let pageObj = {
298
 			$('#ITP_AJAX_OPER02010_DETAIL_CONTAINER').hide();
268
 			$('#ITP_AJAX_OPER02010_DETAIL_CONTAINER').hide();
299
 			$('#ITP_AJAX_OPER02010_VIEW_CONTAINER').show();
269
 			$('#ITP_AJAX_OPER02010_VIEW_CONTAINER').show();
300
 		}
270
 		}
301
-	}
302
-};
303
-
304
-/*가맹점 조회 Object*/
305
-let afflShopObj = {
306
-	init: function() {
307
-		(AUTH_TYPE_CD === '10' || AUTH_TYPE_CD === '20') ? this.action() : this.make();
308
 	},
271
 	},
309
-	button: function() {
310
-		var _this = this;
311
-		// 가맹점 조회 버튼 클릭
312
-		$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP').on('click', function() {
313
-			_this.popup('L');
314
-		});
315
-		// 가맹점 텍스트 삭제 버튼 클릭
316
-		$('#ITP_FORM_OPER02010_DELETE_AFFL_SHOP').on('click', function() {
317
-			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM').val('');
318
-			$('select#ITP_FORM_OPER02010_SEARCH_BRAND_ID option').remove();
319
-		});
320
-		// 신규등록 가맹점 조회 버튼 클릭
321
-		// $('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').on('click', function() {
322
-		// 	_this.popup('C');
323
-		// });
324
-		// 신규등록 가맹점 텍스트 삭제 버튼 클릭
325
-		$('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').on('click', function() {
326
-			$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
327
-			$('select#ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID option').remove();
328
-			$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD option:eq(0)').prop('selected', true);
329
-			$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').trigger('change');
330
-		});
331
-	},
332
-	make: function() {
333
-		$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP').hide();
334
-		$('#ITP_FORM_OPER02010_DELETE_AFFL_SHOP').hide();
335
-		if(AFFL_SHOP_LIST) {
336
-			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_ID').val(AFFL_SHOP_LIST[0].afflShopId);
337
-			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM').val(AFFL_SHOP_LIST[0].afflShopNm);
338
-		}
339
-		if(AFFL_BRAND_LIST) {
340
-			fn_make_select_brand(AFFL_BRAND_LIST, 'ITP_FORM_OPER02010_SEARCH_BRAND_ID');
341
-		}
342
-	},
343
-	action: function() {
344
-		this.button();
345
-	},
346
-	popup: function (view) {
347
-		// 팝업
348
-		var popFn = (view === 'C') ? this.callback.create : this.callback.list;
349
-		fn_call_popup('biz', 'BIZPOP_AFFL_SHOP', '#ITP_ASIDE', popFn, null, 'S');
350
-	},
351
-	callback: {
352
-		list: function(rowDataPop) {
353
-			// console.log(rowDataPop);
354
-			if(rowDataPop.AFFL_SHOP) {
355
-				$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
356
-				$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
357
-			}
358
-			if(rowDataPop.AFFL_BRAND) {
359
-				fn_make_select_brand(rowDataPop.AFFL_BRAND, 'ITP_FORM_OPER02010_SEARCH_BRAND_ID', true, '선택');
360
-				// fn_make_select_brand(rowDataPop.AFFL_BRAND, 'ITP_FORM_OPER02010_SEARCH_BRAND_ID');
361
-			}
272
+	grid: {
273
+		init: function() {
274
+			this.unload();
275
+			this.load();
362
 		},
276
 		},
363
-		create: function(rowDataPop) {
364
-			// console.log(rowDataPop);
365
-			if(rowDataPop.AFFL_SHOP) {
366
-				$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
367
-				$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
368
-			}
369
-			if(rowDataPop.AFFL_BRAND) {
370
-				fn_make_select_brand(rowDataPop.AFFL_BRAND, 'ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID', true, '선택');
371
-			}
277
+		load : function() {
278
+			let param = $('#ITP_FORM_OPER02010_DETAIL').serializeObject();
279
+			param.gridSize = $.jgrid.defaults.rowNum;
280
+			param.pagingYn = false; // 페이지안함
281
+
282
+			var option = {
283
+				gridId: OPER02010_DETAIL_GRID_ID,
284
+				colModel: gridColModel.detail,
285
+				param: JSON.stringify(param),
286
+				url: DOMAIN + NTICE_TARGET_GRID_LIST,
287
+				pager: OPER02010_DETAIL_GRID_PAGER,
288
+				multiselect: true,
289
+				rownumbers: false,
290
+				loadComplete: function(data) {
291
+					itp_fn_grid_load_complete(data, OPER02010_DETAIL_GRID_ID, true, undefined, 'OPER02010_DETAIL');
292
+				},
293
+				onPaging: function(action) {
294
+					var pagingFn = {
295
+						callBack: function(args) {
296
+							$(args).trigger('reloadGrid');
297
+						}
298
+					};
299
+					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
300
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, OPER02010_DETAIL_GRID_ID);
301
+						return 'stop';
302
+					} else {
303
+						itp_fn_grid_paging(OPER02010_DETAIL_GRID_ID, action, param);
304
+					}
305
+				},
306
+				onSortCol: function(index, columnIndex, sortOrder) {
307
+					var sortingFn = {
308
+						callBack: function(args) {
309
+							$(args).trigger('reloadGrid');
310
+						}
311
+					};
312
+					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
313
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, OPER02010_DETAIL_GRID_ID);
314
+						return 'stop';
315
+					} else {
316
+						itp_fn_grid_sorting(OPER02010_DETAIL_GRID_ID, index, sortOrder);
317
+					}
318
+				}
319
+			};
320
+			itp_fn_grid_make_remote(option);
321
+		},
322
+		clearData : function() {
323
+			$(OPER02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
324
+			$(OPER02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
325
+			$(OPER02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
326
+			$(OPER02010_DETAIL_GRID_EMPTY).show();
327
+		},
328
+		unload : function() {
329
+			$.jgrid.gridUnload(OPER02010_DETAIL_GRID_ID);
372
 		}
330
 		}
373
 	}
331
 	}
374
 };
332
 };
@@ -376,8 +334,6 @@ let afflShopObj = {
376
 /*목록화면 Object*/
334
 /*목록화면 Object*/
377
 let listObj = {
335
 let listObj = {
378
 	init: function () {
336
 	init: function () {
379
-		// 가맹점 조회
380
-		afflShopObj.init();
381
 		// Grid
337
 		// Grid
382
 		this.grid.init();
338
 		this.grid.init();
383
 	},
339
 	},
@@ -496,7 +452,7 @@ let viewObj = {
496
 		fn_ajax_call(NTICE_INFO_NTICE, param, this.callback, 'GET');
452
 		fn_ajax_call(NTICE_INFO_NTICE, param, this.callback, 'GET');
497
 	},
453
 	},
498
 	callback: function (result) {
454
 	callback: function (result) {
499
-		// console.log(result);
455
+		console.log(result);
500
 		pageObj.switchScreen('VIEW');
456
 		pageObj.switchScreen('VIEW');
501
 		$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_USER_ID').val(result.nticeNo);
457
 		$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_USER_ID').val(result.nticeNo);
502
 		$('#ITP_FORM_OPER02010_VIEW .fnNticeTitl').text(result.nticeTitl);
458
 		$('#ITP_FORM_OPER02010_VIEW .fnNticeTitl').text(result.nticeTitl);
@@ -529,7 +485,7 @@ let viewObj = {
529
 
485
 
530
 			var option = {
486
 			var option = {
531
 				gridId: OPER02010_VIEW_GRID_ID,
487
 				gridId: OPER02010_VIEW_GRID_ID,
532
-				colModel: gridColModel.view,
488
+				colModel: gridColModel.detail,
533
 				param: JSON.stringify(param),
489
 				param: JSON.stringify(param),
534
 				url: DOMAIN + NTICE_TARGET_GRID_LIST,
490
 				url: DOMAIN + NTICE_TARGET_GRID_LIST,
535
 				pager: OPER02010_VIEW_GRID_PAGER,
491
 				pager: OPER02010_VIEW_GRID_PAGER,
@@ -653,66 +609,7 @@ let modifyObj = {
653
 
609
 
654
 		// 리스트 조회
610
 		// 리스트 조회
655
 		createObj.form.init();
611
 		createObj.form.init();
656
-		modifyObj.grid.init();
657
-	},
658
-	grid: {
659
-		init: function() {
660
-			this.unload();
661
-			this.load();
662
-		},
663
-		load : function() {
664
-			let param = $('#ITP_FORM_OPER02010_DETAIL').serializeObject();
665
-			param.gridSize = $.jgrid.defaults.rowNum;
666
-			param.pagingYn = false; // 페이지안함
667
-
668
-			var option = {
669
-				gridId: OPER02010_DETAIL_GRID_ID,
670
-				colModel: gridColModel.detail,
671
-				param: JSON.stringify(param),
672
-				url: DOMAIN + NTICE_TARGET_GRID_LIST,
673
-				pager: OPER02010_DETAIL_GRID_PAGER,
674
-				multiselect: true,
675
-				loadComplete: function(data) {
676
-					itp_fn_grid_load_complete(data, OPER02010_DETAIL_GRID_ID, true, undefined, 'OPER02010_DETAIL');
677
-				},
678
-				onPaging: function(action) {
679
-					var pagingFn = {
680
-						callBack: function(args) {
681
-							$(args).trigger('reloadGrid');
682
-						}
683
-					};
684
-					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
685
-						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, OPER02010_DETAIL_GRID_ID);
686
-						return 'stop';
687
-					} else {
688
-						itp_fn_grid_paging(OPER02010_DETAIL_GRID_ID, action, param);
689
-					}
690
-				},
691
-				onSortCol: function(index, columnIndex, sortOrder) {
692
-					var sortingFn = {
693
-						callBack: function(args) {
694
-							$(args).trigger('reloadGrid');
695
-						}
696
-					};
697
-					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
698
-						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, OPER02010_DETAIL_GRID_ID);
699
-						return 'stop';
700
-					} else {
701
-						itp_fn_grid_sorting(OPER02010_DETAIL_GRID_ID, index, sortOrder);
702
-					}
703
-				}
704
-			};
705
-			itp_fn_grid_make_remote(option);
706
-		},
707
-		clearData : function() {
708
-			$(OPER02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
709
-			$(OPER02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
710
-			$(OPER02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
711
-			$(OPER02010_DETAIL_GRID_EMPTY).show();
712
-		},
713
-		unload : function() {
714
-			$.jgrid.gridUnload(OPER02010_DETAIL_GRID_ID);
715
-		}
612
+		pageObj.grid.init();
716
 	}
613
 	}
717
 };
614
 };
718
 
615
 
@@ -720,14 +617,12 @@ let modifyObj = {
720
 let createObj = {
617
 let createObj = {
721
 	init: function () {
618
 	init: function () {
722
 		this.form.init();
619
 		this.form.init();
723
-		this.button.init();
724
 		this.load();
620
 		this.load();
725
 	},
621
 	},
726
 	form: {
622
 	form: {
727
 		init: function () {
623
 		init: function () {
728
 			this.selectbox();
624
 			this.selectbox();
729
 			this.checkbox();
625
 			this.checkbox();
730
-			this.button();
731
 		},
626
 		},
732
 		selectbox: function () {
627
 		selectbox: function () {
733
 			// 브랜드 selectbox 선택
628
 			// 브랜드 selectbox 선택
@@ -757,27 +652,13 @@ let createObj = {
757
 			$('#ITP_FORM_OPER02010_TARGET').find('input:checkbox').off('change').on('change', function() {
652
 			$('#ITP_FORM_OPER02010_TARGET').find('input:checkbox').off('change').on('change', function() {
758
 				$(this).next().val($(this).is(':checked') ? 'Y' : '');
653
 				$(this).next().val($(this).is(':checked') ? 'Y' : '');
759
 			});
654
 			});
760
-		},
761
-		button: function() {
762
-			// 신규등록 가맹점 조회 버튼 클릭
763
-			$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').off('click').on('click', function() {
764
-				afflShopObj.popup('C');
765
-			});
766
-			// 신규등록 가맹점 텍스트 삭제 버튼 클릭
767
-			$('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').off('click').on('click', function() {
768
-				$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
769
-				$('select#ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID option').remove();
770
-				$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD option:eq(0)').prop('selected', true);
771
-				$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').trigger('change');
772
-			});
773
 		}
655
 		}
774
 	},
656
 	},
775
 	button: {
657
 	button: {
776
-		init: function() {
777
-		},
778
 		addRow: function() {
658
 		addRow: function() {
779
 			// 팝업
659
 			// 팝업
780
 			var popFn = function(rowDataPop) {
660
 			var popFn = function(rowDataPop) {
661
+				console.log(rowDataPop);
781
 				// 기존등록 사용자ID
662
 				// 기존등록 사용자ID
782
 				var exists = '';
663
 				var exists = '';
783
 				const rowData = $(OPER02010_DETAIL_GRID_ID).getRowData();
664
 				const rowData = $(OPER02010_DETAIL_GRID_ID).getRowData();
@@ -831,6 +712,7 @@ let createObj = {
831
 						}
712
 						}
832
 					}
713
 					}
833
 				});
714
 				});
715
+				$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled', false);
834
 				let param = $(formId).serializeObject();
716
 				let param = $(formId).serializeObject();
835
 				param.gridInsertData = gridInsertData;
717
 				param.gridInsertData = gridInsertData;
836
 				param.gridUpdateData = gridUpdateData;
718
 				param.gridUpdateData = gridUpdateData;
@@ -867,64 +749,68 @@ let createObj = {
867
 		itp_fn_set_file_upload('ITP_OPER02010_DETAIL_UPLOAD', 'notice', true, false, 'OPER02010', fileArgs);
749
 		itp_fn_set_file_upload('ITP_OPER02010_DETAIL_UPLOAD', 'notice', true, false, 'OPER02010', fileArgs);
868
 
750
 
869
 		// 권한정보 리스트 조회
751
 		// 권한정보 리스트 조회
870
-		this.grid.init();
871
-	},
872
-	grid: {
873
-		init: function() {
874
-			this.unload();
875
-			this.load();
876
-		},
877
-		load: function() {
878
-			let param = $('#ITP_FORM_OPER02010_DETAIL').serializeObject();
879
-			param.gridSize = $.jgrid.defaults.rowNum;
880
-			param.pagingYn = false; // 페이지안함
752
+		pageObj.grid.init();
753
+	}
754
+};
881
 
755
 
882
-			var option = {
883
-				gridId: OPER02010_DETAIL_GRID_ID,
884
-				colModel: gridColModel.detail,
885
-				param: JSON.stringify(param),
886
-				url: DOMAIN + NTICE_TARGET_GRID_LIST,
887
-				pager: OPER02010_DETAIL_GRID_PAGER,
888
-				loadComplete: function(data) {
889
-					itp_fn_grid_load_complete(data, OPER02010_DETAIL_GRID_ID, true, undefined, 'OPER02010_DETAIL');
890
-				},
891
-				onPaging: function(action) {
892
-					var pagingFn = {
893
-						callBack: function(args) {
894
-							$(args).trigger('reloadGrid');
895
-						}
896
-					};
897
-					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
898
-						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, OPER02010_DETAIL_GRID_ID);
899
-						return 'stop';
900
-					} else {
901
-						itp_fn_grid_paging(OPER02010_DETAIL_GRID_ID, action, param);
902
-					}
903
-				},
904
-				onSortCol: function(index, columnIndex, sortOrder) {
905
-					var sortingFn = {
906
-						callBack: function(args) {
907
-							$(args).trigger('reloadGrid');
908
-						}
909
-					};
910
-					if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
911
-						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, OPER02010_DETAIL_GRID_ID);
912
-						return 'stop';
913
-					} else {
914
-						itp_fn_grid_sorting(OPER02010_DETAIL_GRID_ID, index, sortOrder);
915
-					}
916
-				}
917
-			};
918
-			itp_fn_grid_make_remote(option);
919
-		},
920
-		clearData : function() {
921
-			$(OPER02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
922
-			$(OPER02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
923
-			$(OPER02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
924
-			$(OPER02010_DETAIL_GRID_EMPTY).show();
925
-		},
926
-		unload : function() {
927
-			$.jgrid.gridUnload(OPER02010_DETAIL_GRID_ID);
756
+/*가맹점 조회 Object*/
757
+let afflShopObj = {
758
+	init: function() {
759
+		(AUTH_TYPE_CD === '10' || AUTH_TYPE_CD === '20') ? this.action() : this.make();
760
+	},
761
+	button: function() {
762
+		var _this = this;
763
+		// 가맹점 조회 버튼 클릭
764
+		$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_BTN').on('click', function() {
765
+			_this.popup('L');
766
+		});
767
+		// 가맹점 텍스트 삭제 버튼 클릭
768
+		$('#ITP_FORM_OPER02010_DELETE_AFFL_SHOP_BTN').on('click', function() {
769
+			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_ID').val('');
770
+			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM').val('');
771
+			$('select#ITP_FORM_OPER02010_SEARCH_BRAND_ID option').remove();
772
+		});
773
+		// 신규등록 가맹점 조회 버튼 클릭
774
+		$('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').on('click', function() {
775
+			_this.popup('C');
776
+		});
777
+		// 신규등록 가맹점 텍스트 삭제 버튼 클릭
778
+		$('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').on('click', function() {
779
+			$('#ITP_FORM_OPER02010_DETAIL_AFFL_SHOP_ID').val('');
780
+			$('#ITP_FORM_OPER02010_DETAIL_AFFL_SHOP_NM').val('');
781
+			$('select#ITP_FORM_OPER02010_DETAIL_BRAND_ID option').remove();
782
+			$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD option:eq(0)').prop('selected', true);
783
+			$('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').trigger('change');
784
+		});
785
+	},
786
+	make: function() {
787
+		$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP').hide();
788
+		$('#ITP_FORM_OPER02010_DELETE_AFFL_SHOP').hide();
789
+		if(AFFL_SHOP_LIST) {
790
+			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_ID').val(AFFL_SHOP_LIST[0].afflShopId);
791
+			$('#ITP_FORM_OPER02010_SEARCH_AFFL_SHOP_NM').val(AFFL_SHOP_LIST[0].afflShopNm);
792
+		}
793
+		if(AFFL_BRAND_LIST) {
794
+			fn_make_select_brand(AFFL_BRAND_LIST, 'ITP_FORM_OPER02010_SEARCH_BRAND_ID');
928
 		}
795
 		}
796
+	},
797
+	action: function() {
798
+		this.button();
799
+	},
800
+	popup: function (view) {
801
+		// 팝업
802
+		var popFn = function(rowDataPop) {
803
+			console.log(rowDataPop);
804
+			var id = (view === 'C') ? 'ITP_FORM_OPER02010_DETAIL' : 'ITP_FORM_OPER02010_SEARCH';
805
+			console.log(id);
806
+			if(rowDataPop.AFFL_SHOP) {
807
+				$('#'+ id + '_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
808
+				$('#'+ id + '_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
809
+			}
810
+			if(rowDataPop.AFFL_BRAND) {
811
+				fn_make_select_brand(rowDataPop.AFFL_BRAND, id + '_BRAND_ID', true, '선택');
812
+			}
813
+		};
814
+		fn_call_popup('biz', 'BIZPOP_AFFL_SHOP', '#ITP_ASIDE', popFn, null, 'S');
929
 	}
815
 	}
930
-};
816
+};

+ 17 - 16
src/main/webapp/js/app/oper/ITP_OPER03010.js

@@ -25,12 +25,12 @@ const OPER03010_DETAIL_GRID_EMPTY = '#ITP_OPER03010_DETAIL_jqGridEmpty';
25
 let ITP_FORM_OPER03010_DETAIL_IS_DUPLICATE = false;
25
 let ITP_FORM_OPER03010_DETAIL_IS_DUPLICATE = false;
26
 let ITP_FORM_OPER03010_DETAIL_IS_WRITING = false;
26
 let ITP_FORM_OPER03010_DETAIL_IS_WRITING = false;
27
 
27
 
28
-let AFFL_DETAIL_GRID_LIST = '/api/affl/detail-grid-list';
29
-let AFFL_INFO_AFFL = '/api/affl/info-affl';
30
-let COMPANY_INFO_COMPANY = '/api/affl/info-frcomp';
31
-let COMPANY_SAVE_COMPANY = '/api/affl/save-frcomp';
32
-let COMPANY_CHECK_DUPLICATE = '/api/affl/check-duplicate';
33
-let USER_INTI_USERPW = '/api/user/inti-userpw';
28
+let API_DETAIL_GRID_LIST = '/api/affl/detail-grid-list';
29
+let API_DETAIL_INFO = '/api/affl/info-affl';
30
+let COMPANY_INFO_COMPANY = '/api/affl/info-affl';
31
+let API_DETAIL_SAVE = '/api/affl/save-affi';
32
+let API_CHECK_DUPLICATE = '/api/affl/check-duplicate';
33
+let API_INTI_USERPW = '/api/user/inti-userpw';
34
 
34
 
35
 const gridColModel = {
35
 const gridColModel = {
36
 	// 목록
36
 	// 목록
@@ -295,7 +295,7 @@ let listObj = {
295
 				gridId: OPER03010_GRID_ID,
295
 				gridId: OPER03010_GRID_ID,
296
 				colModel: gridColModel.list,
296
 				colModel: gridColModel.list,
297
 				param: JSON.stringify(param),
297
 				param: JSON.stringify(param),
298
-				url: DOMAIN + AFFL_DETAIL_GRID_LIST,
298
+				url: DOMAIN + API_DETAIL_GRID_LIST,
299
 				pager: OPER03010_GRID_PAGER,
299
 				pager: OPER03010_GRID_PAGER,
300
 				onCellSelect: function(rowId, cellIdx, cellValue) {
300
 				onCellSelect: function(rowId, cellIdx, cellValue) {
301
 					var cm = $(this).jqGrid('getGridParam', 'colModel');
301
 					var cm = $(this).jqGrid('getGridParam', 'colModel');
@@ -361,7 +361,7 @@ let viewObj = {
361
 		this.load(param);
361
 		this.load(param);
362
 	},
362
 	},
363
 	load: function(param) {
363
 	load: function(param) {
364
-		fn_ajax_call(AFFL_INFO_AFFL, param, this.callback, 'GET');
364
+		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
365
 	},
365
 	},
366
 	callback:  function(result) {
366
 	callback:  function(result) {
367
 		console.log(result);
367
 		console.log(result);
@@ -412,6 +412,7 @@ let viewObj = {
412
 				colModel: gridColModel.detail,
412
 				colModel: gridColModel.detail,
413
 				data: saleList,
413
 				data: saleList,
414
 				pager: OPER03010_VIEW_GRID_PAGER,
414
 				pager: OPER03010_VIEW_GRID_PAGER,
415
+				multiselect: false
415
 			};
416
 			};
416
 			itp_fn_grid_make_local(option);
417
 			itp_fn_grid_make_local(option);
417
 		},
418
 		},
@@ -439,7 +440,7 @@ let modifyObj = {
439
 		}
440
 		}
440
 	},
441
 	},
441
 	load: function(param) {
442
 	load: function(param) {
442
-		fn_ajax_call(AFFL_INFO_AFFL, param, this.callback, 'GET');
443
+		fn_ajax_call(API_DETAIL_INFO, param, this.callback, 'GET');
443
 	},
444
 	},
444
 	callback: function(result) {
445
 	callback: function(result) {
445
 		console.log(result);
446
 		console.log(result);
@@ -533,7 +534,7 @@ let createObj = {
533
 				};
534
 				};
534
 				const key = {'cmpyCd':  $(formId + '_CMPY_CD').val()};
535
 				const key = {'cmpyCd':  $(formId + '_CMPY_CD').val()};
535
 				const param = $.param(key);
536
 				const param = $.param(key);
536
-				fn_ajax_call(COMPANY_CHECK_DUPLICATE, param, dupFn, 'GET');
537
+				fn_ajax_call(API_CHECK_DUPLICATE, param, dupFn, 'GET');
537
 			}
538
 			}
538
 		},
539
 		},
539
 		resetPass: function() {
540
 		resetPass: function() {
@@ -541,7 +542,7 @@ let createObj = {
541
 				callBack: function(args) {
542
 				callBack: function(args) {
542
 					const key = {'userId':  $('#ITP_FORM_OPER03010_DETAIL_CMPY_CD').val()};
543
 					const key = {'userId':  $('#ITP_FORM_OPER03010_DETAIL_CMPY_CD').val()};
543
 					const param = $.param(key);
544
 					const param = $.param(key);
544
-					fn_ajax_call(USER_INTI_USERPW, param, undefined, 'GET');
545
+					fn_ajax_call(API_INTI_USERPW, param, undefined, 'GET');
545
 				}
546
 				}
546
 			};
547
 			};
547
 			itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.askResetUserPw, resetPwFn, null);
548
 			itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.askResetUserPw, resetPwFn, null);
@@ -556,15 +557,15 @@ let createObj = {
556
 			new daum.Postcode({
557
 			new daum.Postcode({
557
 				oncomplete: function(data) {
558
 				oncomplete: function(data) {
558
 					// 전체주소 리턴
559
 					// 전체주소 리턴
559
-					document.getElementById('ITP_FORM_OPER03010_DETAIL_CMPY_ZIPNO').value = data.zonecode;
560
-					document.getElementById('ITP_FORM_OPER03010_DETAIL_CMPY_ADRES').value = data.roadAddress;
560
+					document.getElementById('ITP_FORM_OPER03010_DETAIL_ZIPNO').value = data.zonecode;
561
+					document.getElementById('ITP_FORM_OPER03010_DETAIL_ADRES').value = data.roadAddress;
561
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_LOTS_ADDRESS').value = !!data.autoJibunAddress ? data.autoJibunAddress : data.jibunAddress;
562
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_LOTS_ADDRESS').value = !!data.autoJibunAddress ? data.autoJibunAddress : data.jibunAddress;
562
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_STREET_ADDRESS').value = data.roadAddress;
563
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_STREET_ADDRESS').value = data.roadAddress;
563
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_HJ_DONG').value = !!data.hname ? data.hname : data.bname;
564
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_HJ_DONG').value = !!data.hname ? data.hname : data.bname;
564
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_BJ_DONG').value = data.bname;
565
 					document.getElementById('ITP_FORM_OPER03010_DETAIL_BJ_DONG').value = data.bname;
565
 
566
 
566
 					kakaoMap.init('ITP_FORM_OPER03010_DETAIL_MAP', data.roadAddress);
567
 					kakaoMap.init('ITP_FORM_OPER03010_DETAIL_MAP', data.roadAddress);
567
-					document.getElementById('ITP_FORM_OPER03010_DETAIL_CMPY_ADRES_DTL').focus();
568
+					document.getElementById('ITP_FORM_OPER03010_DETAIL_ADRES_DTL').focus();
568
 				}
569
 				}
569
 			}).open();
570
 			}).open();
570
 		},
571
 		},
@@ -648,7 +649,7 @@ let createObj = {
648
 						ITP_FORM_OPER03010_DETAIL_IS_WRITING = false;
649
 						ITP_FORM_OPER03010_DETAIL_IS_WRITING = false;
649
 						listObj.grid.search();
650
 						listObj.grid.search();
650
 					};
651
 					};
651
-					fn_ajax_call(COMPANY_SAVE_COMPANY, JSON.stringify(param), searhFn, 'POST');
652
+					fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
652
 				}
653
 				}
653
 			}
654
 			}
654
 		}
655
 		}
@@ -668,7 +669,7 @@ let createObj = {
668
 				gridId: OPER03010_DETAIL_GRID_ID,
669
 				gridId: OPER03010_DETAIL_GRID_ID,
669
 				colModel: gridColModel.detail,
670
 				colModel: gridColModel.detail,
670
 				param: JSON.stringify(param),
671
 				param: JSON.stringify(param),
671
-				url: DOMAIN + AFFL_DETAIL_GRID_LIST,
672
+				url: DOMAIN + API_DETAIL_GRID_LIST,
672
 				pager: OPER03010_DETAIL_GRID_PAGER,
673
 				pager: OPER03010_DETAIL_GRID_PAGER,
673
 				loadComplete: function(data) {
674
 				loadComplete: function(data) {
674
 					itp_fn_grid_load_complete(data, OPER03010_DETAIL_GRID_ID, true, undefined, 'OPER03010_DETAIL');
675
 					itp_fn_grid_load_complete(data, OPER03010_DETAIL_GRID_ID, true, undefined, 'OPER03010_DETAIL');

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

@@ -48,7 +48,7 @@ function itp_fn_BIZPOP_AFFL_BRAND(parentPopFn, args, returnType) {
48
 	    var selectedIds = $(THIS_GIRD_ID).getGridParam('selarrrow');
48
 	    var selectedIds = $(THIS_GIRD_ID).getGridParam('selarrrow');
49
 
49
 
50
 		if(selectedIds.length > 1) { // 1개만 선택
50
 		if(selectedIds.length > 1) { // 1개만 선택
51
-			return;
51
+			// return;
52
 		} 
52
 		} 
53
 		
53
 		
54
 	    for (var i=selectedIds.length-1; i>=0; i--) {
54
 	    for (var i=selectedIds.length-1; i>=0; i--) {