Explorar o código

메인화면 구매요청

marseyes %!s(int64=2) %!d(string=hai) anos
pai
achega
a1198a996b
Modificáronse 2 ficheiros con 25 adicións e 138 borrados
  1. 20 119
      src/main/webapp/js/app/main.js
  2. 5 19
      src/main/webapp/main.html

+ 20 - 119
src/main/webapp/js/app/main.js

@@ -5,6 +5,7 @@ const MAIN_NOTICE_GRID_PAGER = '#ITP_MAIN_NOTICE_jqGridPager';
5 5
 const MAIN_NOTICE_GRID_EMPTY = '#ITP_MAIN_NOTICE_jqGridEmpty';
6 6
 
7 7
 let NTICE_DETAIL_GRID_LIST = '/api/ntice/main-detail-grid-list';
8
+let MAIN_CHART_PCH_REQ_CHART = '/api/main/chart/pch-req-chart';
8 9
 
9 10
 require(['config'], function() {
10 11
 	require([
@@ -22,9 +23,13 @@ require(['config'], function() {
22 23
 	    	// itp_fn_fire_window_resize();
23 24
 
24 25
 			// 조회
25
-	    	itp_fn_MAIN_NOTICE_search();			
26
+	    	itp_fn_MAIN_NOTICE_search();		
26 27
 
27 28
 		}, 300);
29
+		
30
+		$('#ITP_FORM_MAIN_SEARCH_PR_TYPE').on('change', function() {
31
+			drawChartReq();
32
+		});
28 33
 				
29 34
 	});
30 35
 });
@@ -41,18 +46,20 @@ google.charts.setOnLoadCallback(drawLine);
41 46
 
42 47
 //구매요청 그래프
43 48
 function drawChartReq() {
44
-  var data = google.visualization.arrayToDataTable([
45
-    ['구매요청', '대기', '반려', '승인',],
46
-    ['2014', 4.2 , 2.5 , 2]
47
-  ]);
48
-
49
-  var options = {
50
-    	legend: { position: 'left' }
51
-  };
52
-
53
-  var chart = new google.charts.Bar(document.getElementById('ITP_PCH_REQ_GRAPH'));
54
-
55
-  chart.draw(data, options);
49
+	
50
+	const key = { brandId:fn_make_user_info.get('brandId'), storeId:fn_make_user_info.get('storeId'), prType: $('#ITP_FORM_MAIN_SEARCH_PR_TYPE').val() };
51
+	var param = $.param(key);
52
+	fn_ajax_call(MAIN_CHART_PCH_REQ_CHART, param, function(result) {
53
+		
54
+		var data = google.visualization.arrayToDataTable( eval(result.chartData) );
55
+	  	var options = {
56
+			legend: { position: 'left' }
57
+	  	};	
58
+	  	var chart = new google.charts.Bar(document.getElementById('ITP_PCH_REQ_GRAPH'));
59
+	  	chart.draw(data, options);
60
+		
61
+	}, 'GET');
62
+	
56 63
 }
57 64
 
58 65
 //구매발주 그래프
@@ -131,101 +138,6 @@ function drawLine() {
131 138
   chart.draw(data, options);
132 139
 }
133 140
 
