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

Merge branch 'master' of http://106.246.249.162:13000/orderqueen/oqpo-view

juney преди 2 години
родител
ревизия
80c1d48208

+ 68 - 0
src/main/webapp/app/settmng/SETTMNG04010.html

@@ -0,0 +1,68 @@
1
+<section id="ITP_TAB_SETTMNG04010" class="tab-pane active itp_sec">
2
+	<div class="itp_cont">
3
+		<article class="itp_detail">
4
+			<div class="itp_det_head fix">
5
+				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i><strong>카드취소관리</strong></h2>
6
+				<div class="pull-right itp_cicon">
7
+					<button type="button" id="ITP_BTN_SETTMNG04010_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_SETTMNG04010_CARD_CANCEL" class="btn btn-warning btn-sm REQ" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;카드취소&nbsp;&nbsp;</button>
9
+				</div>
10
+			</div>
11
+			<div class="itp_det_in">
12
+				<div id="ITP_AJAX_SETTMNG04010_LIST_CONTAINER">
13
+					<div class="itp_lg_form itp_type1 fix">
14
+						<div class="itp_srh_border fix">
15
+							<div class="col-xs-12">
16
+								<form id="ITP_FORM_SETTMNG04010_SEARCH" class="form-horizontal">
17
+								<input type="hidden" id="ITP_FORM_SETTMNG04010_SEARCH_BRAND_ID" name="sbrandId" value="">
18
+								<input type="hidden" id="ITP_FORM_SETTMNG04010_SEARCH_STORE_ID" name="sstoreId" value="">
19
+								<input type="hidden" id="ITP_FORM_SETTMNG04010_SEARCH_SPPLY_ID" name="sspplyId" value="">
20
+								<input type="hidden" id="ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_GUBUN" name="sgubun" value="1">
21
+									<div class="form-group">
22
+										<div class="col-xs-1 itp_ip itp_noMar" style="width:70px; padding-top: 5px; padding-right: 5px;">
23
+											<label>거래일시</label>
24
+										</div>
25
+										<div class="col-xs-3 itp_ip itp_noMar">
26
+											<div class="input-daterange input-group date">
27
+												<input type="text" id="ITP_FORM_SETTMNG04010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="" readonly>
28
+												<span class="input-group-addon itp_date_to">~</span>
29
+												<input type="text" id="ITP_FORM_SETTMNG04010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="" readonly> 
30
+											</div>
31
+										</div>
32
+										<div class="col-xs-3 itp_ip itp_noMar">
33
+											<div class="input-group">
34
+											<input type="text" id="ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM" class="form-control itp_input" placeholder="매장명" readonly="readonly" />
35
+												<span class="input-group-btn">
36
+													<button id="ITP_BTN_SETTMNG04010_SEARCH_ERASE" class="btn btn-default btn-sm itp_btn UPB" type="button"><i class="glyphicon glyphicon-remove"></i></button>
37
+													<button type="button" id="ITP_BTN_SETTMNG04010_SEARCH_STORE_POP" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
38
+												</span>
39
+											</div>
40
+										</div>
41
+										<div class="col-xs-2 itp_ip itp_noMar">
42
+											<select id="ITP_FORM_SETTMNG04010_SEARCH_STTL_ST_CD" data-select-code="STTL_ST_CD" class="form-control itp_input" name="ssttlStCd">
43
+												<option>거래타입</option>
44
+											</select>
45
+										</div>
46
+										<div class="col-xs-2 itp_ip itp_noMar">
47
+											<input type="text" id="ITP_FORM_SETTMNG04010_SEARCH_" class="form-control itp_input" name="" value="" placeholder="승인번호">
48
+										</div>
49
+									</div>									
50
+								</form>
51
+							</div>
52
+						</div>
53
+					</div>
54
+					<div class="itp_table fix">
55
+						<div id="ITP_SETTMNG04010_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
56
+							<div id="ITP_SETTMNG04010_jqGridView" class="itp_views fix"></div>
57
+							<button type="button" id="ITP_BTN_SETTMNG04010_EXCEL" class="btn btn-success btn-sm Excel" style="float:right;"><i class="glyphicon "></i>Excel</button>
58
+							<table id="ITP_SETTMNG04010_jqGrid"></table>
59
+							<div id="ITP_SETTMNG04010_jqGridPager"></div>
60
+							<div id="ITP_SETTMNG04010_jqGridEmpty" class="itp_no_data"></div>
61
+						</div>
62
+					</div>
63
+				</div>
64
+			</div>
65
+		</article>
66
+	</div>
67
+	<div id="ITP_TAP_JS"></div>
68
+</section>

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

