Quellcode durchsuchen

공급사 정산 요청 개발중

marseyes vor 2 Jahren
Ursprung
Commit
49ce912dcf

+ 14 - 16
src/main/webapp/app/vsettmng/VSETTMNG01010.html

@@ -5,15 +5,11 @@
5 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_VSETTMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8
-					<button type="button" id="ITP_BTN_VSETTMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;정산요청&nbsp;&nbsp;</button>
9
-					<button type="button" id="ITP_BTN_VSETTMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;요청&nbsp;&nbsp;</button>
8
+					<button type="button" id="ITP_BTN_VSETTMNG01010_NEWREG" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;정산요청&nbsp;&nbsp;</button>
9
+					<button type="button" id="ITP_BTN_VSETTMNG01010_REQUEST" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;요청&nbsp;&nbsp;</button>
10 10
 					<button type="button" id="ITP_BTN_VSETTMNG01010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i> &nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
11 11
 				</div>
12
-				<div style="top:0px; text-align:center; font-size:20px;">
13
-					<span style="text-decoration:underline; font-weight:600;">테스트공급업체</span>
14
-					<button type="button" id="ITP_BTN_VSETTMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
15
-					<button type="button" id="ITP_BTN_VSETTMNG01010_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
16
-				</div>
12
+				
17 13
 			</div>
18 14
 			<div class="itp_det_in">
19 15
 				<div id="ITP_AJAX_VSETTMNG01010_LIST_CONTAINER">
@@ -21,31 +17,33 @@
21 17
 						<div class="itp_srh_border fix">
22 18
 							<div class="col-xs-12">
23 19
 								<form id="ITP_FORM_VSETTMNG01010_SEARCH" class="form-horizontal">
20
+									<input type="hidden" id="ITP_FORM_VSETTMNG01010_SEARCH_BRAND_ID" name="sbrandId" value="">
21
+									<input type="hidden" id="ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID" name="sstoreId" value="">
22
+									<input type="hidden" id="ITP_FORM_VSETTMNG01010_SEARCH_SPPLY_ID" name="sspplyId" value="">
23
+								
24 24
 									<div class="form-group">
25
+										<!--  
25 26
 										<div class="col-xs-2 itp_ip itp_noMar">
26 27
 											<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_STORE_NM" class="form-control itp_input" name="sStoreNm" placeholder="매장명" />
27 28
 										</div>
28 29
 										<div class="col-xs-1 itp_in" style="padding-left: 5px; width:10%;">
29
-											<button type="button" id="ITP_BTN_VSETTMNG01010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
30
-											<button type="button" id="ITP_BTN_VSETTMNG01010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
30
+											<button type="button" id="ITP_BTN_VSETTMNG01010_STORE_SEARCH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
31
+											<button type="button" id="ITP_BTN_VSETTMNG01010_STORE_ERASE" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
31 32
 						                </div>
33
+						                -->
32 34
 						                <div class="col-xs-2 itp_ip itp_noMar" style="width:11%; top:3px;">
33 35
 						                	<label>입고/수거일자</label>
34 36
 						                </div>
35 37
 										<div class="col-xs-3 itp_ip itp_noMar">
36 38
 											<div class="input-daterange input-group date">
37
-												<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_" class="form-control itp_input" name="" value="">
39
+												<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="">
38 40
 												<span class="input-group-addon itp_date_to">~</span>
39
-												<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_COL_DT" class="form-control itp_input" name="colDt" value="">
41
+												<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="">
40 42
 											</div>
41 43
 										</div>
42 44
 										<div class="col-xs-2 itp_ip itp_noMar">
43
-											<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="품목명" />
45
+											<input type="text" id="ITP_FORM_VSETTMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목명" />
44 46
 										</div>
45
-										<div class="col-xs-1 itp_in" style="padding-left: 5px; width:10%;">
46
-											<button type="button" id="ITP_BTN_VSETTMNG01010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
47
-											<button type="button" id="ITP_BTN_VSETTMNG01010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
48
-						                </div>
49 47
 									</div>
50 48
 								</form>
51 49
 							</div>

+ 697 - 0
src/main/webapp/js/app/vsettmng/ITP_VSETTMNG01010.js

