|
@@ -27,7 +27,7 @@ require(['config'], function() {
|
27
|
27
|
// 조회
|
28
|
28
|
itp_fn_MAIN_NOTICE_search();
|
29
|
29
|
itp_fn_MAIN_COUNT();
|
30
|
|
-
|
|
30
|
+
|
31
|
31
|
$('#ITP_FORM_MAIN_SEARCH_PR_TYPE').on('change', function() {
|
32
|
32
|
drawChartReq();
|
33
|
33
|
});
|
|
@@ -56,6 +56,7 @@ require(['config'], function() {
|
56
|
56
|
google.charts.load('current', {'packages':['corechart']});
|
57
|
57
|
google.charts.load('current', {'packages':['bar']});
|
58
|
58
|
|
|
59
|
+ /*
|
59
|
60
|
$('#ITP_MAIN_HEADER_BRAND').hide();
|
60
|
61
|
$('#ITP_MAIN_HEADER_STORE').hide();
|
61
|
62
|
$('#ITP_MAIN_HEADER_SPPLY').hide();
|
|
@@ -68,11 +69,13 @@ require(['config'], function() {
|
68
|
69
|
$('#ITP_MAIN_DRAW_DELI_CHART').hide(); // 입고
|
69
|
70
|
$('#ITP_MAIN_DRAW_RELEASE_CHART').hide(); // 출고
|
70
|
71
|
$('#ITP_MAIN_DRAW_ORDERS_CHART').hide(); // 수주내역
|
71
|
|
-
|
72
|
|
- var authTpCd = fn_make_user_info.get('authTpCd'); // 10:관리자, 20:영업담당자, 30:가맹점, 40:브랜드, 50:매장, 60:공급사
|
|
72
|
+ */
|
|
73
|
+
|
|
74
|
+ var authTpCd = fn_make_user_info.get('authTpCd');
|
|
75
|
+ // 10:관리자, 20:영업담당자, 30:가맹점, 40:브랜드, 50:매장, 60:공급사
|
73
|
76
|
// console.log('>>>> authTpCd = ' + authTpCd);
|
74
|
|
-
|
75
|
|
- if( authTpCd == '40' ) { // 브랜드
|
|
77
|
+ var chartCnt=0;
|
|
78
|
+ if( authTpCd == '40' || authTpCd == '10' ) { // 브랜드
|
76
|
79
|
$('#ITP_MAIN_HEADER_BRAND').show();
|
77
|
80
|
|
78
|
81
|
$('#ITP_MAIN_DRAW_CHART_REQ').show();
|
|
@@ -84,8 +87,13 @@ require(['config'], function() {
|
84
|
87
|
$('#ITP_MAIN_DRAW_CHART_REQ_UP').show();
|
85
|
88
|
google.charts.setOnLoadCallback(drawChartReqUp); // 매출순위
|
86
|
89
|
|
87
|
|
- $('#ITP_MAIN_DRAW_CHART_CORE').show();
|
88
|
|
- google.charts.setOnLoadCallback(drawChartcore); // 정산
|
|
90
|
+ if(fn_make_user_info.get('brandId')) {
|
|
91
|
+ $('#ITP_MAIN_DRAW_CHART_CORE').show();
|
|
92
|
+ google.charts.setOnLoadCallback(drawChartcore); // 정산
|
|
93
|
+ chartCnt=4;
|
|
94
|
+ } else {
|
|
95
|
+ chartCnt=3;
|
|
96
|
+ }
|
89
|
97
|
|
90
|
98
|
$('#ITP_MAIN_DRAW_LINE').show();
|
91
|
99
|
$('#ITP_MAIN_DRAW_LINE .itp_main_draw_line').show();
|
|
@@ -104,7 +112,7 @@ require(['config'], function() {
|
104
|
112
|
|
105
|
113
|
$('#ITP_MAIN_DRAW_CHART_CORE').show();
|
106
|
114
|
google.charts.setOnLoadCallback(drawChartcore); // 정산
|
107
|
|
-
|
|
115
|
+ chartCnt=4;
|
108
|
116
|
} else if( authTpCd == '60' ) { // 공급사
|
109
|
117
|
$('#ITP_MAIN_HEADER_SPPLY').show();
|
110
|
118
|
|
|
@@ -119,7 +127,12 @@ require(['config'], function() {
|
119
|
127
|
|
120
|
128
|
$('#ITP_MAIN_DRAW_CHART_CORE').show();
|
121
|
129
|
google.charts.setOnLoadCallback(drawChartcore); // 정산
|
122
|
|
- }
|
|
130
|
+ chartCnt=4;
|
|
131
|
+ }
|
|
132
|
+
|
|
133
|
+ if(chartCnt==3) {
|
|
134
|
+ $('#ITP_MAIN_GRAPH_AREA').css('grid-template-columns','1fr 1fr 1fr');
|
|
135
|
+ }
|
123
|
136
|
|
124
|
137
|
}, 300);
|
125
|
138
|
});
|
|
@@ -129,20 +142,21 @@ require(['config'], function() {
|
129
|
142
|
function drawChartReq() {
|
130
|
143
|
|
131
|
144
|
const key = { brandId:fn_make_user_info.get('brandId'), storeId:fn_make_user_info.get('storeId'), prType: $('#ITP_FORM_MAIN_SEARCH_PR_TYPE').val() };
|
132
|
|
- var param = $.param(key);
|
|
145
|
+ var param = $.param(key);
|
133
|
146
|
fn_ajax_call(MAIN_CHART_PCH_REQ_CHART, param, function(result) {
|
134
|
147
|
|
135
|
148
|
var data = google.visualization.arrayToDataTable( eval(result.chartData) );
|
136
|
149
|
var options = {
|
137
|
150
|
legend: { position: 'left' },
|
138
|
|
- bar: { groupWidth: "90%" }
|
|
151
|
+ bar: { groupWidth: "50%" },
|
|
152
|
+ width: 300,
|
139
|
153
|
};
|
140
|
154
|
var chart = new google.charts.Bar(document.getElementById('ITP_PCH_REQ_GRAPH'));
|
141
|
155
|
// chart.draw(data, options);
|
|
156
|
+ console.log("xx draw char req xx", param, data, chart)
|
142
|
157
|
chart.draw(data, google.charts.Bar.convertOptions(options));
|
143
|
158
|
|
144
|
|
- }, 'GET');
|
145
|
|
-
|
|
159
|
+ }, 'GET');
|
146
|
160
|
}
|
147
|
161
|
|
148
|
162
|
//수주내역 그래프
|
|
@@ -156,8 +170,9 @@ function drawChartOrders() {
|
156
|
170
|
|
157
|
171
|
var data = google.visualization.arrayToDataTable( eval(result.chartData) );
|
158
|
172
|
var options = {
|
159
|
|
- legend: { position: 'left' }
|
160
|
|
- };
|
|
173
|
+ legend: { position: 'left' },
|
|
174
|
+ width: 300,
|
|
175
|
+ };
|
161
|
176
|
var chart = new google.charts.Bar(document.getElementById('ITP_ORDERS_GRAPH'));
|
162
|
177
|
chart.draw(data, options);
|
163
|
178
|
|
|
@@ -176,8 +191,9 @@ function drawChartDeli() {
|
176
|
191
|
|
177
|
192
|
var data = google.visualization.arrayToDataTable( eval(result.chartData) );
|
178
|
193
|
var options = {
|
179
|
|
- legend: { position: 'left' }
|
180
|
|
- };
|
|
194
|
+ legend: { position: 'left' },
|
|
195
|
+ width: 300,
|
|
196
|
+ };
|
181
|
197
|
var chart = new google.charts.Bar(document.getElementById('ITP_DELI_GRAPH'));
|
182
|
198
|
chart.draw(data, options);
|
183
|
199
|
|
|
@@ -196,7 +212,8 @@ function drawChartRelease() {
|
196
|
212
|
|
197
|
213
|
var data = google.visualization.arrayToDataTable( eval(result.chartData) );
|
198
|
214
|
var options = {
|
199
|
|
- legend: { position: 'left' }
|
|
215
|
+ legend: { position: 'left' },
|
|
216
|
+ width: 300,
|
200
|
217
|
};
|
201
|
218
|
var chart = new google.charts.Bar(document.getElementById('ITP_RELEASE_GRAPH'));
|
202
|
219
|
chart.draw(data, options);
|
|
@@ -216,7 +233,8 @@ function drawChartPodr() {
|
216
|
233
|
|
217
|
234
|
var options = {
|
218
|
235
|
legend: { position: 'left' },
|
219
|
|
- bar: { groupWidth: "90%" }
|
|
236
|
+ bar: { groupWidth: "50%" },
|
|
237
|
+ width: 300,
|
220
|
238
|
};
|
221
|
239
|
var chart = new google.charts.Bar(document.getElementById('ITP_PCH_PODR_GRAPH'));
|
222
|
240
|
// chart.draw(data, options);
|
|
@@ -238,8 +256,10 @@ function drawChartReqUp() {
|
238
|
256
|
var options = {
|
239
|
257
|
title: '구매요청 상위 품목',
|
240
|
258
|
legend: { position: 'left' },
|
241
|
|
- bars: 'horizontal'
|
|
259
|
+ bars: 'horizontal',
|
|
260
|
+ width: 300,
|
242
|
261
|
};
|
|
262
|
+ console.log("xxxxxxxxxxx drawChartReqUp xxxxxxxxxxx")
|
243
|
263
|
|
244
|
264
|
var chart = new google.charts.Bar(document.getElementById('ITP_PCH_REQ_UP_ITEM_GRAPH'));
|
245
|
265
|
chart.draw(data, options);
|
|
@@ -259,11 +279,12 @@ function drawChartcore() {
|
259
|
279
|
var data = google.visualization.arrayToDataTable( eval(result.chartData) );
|
260
|
280
|
|
261
|
281
|
var options = {
|
262
|
|
- // title: '정산',
|
263
|
|
- legend: { position: 'left' }
|
264
|
|
- };
|
265
|
|
-
|
|
282
|
+ // title: '정산',
|
|
283
|
+ legend: { position: 'left' },
|
|
284
|
+ width: 300,
|
|
285
|
+ };
|
266
|
286
|
var chart = new google.visualization.PieChart(document.getElementById('ITP_STTL_GRAPH'));
|
|
287
|
+ console.log("xxxxxxxxxxx drawChartcore xxxxxxxxxxx", data, options )
|
267
|
288
|
chart.draw(data, options);
|
268
|
289
|
|
269
|
290
|
}, 'GET');
|