@@ -53,7 +53,7 @@ var popPageObj = {
53 53
 		$('#ITP_FORM_PO_STOCK_PROC_POPUP .fnLocationNm').text(result.locationNm);
54 54
 		$('#ITP_FORM_PO_STOCK_PROC_POPUP .fnItemId').text(result.itemId);
55 55
 		$('#ITP_FORM_PO_STOCK_PROC_POPUP .fnItemNm').text(result.itemNm);
56
-		$('#ITP_FORM_PO_STOCK_PROC_POPUP .fnStckQty').text(result.stckQty.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','));
56
+		$('#ITP_FORM_PO_STOCK_PROC_POPUP .fnStckQty').text(itp_fn_number_comma(result.stckQty));
57 57
 		
58 58
 		// 창고 및 로케이션 리스트
59 59
 		popPageObj.fnWhsList(function() {

+ 500 - 0
src/main/webapp/js/app/settmng/ITP_SETTMNG04010.js

@@ -0,0 +1,500 @@
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 SETTMNG04010_GRID_ID = '#ITP_SETTMNG04010_jqGrid';
13
+const SETTMNG04010_GRID_LIST = '#ITP_SETTMNG04010_jqGrid_list';
14
+const SETTMNG04010_GRID_PAGER = '#ITP_SETTMNG04010_jqGridPager';
15
+const SETTMNG04010_GRID_EMPTY = '#ITP_SETTMNG04010_jqGridEmpty';
16
+
17
+const SETTMNG04010_DETAIL_GRID_ID = '#ITP_SETTMNG04010_DETAIL_jqGrid';
18
+const SETTMNG04010_DETAIL_GRID_LIST = '#ITP_SETTMNG04010_DETAIL_jqGrid_list';
19
+const SETTMNG04010_DETAIL_GRID_PAGER = '#ITP_SETTMNG04010_DETAIL_jqGridPager';
20
+const SETTMNG04010_DETAIL_GRID_EMPTY = '#ITP_SETTMNG04010_DETAIL_jqGridEmpty';
21
+
22
+let ITP_FORM_SETTMNG04010_DETAIL_IS_DUPLICATE = false;
23
+let ITP_FORM_SETTMNG04010_DETAIL_IS_WRITING = false;
24
+let SETTMNG04010_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: false
49
+		},
50
+		{
51
+			index: 'BRAND_NM', name: 'brandNm',
52
+			label: "브랜드명",
53
+			width: '10', fixed: false, align: 'center',
54
+			sortable: false, hidden: false
55
+		},
56
+		{
57
+			index: 'STORE_NM', name: 'storeNm',
58
+			label: "매장명",
59
+			width: '10', fixed: false, align: 'left',
60
+			sortable: false, hidden: false, classes: 'ui-ellipsis'
61
+		},
62
+		{
63
+			index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
64
+			label: "거래타입", 
65
+			width: '8', fixed: false, align: 'center',
66
+			sortable: false, hidden: false
67
+		},
68
+		{
69
+			index: 'SPPLY_NM', name: 'spplyNm',
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: false
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
+};
94
+
95
+require(['config'], function() {
96
+	require([
97
+		'kakao.map.util'
98
+	], function($) {
99
+		pageObj.init();
100
+	});
101
+});
102
+
103
+/*화면공통 Object*/
104
+let pageObj = {
105
+	init: function () {
106
+		this.ui.init();
107
+		this.event.init();
108
+	},
109
+	ui: {
110
+		init: function () {
111
+			this.view();
112
+			this.grid();
113
+			this.ready();
114
+		},
115
+		view: function() {
116
+			// 버튼 권한설정
117
+			fn_proc_btn_auth('SETTMNG04010');
118
+			
119
+			// 공통코드 표시
120
+			$('select').each(function() {
121
+		        if($(this).data('select-code')) {
122
+		            fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
123
+		        }
124
+		    });
125
+
126
+			// 조회일자 지정
127
+			var now = new Date();
128
+			$('#ITP_TAB_SETTMNG04010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);			
129
+			$('#ITP_FORM_SETTMNG04010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
130
+			$('#ITP_FORM_SETTMNG04010_SEARCH_TO_DT').datepicker('setDate', new Date());
131
+			
132
+			// 권한에 따라 매장값 설정
133
+			$('#ITP_FORM_SETTMNG04010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
134
+			LOGIN_AUTH_TYPE_CD = fn_make_user_info.get('authTpCd'); // 권한타입
135
+			if(LOGIN_AUTH_TYPE_CD == '50') {
136
+				$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_ID').val(fn_make_user_info.get('storeId'));
137
+				$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM').val(fn_make_user_info.get('storeNm'));	
138
+			}
139
+			
140
+		},
141
+		grid: function() {
142
+			itp_fn_jqgrid_resize(SETTMNG04010_GRID_ID, SETTMNG04010_GRID_LIST, 'lg');
143
+			listObj.empty.init();
144
+			itp_fn_fire_window_resize();
145
+		},
146
+		ready: function() {
147
+			listObj.init();
148
+		}
149
+	},
150
+	event: {
151
+		init: function () {
152
+			this.button();
153
+			this.change();
154
+		},
155
+		button: function () {
156
+			// 버튼 클릭 이벤트
157
+			$('button').each(function() {
158
+				var id = $(this).attr('id');
159
+				$(this).on('click', function() {
160
+					switch (id) {
161
+						case 'ITP_BTN_SETTMNG04010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
162
+						case 'ITP_BTN_SETTMNG04010_CANCELLIST'		: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
163
+						case 'ITP_BTN_SETTMNG04010_STTL_END'		: modifyObj.button.endSttl(); 	break;	// 정산확정 버튼
164
+						case 'ITP_BTN_SETTMNG04010_SEARCH_STORE_POP'	: listObj.button.storePop();	break;	// 매장검색 팝업
165
+						case 'ITP_BTN_SETTMNG04010_SEARCH_ERASE'		: listObj.button.storeErase();	break;	// 매장 지움
166
+						case 'ITP_BTN_SETTMNG04010_EXCEL'			: listObj.excelDown();	break;	// 엑셀 다운로드
167
+					}
168
+				});
169
+			});
170
+
171
+			$('body').on('click', function(e) {
172
+				var gridId = SETTMNG04010_DETAIL_GRID_ID.replace('#', '');
173
+				var rids = $(SETTMNG04010_DETAIL_GRID_ID).jqGrid('getDataIDs');
174
+				var last_row_id = rids[rids.length - 1];
175
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'SETTMNG04010_DETAIL');
176
+			});
177
+
178
+		}, 
179
+		change: function() {
180
+			$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_GUBUN').on('change', function() {
181
+				var gubunVal = $('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_GUBUN').val();
182
+				if(gubunVal == '1') { // 매장
183
+					$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '매장명');
184
+					
185
+					$(SETTMNG04010_GRID_ID).jqGrid('hideCol', ["spplyNm"]);
186
+					$(SETTMNG04010_GRID_ID).jqGrid('showCol', ["storeNm"]);		
187
+					// $(SETTMNG04010_GRID_ID).setColProp('spplyNm', {hidden: true});
188
+					// $(SETTMNG04010_GRID_ID).setColProp('storeNm', {hidden: false});
189
+								
190
+				} else if(gubunVal == '2') { // 공급업체
191
+					$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '공급사명');
192
+					
193
+					$(SETTMNG04010_GRID_ID).jqGrid('hideCol', ["storeNm"]);
194
+					$(SETTMNG04010_GRID_ID).jqGrid('showCol', ["spplyNm"]);
195
+					// $(SETTMNG04010_GRID_ID).setColProp('storeNm', {hidden: true});
196
+					// $(SETTMNG04010_GRID_ID).setColProp('spplyNm', {hidden: false});
197
+				}	
198
+				listObj.button.search();	
199
+				// itp_fn_jqgrid_resize(SETTMNG04010_GRID_ID, SETTMNG04010_GRID_LIST, 'lg');							
200
+			});			
201
+		}
202
+	},
203
+	switchScreen: function(mode) {
204
+		if(mode == 'LIST') { // 목록
205
+			$('#ITP_BTN_SETTMNG04010_MODIFY').hide();
206
+			$('#ITP_BTN_SETTMNG04010_CANCELLIST').hide();
207
+			$('#ITP_BTN_SETTMNG04010_DELETE').hide();
208
+			$('#ITP_BTN_SETTMNG04010_STTL_END').hide();
209
+			
210
+			if(LOGIN_AUTH_TYPE_CD == '50') { // 매장관리자
211
+				$('#ITP_BTN_SETTMNG04010_SEARCH_STORE_POP').hide();
212
+				$('#ITP_BTN_SETTMNG04010_SEARCH_ERASE').hide();
213
+			} else {
214
+				$('#ITP_BTN_SETTMNG04010_SEARCH_STORE_POP').show();
215
+				$('#ITP_BTN_SETTMNG04010_SEARCH_ERASE').show();
216
+			}
217
+			
218
+			fn_show_btn_auth('#ITP_BTN_SETTMNG04010_SRH');
219
+			fn_show_btn_auth('#ITP_BTN_SETTMNG04010_CARD_CANCEL');
220
+			
221
+			$('#ITP_AJAX_SETTMNG04010_LIST_CONTAINER').show();
222
+			$('#ITP_AJAX_SETTMNG04010_DETAIL_CONTAINER').hide();
223
+			
224
+			$('#ITP_BTN_SETTMNG04010_EXCEL').show();
225
+			
226
+		} else if(mode == 'DETAIL') { // 보기
227
+			$('#ITP_BTN_SETTMNG04010_SRH').hide();
228
+			
229
+			fn_show_btn_auth('#ITP_BTN_SETTMNG04010_STTL_END');
230
+			fn_show_btn_auth('#ITP_BTN_SETTMNG04010_CANCELLIST');
231
+
232
+			$('#ITP_AJAX_SETTMNG04010_LIST_CONTAINER').hide();
233
+			$('#ITP_AJAX_SETTMNG04010_DETAIL_CONTAINER').show();
234
+		}
235
+	}
236
+};
237
+
238
+/*목록화면 Object*/
239
+let listObj = {
240
+	init: function () {
241
+		this.grid.init();
242
+	},
243
+	itp_SETTMNG04010_search: false,
244
+	button: {
245
+		search: function() {
246
+			listObj.itp_SETTMNG04010_search = true;
247
+			let param = $('#ITP_FORM_SETTMNG04010_SEARCH').serializeObject();
248
+			param.gridSize = $.jgrid.defaults.rowNum;
249
+			param.gridPage = $.jgrid.defaults.page;
250
+			$(SETTMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
251
+		}, 
252
+		storePop: function() {
253
+			fn_call_popup('biz', 'BIZPOP_BRAND_STORE', '#ITP_ASIDE', function(result) {
254
+				// alert(JSON.stringify(result));
255
+				$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_ID').val(result[0].storeId);
256
+				$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM').val(result[0].storeNm);				
257
+				listObj.button.search();
258
+			}, null, 'S');
259
+		}, 
260
+		storeErase: function() {
261
+			$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_ID').val('');
262
+			$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_SPPLY_NM').val('');
263
+			listObj.button.search();
264
+		}
265
+	},
266
+	empty: {
267
+		init: function() {
268
+			var _this = this;
269
+			this.push();
270
+			$(SETTMNG04010_GRID_EMPTY).on('click', function() {
271
+				_this.back();
272
+				_this.itp_SETTMNG04010_param.gridSize = $.jgrid.defaults.rowNum;
273
+				$(SETTMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_SETTMNG04010_param)}).trigger('reloadGrid');
274
+			});
275
+		},
276
+		itp_SETTMNG04010_param: {},
277
+		push: function() {
278
+			let param = $('#ITP_FORM_SETTMNG04010_SEARCH').serializeObject();
279
+			listObj.itp_SETTMNG04010_param = param;
280
+		},
281
+		back: function() {
282
+			$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_ID').val(listObj.itp_SETTMNG04010_param.sstoreId);
283
+			$('#ITP_FORM_SETTMNG04010_SEARCH_STORE_NM').val(listObj.itp_SETTMNG04010_param.sstoreNm);
284
+			$('#ITP_FORM_SETTMNG04010_SEARCH_FROM_DT').val(listObj.itp_SETTMNG04010_param.fromDt);
285
+			$('#ITP_FORM_SETTMNG04010_SEARCH_TO_DT').val(listObj.itp_SETTMNG04010_param.toDt);
286
+			$('#ITP_FORM_SETTMNG04010_SEARCH_ITEM_NM').val(listObj.itp_SETTMNG04010_param.sitemNm);
287
+		}
288
+	},
289
+	grid: {
290
+		init: function () {
291
+			// 데이터 없을때
292
+			listObj.empty.push();
293
+			this.search();
294
+		},
295
+		colModel: gridColModel.list,
296
+		search: function() {
297
+			pageObj.switchScreen('LIST');
298
+			this.unload();
299
+			this.load();
300
+		},
301
+		load: function() {			
302
+			let param = $('#ITP_FORM_SETTMNG04010_SEARCH').serializeObject();
303
+			param.gridSize = $.jgrid.defaults.rowNum;
304
+
305
+			var option = {
306
+				gridId: SETTMNG04010_GRID_ID,
307
+				colModel: gridColModel.list,
308
+				param: param,
309
+				url: DOMAIN + STTL_STATE_DETAIL_GRID_LIST,
310
+				pager: SETTMNG04010_GRID_PAGER,
311
+				onCellSelect: function(rowId, cellIdx, cellValue) {
312
+					var cm = $(this).jqGrid('getGridParam', 'colModel');
313
+					var colNm = cm[cellIdx].name;
314
+					if (colNm == 'sttlMgntUnqNo') {
315
+						const sttlMgntUnqNoVal = $(this).jqGrid('getCell', rowId, 'sttlMgntUnqNo');
316
+						
317
+						const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
318
+						var param = $.param(key);
319
+						modifyObj.init(param);
320
+					}
321
+				},
322
+				loadComplete: function(data) {
323
+					console.log(data);
324
+					itp_fn_grid_load_complete(data, SETTMNG04010_GRID_ID, true, 'number', 'SETTMNG04010', listObj.itp_SETTMNG04010_search, listObj.empty, true, data.gridRecords, true);
325
+					var ids = $(SETTMNG04010_GRID_ID).getDataIDs();
326
+					$.each(ids, function(idx, rowId) {
327
+						$(SETTMNG04010_GRID_ID).jqGrid('setCell', rowId, 'sttlMgntUnqNo', '', ITP_GRID_COL_STYLE.link);
328
+					});
329
+				},
330
+				onPaging: function(action) {
331
+					itp_fn_grid_paging(SETTMNG04010_GRID_ID, action, param);
332
+				}
333
+			};
334
+			itp_fn_grid_make_remote(option);
335
+		},
336
+		clearData : function() {
337
+			$(SETTMNG04010_GRID_ID).jqGrid('clearGridData', true);
338
+			$(SETTMNG04010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
339
+			$(SETTMNG04010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
340
+			$(SETTMNG04010_GRID_EMPTY).show();
341
+		},
342
+		unload : function() {
343
+			$.jgrid.gridUnload(SETTMNG04010_GRID_ID);
344
+		}
345
+	},
346
+	excelDown: function() {
347
+		var param = {
348
+			'url': STTL_STATE_DETAIL_GRID_LIST,
349
+			'param': $('#ITP_FORM_SETTMNG04010_SEARCH').serializeObject(),
350
+			'gridColumns': $(SETTMNG04010_GRID_ID).jqGrid('getGridParam', 'colModel'),
351
+			'fileName': '정산현황.xlsx',
352
+			'sheetName': '정산현황리스트'
353
+		};
354
+		itp_fn_remote_to_excel(param);
355
+	}
356
+};
357
+
358
+/*상세화면 Object*/
359
+let modifyObj = {
360
+	init: function (param) {
361
+		this.load(param);
362
+	},
363
+	button: {
364
+		cancel: function() {
365
+			listObj.grid.search();
366
+		}, 
367
+		endSttl: function() {
368
+			// 정산확정
369
+			const formId = '#ITP_FORM_SETTMNG04010_DETAIL';
370
+			let param = $(formId).serializeObject();
371
+			var confirmFn= {
372
+				callBack: function() {
373
+					var searhFn = function() {
374
+						listObj.grid.search();
375
+					};
376
+					fn_ajax_call(STTL_STATE_STTL_END, JSON.stringify(param), searhFn, 'POST'); 	
377
+				}
378
+			};
379
+			var sttlReqAmt =  parseInt($('#ITP_FORM_SETTMNG04010_DETAIL_STTL_REQ_AMT').val());
380
+			var acctBal =  parseInt($('#ITP_FORM_SETTMNG04010_DETAIL_ACCT_BAL').val());
381
+			
382
+			if(acctBal > 0) {
383
+				if(acctBal >= sttlReqAmt) {
384
+					itp_fn_modal_confirm('계좌잔액에서 지급처리가 진행됩니다.\n정산 확정하시겠습니까?', confirmFn, null);						
385
+				} else {
386
+					itp_fn_modal_confirm('일부금액이 계좌잔액에서 지급처리가 진행됩니다.\n정산 확정하시겠습니까?', confirmFn, null);	
387
+				}					
388
+			} else {
389
+				itp_fn_modal_confirm('정산 확정하시겠습니까?', confirmFn, null);
390
+			}
391
+		}
392
+	}, 
393
+	load: function(param) {
394
+		fn_ajax_call(STTL_REQ_INFO_STTL, param, this.callback, 'GET');
395
+	},
396
+	callback: function (result) {
397
+		// console.log(result);
398
+		pageObj.switchScreen('DETAIL');
399
+		$('#ITP_FORM_SETTMNG04010_DETAIL_BRAND_ID').val(result.brandId);
400
+		$('#ITP_FORM_SETTMNG04010_DETAIL_STORE_ID').val(result.storeId);
401
+		$('#ITP_FORM_SETTMNG04010_DETAIL_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
402
+		$('#ITP_FORM_SETTMNG04010_DETAIL_ACCT_BAL').val(result.acctBal); // 계좌잔액
403
+		$('#ITP_FORM_SETTMNG04010_DETAIL_STTL_REQ_AMT').val(result.sttlReqAmt); // 정산요청금액
404
+		
405
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnBrandNm').text(result.brandNm);
406
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnStoreNm').text(result.storeNm);
407
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
408
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnAcctBal').text(itp_fn_number_comma(result.acctBal));
409
+		
410
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlRjctRsn').text(result.sttlRjctRsn == null ? '' : result.sttlRjctRsn);
411
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlStNm').text(result.sttlStNm);
412
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlReqDt').text(result.sttlReqDt);  // 정산요청일자
413
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlReqAmt').text(itp_fn_number_comma(result.sttlReqAmt));
414
+		// $('#ITP_FORM_SETTMNG04010_DETAIL_STTL_DT').val(result.sttlDt);  // 정산일자
415
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlDt').text(result.sttlDt == null ? '' : result.sttlDt);  // 정산요청일자
416
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSttlAmt').text(itp_fn_number_comma(result.sttlAmt));
417
+		
418
+		// $('#ITP_FORM_SETTMNG04010_DETAIL .fnRcptYn').text(result.rcptYn == null ? '' : result.rcptYn);
419
+		// $('#ITP_FORM_SETTMNG04010_DETAIL .fnRcptDt').text(result.rcptDt == null ? '' : result.rcptDt);
420
+		
421
+		if(result.rcptYn == null) {
422
+			$('#ITP_FORM_SETTMNG04010_DETAIL .fnRcptYnDate').text('');	
423
+		} else if(result.rcptYn == 'N') {
424
+			$('#ITP_FORM_SETTMNG04010_DETAIL .fnRcptYnDate').text('N');
425
+		} else if(result.rcptYn == 'Y') {
426
+			$('#ITP_FORM_SETTMNG04010_DETAIL .fnRcptYnDate').text('Y (' + result.rcptDt + ')');
427
+		}
428
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnUnpaidAmt').text(itp_fn_number_comma(result.unpaidAmt));
429
+		
430
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSysRegDttm').text(result.sysRegDttm);
431
+		$('#ITP_FORM_SETTMNG04010_DETAIL .fnSysRegNm').text(result.sysRegNm);
432
+		
433
+		if(result.sttlStCd == 'ST10') { // 정산요청
434
+			$('#ITP_BTN_SETTMNG04010_STTL_END').show();
435
+		} else {
436
+			$('#ITP_BTN_SETTMNG04010_STTL_END').hide();
437
+		}
438
+
439
+		// 리스트 조회
440
+		modifyObj.grid.init();
441
+	},
442
+	grid: {
443
+		init: function() {
444
+			this.unload();
445
+			this.load();
446
+		},
447
+		load : function() {
448
+			let param = $('#ITP_FORM_SETTMNG04010_DETAIL').serializeObject();
449
+			param.gridSize = $.jgrid.defaults.rowNum;
450
+			param.pagingYn = false; // 페이징안함
451
+
452
+			var option = {
453
+				gridId: SETTMNG04010_DETAIL_GRID_ID,
454
+				colModel: gridColModel.view,
455
+				param: param,
456
+				url: DOMAIN + STTL_REQ_STL_GRID_LIST,
457
+				pager: SETTMNG04010_DETAIL_GRID_PAGER,
458
+				loadComplete: function(data) {
459
+					itp_fn_grid_load_complete(data, SETTMNG04010_DETAIL_GRID_ID, true, undefined, 'SETTMNG04010_DETAIL');
460
+				},
461
+				onPaging: function(action) {
462
+					var pagingFn = {
463
+						callBack: function(args) {
464
+							$(args).trigger('reloadGrid');
465
+						}
466
+					};
467
+					if (itp_fn_check_grid_is_writing(SETTMNG04010_DETAIL_GRID_ID)) {
468
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, SETTMNG04010_DETAIL_GRID_ID);
469
+						return 'stop';
470
+					} else {
471
+						itp_fn_grid_paging(SETTMNG04010_DETAIL_GRID_ID, action, param);
472
+					}
473
+				},
474
+				onSortCol: function(index, columnIndex, sortOrder) {
475
+					var sortingFn = {
476
+						callBack: function(args) {
477
+							$(args).trigger('reloadGrid');
478
+						}
479
+					};
480
+					if (itp_fn_check_grid_is_writing(SETTMNG04010_DETAIL_GRID_ID)) {
481
+						itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, SETTMNG04010_DETAIL_GRID_ID);
482
+						return 'stop';
483
+					} else {
484
+						itp_fn_grid_sorting(SETTMNG04010_DETAIL_GRID_ID, index, sortOrder);
485
+					}
486
+				}
487
+			};
488
+			itp_fn_grid_make_remote(option);
489
+		},
490
+		clearData : function() {
491
+			$(SETTMNG04010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
492
+			$(SETTMNG04010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
493
+			$(SETTMNG04010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
494
+			$(SETTMNG04010_DETAIL_GRID_EMPTY).show();
495
+		},
496
+		unload : function() {
497
+			$.jgrid.gridUnload(SETTMNG04010_DETAIL_GRID_ID);
498
+		}
499
+	}
500
+};

+ 8 - 2
src/main/webapp/js/app/stinfo/ITP_STINFO04010.js

@@ -422,13 +422,17 @@ let pageObj = {
422 422
         //파일업로드(등록/수정화면)
423 423
         var id = 'STINFO04010';
424 424
         $('#ITP_' + id + '_DETAIL_UPLOAD').empty();
425
+        $('#ITP_' + id + '_DETAIL_LOGO_FILE').empty();
426
+        var removeFn = (param) => {
427
+            $('#ITP_' + id + '_DETAIL_LOGO_FILE').empty();
428
+        };
425 429
         const fileArgs = {
426 430
             'fileNo': $('#ITP_FORM_' + id + '_DETAIL_FILE_NO').val(),
427 431
             'viewCd': $('#ITP_FORM_' + id + '_DETAIL_VIEW_CD').val(),
428 432
             'showYn': $('#ITP_' + id + '_DETAIL_UPLOAD').attr('data-show-yn'),
429 433
             'fileId': '#ITP_FORM_' + id + '_DETAIL_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
430 434
         };
431
-        itp_fn_set_file_upload('ITP_' + id + '_DETAIL_UPLOAD', 'affl', true, false, id, fileArgs);
435
+        itp_fn_set_file_upload('ITP_' + id + '_DETAIL_UPLOAD', 'affl', false, false, id, fileArgs, removeFn);
432 436
     },
433 437
     switchScreen: function(mode) {
434 438
 		SCREEN_MODE = mode;
@@ -736,9 +740,11 @@ let modifyObj = {
736 740
         // });
737 741
 		$('#ITP_FORM_STINFO04010_DETAIL #ITP_FORM_STINFO04010_DETAIL_OQ_MENU_CD').val(result.oqMenuCd);
738 742
 		$('#ITP_FORM_STINFO04010_DETAIL #ITP_FORM_STINFO04010_DETAIL_OQ_BRAND_ID').val(result.oqBrandId);
739
-        $('#ITP_FORM_OPER04010_DETAIL #ITP_FORM_STINFO04010_DETAIL_FILE_NO').val(result.itemImageFileNo);
743
+        $('#ITP_FORM_STINFO04010_DETAIL #ITP_FORM_STINFO04010_DETAIL_FILE_NO').val(result.itemImageFileNo);
740 744
         
741 745
         pageObj.fileUpload();
746
+        itp_fn_attach_file.view('ITP_STINFO040100_DETAIL_LOGO_FILE', result.fileLogNoList
747
+                , 'form-control itp_input', 'border:none; top:12px; left:12px; height:100px; width:125px; position:absolute;');
742 748
         itemClassLevel.data.push(result.itemClass1);
743 749
         itemClassLevel.data.push(result.itemClass2);
744 750
         itemClassLevel.data.push(result.itemClass3);

+ 1 - 1
src/main/webapp/main.html

@@ -191,7 +191,7 @@
191 191
 	<div id="ITP_WRAPPER">
192 192
 		<!-- <div id="ITP_OVERLAY"></div> -->
193 193
 
194
-		<!-- 상단 -->
194
+		<!-- 상단 -->
195 195
 		<header id="ITP_HEADER">
196 196
 			<div class="itp_head bg-orange">
197 197
 				<h1 class="text-center itp_tit">