Преглед на файлове

재고 실사 작업중

marseyes преди 2 години
родител
ревизия
fb0e41999b

+ 61 - 25
src/main/webapp/app/stockmng/STOCKMNG02010.html

@@ -16,10 +16,13 @@
16 16
 						<div class="itp_srh_border fix">
17 17
 							<div class="col-xs-12">
18 18
 								<form id="ITP_FORM_STOCKMNG02010_SEARCH" class="form-horizontal">
19
+									<input type="hidden" id="ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID" name="sbrandId" value="">
20
+									<input type="hidden" id="ITP_FORM_STOCKMNG02010_SEARCH_STORE_ID" name="sstoreId" value="">
21
+								
19 22
 									<div class="form-group">
20 23
 										<div class="col-xs-10">
21 24
 											<div class="col-xs-2 itp_ip itp_noMar">
22
-												<select id="ITP_FORM_STOCKMNG02010_SERVICE_CDD_DT" class="form-control itp_input" name="serviceCddDt">
25
+												<select class="form-control itp_input">
23 26
 													<option value="">실사기준일</option>											
24 27
 												</select>
25 28
 											</div>
@@ -31,14 +34,10 @@
31 34
 												</div>
32 35
 											</div>
33 36
 											<div class="col-xs-2 itp_ip itp_noMar">
34
-												<select id="ITP_FORM_STOCKMNG02010_SEARCH_WHS_MGNT_BASE_INFO " class="form-control itp_input" name="sWhsMgntBaseInfo">
35
-													<option value="">창고</option>											
36
-												</select>	
37
+												<select id="ITP_FORM_STOCKMNG02010_SEARCH_WHS_ID" class="form-control itp_input" name="swhsId"></select>	
37 38
 											</div>
38 39
 											<div class="col-xs-3 itp_ip itp_noMar">
39
-												<select id="ITP_FORM_STOCKMNG02010_SEARCH_WHS_MGNT_BASE_LOC" class="form-control itp_input" name="sWhsMgntBaseLoc">
40
-													<option value="">판매용/B품/폐기품</option>											
41
-												</select>										
40
+												<select id="ITP_FORM_STOCKMNG02010_SEARCH_LOCATION" class="form-control itp_input" name="slocation"></select>										
42 41
 											</div>
43 42
 										</div>
44 43
 									</div>
@@ -55,30 +54,30 @@
55 54
 						</div>
56 55
 					</div>
57 56
 				</div>
58
-				<div id="ITP_AJAX_STOCKMNG02010_LIST_CONTAINER">
57
+				<div id="ITP_AJAX_STOCKMNG02010_DETAIL_CONTAINER">
59 58
 					<div class="itp_lg_form itp_type1 fix">
60 59
 						<div class="itp_srh_border fix">
61 60
 							<div class="col-xs-12">
62
-								<form id="ITP_FORM_STOCKMNG02010_SEARCH" class="form-horizontal">
61
+								<form id="ITP_FORM_STOCKMNG02010_DETAIL_SEARCH" class="form-horizontal">
63 62
 									<div class="form-group">
64 63
 										<div class="col-xs-10">
65 64
 											<div class="col-xs-2 itp_ip itp_noMar">
66
-												<select id="ITP_FORM_STOCKMNG02010_SERVICE_CDD_DT" class="form-control itp_input" name="serviceCddDt">
65
+												<select id="ITP_FORM_STOCKMNG02010_DETAIL_SERVICE_CDD_DT" class="form-control itp_input" name="serviceCddDt">
67 66
 													<option value="">실사기준일</option>											
68 67
 												</select>
69 68
 											</div>
70 69
 											<div class="col-xs-2 itp_ip itp_noMar">
71
-												<select id="ITP_FORM_STOCKMNG02010_SERVICE_WHS_NM" class="form-control itp_input" name="servicewhsNm">
70
+												<select id="ITP_FORM_STOCKMNG02010_DETAIL_SERVICE_WHS_NM" class="form-control itp_input" name="servicewhsNm">
72 71
 													<option value="">창고</option>											
73 72
 												</select>	
74 73
 											</div>
75 74
 											<div class="col-xs-3 itp_ip itp_noMar">
76
-												<select id="ITP_FORM_STOCKMNG02010_SEARCH_STCK_DVSN" class="form-control itp_input" name="sStckDvsn">
75
+												<select id="ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_STCK_DVSN" class="form-control itp_input" name="sStckDvsn">
77 76
 												<option value="">판매용/B품/폐기품</option>											
78 77
 												</select>										
79 78
 											</div>
80 79
 											<div class="col-xs-2 itp_ip">
81
-												<button type="button" id="ITP_BTN_STOCKMNG02010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;엑셀업로드&nbsp;&nbsp;</button>
80
+												<button type="button" id="ITP_BTN_STOCKMNG02010_DETAIL_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;엑셀업로드&nbsp;&nbsp;</button>
82 81
 											</div>
83 82
 										</div>
84 83
 									</div>
@@ -88,24 +87,61 @@
88 87
 					</div>
89 88
 					<div class="fix" style="padding-right:10px;">
90 89
 						<div class="pull-right itp_cicon">
91
-							<button type="button" id="ITP_BTN_STOCKMNG02010_ADDROW" class="btn btn-primary btn-sm ARB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;품목추가&nbsp;&nbsp;</button>
90
+							<button type="button" id="ITP_BTN_STOCKMNG02010_DETAIL_ADDROW" class="btn btn-primary btn-sm ARB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;품목추가&nbsp;&nbsp;</button>
92 91
 						</div>
93 92
 					</div>
94 93
 					<div class="itp_table fix">