134
-var itp_fn_MAIN_NOTICE_grid = {
135
-	init: function() {
136
-		// 데이터 없을때
137
-		itp_fn_MAIN_NOTICE_empty.push();
138
-		$(MAIN_NOTICE_GRID_EMPTY).on('click', function() {
139
-			itp_fn_MAIN_NOTICE_empty.back();
140
-			itp_MAIN_NOTICE_param.gridSize = $.jgrid.defaults.rowNum;
141
-			$(MAIN_NOTICE_GRID_ID).setGridParam({'postData': JSON.stringify(itp_MAIN_NOTICE_param)}).trigger('reloadGrid');
142
-		});
143
-		console.log("grid init", MAIN_NOTICE_GRID_LIST);
144
-		itp_fn_jqgrid_resize(MAIN_NOTICE_GRID_ID, MAIN_NOTICE_GRID_LIST, 'lg');
145
-	},
146
-	callBack: function() {
147
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
148
-		param.gridSize = $.jgrid.defaults.rowNum;
149
-		$(MAIN_NOTICE_GRID_ID).jqGrid({
150
-			colModel: [
151
-				{
152
-					index: 'NTICE_NO', name: 'nticeNo',
153
-					label: ITP_MSG_LOCALE.label.notiNo, //공지번호
154
-					width: '10', fixed: false, align: 'center',
155
-					sortable: false, hidden: false
156
-				},
157
-				{
158
-					index: 'NTICE_TITL', name: 'nticeTitl',
159
-					label: '공지사항', //공지제목
160
-					width: '15', fixed: false, align: 'left',
161
-					sortable: false, hidden: false
162
-				},
163
-				{
164
-					index: 'ADD_DT', name: 'addDt',
165
-					label: ITP_MSG_LOCALE.label.regDt, //등록일
166
-					width: '10', fixed: false, align: 'center',
167
-					sortable: false, hidden: false
168
-				}
169
-			],
170
-			loadBeforeSend: function(jqXHR) {
171
-			    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
172
-			},
173
-			postData: JSON.stringify(param),
174
-			url: DOMAIN + NTICE_DETAIL_GRID_LIST,
175
-			pager: MAIN_NOTICE_GRID_PAGER,
176
-			multiselect: false,
177
-			rownumbers: true,
178
-			onCellSelect: function(rowId, cellIdx, cellValue) {
179
-				var cm = $(this).jqGrid('getGridParam', 'colModel');
180
-				var colNm = cm[cellIdx].name;
181
-				if (colNm == 'nticeTitl') {
182
-					const nticeNoVal = $(this).jqGrid('getCell', rowId, 'nticeNo');
183
-					const key = {nticeNo: nticeNoVal, viewCd: 'R'};
184
-					var param = $.param(key);
185
-					// itp_fn_MAIN_NOTICE_view(param);
186
-					
187
-					fn_call_popup('comm', 'NOTICE_INFO_POPUP', '#ITP_ASIDE', function() {
188
-												
189
-					}, param, 'S');
190
-					$('#ITP_NOTICE_INFO_POPUP > div.modal-dialog').width('500px');
191
-				}
192
-		   	},
193
-			loadComplete: function(data) {
194
-				
195
-				console.log('>>>>> ' + JSON.stringify(data));
196
-				
197
-				itp_fn_grid_load_complete(data, MAIN_NOTICE_GRID_ID, true, 'number', 'MAIN_NOTICE', itp_MAIN_NOTICE_search, itp_fn_MAIN_NOTICE_empty, false, data.gridRecords, true);
198
-				var ids = $(MAIN_NOTICE_GRID_ID).getDataIDs();
199
-				$.each(ids, function(idx, rowId) {
200
-					$(MAIN_NOTICE_GRID_ID).jqGrid('setCell', rowId, 'nticeTitl', '', ITP_GRID_COL_STYLE.link);
201
-				});
202
-
203
-				if ($('#ITP_CONTAINER').data('openYn') == 'Y') {
204
-					$('#ITP_CONTAINER').data('openYn', 'N');
205
-					const keyNew = {nticeNo: $('#ITP_CONTAINER').data('nticeNo'), viewCd: 'R'};
206
-					var paramNew = $.param(keyNew);
207
-					itp_fn_MAIN_NOTICE_view(paramNew);
208
-				}
209
-		    },
210
-		    loadError: function(jqXHR, textStatus, errorThrown) {
211
-		    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
212
-		    },
213
-		    onPaging: function(action) {
214
-		    	itp_fn_grid_paging(MAIN_NOTICE_GRID_ID, action, param);
215
-		    }
216
-		}).navGrid(MAIN_NOTICE_GRID_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
217
-	},
218
-	clearData : function() {
219
-		$(MAIN_NOTICE_GRID_ID).jqGrid('clearGridData', true);
220
-		$(MAIN_NOTICE_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
221
-		$(MAIN_NOTICE_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
222
-		$(MAIN_NOTICE_GRID_EMPTY).show();
223
-	},
224
-	unload : function() {
225
-		$.jgrid.gridUnload(MAIN_NOTICE_GRID_ID);
226
-	}
227
-};
228
-
229 141
 var itp_fn_MAIN_NOTICE_search = function() {
230 142
 	// itp_fn_MAIN_NOTICE_grid.unload();
231 143
 	// itp_fn_MAIN_NOTICE_grid.callBack();
@@ -245,14 +157,3 @@ var itp_fn_MAIN_NOTICE_search = function() {
245 157
 	fn_ajax_call(NTICE_DETAIL_GRID_LIST, JSON.stringify(param), searhFn, 'POST');
246 158
 };
247 159
 
248
-let itp_MAIN_NOTICE_param = {};
249
-let itp_MAIN_NOTICE_search = false;
250
-var itp_fn_MAIN_NOTICE_empty = {
251
-	push: function() {		
252
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
253
-		itp_MAIN_NOTICE_param = param;
254
-	},
255
-	back: function() {
256
-		
257
-	}
258
-};

+ 5 - 19
src/main/webapp/main.html

@@ -161,23 +161,6 @@
161 161
 									<div class="itp_side_bar_header">
162 162
 										<label>공지사항</label>
163 163
 									</div>
164
-									<!--  
165
-									<div class="itp_side_bar_note">
166
-										<label class="fn">공지 xxx제목 조금 긴 제목</label>
167
-										<label class="date fn">2022.11.01</label>
168
-										<div class="fn">공지1 내용 들어가는곳fasdfdddddddddddddddasdfasdfsfdasdasdsadsaasdasdasdadsadaasdasdafddddddddddddddddddddddsdsfsdfdsfsdfddasdsadasdssds </div>
169
-									</div>
170
-									<div class="itp_side_bar_note">
171
-										<label class="fn">공지 2제목</label>
172
-										<label class="date fn">2022.11.01</label>
173
-										<div class="fn">공지 1 내용 가나다라마바상라ㅣㅁㄴ리ㅏㄴ멀ㄴ얾ㅣ;ㅁ너ㅣㅏ런ㅁ이ㅏ;러</div>
174
-									</div>
175
-									<div class="itp_side_bar_note">
176
-										<label class="fn">공지 2제목</label>
177
-										<label class="date fn">2022.11.01</label>
178
-										<div class="fn">공지 1 내용 가나다라마바상라ㅣㅁㄴ리ㅏㄴ멀ㄴ얾ㅣ;ㅁ너ㅣㅏ런ㅁ이ㅏ;러</div>
179
-									</div>
180
-									-->
181 164
 								</div>
182 165
 								<div id="ITP_MAIN_HEADER" style="display: inline-block;">
183 166
 									<div class="col_4" style="margin-left:0">
@@ -242,8 +225,11 @@
242 225
 								<div id="ITP_MAIN_GRAPH_AREA">
243 226
 									<div class="itp_graph_box">
244 227
 										<div class="itp_graph_side">
245
-											<select>
246
-												<option>fasdf</option>
228
+											<select id="ITP_FORM_MAIN_SEARCH_PR_TYPE" name="prType">
229
+												<option value="A">당일</option>
230
+												<option value="B">1주일</option>
231
+												<option value="C">15일</option>
232
+												<option value="D">1개월</option>
247 233
 											</select>
248 234
 											<div class="itp_graph_info_bar">
249 235
 												<div class="itp_graph_info">구매요청</div>