@@ -0,0 +1,697 @@
1
+/********************************************************
2
+ --------------------------------------------------------
3
+ - Object 목록								            -
4
+ --------------------------------------------------------
5
+ * const gridColModel = {}	: 화면 Grid Object			*
6
+ * let pageObj = {}			: 화면공통 Object			*
7
+ * let listObj = {}			: 목록화면 Object			*
8
+ * let modifyObj = {}			: 상세화면 Object			*
9
+ *******************************************************/
10
+
11
+/*화면 변수*/
12
+const VSETTMNG01010_GRID_ID = '#ITP_VSETTMNG01010_jqGrid';
13
+const VSETTMNG01010_GRID_LIST = '#ITP_VSETTMNG01010_jqGrid_list';
14
+const VSETTMNG01010_GRID_PAGER = '#ITP_VSETTMNG01010_jqGridPager';
15
+const VSETTMNG01010_GRID_EMPTY = '#ITP_VSETTMNG01010_jqGridEmpty';
16
+
17
+const VSETTMNG01010_DETAIL_GRID_ID = '#ITP_VSETTMNG01010_DETAIL_jqGrid';
18
+const VSETTMNG01010_DETAIL_GRID_LIST = '#ITP_VSETTMNG01010_DETAIL_jqGrid_list';
19
+const VSETTMNG01010_DETAIL_GRID_PAGER = '#ITP_VSETTMNG01010_DETAIL_jqGridPager';
20
+const VSETTMNG01010_DETAIL_GRID_EMPTY = '#ITP_VSETTMNG01010_DETAIL_jqGridEmpty';
21
+
22
+let ITP_FORM_VSETTMNG01010_DETAIL_IS_DUPLICATE = false;
23
+let ITP_FORM_VSETTMNG01010_DETAIL_IS_WRITING = false;
24
+let VSETTMNG01010_DETAIL_GRID_LAST_ROW_ID;
25
+
26
+/*API URL*/
27
+let STTL_REQ_DETAIL_GRID_LIST = '/api/sttl/req/detail-grid-list';
28
+let STTL_REQ_REQUEST_STTL = '/api/sttl/req/request-sttl';
29
+let STTL_REQ_REQUEST_STTL_PROC = '/api/sttl/req/request-sttl-proc';
30
+let STTL_REQ_INFO_STTL = '/api/sttl/req/info-sttl';
31
+let STTL_REQ_STL_GRID_LIST = '/api/sttl/req/stl-grid-list';
32
+
33
+let LOGIN_AUTH_TYPE_CD;
34
+
35
+/*화면 Grid ColModel*/
36
+const gridColModel = {
37
+	list: [
38
+		{
39
+			index: 'VIEW_CD', name: 'viewCd',
40
+			label: ITP_MSG_LOCALE.label.viewCd,
41
+			width: '10', fixed: false, align: 'center',
42
+			sortable: false, hidden: true
43
+		},
44
+		{
45
+			index: 'STTL_MGNT_UNQ_NO', name: 'sttlMgntUnqNo',
46
+			label: "정산관리고유번호", 
47
+			width: '0', fixed: false, align: 'center',
48
+			sortable: false, hidden: true
49
+		},
50
+		{
51
+			index: 'STTL_MGNT_DTL_NO', name: 'sttlMgntDtlNo',
52
+			label: '정산관리상세번호',
53
+			width: '10', fixed: false, align: 'center',
54
+			sortable: false, hidden: true
55
+		},
56
+		{
57
+			index: 'MGNT_UNQ_NO', name: 'mgntUnqNo',
58
+			label: '관리고유번호',
59
+			width: '10', fixed: false, align: 'center',
60
+			sortable: false, hidden: true
61
+		},
62
+		{
63
+			index: 'BRAND_NM', name: 'brandNm',
64
+			label: "브랜드",
65
+			width: '10', fixed: false, align: 'center',
66
+			sortable: false, hidden: false
67
+		},
68
+		{
69
+			index: 'STORE_NM', name: 'storeNm',
70
+			label: "매장명",
71
+			width: '10', fixed: false, align: 'center',
72
+			sortable: false, hidden: true
73
+		},
74
+		{
75
+			index: 'LOAN_DVSN', name: 'loanDvsn',
76
+			label: "정산타입", 
77
+			width: '8', fixed: false, align: 'center',
78
+			sortable: false, hidden: true
79
+		},
80
+		{
81
+			index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
82
+			label: "정산타입", 
83
+			width: '8', fixed: false, align: 'center',
84
+			sortable: false, hidden: true
85
+		},
86
+		{
87
+			index: 'STTL_ST_CD', name: 'sttlStCd',
88
+			label: "정산상태코드", 
89
+			width: '8', fixed: false, align: 'center',
90
+			sortable: false, hidden: true
91
+		},
92
+		{
93
+			index: 'STTL_ST_NM', name: 'sttlStNm',
94
+			label: "정산상태", 
95
+			width: '8', fixed: false, align: 'center',
96
+			sortable: false, hidden: false
97
+		},		
98
+		{
99
+			index: 'ITEM_ID', name: 'itemId',
100
+			label: "품목코드",
101
+			width: '10', fixed: false, align: 'center',
102
+			sortable: false, editable: false, edittype: 'text'
103
+		},
104
+		{
105
+			index: 'ITEM_NM', name: 'itemNm',
106
+			label: "품목명",
107
+			width: '10', fixed: false, align: 'center',
108
+			sortable: false, editable: false, edittype: 'text'
109
+		},
110
+		{
111
+			index: 'UNIT', name: 'unit',
112
+			label: "단위",
113
+			width: '6', fixed: false, align: 'center',
114
+			sortable: false, editable: false, edittype: 'text'
115
+		},
116
+		{
117
+			index: 'UNIT_AMT', name: 'unitAmt',
118
+			label: "단가",
119
+			width: '7', fixed: false, align: 'center',
120
+			sortable: false, editable: false, edittype: 'text', 
121
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
122
+		},
123
+		{
124
+			index: 'PODR_QTY', name: 'podrQty',
125
+			label: "발주수량",
126
+			width: '7', fixed: false, align: 'center',
127
+			sortable: false, editable: false, edittype: 'text', 
128
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
129
+		},
130
+		{
131
+			index: 'DLV_QTY', name: 'dlvQty',
132
+			label: "납품수량",
133
+			width: '7', fixed: false, align: 'center',
134
+			sortable: false, editable: false, edittype: 'text', 
135
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
136
+		},
137
+		{
138
+			index: 'WHS_COL_QTY', name: 'whsColQty',
139
+			label: "입고/수거수량",
140
+			width: '10', fixed: false, align: 'center',
141
+			sortable: false, editable: false, edittype: 'text', 
142
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
143
+		}, 
144
+		{
145
+			index: 'WHS_COL_DT', name: 'whsColDt',
146
+			label: "입고/수거일자",
147
+			width: '10', fixed: false, align: 'center',
148
+			sortable: false, editable: false, edittype: 'text'
149
+		},
150
+		{
151
+			index: 'WHS_COL_AMT', name: 'whsColAmt',
152
+			label: "입고/수거금액",
153
+			width: '10', fixed: false, align: 'center',
154
+			sortable: false, editable: false, edittype: 'text', 
155
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
156
+		},
157
+		{
158
+			index: 'STTL_DVSN', name: 'sttlDvsn',
159
+			label: "정산구분",
160
+			width: '8', fixed: false, align: 'center',
161
+			sortable: false, hidden: true
162
+		},
163
+		{
164
+			index: 'STTL_DVSN_NM', name: 'sttlDvsnNm',
165
+			label: "정산구분",
166
+			width: '8', fixed: false, align: 'center',
167
+			sortable: false, editable: false, edittype: 'text'
168
+		},
169
+		{
170
+			index: 'PODR_UNQ_NO', name: 'podrUnqNo',
171
+			label: "발주번호",
172
+			width: '8', fixed: false, align: 'center',
173
+			sortable: false, editable: false, edittype: 'text'
174
+		},
175
+		{
176
+			index: 'PODR_DTL_NO', name: 'podrDtlNo',
177
+			label: "발주항번",
178
+			width: '7', fixed: false, align: 'center',
179
+			sortable: false, editable: false, edittype: 'text'
180
+		}	
181
+	],
182
+	view: [
183
+		{
184
+			index: 'VIEW_CD', name: 'viewCd',
185
+			label: ITP_MSG_LOCALE.label.viewCd,
186
+			width: '10', fixed: false, align: 'center',
187
+			sortable: false, hidden: true
188
+		},
189
+		{
190
+			index: 'STTL_MGNT_DTL_NO', name: 'sttlMgntDtlNo',
191
+			label: '정산관리상세번호',
192
+			width: '10', fixed: false, align: 'center',
193
+			sortable: false, hidden: true
194
+		},		
195
+		{
196
+			index: 'BRAND_NM', name: 'brandNm',
197
+			label: "브랜드",
198
+			width: '10', fixed: false, align: 'center',
199
+			sortable: false, hidden: true
200
+		},
201
+		{
202
+			index: 'STORE_NM', name: 'storeNm',
203
+			label: "매장명",
204
+			width: '10', fixed: false, align: 'center',
205
+			sortable: false, hidden: true
206
+		},
207
+		{
208
+			index: 'ITEM_ID', name: 'itemId',
209
+			label: "품목코드",
210
+			width: '10', fixed: false, align: 'center',
211
+			sortable: false, editable: false, edittype: 'text'
212
+		},
213
+		{
214
+			index: 'ITEM_NM', name: 'itemNm',
215
+			label: "품목명",
216
+			width: '10', fixed: false, align: 'center',
217
+			sortable: false, editable: false, edittype: 'text'
218
+		},
219
+		{
220
+			index: 'UNIT', name: 'unit',
221
+			label: "단위",
222
+			width: '8', fixed: false, align: 'center',
223
+			sortable: false, editable: false, edittype: 'text'
224
+		},
225
+		{
226
+			index: 'UNIT_AMT', name: 'unitAmt',
227
+			label: "단가",
228
+			width: '8', fixed: false, align: 'center',
229
+			sortable: false, editable: false, edittype: 'text', 
230
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
231
+		},
232
+		{
233
+			index: 'PODR_QTY', name: 'podrQty',
234
+			label: "발주수량",
235
+			width: '8', fixed: false, align: 'center',
236
+			sortable: false, editable: false, edittype: 'text', 
237
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
238
+		},
239
+		{
240
+			index: 'DLV_QTY', name: 'dlvQty',
241
+			label: "납품수량",
242
+			width: '8', fixed: false, align: 'center',
243
+			sortable: false, editable: false, edittype: 'text', 
244
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
245
+		},
246
+		{
247
+			index: 'WHS_COL_QTY', name: 'whsColQty',
248
+			label: "입고/수거수량",
249
+			width: '8', fixed: false, align: 'center',
250
+			sortable: false, editable: false, edittype: 'text', 
251
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
252
+		}, 
253
+		{
254
+			index: 'WHS_COL_DT', name: 'whsColDt',
255
+			label: "입고/수거일자",
256
+			width: '8', fixed: false, align: 'center',
257
+			sortable: false, editable: false, edittype: 'text'
258
+		},
259
+		{
260
+			index: 'WHS_COL_AMT', name: 'whsColAmt',
261
+			label: "입고/수거금액",
262
+			width: '8', fixed: false, align: 'center',
263
+			sortable: false, editable: false, edittype: 'text', 
264
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
265
+		},
266
+		{
267
+			index: 'STTL_DVSN_NM', name: 'sttlDvsnNm',
268
+			label: "정산구분",
269
+			width: '8', fixed: false, align: 'center',
270
+			sortable: false, editable: false, edittype: 'text'
271
+		},
272
+		{
273
+			index: 'PODR_UNQ_NO', name: 'podrUnqNo',
274
+			label: "발주번호",
275
+			width: '8', fixed: false, align: 'center',
276
+			sortable: false, editable: false, edittype: 'text'
277
+		},
278
+		{
279
+			index: 'PODR_DTL_NO', name: 'podrDtlNo',
280
+			label: "발주항번",
281
+			width: '8', fixed: false, align: 'center',
282
+			sortable: false, editable: false, edittype: 'text'
283
+		}
284
+	]
285
+};
286
+
287
+require(['config'], function() {
288
+	require([
289
+		'kakao.map.util'
290
+	], function($) {
291
+		pageObj.init();
292
+	});
293
+});
294
+
295
+/*화면공통 Object*/
296
+let pageObj = {
297
+	init: function () {
298
+		this.ui.init();
299
+		this.event.init();
300
+	},
301
+	ui: {
302
+		init: function () {
303
+			this.view();
304
+			this.grid();
305
+			this.ready();
306
+		},
307
+		view: function() {
308
+			// 버튼 권한설정
309
+			fn_proc_btn_auth('VSETTMNG01010');
310
+			
311
+			// 공통코드 표시
312
+			$('select').each(function() {
313
+		        if($(this).data('select-code')) {
314
+		            fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
315
+		        }
316
+		    });
317
+
318
+			// 조회일자 지정
319
+			var now = new Date();
320
+			$('#ITP_TAB_VSETTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);			
321
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
322
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date());
323
+			
324
+			// 권한에 따라 매장값 설정
325
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
326
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_SPPLY_ID').val(fn_make_user_info.get('spplyId'));
327
+			LOGIN_AUTH_TYPE_CD = fn_make_user_info.get('authTpCd'); // 권한타입
328
+			if(LOGIN_AUTH_TYPE_CD == '50') {
329
+				$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val(fn_make_user_info.get('storeId'));
330
+				$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_NM').val(fn_make_user_info.get('storeNm'));	
331
+			}
332
+			
333
+		},
334
+		grid: function() {
335
+			itp_fn_jqgrid_resize(VSETTMNG01010_GRID_ID, VSETTMNG01010_GRID_LIST, 'lg');
336
+			listObj.empty.init();
337
+			itp_fn_fire_window_resize();
338
+		},
339
+		ready: function() {
340
+			listObj.init();
341
+		}
342
+	},
343
+	event: {
344
+		init: function () {
345
+			this.button();
346
+		},
347
+		button: function () {
348
+			// 버튼 클릭 이벤트
349
+			$('button').each(function() {
350
+				var id = $(this).attr('id');
351
+				$(this).on('click', function() {
352
+					switch (id) {
353
+						case 'ITP_BTN_VSETTMNG01010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
354
+						case 'ITP_BTN_VSETTMNG01010_CANCELLIST'		: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
355
+						case 'ITP_BTN_VSETTMNG01010_NEWREG'			: listObj.button.reqSttl();	break;	// 정산요청 버튼
356
+						case 'ITP_BTN_VSETTMNG01010_REQUEST'			: modifyObj.button.request();	break;	// 요청 버튼
357
+						case 'ITP_BTN_VSETTMNG01010_STORE_SEARCH'	: listObj.button.storePop();	break;	// 매장검색 팝업
358
+						case 'ITP_BTN_VSETTMNG01010_STORE_ERASE'		: listObj.button.storeErase();	break;	// 매장 지움
359
+					}
360
+				});
361
+			});
362
+
363
+			$('body').on('click', function(e) {
364
+				var gridId = VSETTMNG01010_DETAIL_GRID_ID.replace('#', '');
365
+				var rids = $(VSETTMNG01010_DETAIL_GRID_ID).jqGrid('getDataIDs');
366
+				var last_row_id = rids[rids.length - 1];
367
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'VSETTMNG01010_DETAIL');
368
+			});
369
+
370
+		}
371
+	},
372
+	switchScreen: function(mode) {
373
+		if(mode == 'LIST') { // 목록
374
+			$('#ITP_BTN_VSETTMNG01010_MODIFY').hide();
375
+			$('#ITP_BTN_VSETTMNG01010_CANCELLIST').hide();
376
+			$('#ITP_BTN_VSETTMNG01010_DELETE').hide();
377
+			$('#ITP_BTN_VSETTMNG01010_REQUEST').hide();
378
+			
379
+			if(LOGIN_AUTH_TYPE_CD == '50') { // 매장관리자
380
+				$('#ITP_BTN_VSETTMNG01010_STORE_SEARCH').hide();
381
+				$('#ITP_BTN_VSETTMNG01010_STORE_ERASE').hide();
382
+			} else {
383
+				$('#ITP_BTN_VSETTMNG01010_STORE_SEARCH').show();
384
+				$('#ITP_BTN_VSETTMNG01010_STORE_ERASE').show();
385
+			}
386
+			
387
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG01010_SRH');
388
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG01010_NEWREG');
389
+			
390
+			$('#ITP_AJAX_VSETTMNG01010_LIST_CONTAINER').show();
391
+			$('#ITP_AJAX_VSETTMNG01010_DETAIL_CONTAINER').hide();
392
+			
393
+		} else if(mode == 'DETAIL') { // 보기
394
+			$('#ITP_BTN_VSETTMNG01010_SRH').hide();
395
+			$('#ITP_BTN_VSETTMNG01010_NEWREG').hide();
396
+			$('#ITP_BTN_VSETTMNG01010_DELETE').hide();
397
+			
398
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG01010_REQUEST');
399
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG01010_CANCELLIST');
400
+
401
+			$('#ITP_AJAX_VSETTMNG01010_LIST_CONTAINER').hide();
402
+			$('#ITP_AJAX_VSETTMNG01010_DETAIL_CONTAINER').show();
403
+		}
404
+	}
405
+};
406
+
407
+/*목록화면 Object*/
408
+let listObj = {
409
+	init: function () {
410
+		this.grid.init();
411
+	},
412
+	itp_VSETTMNG01010_search: false,
413
+	button: {
414
+		search: function() {
415
+			listObj.itp_VSETTMNG01010_search = true;
416
+			let param = $('#ITP_FORM_VSETTMNG01010_SEARCH').serializeObject();
417
+			param.gridSize = $.jgrid.defaults.rowNum;
418
+			param.gridPage = $.jgrid.defaults.page;
419
+			$(VSETTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
420
+		},
421
+		reqSttl: function() { // 정산요청
422
+			// 매장선택 체크
423
+			// if($('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val() == '') {
424
+			// itp_fn_modal_alert_ajax('정산요청을 위한 매장을 선택하세요.');
425
+			// return;
426
+			// }
427
+		
428
+			// 그리드에서 최소1개는 선택해야 함
429
+			const rowKey = $(VSETTMNG01010_GRID_ID).getGridParam('selrow');
430
+		    if (!rowKey) {
431
+				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.noData);
432
+		    	return;
433
+		    }
434
+
435
+			var selectedIds = $(VSETTMNG01010_GRID_ID).getGridParam('selarrrow');
436
+			let sttlReqDataList = [];			
437
+			var check = true;
438
+			$.each(selectedIds, function(key, value) {
439
+				var sttlMgntUnqNo = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).sttlMgntUnqNo;				
440
+				var sttlMgntDtlNo = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).sttlMgntDtlNo;
441
+				var loanDvsn = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).loanDvsn;		// 여신구분
442
+				var sttlStCd = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).sttlStCd;		// 정산상태코드
443
+				var sttlDvsn = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).sttlDvsn;		// 정산구분
444
+				var mgntUnqNo = $(VSETTMNG01010_GRID_ID).jqGrid('getRowData', value).mgntUnqNo;
445
+								
446
+				if(sttlStCd == 'ST10' || sttlStCd == 'ST20') { // 정산요청 및 정산확정 건은 정산요청이 불가능 
447
+					check = false;	
448
+				}
449
+				let data = {}
450
+				data.sttlMgntUnqNo = sttlMgntUnqNo;
451
+				data.sttlMgntDtlNo = sttlMgntDtlNo;
452
+				data.loanDvsn = loanDvsn;
453
+				data.sttlDvsn = sttlDvsn;
454
+				data.mgntUnqNo = mgntUnqNo;
455
+				sttlReqDataList.push(data);
456
+			});
457
+			if(!check) {
458
+				itp_fn_modal_alert_ajax('정산요청 및 확정된 건은 정산 요청이 불가능합니다.');
459
+				return;
460
+			}
461
+			
462
+			let param = {};
463
+			param.brandId = $('#ITP_FORM_VSETTMNG01010_SEARCH_BRAND_ID').val();
464
+			// param.storeId = $('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val();
465
+			param.spplyId = $('#ITP_FORM_VSETTMNG01010_SEARCH_SPPLY_ID').val();
466
+			param.sttlReqDataList = sttlReqDataList;
467
+			fn_ajax_call(STTL_REQ_REQUEST_STTL, JSON.stringify(param), function(result) {
468
+				
469
+				// alert(JSON.stringify(result));
470
+				// $('#ITP_FORM_VSETTMNG01010_DETAIL_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
471
+				
472
+				const sttlMgntUnqNoVal = result.sttlMgntUnqNo;
473
+				const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
474
+				var param = $.param(key);
475
+				modifyObj.init(param);
476
+				
477
+			}, 'POST');			
478
+		}, 
479
+		storePop: function() {
480
+			fn_call_popup('biz', 'BIZPOP_BRAND_STORE', '#ITP_ASIDE', function(result) {
481
+				// alert(JSON.stringify(result));
482
+				$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val(result[0].storeId);
483
+				$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_NM').val(result[0].storeNm);				
484
+				listObj.button.search();
485
+			}, null, 'S');
486
+		}, 
487
+		storeErase: function() {
488
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val('');
489
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_NM').val('');
490
+			listObj.button.search();
491
+		}
492
+	},
493
+	empty: {
494
+		init: function() {
495
+			var _this = this;
496
+			this.push();
497
+			$(VSETTMNG01010_GRID_EMPTY).on('click', function() {
498
+				_this.back();
499
+				_this.itp_VSETTMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
500
+				$(VSETTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_VSETTMNG01010_param)}).trigger('reloadGrid');
501
+			});
502
+		},
503
+		itp_VSETTMNG01010_param: {},
504
+		push: function() {
505
+			let param = $('#ITP_FORM_VSETTMNG01010_SEARCH').serializeObject();
506
+			listObj.itp_VSETTMNG01010_param = param;
507
+		},
508
+		back: function() {
509
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_ID').val(listObj.itp_VSETTMNG01010_param.sstoreId);
510
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_STORE_NM').val(listObj.itp_VSETTMNG01010_param.sstoreNm);
511
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_FROM_DT').val(listObj.itp_VSETTMNG01010_param.fromDt);
512
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_TO_DT').val(listObj.itp_VSETTMNG01010_param.toDt);
513
+			$('#ITP_FORM_VSETTMNG01010_SEARCH_ITEM_NM').val(listObj.itp_VSETTMNG01010_param.sitemNm);
514
+		}
515
+	},
516
+	grid: {
517
+		init: function () {
518
+			// 데이터 없을때
519
+			listObj.empty.push();
520
+			this.search();
521
+		},
522
+		colModel: gridColModel.list,
523
+		search: function() {
524
+			pageObj.switchScreen('LIST');
525
+			this.unload();
526
+			this.load();
527
+		},
528
+		load: function() {			
529
+			let param = $('#ITP_FORM_VSETTMNG01010_SEARCH').serializeObject();
530
+			param.gridSize = $.jgrid.defaults.rowNum;
531
+
532
+			var option = {
533
+				gridId: VSETTMNG01010_GRID_ID,
534
+				colModel: gridColModel.list,
535
+				param: param,
536
+				url: DOMAIN + STTL_REQ_DETAIL_GRID_LIST,
537
+				pager: VSETTMNG01010_GRID_PAGER,
538
+				multiselect: true, 
539
+				onCellSelect: function(rowId, cellIdx, cellValue) {
540
+					var cm = $(this).jqGrid('getGridParam', 'colModel');
541
+					var colNm = cm[cellIdx].name;
542
+					if (colNm == 'sttlReqDt') {
543
+						const sttlMgntUnqNoVal = $(this).jqGrid('getCell', rowId, 'sttlMgntUnqNo');
544
+						
545
+						const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
546
+						var param = $.param(key);
547
+						modifyObj.init(param);
548
+					}
549
+				},
550
+				loadComplete: function(data) {
551
+					console.log(data);
552
+					itp_fn_grid_load_complete(data, VSETTMNG01010_GRID_ID, true, 'number', 'VSETTMNG01010', listObj.itp_VSETTMNG01010_search, listObj.empty, true, data.gridRecords, true);
553
+					var ids = $(VSETTMNG01010_GRID_ID).getDataIDs();
554
+					$.each(ids, function(idx, rowId) {
555
+						// $(VSETTMNG01010_GRID_ID).jqGrid('setCell', rowId, 'sttlReqDt', '', ITP_GRID_COL_STYLE.link);
556
+					});
557
+				},
558
+				onPaging: function(action) {
559
+					itp_fn_grid_paging(VSETTMNG01010_GRID_ID, action, param);
560
+				}
561
+			};
562
+			itp_fn_grid_make_remote(option);
563
+		},
564
+		clearData : function() {
565
+			$(VSETTMNG01010_GRID_ID).jqGrid('clearGridData', true);
566
+			$(VSETTMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
567
+			$(VSETTMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
568
+			$(VSETTMNG01010_GRID_EMPTY).show();
569
+		},
570
+		unload : function() {
571
+			$.jgrid.gridUnload(VSETTMNG01010_GRID_ID);
572
+		}
573
+	}
574
+};
575
+
576
+/*상세화면 Object*/
577
+let modifyObj = {
578
+	init: function (param) {
579
+		this.load(param);
580
+	},
581
+	button: {
582
+		cancel: function() {
583
+			listObj.grid.search();
584
+		},
585
+		request: function() {
586
+			
587
+			const formId = '#ITP_FORM_VSETTMNG01010_DETAIL';
588
+			itp_fn_form_clear_validate(null, formId);
589
+			
590
+			var vali_sttlReqDt = itp_fn_form_validate(formId, formId + '_STTL_REQ_DT', ['empty'], undefined); // 정산요청일자
591
+			
592
+			if (vali_sttlReqDt) {
593
+				let sttlReqDataList = [];
594
+				const rowData = $(VSETTMNG01010_DETAIL_GRID_ID).getRowData();
595
+				// const keyValue = $(formId + '_WHS_ID').val();
596
+				$.each(rowData, function(key, value) {
597
+					sttlReqDataList.push(value);
598
+				});
599
+				let param = $(formId).serializeObject();
600
+				param.sttlReqDataList = sttlReqDataList;
601
+				
602
+				// console.log(JSON.stringify(param));
603
+				var confirmFn= {
604
+					callBack: function() {
605
+						//
606
+						var searhFn = function() {
607
+							ITP_FORM_VSETTMNG01010_DETAIL_IS_WRITING = false;
608
+							listObj.grid.search();
609
+						};
610
+						fn_ajax_call(STTL_REQ_REQUEST_STTL_PROC, JSON.stringify(param), searhFn, 'POST'); 	
611
+					}
612
+				};
613
+				itp_fn_modal_confirm(ITP_MSG_LOCALE.message.form.procData, confirmFn, null);				
614
+			}
615
+		}
616
+	}, 
617
+	load: function(param) {
618
+		fn_ajax_call(STTL_REQ_INFO_STTL, param, this.callback, 'GET');
619
+	},
620
+	callback: function (result) {
621
+		// console.log(result);
622
+		pageObj.switchScreen('DETAIL');
623
+		$('#ITP_FORM_VSETTMNG01010_DETAIL_BRAND_ID').val(result.brandId);
624
+		$('#ITP_FORM_VSETTMNG01010_DETAIL_STORE_ID').val(result.storeId);
625
+		$('#ITP_FORM_VSETTMNG01010_DETAIL_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
626
+		
627
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnBrandNm').text(result.brandNm);
628
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnStoreNm').text(result.storeNm);
629
+		$('#ITP_FORM_VSETTMNG01010_DETAIL_STTL_REQ_DT').val(result.sttlReqDt);
630
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnSttlStNm').text(result.sttlStNm);
631
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnSttlReqAmt').text(itp_fn_number_comma(result.sttlReqAmt));
632
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnAcctBal').text(itp_fn_number_comma(result.acctBal));
633
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnSysRegDttm').text(result.sysRegDttm);
634
+		$('#ITP_FORM_VSETTMNG01010_DETAIL .fnSysRegNm').text(result.sysRegNm);
635
+
636
+		// 리스트 조회
637
+		modifyObj.grid.init();
638
+	},
639
+	grid: {
640
+		init: function() {
641
+			this.unload();
642
+			this.load();
643
+		},
644
+		load : function() {
645
+			let param = $('#ITP_FORM_VSETTMNG01010_DETAIL').serializeObject();
646
+			param.gridSize = $.jgrid.defaults.rowNum;
647
+			param.pagingYn = false; // 페이징안함
648
+
649
+			var option = {
650
+				gridId: VSETTMNG01010_DETAIL_GRID_ID,
651
+				colModel: gridColModel.view,
652
+				param: param,
653
+				url: DOMAIN + STTL_REQ_STL_GRID_LIST,
654
+				pager: VSETTMNG01010_DETAIL_GRID_PAGER,
655
+				loadComplete: function(data) {
656
+					itp_fn_grid_load_complete(data, VSETTMNG01010_DETAIL_GRID_ID, true, undefined, 'VSETTMNG01010_DETAIL');
657
+				},
658
+				onPaging: function(action) {
659
+					var pagingFn = {
660
+						callBack: function(args) {
661
+							$(args).trigger('reloadGrid');
662
+						}
663
+					};
664
+					if (itp_fn_check_grid_is_writing(VSETTMNG01010_DETAIL_GRID_ID)) {
665
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, VSETTMNG01010_DETAIL_GRID_ID);
666
+						return 'stop';
667
+					} else {
668
+						itp_fn_grid_paging(VSETTMNG01010_DETAIL_GRID_ID, action, param);
669
+					}
670
+				},
671
+				onSortCol: function(index, columnIndex, sortOrder) {
672
+					var sortingFn = {
673
+						callBack: function(args) {
674
+							$(args).trigger('reloadGrid');
675
+						}
676
+					};
677
+					if (itp_fn_check_grid_is_writing(VSETTMNG01010_DETAIL_GRID_ID)) {
678
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, VSETTMNG01010_DETAIL_GRID_ID);
679
+						return 'stop';
680
+					} else {
681
+						itp_fn_grid_sorting(VSETTMNG01010_DETAIL_GRID_ID, index, sortOrder);
682
+					}
683
+				}
684
+			};
685
+			itp_fn_grid_make_remote(option);
686
+		},
687
+		clearData : function() {
688
+			$(VSETTMNG01010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
689
+			$(VSETTMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
690
+			$(VSETTMNG01010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
691
+			$(VSETTMNG01010_DETAIL_GRID_EMPTY).show();
692
+		},
693
+		unload : function() {
694
+			$.jgrid.gridUnload(VSETTMNG01010_DETAIL_GRID_ID);
695
+		}
696
+	}
697
+};

+ 625 - 0
src/main/webapp/js/app/vsettmng/ITP_VSETTMNG02010.js

@@ -0,0 +1,625 @@
1
+/********************************************************
2
+ --------------------------------------------------------
3
+ - Object 목록								            -
4
+ --------------------------------------------------------
5
+ * const gridColModel = {}	: 화면 Grid Object			*
6
+ * let pageObj = {}			: 화면공통 Object			*
7
+ * let listObj = {}			: 목록화면 Object			*
8
+ * let modifyObj = {}			: 상세화면 Object			*
9
+ *******************************************************/
10
+
11
+/*화면 변수*/
12
+const VSETTMNG02010_GRID_ID = '#ITP_VSETTMNG02010_jqGrid';
13
+const VSETTMNG02010_GRID_LIST = '#ITP_VSETTMNG02010_jqGrid_list';
14
+const VSETTMNG02010_GRID_PAGER = '#ITP_VSETTMNG02010_jqGridPager';
15
+const VSETTMNG02010_GRID_EMPTY = '#ITP_VSETTMNG02010_jqGridEmpty';
16
+
17
+const VSETTMNG02010_DETAIL_GRID_ID = '#ITP_VSETTMNG02010_DETAIL_jqGrid';
18
+const VSETTMNG02010_DETAIL_GRID_LIST = '#ITP_VSETTMNG02010_DETAIL_jqGrid_list';
19
+const VSETTMNG02010_DETAIL_GRID_PAGER = '#ITP_VSETTMNG02010_DETAIL_jqGridPager';
20
+const VSETTMNG02010_DETAIL_GRID_EMPTY = '#ITP_VSETTMNG02010_DETAIL_jqGridEmpty';
21
+
22
+let ITP_FORM_VSETTMNG02010_DETAIL_IS_DUPLICATE = false;
23
+let ITP_FORM_VSETTMNG02010_DETAIL_IS_WRITING = false;
24
+let VSETTMNG02010_DETAIL_GRID_LAST_ROW_ID;
25
+
26
+/*API URL*/
27
+let STTL_STATE_DETAIL_GRID_LIST = '/api/sttl/state/detail-grid-list';
28
+let STTL_STATE_STTL_END = '/api/sttl/state/sttl-end';
29
+
30
+let STTL_REQ_INFO_STTL = '/api/sttl/req/info-sttl';
31
+let STTL_REQ_STL_GRID_LIST = '/api/sttl/req/stl-grid-list';
32
+
33
+let LOGIN_AUTH_TYPE_CD;
34
+
35
+/*화면 Grid ColModel*/
36
+const gridColModel = {
37
+	list: [
38
+		{
39
+			index: 'VIEW_CD', name: 'viewCd',
40
+			label: ITP_MSG_LOCALE.label.viewCd,
41
+			width: '10', fixed: false, align: 'center',
42
+			sortable: false, hidden: true
43
+		},		
44
+		{
45
+			index: 'BRAND_NM', name: 'brandNm',
46
+			label: "브랜드",
47
+			width: '10', fixed: false, align: 'center',
48
+			sortable: false, hidden: true
49
+		},
50
+		{
51
+			index: 'STORE_NM', name: 'storeNm',
52
+			label: "매장명",
53
+			width: '10', fixed: false, align: 'center',
54
+			sortable: false, hidden: false
55
+		},
56
+		{
57
+			index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
58
+			label: "정산타입", 
59
+			width: '8', fixed: false, align: 'center',
60
+			sortable: false, hidden: false
61
+		},
62
+		{
63
+			index: 'SPPLY_NM', name: 'spplyNm',
64
+			label: "공급사명",
65
+			width: '10', fixed: false, align: 'center',
66
+			sortable: false, hidden: true
67
+		},
68
+		{
69
+			index: 'STTL_MGNT_UNQ_NO', name: 'sttlMgntUnqNo',
70
+			label: "정산번호", 
71
+			width: '10', fixed: false, align: 'center',
72
+			sortable: false, hidden: false
73
+		},
74
+		{
75
+			index: 'STTL_ST_CD', name: 'sttlStCd',
76
+			label: "정산상태코드", 
77
+			width: '8', fixed: false, align: 'center',
78
+			sortable: false, hidden: true
79
+		},
80
+		{
81
+			index: 'STTL_ST_NM', name: 'sttlStNm',
82
+			label: "정산상태", 
83
+			width: '10', fixed: false, align: 'center',
84
+			sortable: false, hidden: false
85
+		},		
86
+		{
87
+			index: 'STTL_REQ_DT', name: 'sttlReqDt',
88
+			label: "정산요청일",
89
+			width: '10', fixed: false, align: 'center',
90
+			sortable: false, editable: false, edittype: 'text'
91
+		},
92
+		{
93
+			index: 'STTL_REQ_AMT', name: 'sttlReqAmt',
94
+			label: "정산요청금액",
95
+			width: '10', fixed: false, align: 'center',
96
+			sortable: false, editable: false, edittype: 'text', 
97
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
98
+		}, 
99
+		{
100
+			index: 'STTL_DT', name: 'sttlDt',
101
+			label: "정산확정일",
102
+			width: '10', fixed: false, align: 'center',
103
+			sortable: false, editable: false, edittype: 'text'
104
+		},
105
+		{
106
+			index: 'STTL_REQ_AMT', name: 'sttlAmt',
107
+			label: "정산확정금액",
108
+			width: '10', fixed: false, align: 'center',
109
+			sortable: false, editable: false, edittype: 'text', 
110
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
111
+		},
112
+		{
113
+			index: 'UNPAID_AMT', name: 'unpaidAmt',
114
+			label: "미납금액",
115
+			width: '10', fixed: false, align: 'center',
116
+			sortable: false, editable: false, edittype: 'text', 
117
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
118
+		}, 
119
+		{
120
+			index: 'STTL_REG_MGR_NM', name: 'sttlRegMgrNm',
121
+			label: "등록자",
122
+			width: '10', fixed: false, align: 'center',
123
+			sortable: false, editable: false, edittype: 'text'
124
+		}
125
+	],
126
+	view: [
127
+		{
128
+			index: 'VIEW_CD', name: 'viewCd',
129
+			label: ITP_MSG_LOCALE.label.viewCd,
130
+			width: '10', fixed: false, align: 'center',
131
+			sortable: false, hidden: true
132
+		},
133
+		{
134
+			index: 'STTL_MGNT_DTL_NO', name: 'sttlMgntDtlNo',
135
+			label: '정산관리상세번호',
136
+			width: '10', fixed: false, align: 'center',
137
+			sortable: false, hidden: true
138
+		},		
139
+		{
140
+			index: 'BRAND_NM', name: 'brandNm',
141
+			label: "브랜드",
142
+			width: '10', fixed: false, align: 'center',
143
+			sortable: false, hidden: true
144
+		},
145
+		{
146
+			index: 'STORE_NM', name: 'storeNm',
147
+			label: "매장명",
148
+			width: '10', fixed: false, align: 'center',
149
+			sortable: false, hidden: true
150
+		},
151
+		{
152
+			index: 'ITEM_ID', name: 'itemId',
153
+			label: "품목코드",
154
+			width: '10', fixed: false, align: 'center',
155
+			sortable: false, editable: false, edittype: 'text'
156
+		},
157
+		{
158
+			index: 'ITEM_NM', name: 'itemNm',
159
+			label: "품목명",
160
+			width: '10', fixed: false, align: 'center',
161
+			sortable: false, editable: false, edittype: 'text'
162
+		},
163
+		{
164
+			index: 'UNIT', name: 'unit',
165
+			label: "단위",
166
+			width: '8', fixed: false, align: 'center',
167
+			sortable: false, editable: false, edittype: 'text'
168
+		},
169
+		{
170
+			index: 'UNIT_AMT', name: 'unitAmt',
171
+			label: "단가",
172
+			width: '8', fixed: false, align: 'center',
173
+			sortable: false, editable: false, edittype: 'text', 
174
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
175
+		},
176
+		{
177
+			index: 'PODR_QTY', name: 'podrQty',
178
+			label: "발주수량",
179
+			width: '8', fixed: false, align: 'center',
180
+			sortable: false, editable: false, edittype: 'text', 
181
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
182
+		},
183
+		{
184
+			index: 'DLV_QTY', name: 'dlvQty',
185
+			label: "납품수량",
186
+			width: '8', fixed: false, align: 'center',
187
+			sortable: false, editable: false, edittype: 'text', 
188
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
189
+		},
190
+		{
191
+			index: 'WHS_COL_QTY', name: 'whsColQty',
192
+			label: "입고/수거수량",
193
+			width: '8', fixed: false, align: 'center',
194
+			sortable: false, editable: false, edittype: 'text', 
195
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
196
+		}, 
197
+		{
198
+			index: 'WHS_COL_DT', name: 'whsColDt',
199
+			label: "입고/수거일자",
200
+			width: '8', fixed: false, align: 'center',
201
+			sortable: false, editable: false, edittype: 'text'
202
+		},
203
+		{
204
+			index: 'WHS_COL_AMT', name: 'whsColAmt',
205
+			label: "입고/수거금액",
206
+			width: '8', fixed: false, align: 'center',
207
+			sortable: false, editable: false, edittype: 'text', 
208
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
209
+		},
210
+		{
211
+			index: 'STTL_DVSN_NM', name: 'sttlDvsnNm',
212
+			label: "정산구분",
213
+			width: '8', fixed: false, align: 'center',
214
+			sortable: false, editable: false, edittype: 'text'
215
+		},
216
+		{
217
+			index: 'PODR_UNQ_NO', name: 'podrUnqNo',
218
+			label: "발주번호",
219
+			width: '8', fixed: false, align: 'center',
220
+			sortable: false, editable: false, edittype: 'text'
221
+		},
222
+		{
223
+			index: 'PODR_DTL_NO', name: 'podrDtlNo',
224
+			label: "발주항번",
225
+			width: '8', fixed: false, align: 'center',
226
+			sortable: false, editable: false, edittype: 'text'
227
+		}
228
+	]
229
+};
230
+
231
+require(['config'], function() {
232
+	require([
233
+		'kakao.map.util'
234
+	], function($) {
235
+		pageObj.init();
236
+	});
237
+});
238
+
239
+/*화면공통 Object*/
240
+let pageObj = {
241
+	init: function () {
242
+		this.ui.init();
243
+		this.event.init();
244
+	},
245
+	ui: {
246
+		init: function () {
247
+			this.view();
248
+			this.grid();
249
+			this.ready();
250
+		},
251
+		view: function() {
252
+			// 버튼 권한설정
253
+			fn_proc_btn_auth('VSETTMNG02010');
254
+			
255
+			// 공통코드 표시
256
+			$('select').each(function() {
257
+		        if($(this).data('select-code')) {
258
+		            fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
259
+		        }
260
+		    });
261
+
262
+			// 조회일자 지정
263
+			var now = new Date();
264
+			$('#ITP_TAB_VSETTMNG02010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);			
265
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
266
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_TO_DT').datepicker('setDate', new Date());
267
+			
268
+			// 권한에 따라 매장값 설정
269
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
270
+			LOGIN_AUTH_TYPE_CD = fn_make_user_info.get('authTpCd'); // 권한타입
271
+			if(LOGIN_AUTH_TYPE_CD == '50') {
272
+				$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_ID').val(fn_make_user_info.get('storeId'));
273
+				$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_NM').val(fn_make_user_info.get('storeNm'));	
274
+			}
275
+			
276
+		},
277
+		grid: function() {
278
+			itp_fn_jqgrid_resize(VSETTMNG02010_GRID_ID, VSETTMNG02010_GRID_LIST, 'lg');
279
+			listObj.empty.init();
280
+			itp_fn_fire_window_resize();
281
+		},
282
+		ready: function() {
283
+			listObj.init();
284
+		}
285
+	},
286
+	event: {
287
+		init: function () {
288
+			this.button();
289
+			this.change();
290
+		},
291
+		button: function () {
292
+			// 버튼 클릭 이벤트
293
+			$('button').each(function() {
294
+				var id = $(this).attr('id');
295
+				$(this).on('click', function() {
296
+					switch (id) {
297
+						case 'ITP_BTN_VSETTMNG02010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
298
+						case 'ITP_BTN_VSETTMNG02010_CANCELLIST'		: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
299
+						case 'ITP_BTN_VSETTMNG02010_STTL_END'		: modifyObj.button.endSttl(); 	break;	// 정산확정 버튼
300
+						case 'ITP_BTN_VSETTMNG02010_SEARCH_STORE_POP'	: listObj.button.storePop();	break;	// 매장검색 팝업
301
+						case 'ITP_BTN_VSETTMNG02010_SEARCH_ERASE'		: listObj.button.storeErase();	break;	// 매장 지움
302
+					}
303
+				});
304
+			});
305
+
306
+			$('body').on('click', function(e) {
307
+				var gridId = VSETTMNG02010_DETAIL_GRID_ID.replace('#', '');
308
+				var rids = $(VSETTMNG02010_DETAIL_GRID_ID).jqGrid('getDataIDs');
309
+				var last_row_id = rids[rids.length - 1];
310
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'VSETTMNG02010_DETAIL');
311
+			});
312
+
313
+		}, 
314
+		change: function() {
315
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_GUBUN').on('change', function() {
316
+				var gubunVal = $('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_GUBUN').val();
317
+				if(gubunVal == '1') { // 매장
318
+					$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '매장명');
319
+					
320
+					$(VSETTMNG02010_GRID_ID).jqGrid('hideCol', ["spplyNm"]);
321
+					$(VSETTMNG02010_GRID_ID).jqGrid('showCol', ["storeNm"]);		
322
+					// $(VSETTMNG02010_GRID_ID).setColProp('spplyNm', {hidden: true});
323
+					// $(VSETTMNG02010_GRID_ID).setColProp('storeNm', {hidden: false});
324
+								
325
+				} else if(gubunVal == '2') { // 공급업체
326
+					$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '공급사명');
327
+					
328
+					$(VSETTMNG02010_GRID_ID).jqGrid('hideCol', ["storeNm"]);
329
+					$(VSETTMNG02010_GRID_ID).jqGrid('showCol', ["spplyNm"]);
330
+					// $(VSETTMNG02010_GRID_ID).setColProp('storeNm', {hidden: true});
331
+					// $(VSETTMNG02010_GRID_ID).setColProp('spplyNm', {hidden: false});
332
+				}	
333
+				listObj.button.search();	
334
+				// itp_fn_jqgrid_resize(VSETTMNG02010_GRID_ID, VSETTMNG02010_GRID_LIST, 'lg');							
335
+			});			
336
+		}
337
+	},
338
+	switchScreen: function(mode) {
339
+		if(mode == 'LIST') { // 목록
340
+			$('#ITP_BTN_VSETTMNG02010_MODIFY').hide();
341
+			$('#ITP_BTN_VSETTMNG02010_CANCELLIST').hide();
342
+			$('#ITP_BTN_VSETTMNG02010_DELETE').hide();
343
+			$('#ITP_BTN_VSETTMNG02010_STTL_END').hide();
344
+			
345
+			if(LOGIN_AUTH_TYPE_CD == '50') { // 매장관리자
346
+				$('#ITP_BTN_VSETTMNG02010_SEARCH_STORE_POP').hide();
347
+				$('#ITP_BTN_VSETTMNG02010_SEARCH_ERASE').hide();
348
+			} else {
349
+				$('#ITP_BTN_VSETTMNG02010_SEARCH_STORE_POP').show();
350
+				$('#ITP_BTN_VSETTMNG02010_SEARCH_ERASE').show();
351
+			}
352
+			
353
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG02010_SRH');
354
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG02010_NEWREG');
355
+			
356
+			$('#ITP_AJAX_VSETTMNG02010_LIST_CONTAINER').show();
357
+			$('#ITP_AJAX_VSETTMNG02010_DETAIL_CONTAINER').hide();
358
+			
359
+		} else if(mode == 'DETAIL') { // 보기
360
+			$('#ITP_BTN_VSETTMNG02010_SRH').hide();
361
+			$('#ITP_BTN_VSETTMNG02010_NEWREG').hide();
362
+			$('#ITP_BTN_VSETTMNG02010_DELETE').hide();
363
+			
364
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG02010_STTL_END');
365
+			fn_show_btn_auth('#ITP_BTN_VSETTMNG02010_CANCELLIST');
366
+
367
+			$('#ITP_AJAX_VSETTMNG02010_LIST_CONTAINER').hide();
368
+			$('#ITP_AJAX_VSETTMNG02010_DETAIL_CONTAINER').show();
369
+		}
370
+	}
371
+};
372
+
373
+/*목록화면 Object*/
374
+let listObj = {
375
+	init: function () {
376
+		this.grid.init();
377
+	},
378
+	itp_VSETTMNG02010_search: false,
379
+	button: {
380
+		search: function() {
381
+			listObj.itp_VSETTMNG02010_search = true;
382
+			let param = $('#ITP_FORM_VSETTMNG02010_SEARCH').serializeObject();
383
+			param.gridSize = $.jgrid.defaults.rowNum;
384
+			param.gridPage = $.jgrid.defaults.page;
385
+			$(VSETTMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
386
+		}, 
387
+		storePop: function() {
388
+			fn_call_popup('biz', 'BIZPOP_BRAND_STORE', '#ITP_ASIDE', function(result) {
389
+				// alert(JSON.stringify(result));
390
+				$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_ID').val(result[0].storeId);
391
+				$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_NM').val(result[0].storeNm);				
392
+				listObj.button.search();
393
+			}, null, 'S');
394
+		}, 
395
+		storeErase: function() {
396
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_ID').val('');
397
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_SPPLY_NM').val('');
398
+			listObj.button.search();
399
+		}
400
+	},
401
+	empty: {
402
+		init: function() {
403
+			var _this = this;
404
+			this.push();
405
+			$(VSETTMNG02010_GRID_EMPTY).on('click', function() {
406
+				_this.back();
407
+				_this.itp_VSETTMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
408
+				$(VSETTMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_VSETTMNG02010_param)}).trigger('reloadGrid');
409
+			});
410
+		},
411
+		itp_VSETTMNG02010_param: {},
412
+		push: function() {
413
+			let param = $('#ITP_FORM_VSETTMNG02010_SEARCH').serializeObject();
414
+			listObj.itp_VSETTMNG02010_param = param;
415
+		},
416
+		back: function() {
417
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_ID').val(listObj.itp_VSETTMNG02010_param.sstoreId);
418
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_STORE_NM').val(listObj.itp_VSETTMNG02010_param.sstoreNm);
419
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_FROM_DT').val(listObj.itp_VSETTMNG02010_param.fromDt);
420
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_TO_DT').val(listObj.itp_VSETTMNG02010_param.toDt);
421
+			$('#ITP_FORM_VSETTMNG02010_SEARCH_ITEM_NM').val(listObj.itp_VSETTMNG02010_param.sitemNm);
422
+		}
423
+	},
424
+	grid: {
425
+		init: function () {
426
+			// 데이터 없을때
427
+			listObj.empty.push();
428
+			this.search();
429
+		},
430
+		colModel: gridColModel.list,
431
+		search: function() {
432
+			pageObj.switchScreen('LIST');
433
+			this.unload();
434
+			this.load();
435
+		},
436
+		load: function() {			
437
+			let param = $('#ITP_FORM_VSETTMNG02010_SEARCH').serializeObject();
438
+			param.gridSize = $.jgrid.defaults.rowNum;
439
+
440
+			var option = {
441
+				gridId: VSETTMNG02010_GRID_ID,
442
+				colModel: gridColModel.list,
443
+				param: param,
444
+				url: DOMAIN + STTL_STATE_DETAIL_GRID_LIST,
445
+				pager: VSETTMNG02010_GRID_PAGER,
446
+				onCellSelect: function(rowId, cellIdx, cellValue) {
447
+					var cm = $(this).jqGrid('getGridParam', 'colModel');
448
+					var colNm = cm[cellIdx].name;
449
+					if (colNm == 'sttlMgntUnqNo') {
450
+						const sttlMgntUnqNoVal = $(this).jqGrid('getCell', rowId, 'sttlMgntUnqNo');
451
+						
452
+						const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
453
+						var param = $.param(key);
454
+						modifyObj.init(param);
455
+					}
456
+				},
457
+				loadComplete: function(data) {
458
+					console.log(data);
459
+					itp_fn_grid_load_complete(data, VSETTMNG02010_GRID_ID, true, 'number', 'VSETTMNG02010', listObj.itp_VSETTMNG02010_search, listObj.empty, true, data.gridRecords, true);
460
+					var ids = $(VSETTMNG02010_GRID_ID).getDataIDs();
461
+					$.each(ids, function(idx, rowId) {
462
+						$(VSETTMNG02010_GRID_ID).jqGrid('setCell', rowId, 'sttlMgntUnqNo', '', ITP_GRID_COL_STYLE.link);
463
+					});
464
+				},
465
+				onPaging: function(action) {
466
+					itp_fn_grid_paging(VSETTMNG02010_GRID_ID, action, param);
467
+				}
468
+			};
469
+			itp_fn_grid_make_remote(option);
470
+		},
471
+		clearData : function() {
472
+			$(VSETTMNG02010_GRID_ID).jqGrid('clearGridData', true);
473
+			$(VSETTMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
474
+			$(VSETTMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
475
+			$(VSETTMNG02010_GRID_EMPTY).show();
476
+		},
477
+		unload : function() {
478
+			$.jgrid.gridUnload(VSETTMNG02010_GRID_ID);
479
+		}
480
+	}
481
+};
482
+
483
+/*상세화면 Object*/
484
+let modifyObj = {
485
+	init: function (param) {
486
+		this.load(param);
487
+	},
488
+	button: {
489
+		cancel: function() {
490
+			listObj.grid.search();
491
+		}, 
492
+		endSttl: function() {
493
+			// 정산확정
494
+			const formId = '#ITP_FORM_VSETTMNG02010_DETAIL';
495
+			let param = $(formId).serializeObject();
496
+			var confirmFn= {
497
+				callBack: function() {
498
+					var searhFn = function() {
499
+						listObj.grid.search();
500
+					};
501
+					fn_ajax_call(STTL_STATE_STTL_END, JSON.stringify(param), searhFn, 'POST'); 	
502
+				}
503
+			};
504
+			var sttlReqAmt =  parseInt($('#ITP_FORM_VSETTMNG02010_DETAIL_STTL_REQ_AMT').val());
505
+			var acctBal =  parseInt($('#ITP_FORM_VSETTMNG02010_DETAIL_ACCT_BAL').val());
506
+			
507
+			if(acctBal > 0) {
508
+				if(acctBal >= sttlReqAmt) {
509
+					itp_fn_modal_confirm('계좌잔액에서 지급처리가 진행됩니다.\n정산 확정하시겠습니까?', confirmFn, null);						
510
+				} else {
511
+					itp_fn_modal_confirm('일부금액이 계좌잔액에서 지급처리가 진행됩니다.\n정산 확정하시겠습니까?', confirmFn, null);	
512
+				}					
513
+			} else {
514
+				itp_fn_modal_confirm('정산 확정하시겠습니까?', confirmFn, null);
515
+			}
516
+		}
517
+	}, 
518
+	load: function(param) {
519
+		fn_ajax_call(STTL_REQ_INFO_STTL, param, this.callback, 'GET');
520
+	},
521
+	callback: function (result) {
522
+		// console.log(result);
523
+		pageObj.switchScreen('DETAIL');
524
+		$('#ITP_FORM_VSETTMNG02010_DETAIL_BRAND_ID').val(result.brandId);
525
+		$('#ITP_FORM_VSETTMNG02010_DETAIL_STORE_ID').val(result.storeId);
526
+		$('#ITP_FORM_VSETTMNG02010_DETAIL_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
527
+		$('#ITP_FORM_VSETTMNG02010_DETAIL_ACCT_BAL').val(result.acctBal); // 계좌잔액
528
+		$('#ITP_FORM_VSETTMNG02010_DETAIL_STTL_REQ_AMT').val(result.sttlReqAmt); // 정산요청금액
529
+		
530
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnBrandNm').text(result.brandNm);
531
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnStoreNm').text(result.storeNm);
532
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
533
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnAcctBal').text(itp_fn_number_comma(result.acctBal));
534
+		
535
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlRjctRsn').text(result.sttlRjctRsn == null ? '' : result.sttlRjctRsn);
536
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlStNm').text(result.sttlStNm);
537
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlReqDt').text(result.sttlReqDt);  // 정산요청일자
538
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlReqAmt').text(itp_fn_number_comma(result.sttlReqAmt));
539
+		// $('#ITP_FORM_VSETTMNG02010_DETAIL_STTL_DT').val(result.sttlDt);  // 정산일자
540
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlDt').text(result.sttlDt == null ? '' : result.sttlDt);  // 정산요청일자
541
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSttlAmt').text(itp_fn_number_comma(result.sttlAmt));
542
+		
543
+		// $('#ITP_FORM_VSETTMNG02010_DETAIL .fnRcptYn').text(result.rcptYn == null ? '' : result.rcptYn);
544
+		// $('#ITP_FORM_VSETTMNG02010_DETAIL .fnRcptDt').text(result.rcptDt == null ? '' : result.rcptDt);
545
+		
546
+		if(result.rcptYn == null) {
547
+			$('#ITP_FORM_VSETTMNG02010_DETAIL .fnRcptYnDate').text('');	
548
+		} else if(result.rcptYn == 'N') {
549
+			$('#ITP_FORM_VSETTMNG02010_DETAIL .fnRcptYnDate').text('N');
550
+		} else if(result.rcptYn == 'Y') {
551
+			$('#ITP_FORM_VSETTMNG02010_DETAIL .fnRcptYnDate').text('Y (' + result.rcptDt + ')');
552
+		}
553
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnUnpaidAmt').text(itp_fn_number_comma(result.unpaidAmt));
554
+		
555
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSysRegDttm').text(result.sysRegDttm);
556
+		$('#ITP_FORM_VSETTMNG02010_DETAIL .fnSysRegNm').text(result.sysRegNm);
557
+		
558
+		if(result.sttlStCd == 'ST10') { // 정산요청
559
+			$('#ITP_BTN_VSETTMNG02010_STTL_END').show();
560
+		} else {
561
+			$('#ITP_BTN_VSETTMNG02010_STTL_END').hide();
562
+		}
563
+
564
+		// 리스트 조회
565
+		modifyObj.grid.init();
566
+	},
567
+	grid: {
568
+		init: function() {
569
+			this.unload();
570
+			this.load();
571
+		},
572
+		load : function() {
573
+			let param = $('#ITP_FORM_VSETTMNG02010_DETAIL').serializeObject();
574
+			param.gridSize = $.jgrid.defaults.rowNum;
575
+			param.pagingYn = false; // 페이징안함
576
+
577
+			var option = {
578
+				gridId: VSETTMNG02010_DETAIL_GRID_ID,
579
+				colModel: gridColModel.view,
580
+				param: param,
581
+				url: DOMAIN + STTL_REQ_STL_GRID_LIST,
582
+				pager: VSETTMNG02010_DETAIL_GRID_PAGER,
583
+				loadComplete: function(data) {
584
+					itp_fn_grid_load_complete(data, VSETTMNG02010_DETAIL_GRID_ID, true, undefined, 'VSETTMNG02010_DETAIL');
585
+				},
586
+				onPaging: function(action) {
587
+					var pagingFn = {
588
+						callBack: function(args) {
589
+							$(args).trigger('reloadGrid');
590
+						}
591
+					};
592
+					if (itp_fn_check_grid_is_writing(VSETTMNG02010_DETAIL_GRID_ID)) {
593
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, VSETTMNG02010_DETAIL_GRID_ID);
594
+						return 'stop';
595
+					} else {
596
+						itp_fn_grid_paging(VSETTMNG02010_DETAIL_GRID_ID, action, param);
597
+					}
598
+				},
599
+				onSortCol: function(index, columnIndex, sortOrder) {
600
+					var sortingFn = {
601
+						callBack: function(args) {
602
+							$(args).trigger('reloadGrid');
603
+						}
604
+					};
605
+					if (itp_fn_check_grid_is_writing(VSETTMNG02010_DETAIL_GRID_ID)) {
606
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, VSETTMNG02010_DETAIL_GRID_ID);
607
+						return 'stop';
608
+					} else {
609
+						itp_fn_grid_sorting(VSETTMNG02010_DETAIL_GRID_ID, index, sortOrder);
610
+					}
611
+				}
612
+			};
613
+			itp_fn_grid_make_remote(option);
614
+		},
615
+		clearData : function() {
616
+			$(VSETTMNG02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
617
+			$(VSETTMNG02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
618
+			$(VSETTMNG02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
619
+			$(VSETTMNG02010_DETAIL_GRID_EMPTY).show();
620
+		},
621
+		unload : function() {
622
+			$.jgrid.gridUnload(VSETTMNG02010_DETAIL_GRID_ID);
623
+		}
624
+	}
625
+};