95
-						<div id="ITP_STOCKMNG02010_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
96
-							<div id="ITP_STOCKMNG02010_jqGridView" class="itp_views fix"></div>
97
-							<table id="ITP_STOCKMNG02010_jqGrid"></table>
98
-							<div id="ITP_STOCKMNG02010_jqGridPager"></div>
99
-							<div id="ITP_STOCKMNG02010_jqGridEmpty" class="itp_no_data"></div>
94
+						<div id="ITP_STOCKMNG02010_DETAIL_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
95
+							<div id="ITP_STOCKMNG02010_DETAIL_jqGridView" class="itp_views fix"></div>
96
+							<table id="ITP_STOCKMNG02010_DETAIL_jqGrid"></table>
97
+							<div id="ITP_STOCKMNG02010_DETAIL_jqGridPager"></div>
98
+							<div id="ITP_STOCKMNG02010_DETAIL_jqGridEmpty" class="itp_no_data"></div>
100 99
 						</div>
101 100
 					</div>
102 101
 				</div>
103
-				<div class="itp_table fix">
104
-					<div id="ITP_STOCKMNG02010_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
105
-						<div id="ITP_STOCKMNG02010_jqGridView" class="itp_views fix"></div>
106
-						<table id="ITP_STOCKMNG02010_jqGrid"></table>
107
-						<div id="ITP_STOCKMNG02010_jqGridPager"></div>
108
-						<div id="ITP_STOCKMNG02010_jqGridEmpty" class="itp_no_data"></div>
102
+				<div id="ITP_AJAX_STOCKMNG02010_VIEW_CONTAINER">
103
+					<div class="itp_lg_form itp_type1 fix">
104
+						<div class="itp_srh_border fix">
105
+							<div class="col-xs-12">
106
+								<form id="ITP_FORM_STOCKMNG02010_VIEW_SEARCH" class="form-horizontal">
107
+									<div class="form-group">
108
+										<div class="col-xs-10">
109
+											<div class="col-xs-2 itp_ip itp_noMar">
110
+												<select id="ITP_FORM_STOCKMNG02010_VIEW_SERVICE_CDD_DT" class="form-control itp_input" name="serviceCddDt">
111
+													<option value="">실사기준일</option>											
112
+												</select>
113
+											</div>
114
+											<div class="col-xs-2 itp_ip itp_noMar">
115
+												<select id="ITP_FORM_STOCKMNG02010_VIEW_SERVICE_WHS_NM" class="form-control itp_input" name="servicewhsNm">
116
+													<option value="">창고</option>											
117
+												</select>	
118
+											</div>
119
+											<div class="col-xs-3 itp_ip itp_noMar">
120
+												<select id="ITP_FORM_STOCKMNG02010_VIEW_SEARCH_STCK_DVSN" class="form-control itp_input" name="sStckDvsn">
121
+												<option value="">판매용/B품/폐기품</option>											
122
+												</select>										
123
+											</div>
124
+											<div class="col-xs-2 itp_ip">
125
+												<button type="button" id="ITP_BTN_STOCKMNG02010_VIEW_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;엑셀업로드&nbsp;&nbsp;</button>
126
+											</div>
127
+										</div>
128
+									</div>
129
+								</form>
130
+							</div>
131
+						</div>
132
+					</div>
133
+					<div class="fix" style="padding-right:10px;">
134
+						<div class="pull-right itp_cicon">
135
+							<button type="button" id="ITP_BTN_STOCKMNG02010_VIEW_ADDROW" class="btn btn-primary btn-sm ARB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;품목추가&nbsp;&nbsp;</button>
136
+						</div>
137
+					</div>
138
+					<div class="itp_table fix">
139
+						<div id="ITP_STOCKMNG02010_VIEW_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
140
+							<div id="ITP_STOCKMNG02010_VIEW_jqGridView" class="itp_views fix"></div>
141
+							<table id="ITP_STOCKMNG02010_VIEW_jqGrid"></table>
142
+							<div id="ITP_STOCKMNG02010_VIEW_jqGridPager"></div>
143
+							<div id="ITP_STOCKMNG02010_VIEW_jqGridEmpty" class="itp_no_data"></div>
144
+						</div>
109 145
 					</div>
110 146
 				</div>
111 147
 			</div>

+ 0 - 1
src/main/webapp/js/app/stockmng/ITP_STOCKMNG01010.js

@@ -19,7 +19,6 @@ let STOCKMNG01010_DETAIL_GRID_LAST_ROW_ID;
19 19
 
20 20
 /*API URL*/
21 21
 let STOCK_MNG_DETAIL_GRID_LIST = '/api/stock/mng/detail-grid-list';
22
-let WHS_MNG_ADD_WHS = '/api/whs/mng/add-whs';
23 22
 let WHS_MNG_DETAIL_GRID_LIST = '/api/whs/mng/detail-grid-list';
24 23
 let WHS_MNG_LOCATION_GRID_LIST = '/api/whs/mng/location-grid-list';
25 24
 

+ 746 - 0
src/main/webapp/js/app/stockmng/ITP_STOCKMNG02010.js

