|
@@ -22,7 +22,11 @@ let MAIN_CHART_SFT_STCK_CHART = '/api/main/chart/sft-stck-chart';
|
22
|
22
|
let MAIN_CHART_DELI_CHART = '/api/main/chart/deli-chart';
|
23
|
23
|
|
24
|
24
|
var chartCnt=0;
|
25
|
|
-
|
|
25
|
+var chartWidth=window.offsetWidth-16;
|
|
26
|
+function clickNotify(nticeNo) {
|
|
27
|
+ mobPopObj.popNotice.open(nticeNo);
|
|
28
|
+}
|
|
29
|
+
|
26
|
30
|
var mobMainObj = {
|
27
|
31
|
init: function () {
|
28
|
32
|
this.ui();
|
|
@@ -30,7 +34,7 @@ var mobMainObj = {
|
30
|
34
|
this.count.init();
|
31
|
35
|
this.chart.init();
|
32
|
36
|
},
|
33
|
|
- ui: function() {
|
|
37
|
+ ui: function() {
|
34
|
38
|
var authTpCd = fn_make_user_info.get('authTpCd');
|
35
|
39
|
if(authTpCd === '40' || authTpCd === '10') {
|
36
|
40
|
$('#ITP_MAIN_HEADER_BRAND').show();
|
|
@@ -38,23 +42,40 @@ var mobMainObj = {
|
38
|
42
|
$('#ITP_MAIN_HEADER_STORE').show();
|
39
|
43
|
} else if(authTpCd === '60') {
|
40
|
44
|
$('#ITP_MAIN_HEADER_SPPLY').show();
|
41
|
|
- }
|
|
45
|
+ }
|
42
|
46
|
},
|
43
|
47
|
notice: {
|
44
|
48
|
init: function () {
|
45
|
49
|
this.load();
|
46
|
50
|
},
|
47
|
51
|
load: function () {
|
48
|
|
- var searchFn = function (result) {
|
49
|
|
- console.log(result);
|
50
|
|
- if(result.gridRecords > 0) {
|
51
|
|
-
|
|
52
|
+ var searhFn = function(result) {
|
|
53
|
+ if(Array.isArray(result.gridRows) && result.gridRows.length ) {
|
|
54
|
+ var s='', idx=1;
|
|
55
|
+ for(var c of result.gridRows ) {
|
|
56
|
+ let title=c.nticeTitl;
|
|
57
|
+ if(title.length>62) {
|
|
58
|
+ title=title.substr(0,62)+'...';
|
|
59
|
+ }
|
|
60
|
+ s+=`<li>
|
|
61
|
+ <div class="itp_note_info">
|
|
62
|
+ <label>공지제목</label>
|
|
63
|
+ <span>:</span>
|
|
64
|
+ <div class="under fnNoteTitle"><a href="javascript:clickNotify('${c.nticeNo}')">${title}</a></div>
|
|
65
|
+ </div>
|
|
66
|
+ <div class="itp_note_info">
|
|
67
|
+ <label>공지일</label>
|
|
68
|
+ <span>:</span>
|
|
69
|
+ <div class="fnNoteDt">${c.addDt}</div>
|
|
70
|
+ </div>
|
|
71
|
+ </li>`;
|
|
72
|
+ }
|
|
73
|
+ $('#ITP_NOTE_ROW').html(s);
|
52
|
74
|
} else {
|
53
|
|
-
|
54
|
|
- }
|
|
75
|
+ $('#ITP_NOTE_ROW').html('<div class="itp_note_bar" style="display: block;"> <h1>등록된 게시물이 없습니다.</h1> </div>')
|
|
76
|
+ }
|
55
|
77
|
};
|
56
|
|
- const param = {};
|
57
|
|
- fn_ajax_call(NTICE_DETAIL_GRID_LIST, JSON.stringify(param), searchFn, 'POST');
|
|
78
|
+ fn_ajax_call(NTICE_DETAIL_GRID_LIST, "{}", searhFn, 'POST');
|
58
|
79
|
}
|
59
|
80
|
},
|
60
|
81
|
count: {
|
|
@@ -140,7 +161,7 @@ var mobMainObj = {
|
140
|
161
|
var options = {
|
141
|
162
|
legend: { position: 'left' },
|
142
|
163
|
bar: { groupWidth: "50%" },
|
143
|
|
- width: chartCnt==4? 245: 300,
|
|
164
|
+ width: chartWidth,
|
144
|
165
|
};
|
145
|
166
|
var chart = new google.charts.Bar(document.getElementById('ITP_PCH_REQ_GRAPH'));
|
146
|
167
|
// chart.draw(data, options);
|
|
@@ -159,7 +180,7 @@ var mobMainObj = {
|
159
|
180
|
var options = {
|
160
|
181
|
legend: { position: 'left' },
|
161
|
182
|
bar: { groupWidth: "50%" },
|
162
|
|
- width: chartCnt==4? 245: 300,
|
|
183
|
+ width: chartWidth,
|
163
|
184
|
};
|
164
|
185
|
var chart = new google.charts.Bar(document.getElementById('ITP_PCH_PODR_GRAPH'));
|
165
|
186
|
// chart.draw(data, options);
|
|
@@ -178,7 +199,7 @@ var mobMainObj = {
|
178
|
199
|
title: '구매요청 상위 품목',
|
179
|
200
|
legend: { position: 'left' },
|
180
|
201
|
bars: 'horizontal',
|
181
|
|
- width: 300,
|
|
202
|
+ width: chartWidth,
|
182
|
203
|
};
|
183
|
204
|
console.log("xxxxxxxxxxx drawChartReqUp xxxxxxxxxxx")
|
184
|
205
|
|
|
@@ -198,7 +219,7 @@ var mobMainObj = {
|
198
|
219
|
var options = {
|
199
|
220
|
// title: '정산',
|
200
|
221
|
legend: { position: 'left' },
|
201
|
|
- width: 300,
|
|
222
|
+ width: chartWidth,
|
202
|
223
|
};
|
203
|
224
|
var chart = new google.visualization.PieChart(document.getElementById('ITP_STTL_GRAPH'));
|
204
|
225
|
console.log("xxxxxxxxxxx drawChartcore xxxxxxxxxxx", data, options )
|
|
@@ -215,7 +236,7 @@ var mobMainObj = {
|
215
|
236
|
|
216
|
237
|
var options = {
|
217
|
238
|
title: '',
|
218
|
|
- width: 900,
|
|
239
|
+ width: chartWidth + 100,
|
219
|
240
|
legend: { position: 'top' }
|
220
|
241
|
};
|
221
|
242
|
|
|
@@ -242,3 +263,39 @@ function appCallFnVersion(version) {
|
242
|
263
|
MOBILE_APP_VERSION = version;
|
243
|
264
|
console.log(MOBILE_APP_VERSION);
|
244
|
265
|
}
|
|
266
|
+
|
|
267
|
+let mobPopObj = {
|
|
268
|
+ popNotice: {
|
|
269
|
+ popId: 'ITP_POP_NOTICE',
|
|
270
|
+ open: function (nticeNo) {
|
|
271
|
+ mobPopObj.show(this.popId);
|
|
272
|
+ this.search(nticeNo);
|
|
273
|
+ },
|
|
274
|
+ close: function() {
|
|
275
|
+ mobPopObj.hide(this.popId);
|
|
276
|
+ },
|
|
277
|
+ search: function (nticeNo) {
|
|
278
|
+ fn_ajax_call('/api/ntice/info-ntice', {nticeNo}, function(result) {
|
|
279
|
+ // 브랜드그룹 셋팅
|
|
280
|
+ $('#ITP_POP_NOTICE_AREA .fnNoteNm').html(result.nticeTitl);
|
|
281
|
+ $('#ITP_POP_NOTICE_AREA .fnNote').html(result.nticeDesc);
|
|
282
|
+ $('#ITP_POP_NOTICE_AREA .fnNoteFromTo').html(result.notiStDay+' ~ '+result.notiEdDay);
|
|
283
|
+ /*
|
|
284
|
+ $('#ITP_FORM_NOTICE_INFO_POPUP_AFFL_SHOP_NM').html(result.afflShopNm);
|
|
285
|
+ $('#ITP_FORM_NOTICE_INFO_POPUP_BRAND_NM').html(result.brandNm);
|
|
286
|
+ */
|
|
287
|
+ }, 'GET');
|
|
288
|
+ },
|
|
289
|
+
|
|
290
|
+ },
|
|
291
|
+ show: function(popId) {
|
|
292
|
+ console.log("popup show id=="+popId)
|
|
293
|
+ $('#' + popId+' .btn-pop-close').on('click', function() {
|
|
294
|
+ mobPopObj.hide(popId);
|
|
295
|
+ });
|
|
296
|
+ $('#' + popId).show();
|
|
297
|
+ },
|
|
298
|
+ hide: function(popId) {
|
|
299
|
+ $('#' + popId).closest('.mobile-pop-close').hide();
|
|
300
|
+ }
|
|
301
|
+};
|