1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
vatModule.controller('VatModelAnalysisController', ['$scope', '$translate', '$uibModal', 'vatSessionService', 'modelConfigurationService', '$compile', '$timeout', '$q', 'SweetAlert', '$http', 'apiConfig',
function ($scope, $translate, $uibModal, vatSessionService, modelConfigurationService, $compile, $timeout, $q, SweetAlert, $http, apiConfig) {
'use strict';
//由 project 决定的在本页面中固定的变量
$scope.industryId = vatSessionService.project.industryID;
$scope.organizationId = vatSessionService.project.organizationID;
$scope.projectId = vatSessionService.project.id;
$scope.projectYear = vatSessionService.project.year;
$scope.projectPeriod = vatSessionService.month;
$scope.serviceTypeId = vatSessionService.project.serviceTypeID;
var xArray = ['1月', '2月', '3月', '4月', '5月', '6月',
'7月', '8月', '9月', '10月', '11月', '12月'];
var colors = ['#ffb600', '#dc6900', '#a32020'];
//增值税负担率
function getBurdenRateData(chart) {
var yArray = ['应纳税额', '主营业务收入', '占比'];
$http.get('/reportAnalysis/burdenRateData/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '增值税负担率'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 10,
data: yArray
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: [
{
type: 'value',
name: '金额',
// min: 0,
// max: 250,
position: 'right',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return formatNum(val);
}
}
},
{
type: 'value',
name: '占比',
// min: 0,
// max: 25,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return (val * 100) + ' %';
}
}
}
],
series: [
{
name: yArray[0],
type: 'bar',
itemStyle: {
color: colors[1]
},
data: res.data.vatAmount
},
{
name: yArray[1],
type: 'bar',
itemStyle: {
color: colors[0]
},
data: res.data.income
},
{
name: yArray[2],
type: 'line',
yAxisIndex: 1,
itemStyle: {
color: colors[2]
},
lineStyle: {
color: colors[2]
},
data: res.data.rate
}
]
};
chart.setOption(option);
}
})
}
//增值税申报表收入与会计收入差异离散度分析
function getDispersion(chart) {
$http.get('/reportAnalysis/burdenRateData/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var data = [];
for (var i in xArray) {
data.push([xArray[i], res.data.rate[i]]);
}
var option = {
title: {
text: '增值税申报表收入与会计收入差异离散度分析'
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: {},
series: [{
// symbolSize: 20,
itemStyle: {
color: '#dc6900'
},
data: data,
type: 'scatter'
}],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
}
};
chart.setOption(option);
}
})
}
//进项税额占主营业务成本的比例
function getIncomeRateData(chart) {
var yArray = ['进项税额', '主营业务成本', '占比'];
$http.get('/reportAnalysis/incomeRate/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '进项税额占主营业务成本比例'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 10,
data: yArray
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: [
{
type: 'value',
name: '金额',
// min: 0,
// max: 250,
position: 'right',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return formatNum(val);
}
}
},
{
type: 'value',
name: '占比',
// min: 0,
// max: 25,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return (val * 100) + ' %';
}
}
}
],
series: [
{
name: yArray[0],
type: 'bar',
itemStyle: {
color: colors[1]
},
data: res.data.vatAmount
},
{
name: yArray[1],
type: 'bar',
itemStyle: {
color: colors[0]
},
data: res.data.income
},
{
name: yArray[2],
type: 'line',
yAxisIndex: 1,
itemStyle: {
color: colors[2]
},
data: res.data.rate
}
]
};
chart.setOption(option);
}
})
}
//进项税转出额波动率
function getIncomeVolatilityData(chart) {
var yArray = ['本期进项税额转出额', '进项税额', '占比'];
$http.get('/reportAnalysis/incomeVolatility/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '进项税转出额波动率'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 10,
data: yArray
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: [
{
type: 'value',
name: '金额',
// min: 0,
// max: 250,
position: 'right',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return formatNum(val);
}
}
},
{
type: 'value',
name: '占比',
// min: 0,
// max: 25,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return (val * 100) + ' %';
}
}
}
],
series: [
{
name: yArray[0],
type: 'bar',
itemStyle: {
color: colors[1]
},
data: res.data.vatAmount
},
{
name: yArray[1],
type: 'bar',
itemStyle: {
color: colors[0]
},
data: res.data.income
},
{
name: yArray[2],
type: 'line',
yAxisIndex: 1,
itemStyle: {
color: colors[2]
},
data: res.data.rate
}
]
};
chart.setOption(option);
}
})
}
//增值税应税收入、增值税免、抵、退办法出口收入 占会计收入比例
function getVatIncomeRateData(chart) {
var yArray = ['增值税应税收入', '增值税免、抵、退出口收入', '其余'];
$http.get('/reportAnalysis/vatIncomeRate/' + $scope.projectId + "/" + $scope.projectPeriod, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '应税收入、出口收入比例'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 5,
data: yArray
},
series: [
{
name: '占比',
type: 'pie',
radius: '55%',
center: ['50%', '60%'],
data: [
{value: res.data.vatAmount[0], name: '增值税应税收入'},
{value: res.data.income[0], name: '增值税免、抵、退出口收入'},
{value: res.data.rate[0], name: '其余'}
],
itemStyle: {
emphasis: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
chart.setOption(option);
}
})
}
//应税收入、出口收入占会计收入比例及趋势
function getVatIncomeLineData(chart) {
var yArray = ['应税收入', '出口收入','会计收入','应税占比','出口占比'];
$http.get('/reportAnalysis/vatIncomeLine/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '应税收入、出口收入占会计收入比例及趋势'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 10,
data: yArray
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: [
{
type: 'value',
name: '金额',
// min: 0,
// max: 250,
position: 'right',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return formatNum(val);
}
}
},
{
type: 'value',
name: '占比',
// min: 0,
// max: 250,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return (val * 100) + ' %';
}
}
}
],
series: [
{
name: yArray[0],
type: 'bar',
itemStyle: {
color: '#eb8c00'
},
data: res.data.val1
},
{
name: yArray[1],
type: 'bar',
itemStyle: {
color: '#dc6900'
},
data: res.data.val2
},
{
name: yArray[2],
type: 'bar',
itemStyle: {
color: colors[0]
},
data: res.data.val3
},
{
name: yArray[3],
type: 'line',
yAxisIndex: 1,
itemStyle: {
color: colors[2]
},
data: res.data.rate1
},
{
name: yArray[4],
type: 'line',
yAxisIndex: 1,
itemStyle: {
color: '#602320'
},
data: res.data.rate2
}
]
};
chart.setOption(option);
}
})
}
//已抵扣进项税波动率
function getDeductionData(chart) {
var yArray = ['占比', '基准值'];
$http.get('/reportAnalysis/deduction/' + $scope.projectId, apiConfig.createVat())
.success(function (res) {
if (res && 0 === res.code) {
var option = {
title: {
text: '已抵扣进项税波动率'
},
color: colors,
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
grid: {
right: '20%'
},
toolbox: {
feature: {
dataView: {show: false, readOnly: false},
restore: {show: false},
saveAsImage: {show: true}
}
},
legend: {
type: 'scroll',
bottom: 10,
data: yArray
},
xAxis: [
{
type: 'category',
axisTick: {
alignWithLabel: true
},
data: xArray
}
],
yAxis: [
{
type: 'value',
name: '占比',
// max: 25,
position: 'left',
axisLine: {
lineStyle: {
color: colors[2]
}
},
axisLabel: {
formatter: function (val) {
return (val * 100) + ' %';
}
}
}
],
series: [
{
name: yArray[1],
type: 'line',
itemStyle: {
color: '#968c6d'
},
data: ['1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1']
},
{
name: yArray[0],
type: 'bar',
itemStyle: {
color: colors[1]
},
data: res.data.rate
}
]
};
chart.setOption(option);
}
})
}
function formatNum(strNum) {
if (strNum.length <= 3) {
return strNum;
}
if (!/^(\+|-)?(\d+)(\.\d+)?$/.test(strNum)) {
return strNum;
}
var a = RegExp.$1,
b = RegExp.$2,
c = RegExp.$3;
var re = new RegExp();
re.compile("(\\d)(\\d{3})(,|$)");
while (re.test(b)) {
b = b.replace(re, "$1,$2$3");
}
return a + "" + b + "" + c;
}
function init() {
var width = $("div .row")[0].offsetWidth;
$('div[name="p_chart"]').css("width", (width / 2) - 80);
$('div[name="p_chart"]').css("height", 400);
var burdenRateDiv = echarts.init(document.getElementById('burdenRateDiv'));
var discreteAnalysisDiv = echarts.init(document.getElementById('discreteAnalysisDiv'));
var incomeRateDiv = echarts.init(document.getElementById('incomeRateDiv'));
var incomeVolatilityDiv = echarts.init(document.getElementById('incomeVolatilityDiv'));
// var vatIncomeRateDiv = echarts.init(document.getElementById('vatIncomeRateDiv'));
var vatIncomeLineDiv = echarts.init(document.getElementById('vatIncomeLineDiv'));
var deductionDiv = echarts.init(document.getElementById('deductionDiv'));
getBurdenRateData(burdenRateDiv);
getDispersion(discreteAnalysisDiv);
getIncomeRateData(incomeRateDiv);
getIncomeVolatilityData(incomeVolatilityDiv);
// getVatIncomeRateData(vatIncomeRateDiv);
getVatIncomeLineData(vatIncomeLineDiv);
getDeductionData(deductionDiv);
}
(function () {
init();
})();
}
]);