@@ -0,0 +1,746 @@
1
+/********************************************************
2
+ --------------------------------------------------------
3
+ - Object 목록								            -
4
+ --------------------------------------------------------
5
+ * const gridColModel = {}	: 화면 Grid Object			*
6
+ * let pageObj = {}			: 화면공통 Object			*
7
+ * let listObj = {}			: 목록화면 Object			*
8
+ * let viewObj = {}			: 상세화면 Object			*
9
+ * let createObj = {}		: 신규화면 Object			*
10
+ * let locInfoObj = {}		: 로케이션정보 Object				*
11
+ *******************************************************/
12
+
13
+/*화면 변수*/
14
+const STOCKMNG02010_GRID_ID = '#ITP_STOCKMNG02010_jqGrid';
15
+const STOCKMNG02010_GRID_LIST = '#ITP_STOCKMNG02010_jqGrid_list';
16
+const STOCKMNG02010_GRID_PAGER = '#ITP_STOCKMNG02010_jqGridPager';
17
+const STOCKMNG02010_GRID_EMPTY = '#ITP_STOCKMNG02010_jqGridEmpty';
18
+
19
+const STOCKMNG02010_VIEW_GRID_ID = '#ITP_STOCKMNG02010_VIEW_jqGrid';
20
+const STOCKMNG02010_VIEW_GRID_LIST = '#ITP_STOCKMNG02010_VIEW_jqGrid_list';
21
+const STOCKMNG02010_VIEW_GRID_PAGER = '#ITP_STOCKMNG02010_VIEW_jqGridPager';
22
+const STOCKMNG02010_VIEW_GRID_EMPTY = '#ITP_STOCKMNG02010_VIEW_jqGridEmpty';
23
+
24
+const STOCKMNG02010_DETAIL_GRID_ID = '#ITP_STOCKMNG02010_DETAIL_jqGrid';
25
+const STOCKMNG02010_DETAIL_GRID_LIST = '#ITP_STOCKMNG02010_DETAIL_jqGrid_list';
26
+const STOCKMNG02010_DETAIL_GRID_PAGER = '#ITP_STOCKMNG02010_DETAIL_jqGridPager';
27
+const STOCKMNG02010_DETAIL_GRID_EMPTY = '#ITP_STOCKMNG02010_DETAIL_jqGridEmpty';
28
+
29
+let ITP_FORM_STOCKMNG02010_DETAIL_IS_DUPLICATE = false;
30
+let ITP_FORM_STOCKMNG02010_DETAIL_IS_WRITING = false;
31
+let STOCKMNG02010_DETAIL_GRID_LAST_ROW_ID;
32
+
33
+/* 공통코드 리스트 */
34
+// let ITP_COMMON_CD_STCK_DVSN = fn_make_common_cd_list(CODE_LIST, 'STCK_DVSN', true);
35
+// let ITP_COMMON_CD_LOC_ST_CD = fn_make_common_cd_list(CODE_LIST, 'LOC_ST_CD', true);
36
+
37
+/*API URL*/
38
+let WHS_MNG_INFO_WHS = '/api/whs/mng/info-whs';
39
+let WHS_MNG_ADD_WHS = '/api/whs/mng/add-whs';
40
+let WHS_MNG_MIDIFY_WHS = '/api/whs/mng/modify-whs';
41
+let WHS_MNG_REMOVE_WHS = '/api/whs/mng/remove-whs'; 
42
+
43
+let STOCK_CDD_DETAIL_GRID_LIST = '/api/stock/cdd/detail-grid-list';
44
+let WHS_MNG_DETAIL_GRID_LIST = '/api/whs/mng/detail-grid-list';
45
+let WHS_MNG_LOCATION_GRID_LIST = '/api/whs/mng/location-grid-list';
46
+
47
+/*화면 Grid ColModel*/
48
+const gridColModel = {
49
+	list: [
50
+		{
51
+			index: 'BRAND_ID', name: 'brandId',
52
+			label: "브랜드ID", 
53
+			width: '0', fixed: false, align: 'center',
54
+			sortable: false, hidden: true
55
+		},
56
+		{
57
+			index: 'STORE_ID', name: 'storeId',
58
+			label: "매장ID", 
59
+			width: '0', fixed: false, align: 'center',
60
+			sortable: false, hidden: true
61
+		},
62
+		{
63
+			index: 'BRAND_NM', name: 'brandNm',
64
+			label: ITP_MSG_LOCALE.label.brandNm, //브랜드
65
+			width: '13', fixed: false, align: 'center',
66
+			sortable: false, hidden: false
67
+		},
68
+		{
69
+			index: 'STORE_NM', name: 'storeNm',
70
+			label: "매장명", 
71
+			width: '13', fixed: false, align: 'center',
72
+			sortable: false, hidden: false
73
+		},
74
+		{
75
+			index: 'WHS_ID', name: 'whsId',
76
+			label: "창고번호", 
77
+			width: '8', fixed: false, align: 'center',
78
+			sortable: false, hidden: false
79
+		},
80
+		{
81
+			index: 'WHS_NM', name: 'whsNm',
82
+			label: "창고명", 
83
+			width: '13', fixed: false, align: 'center',
84
+			sortable: false, hidden: false
85
+		},
86
+		{
87
+			index: 'WHS_ST_NM', name: 'whsStNm',
88
+			label: ITP_MSG_LOCALE.label.status, //상태
89
+			width: '6', fixed: false, align: 'center',
90
+			sortable: false, hidden: false
91
+		},
92
+		{
93
+			index: 'MGR_NM', name: 'mgrNm',
94
+			label: "담당자명", 
95
+			width: '8', fixed: false, align: 'center',
96
+			sortable: false, hidden: false
97
+		},
98
+		{
99
+			index: 'MGR_TEL_NO', name: 'mgrTelNo',
100
+			label: "연락처", 
101
+			width: '8', fixed: false, align: 'center',
102
+			sortable: false, hidden: false
103
+		}
104
+	],
105
+	view: [
106
+		{
107
+			index: 'VIEW_CD', name: 'viewCd',
108
+			label: ITP_MSG_LOCALE.label.viewCd,
109
+			width: '10', fixed: false, align: 'center',
110
+			sortable: false, hidden: true
111
+		},		
112
+		{
113
+			index: 'LOCATION', name: 'location',
114
+			label: "로케이션",
115
+			width: '10', fixed: false, align: 'center',
116
+			sortable: false, editable: false, edittype: 'text',
117
+			editrules: {required: true}
118
+		},
119
+		{
120
+			index: 'LOCATION_NM', name: 'locationNm',
121
+			label: "로케이션명",
122
+			width: '12', fixed: false, align: 'center',
123
+			sortable: true, editable: false, edittype: 'text',
124
+			editrules: {required: true}
125
+		},
126
+		{
127
+			index: 'STCK_DVSN_NM', name: 'stckDvsnNm',
128
+			label: "관리등록",
129
+			width: '10', fixed: false, align: 'center',
130
+			sortable: false, editable: false, edittype: 'text'
131
+		},
132
+		{
133
+			index: 'LOC_ST_NM', name: 'locStNm',
134
+			label: "상태",
135
+			width: '10', fixed: false, align: 'center',
136
+			sortable: false, editable: false, edittype: 'text'
137
+		}
138
+	],
139
+	detail: [
140
+		{
141
+			index: 'VIEW_CD', name: 'viewCd',
142
+			label: ITP_MSG_LOCALE.label.viewCd,
143
+			width: '10', fixed: false, align: 'center',
144
+			sortable: false, hidden: true
145
+		},
146
+		{
147
+			index: 'LOCATION', name: 'location',
148
+			label: "로케이션",
149
+			width: '10', fixed: false, align: 'center',
150
+			sortable: false, editable: true, edittype: 'text',
151
+			editrules: {required: false}
152
+		},
153
+		{
154
+			index: 'LOCATION_NM', name: 'locationNm',
155
+			label: "로케이션명",
156
+			width: '12', fixed: false, align: 'center',
157
+			sortable: false, editable: true, edittype: 'text',
158
+			editrules: {required: true}
159
+		}
160
+	]
161
+};
162
+
163
+require(['config'], function() {
164
+	require([
165
+	], function($) {
166
+		pageObj.init();
167
+	});
168
+});
169
+
170
+/*화면공통 Object*/
171
+let pageObj = {
172
+	init: function () {
173
+		this.ui.init();
174
+		this.event.init();
175
+		locInfoObj.init();
176
+	},
177
+	ui: {
178
+		init: function () {
179
+			this.view();
180
+			this.grid();
181
+			this.ready();
182
+		},
183
+		view: function() {
184
+			// 버튼 권한설정
185
+			fn_proc_btn_auth('STOCKMNG02010');
186
+			
187
+			// 브랜드ID 지정
188
+			var data = JSON.parse(sessionStorage.getItem('itp_manage_brand_info'));
189
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID').val(data.brandId);
190
+			
191
+			pageObj.fnWhsList(function() {
192
+				pageObj.fnLocationList();
193
+			}); // 창고리스트
194
+			
195
+			// 공통코드 표시
196
+			// fn_make_select(CODE_LIST, 'WHS_DVSN', 'ITP_FORM_STOCKMNG02010_WHS_DVSN');			
197
+			// fn_make_select(CODE_LIST, 'WHS_ST_CD', 'ITP_FORM_STOCKMNG02010_WHS_ST_CD');
198
+			// fn_make_select(CODE_LIST, 'WHS_ST_CD', 'ITP_FORM_STOCKMNG02010_DETAIL_WHS_ST_CD', true, '선택');
199
+
200
+			// 조회일자 지정
201
+			var now = new Date();
202
+			$('#ITP_FORM_STOCKMNG02010_SEARCH .input-group.date').datepicker(ITP_DATE_LANGUAGE);
203
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
204
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_TO_DT').datepicker('setDate', new Date());
205
+					
206
+		},
207
+		grid: function() {
208
+			itp_fn_jqgrid_resize(STOCKMNG02010_GRID_ID, STOCKMNG02010_GRID_LIST, 'lg');
209
+			listObj.empty.init();
210
+			itp_fn_fire_window_resize();
211
+		},
212
+		ready: function() {
213
+			listObj.init();
214
+		}
215
+	},
216
+	event: {
217
+		init: function () {
218
+			this.button();
219
+			this.change();
220
+		},
221
+		button: function () {
222
+			// 버튼 클릭 이벤트
223
+			$('button').each(function() {
224
+				var id = $(this).attr('id');
225
+				$(this).on('click', function() {
226
+					switch (id) {
227
+						case 'ITP_BTN_STOCKMNG02010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
228
+						case 'ITP_BTN_STOCKMNG02010_NEWREG'				: listObj.button.create(); 		break;	// 신규등록 버튼
229
+						// case 'ITP_BTN_STOCKMNG02010_MODIFY'				: modifyObj.button.modify();	break;	// 수정 버튼
230
+						case 'ITP_BTN_STOCKMNG02010_CANCELLIST'			: createObj.button.cancel(); 	break;	// 취소/목록 버튼
231
+						case 'ITP_BTN_STOCKMNG02010_DELETE'				: 								break;	// 삭제 버튼
232
+						case 'ITP_BTN_STOCKMNG02010_SAVE'				: createObj.button.save(); 		break;	// 저장 버튼
233
+						case 'ITP_BTN_STOCKMNG02010_DETAIL_ADDROW'		: locInfoObj.button.addRow();	break;	// 상세:추가버튼
234
+						case 'ITP_BTN_STOCKMNG02010_DETAIL_DELROW'		: locInfoObj.button.delRow();	break;	// 상세:삭제버튼
235
+					}
236
+				});
237
+			});
238
+
239
+			$('body').on('click', function(e) {
240
+				var gridId = STOCKMNG02010_DETAIL_GRID_ID.replace('#', '');
241
+				var rids = $(STOCKMNG02010_DETAIL_GRID_ID).jqGrid('getDataIDs');
242
+				var last_row_id = rids[rids.length - 1];
243
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'STOCKMNG02010_DETAIL');
244
+			});
245
+
246
+		}, 
247
+		change: function () {
248
+			// 창고 변경
249
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_WHS_ID').on('change', function() {
250
+				pageObj.fnLocationList(function() {
251
+					listObj.button.search(); // 조회	
252
+				}); // 로케이션 리스트
253
+			});
254
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_LOCATION').on('change', function() {
255
+				listObj.button.search(); // 조회
256
+			});
257
+			
258
+		}
259
+	},
260
+	switchScreen: function(mode) {
261
+		if(mode == 'LIST') { // 목록
262
+			$('#ITP_BTN_STOCKMNG02010_MODIFY').hide();
263
+			$('#ITP_BTN_STOCKMNG02010_CANCELLIST').hide();
264
+			$('#ITP_BTN_STOCKMNG02010_DELETE').hide();
265
+			$('#ITP_BTN_STOCKMNG02010_SAVE').hide();
266
+			
267
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_SRH');
268
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_NEWREG');
269
+
270
+			$('#ITP_AJAX_STOCKMNG02010_LIST_CONTAINER').show();
271
+			$('#ITP_AJAX_STOCKMNG02010_DETAIL_CONTAINER').hide();
272
+			$('#ITP_AJAX_STOCKMNG02010_VIEW_CONTAINER').hide();
273
+		} else if(mode == 'ADD') { // 등록
274
+			ITP_FORM_STOCKMNG02010_DETAIL_IS_DUPLICATE = true;
275
+
276
+			$('#ITP_BTN_STOCKMNG02010_SRH').hide();
277
+			$('#ITP_BTN_STOCKMNG02010_MODIFY').hide();
278
+			$('#ITP_BTN_STOCKMNG02010_NEWREG').hide();
279
+			$('#ITP_BTN_STOCKMNG02010_DELETE').hide();
280
+			
281
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_CANCELLIST');
282
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_SAVE');
283
+
284
+			$('#ITP_AJAX_STOCKMNG02010_LIST_CONTAINER').hide();
285
+			$('#ITP_AJAX_STOCKMNG02010_DETAIL_CONTAINER').show();
286
+			$('#ITP_AJAX_STOCKMNG02010_VIEW_CONTAINER').hide();
287
+						
288
+			var data = JSON.parse(sessionStorage.getItem('itp_manage_brand_info'));
289
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_VIEW_CD').val('C');
290
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_BRAND_ID').val(data.brandId);
291
+			$('#ITP_FORM_STOCKMNG02010_DETAIL .fnBrandNm').text(data.brandNm);
292
+			$('#ITP_FORM_STOCKMNG02010_DETAIL .fnWhsId').text('');
293
+			$('#ITP_FORM_STOCKMNG02010_DETAIL .fnRegDtm').text('');
294
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_STORE_ID').val('');
295
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_WHS_ID').val('');
296
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_WHS_ST_CD').val('');
297
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_WHS_NM').val('');
298
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_MGR_TEL_NO').val('');
299
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_MGR_NM').val('');
300
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_STORE_NM').val('');
301
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_ZIPNO').val('');
302
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_LOAD_ADDR').val('');
303
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_DTL_ADDR').val('');
304
+			
305
+		} else if(mode == 'MODIFY') { // 수정
306
+			$('#ITP_BTN_STOCKMNG02010_SRH').hide();
307
+			$('#ITP_BTN_STOCKMNG02010_MODIFY').hide();
308
+			$('#ITP_BTN_STOCKMNG02010_NEWREG').hide();
309
+			$('#ITP_BTN_STOCKMNG02010_DELETE').hide();
310
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_CANCELLIST');
311
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_SAVE');
312
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_RESET_PW');
313
+
314
+			$('#ITP_AJAX_STOCKMNG02010_LIST_CONTAINER').hide();
315
+			$('#ITP_AJAX_STOCKMNG02010_DETAIL_CONTAINER').show();
316
+			$('#ITP_AJAX_STOCKMNG02010_VIEW_CONTAINER').hide();
317
+			// $('#ITP_FORM_STOCKMNG02010_DETAIL_USER_ID').attr('readonly', true);
318
+			// $('#ITP_FORM_STOCKMNG02010_DETAIL_DUP').attr('disabled', true);
319
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP_NM').attr('readonly', true);
320
+
321
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP').hide();
322
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_DELETE_AFFL_SHOP').hide();
323
+		} else if(mode == 'VIEW') { // 보기
324
+			$('#ITP_BTN_STOCKMNG02010_SRH').hide();
325
+			$('#ITP_BTN_STOCKMNG02010_NEWREG').hide();
326
+			$('#ITP_BTN_STOCKMNG02010_DELETE').hide();
327
+			$('#ITP_BTN_STOCKMNG02010_SAVE').hide();
328
+			
329
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_MODIFY');
330
+			fn_show_btn_auth('#ITP_BTN_STOCKMNG02010_CANCELLIST');
331
+
332
+			$('#ITP_AJAX_STOCKMNG02010_LIST_CONTAINER').hide();
333
+			$('#ITP_AJAX_STOCKMNG02010_DETAIL_CONTAINER').hide();
334
+			$('#ITP_AJAX_STOCKMNG02010_VIEW_CONTAINER').show();
335
+		}
336
+	}, 
337
+	fnWhsList: function(fnCall) {
338
+		const brandIdVal = $('#ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID').val();	
339
+		const param = {sbrandId: brandIdVal, pagingYn: false};
340
+		
341
+		fn_ajax_call(WHS_MNG_DETAIL_GRID_LIST, JSON.stringify(param), function(result) {
342
+			
343
+			fn_make_select_whs(result.gridRows, 'ITP_FORM_STOCKMNG02010_SEARCH_WHS_ID');
344
+			
345
+			if (fnCall !== undefined || typeof fnCall !== 'undefined') fnCall();
346
+					
347
+		}, 'POST');
348
+	}, 
349
+	fnLocationList: function(fnCall) {
350
+		const brandIdVal = $('#ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID').val();	
351
+		const whsIdVal = $('#ITP_FORM_STOCKMNG02010_SEARCH_WHS_ID').val();	
352
+		const param = {brandId: brandIdVal, whsId: whsIdVal, pagingYn: false};
353
+		
354
+		fn_ajax_call(WHS_MNG_LOCATION_GRID_LIST, JSON.stringify(param), function(result) {
355
+			
356
+			fn_make_select_location(result.gridRows, 'ITP_FORM_STOCKMNG02010_SEARCH_LOCATION');
357
+			
358
+			if (fnCall !== undefined || typeof fnCall !== 'undefined') fnCall();
359
+					
360
+		}, 'POST');
361
+	}
362
+};
363
+
364
+/*목록화면 Object*/
365
+let listObj = {
366
+	init: function () {
367
+		this.grid.init();
368
+	},
369
+	itp_STOCKMNG02010_search: false,
370
+	button: {
371
+		search: function() {
372
+			listObj.itp_STOCKMNG02010_search = true;
373
+			let param = $('#ITP_FORM_STOCKMNG02010_SEARCH').serializeObject();
374
+			param.gridSize = $.jgrid.defaults.rowNum;
375
+			param.gridPage = $.jgrid.defaults.page;
376
+			$(STOCKMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
377
+		},
378
+		create: function() {
379
+			pageObj.switchScreen('ADD');			
380
+			itp_fn_form_clear_validate(null, '#ITP_FORM_STOCKMNG02010_DETAIL');						
381
+			// 로케이션 리스트 조회
382
+			createObj.init();
383
+		}
384
+	},
385
+	empty: {
386
+		init: function() {
387
+			var _this = this;
388
+			this.push();
389
+			$(STOCKMNG02010_GRID_EMPTY).on('click', function() {
390
+				_this.back();
391
+				_this.itp_STOCKMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
392
+				$(STOCKMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_STOCKMNG02010_param)}).trigger('reloadGrid');
393
+			});
394
+		},
395
+		itp_STOCKMNG02010_param: {},
396
+		push: function() {
397
+			let param = $('#ITP_FORM_STOCKMNG02010_SEARCH').serializeObject();
398
+			listObj.itp_STOCKMNG02010_param = param;
399
+		},
400
+		back: function() {
401
+			$('#ITP_FORM_STOCKMNG02010_DEVI_TP_CD').val(this.itp_STOCKMNG02010_param.deviTpCd);
402
+			$('#ITP_FORM_STOCKMNG02010_ORDER_YN').val(this.itp_STOCKMNG02010_param.orderYn);
403
+			$('#ITP_FORM_STOCKMNG02010_ADT_AUTH_CD').val(this.itp_STOCKMNG02010_param.adtAuthCd);
404
+			$('#ITP_FORM_STOCKMNG02010_EMAIL_RCV_YN').val(this.itp_STOCKMNG02010_param.emailRcvYn);
405
+			$('#ITP_FORM_STOCKMNG02010_MEMB_EXIT_DT').val(this.itp_STOCKMNG02010_param.membExitDt);
406
+			$('#ITP_FORM_STOCKMNG02010_FROM_DT').val(this.itp_STOCKMNG02010_param.fromDt);
407
+			$('#ITP_FORM_STOCKMNG02010_TO_DT').val(this.itp_STOCKMNG02010_param.toDt);
408
+			$('#ITP_FORM_STOCKMNG02010_KEYWORD').val(this.itp_STOCKMNG02010_param.keyword);
409
+		}
410
+	},
411
+	grid: {
412
+		init: function () {
413
+			// 데이터 없을때
414
+			listObj.empty.push();
415
+			this.search();
416
+		},
417
+		colModel: gridColModel.list,
418
+		search: function() {
419
+			pageObj.switchScreen('LIST');
420
+			this.unload();
421
+			this.load();
422
+		},
423
+		load: function() {
424
+			var data = JSON.parse(sessionStorage.getItem('itp_manage_brand_info'));
425
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID').val(data.brandId);
426
+			
427
+			let param = $('#ITP_FORM_STOCKMNG02010_SEARCH').serializeObject();
428
+			param.gridSize = $.jgrid.defaults.rowNum;
429
+
430
+			var option = {
431
+				gridId: STOCKMNG02010_GRID_ID,
432
+				colModel: gridColModel.list,
433
+				param: JSON.stringify(param),
434
+				url: DOMAIN + STOCK_CDD_DETAIL_GRID_LIST,
435
+				pager: STOCKMNG02010_GRID_PAGER,
436
+				onCellSelect: function(rowId, cellIdx, cellValue) {
437
+					var cm = $(this).jqGrid('getGridParam', 'colModel');
438
+					var colNm = cm[cellIdx].name;
439
+					if (colNm == 'whsNm') {
440
+						const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
441
+						const whsIdVal = $(this).jqGrid('getCell', rowId, 'whsId');
442
+						
443
+						const key = {brandId: brandIdVal, whsId: whsIdVal, viewCd: 'R'};
444
+						var param = $.param(key);
445
+						viewObj.init(param);
446
+					}
447
+				},
448
+				loadComplete: function(data) {
449
+					console.log(data);
450
+					itp_fn_grid_load_complete(data, STOCKMNG02010_GRID_ID, true, 'number', 'STOCKMNG02010', listObj.itp_STOCKMNG02010_search, listObj.empty, true, data.gridRecords, true);
451
+					var ids = $(STOCKMNG02010_GRID_ID).getDataIDs();
452
+					$.each(ids, function(idx, rowId) {
453
+						$(STOCKMNG02010_GRID_ID).jqGrid('setCell', rowId, 'whsNm', '', ITP_GRID_COL_STYLE.link);
454
+					});
455
+				},
456
+				onPaging: function(action) {
457
+					itp_fn_grid_paging(STOCKMNG02010_GRID_ID, action, param);
458
+				}
459
+			};
460
+			itp_fn_grid_make_remote(option);
461
+		},
462
+		clearData : function() {
463
+			$(STOCKMNG02010_GRID_ID).jqGrid('clearGridData', true);
464
+			$(STOCKMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
465
+			$(STOCKMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
466
+			$(STOCKMNG02010_GRID_EMPTY).show();
467
+		},
468
+		unload : function() {
469
+			$.jgrid.gridUnload(STOCKMNG02010_GRID_ID);
470
+		}
471
+	}
472
+};
473
+
474
+/*상세화면 Object*/
475
+let viewObj = {
476
+	init: function (param) {
477
+		this.load(param);
478
+	},
479
+	load: function(param) {
480
+		fn_ajax_call(WHS_MNG_INFO_WHS, param, this.callback, 'GET');
481
+	},
482
+	callback: function (result) {
483
+		// console.log(result);
484
+		pageObj.switchScreen('VIEW');
485
+		$('#ITP_FORM_STOCKMNG02010_VIEW #ITP_FORM_STOCKMNG02010_VIEW_BRAND_ID').val(result.brandId);
486
+		$('#ITP_FORM_STOCKMNG02010_VIEW #ITP_FORM_STOCKMNG02010_VIEW_STORE_ID').val(result.storeId);
487
+		$('#ITP_FORM_STOCKMNG02010_VIEW #ITP_FORM_STOCKMNG02010_VIEW_WHS_ID').val(result.whsId);
488
+		
489
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnBrandNm').text(result.brandNm);
490
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnStCd').text(result.whsStNm);
491
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnWhsId').text(result.whsId);
492
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnWhsNm').text(result.whsNm);
493
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnTelNo').text(result.mgrTelNo);
494
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnMgrNm').text(result.mgrNm);		
495
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnSpplyNm').text(result.storeNm ? result.storeNm : '');		
496
+		$('#ITP_FORM_STOCKMNG02010_VIEW .fnRegDtm').text(result.sysRegDttm);
497
+		if(result.zipNo) {
498
+			$('#ITP_FORM_STOCKMNG02010_VIEW .fnAddress').text('('+result.zipNo+') ' + result.addr1 + ' ' + result.addr2);	
499
+		}		
500
+
501
+		// 권한정보 리스트 조회
502
+		viewObj.grid.init();
503
+	},
504
+	grid: {
505
+		init: function() {
506
+			this.unload();
507
+			this.load();
508
+		},
509
+		load : function() {
510
+			let param = $('#ITP_FORM_STOCKMNG02010_VIEW').serializeObject();
511
+			param.gridSize = $.jgrid.defaults.rowNum;
512
+			param.pagingYn = false; // 페이징안함
513
+
514
+			var option = {
515
+				gridId: STOCKMNG02010_VIEW_GRID_ID,
516
+				colModel: gridColModel.view,
517
+				param: JSON.stringify(param),
518
+				url: DOMAIN + WHS_MNG_LOCATION_GRID_LIST,
519
+				pager: STOCKMNG02010_VIEW_GRID_PAGER,
520
+				loadComplete: function(data) {
521
+					itp_fn_grid_load_complete(data, STOCKMNG02010_VIEW_GRID_ID, true, undefined, 'STOCKMNG02010_VIEW');
522
+				},
523
+				onPaging: function(action) {
524
+					var pagingFn = {
525
+						callBack: function(args) {
526
+							$(args).trigger('reloadGrid');
527
+						}
528
+					};
529
+					if (itp_fn_check_grid_is_writing(STOCKMNG02010_VIEW_GRID_ID)) {
530
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, STOCKMNG02010_VIEW_GRID_ID);
531
+						return 'stop';
532
+					} else {
533
+						itp_fn_grid_paging(STOCKMNG02010_VIEW_GRID_ID, action, param);
534
+					}
535
+				},
536
+				onSortCol: function(index, columnIndex, sortOrder) {
537
+					var sortingFn = {
538
+						callBack: function(args) {
539
+							$(args).trigger('reloadGrid');
540
+						}
541
+					};
542
+					if (itp_fn_check_grid_is_writing(STOCKMNG02010_VIEW_GRID_ID)) {
543
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, STOCKMNG02010_VIEW_GRID_ID);
544
+						return 'stop';
545
+					} else {
546
+						itp_fn_grid_sorting(STOCKMNG02010_VIEW_GRID_ID, index, sortOrder);
547
+					}
548
+				}
549
+			};
550
+			itp_fn_grid_make_remote(option);
551
+		},
552
+		clearData : function() {
553
+			$(STOCKMNG02010_VIEW_GRID_ID).jqGrid('clearGridData', true);
554
+			$(STOCKMNG02010_VIEW_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
555
+			$(STOCKMNG02010_VIEW_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
556
+			$(STOCKMNG02010_VIEW_GRID_EMPTY).show();
557
+		},
558
+		unload : function() {
559
+			$.jgrid.gridUnload(STOCKMNG02010_VIEW_GRID_ID);
560
+		}
561
+	}
562
+};
563
+
564
+/*신규화면 Object*/
565
+let createObj = {
566
+	init: function () {
567
+		this.unload();
568
+		this.load();
569
+	},
570
+	button: {
571
+		cancel: function() {
572
+			listObj.grid.search();
573
+		},
574
+		save: function() {
575
+			var detailViewCd = $('#ITP_FORM_STOCKMNG02010_DETAIL_VIEW_CD').val();
576
+			const formId = '#ITP_FORM_STOCKMNG02010_DETAIL';
577
+			itp_fn_form_clear_validate(null, formId);
578
+			
579
+			var vali_whsStatCd = itp_fn_form_validate(formId, formId + '_WHS_ST_CD', ['empty'], undefined); // 상태
580
+			var vali_whsNm = itp_fn_form_validate(formId, formId + '_WHS_NM', ['empty'], undefined);
581
+			
582
+			if (vali_whsStatCd && vali_whsNm) {
583
+				let gridInsertData = [];
584
+				let gridUpdateData = [];
585
+				let gridDeleteData = [];
586
+				const rowData = $(STOCKMNG02010_DETAIL_GRID_ID).getRowData();
587
+				// const keyValue = $(formId + '_WHS_ID').val();
588
+				$.each(rowData, function(key, value) {
589
+					if (value.viewCd != 'R') {
590
+						// value.whsId = keyValue;
591
+						if (value.viewCd == 'C') {
592
+							gridInsertData.push(value);
593
+						} else if (value.viewCd == 'U') {
594
+							gridUpdateData.push(value);
595
+						} else if (value.viewCd == 'D') {
596
+							gridDeleteData.push(value);
597
+						}
598
+					}
599
+				});
600
+				let param = $(formId).serializeObject();
601
+				param.gridInsertData = gridInsertData;
602
+				param.gridUpdateData = gridUpdateData;
603
+				param.gridDeleteData = gridDeleteData;
604
+				//console.log(JSON.stringify(param));
605
+				var searhFn = function() {
606
+					ITP_FORM_STOCKMNG02010_DETAIL_IS_WRITING = false;
607
+					listObj.grid.search();
608
+				};
609
+				fn_ajax_call(detailViewCd == 'C' ? WHS_MNG_ADD_WHS : WHS_MNG_MIDIFY_WHS, JSON.stringify(param), searhFn, 'POST');
610
+			}
611
+		}
612
+	},
613
+	load: function () {
614
+		let param = $('#ITP_FORM_STOCKMNG02010_DETAIL').serializeObject();
615
+		param.gridSize = $.jgrid.defaults.rowNum;
616
+		param.pagingYn = false; // 페이지안함
617
+
618
+		var option = {
619
+			gridId: STOCKMNG02010_DETAIL_GRID_ID,
620
+			colModel: gridColModel.detail,
621
+			param: JSON.stringify(param),
622
+			url: DOMAIN + WHS_MNG_LOCATION_GRID_LIST,
623
+			pager: STOCKMNG02010_DETAIL_GRID_PAGER,
624
+			multiselect: true,
625
+			loadComplete: function(data) {
626
+				itp_fn_grid_load_complete(data, STOCKMNG02010_DETAIL_GRID_ID, true, undefined, 'STOCKMNG02010_DETAIL');
627
+			},
628
+			onPaging: function(action) {
629
+				var pagingFn = {
630
+					callBack: function(args) {
631
+						$(args).trigger('reloadGrid');
632
+					}
633
+				};
634
+				if (itp_fn_check_grid_is_writing(STOCKMNG02010_DETAIL_GRID_ID)) {
635
+					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, STOCKMNG02010_DETAIL_GRID_ID);
636
+					return 'stop';
637
+				} else {
638
+					itp_fn_grid_paging(STOCKMNG02010_DETAIL_GRID_ID, action, param);
639
+				}
640
+			},
641
+			onSortCol: function(index, columnIndex, sortOrder) {
642
+				var sortingFn = {
643
+					callBack: function(args) {
644
+						$(args).trigger('reloadGrid');
645
+					}
646
+				};
647
+				if (itp_fn_check_grid_is_writing(STOCKMNG02010_DETAIL_GRID_ID)) {
648
+					itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, STOCKMNG02010_DETAIL_GRID_ID);
649
+					return 'stop';
650
+				} else {
651
+					itp_fn_grid_sorting(STOCKMNG02010_DETAIL_GRID_ID, index, sortOrder);
652
+				}
653
+			}
654
+		};
655
+		itp_fn_grid_make_remote(option);
656
+	},
657
+	clearData : function() {
658
+		$(STOCKMNG02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
659
+		$(STOCKMNG02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
660
+		$(STOCKMNG02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
661
+		$(STOCKMNG02010_DETAIL_GRID_EMPTY).show();
662
+	},
663
+	unload : function() {
664
+		$.jgrid.gridUnload(STOCKMNG02010_DETAIL_GRID_ID);
665
+	}
666
+};
667
+
668
+/*로케이션정보 Object*/
669
+let locInfoObj = {
670
+	init: function () {
671
+		if(AUTH_TYPE_CD === '10' || AUTH_TYPE_CD === '20') {
672
+			this.action();
673
+		} else {
674
+			this.make();
675
+		}
676
+	},
677
+	button: {
678
+		addRow: function() {
679
+			// $(STOCKMNG02010_DETAIL_GRID_ID).jqGrid('addRow', {position: 'last'});
680
+			// $(STOCKMNG02010_DETAIL_GRID_EMPTY).hide();
681
+			STOCKMNG02010_DETAIL_GRID_LAST_ROW_ID = itp_fn_add_grid_row(STOCKMNG02010_DETAIL_GRID_ID, undefined, ['location'],'STOCKMNG02010_DETAIL');
682
+		},
683
+		delRow: function() {
684
+			itp_fn_grid_del_row(STOCKMNG02010_DETAIL_GRID_ID);
685
+		}
686
+	},
687
+	make: function() {
688
+		$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP').hide();
689
+		$('#ITP_FORM_STOCKMNG02010_DELETE_AFFL_SHOP').hide();
690
+		if(AFFL_SHOP_LIST) {
691
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP_ID').val(AFFL_SHOP_LIST[0].afflShopId);
692
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP_NM').val(AFFL_SHOP_LIST[0].afflShopNm);
693
+		}
694
+		if(AFFL_BRAND_LIST) {
695
+			fn_make_select_brand(AFFL_BRAND_LIST, 'ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID');
696
+		}
697
+	},
698
+	action: function () {
699
+		var _this = this;
700
+		// 로케이션정보 조회 버튼 클릭
701
+		$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP').on('click', function() {
702
+			_this.popup('L');
703
+		});
704
+		// 로케이션정보 텍스트 삭제 버튼 클릭
705
+		$('#ITP_FORM_STOCKMNG02010_DELETE_AFFL_SHOP').on('click', function() {
706
+			$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP_NM').val('');
707
+			$('select#ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID option').remove();
708
+		});
709
+		// 신규등록 로케이션정보 조회 버튼 클릭
710
+		$('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP').on('click', function() {
711
+			_this.popup('C');
712
+		});
713
+		// 신규등록 로케이션정보 텍스트 삭제 버튼 클릭
714
+		$('#ITP_FORM_STOCKMNG02010_DETAIL_DELETE_AFFL_SHOP').on('click', function() {
715
+			$('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
716
+			$('select#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_BRAND_ID option').remove();
717
+		});
718
+	},
719
+	popup: function (view) {
720
+		// 팝업
721
+		var popFn = (view === 'C') ? this.callback.create : this.callback.list;
722
+		fn_call_popup('biz', 'BIZPOP_AFFL_SHOP', '#ITP_ASIDE', popFn, null, 'S');
723
+	},
724
+	callback: {
725
+		list: function(rowDataPop) {
726
+			// console.log(rowDataPop);
727
+			if(rowDataPop.AFFL_SHOP) {
728
+				$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
729
+				$('#ITP_FORM_STOCKMNG02010_SEARCH_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
730
+			}
731
+			if(rowDataPop.AFFL_BRAND) {
732
+				fn_make_select_brand(rowDataPop.AFFL_BRAND, 'ITP_FORM_STOCKMNG02010_SEARCH_BRAND_ID', true, '선택');
733
+			}
734
+		},
735
+		create: function(rowDataPop) {
736
+			// console.log(rowDataPop);
737
+			if(rowDataPop.AFFL_SHOP) {
738
+				// $('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP_ID').val(rowDataPop.AFFL_SHOP.afflShopId);
739
+				// $('#ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_AFFL_SHOP_NM').val(rowDataPop.AFFL_SHOP.afflShopNm);
740
+			}
741
+			if(rowDataPop.AFFL_BRAND) {
742
+				fn_make_select_brand(rowDataPop.AFFL_BRAND, 'ITP_FORM_STOCKMNG02010_DETAIL_SEARCH_BRAND_ID', true, '선택');
743
+			}
744
+		}
745
+	}
746
+};