9a56dbd1 by zhangmeng

数据对接

1 parent e00f9d65
...@@ -4,17 +4,21 @@ ...@@ -4,17 +4,21 @@
4 <div class="title">应收款余额</div> 4 <div class="title">应收款余额</div>
5 <div ref="zhuRef" style="width: 100%; height: 24vh;"></div> 5 <div ref="zhuRef" style="width: 100%; height: 24vh;"></div>
6 </div> 6 </div>
7 7
8 <div class="chartCard mt30"> 8 <div class="chartCard mt30">
9 <div> 9 <div>
10 <div class="title">应收账款余额与收入</div> 10 <div class="title">应收账款余额与收入</div>
11 <div class="po_right"> 11 <div class="po_right">
12 <div class="itemBox"> 12 <div class="itemBox">
13 <el-select v-model="queryParams.select" class="select" placeholder="全部基地(可多选)" size="small"> 13 <el-select
14 <el-option label="全部基地1" value="1"/> 14 v-model="type2"
15 <el-option label="全部基地2" value="2"/> 15 class="select"
16 <el-option label="全部基地3" value="3"/> 16 collapse-tags
17 <el-option label="全部基地4" value="4"/> 17 multiple
18 placeholder="全部基地"
19 size="small"
20 @change="handelSelect2">
21 <el-option v-for="val in list" :key="val.BASE" :label="val.BASE" :value="val.BASE"/>
18 </el-select> 22 </el-select>
19 </div> 23 </div>
20 <div class="itemBox"> 24 <div class="itemBox">
...@@ -24,7 +28,7 @@ ...@@ -24,7 +28,7 @@
24 </div> 28 </div>
25 </div> 29 </div>
26 </div> 30 </div>
27 31
28 <div ref="lineRef" style="width: 100%; height: 24vh;"></div> 32 <div ref="lineRef" style="width: 100%; height: 24vh;"></div>
29 </div> 33 </div>
30 <div class="chartCard mt30"> 34 <div class="chartCard mt30">
...@@ -32,34 +36,18 @@ ...@@ -32,34 +36,18 @@
32 <div class="title">应收账款余额组成</div> 36 <div class="title">应收账款余额组成</div>
33 <div class="po_right" style="justify-content: end;"> 37 <div class="po_right" style="justify-content: end;">
34 <div class="itemBox"> 38 <div class="itemBox">
35 <el-select v-model="queryParams.select" class="select" placeholder="全部基地" size="small"> 39 <el-select
36 <el-option label="全部基地1" value="1"/> 40 v-model="type3"
37 <el-option label="全部基地2" value="2"/> 41 class="select"
38 <el-option label="全部基地3" value="3"/> 42 placeholder="全部基地"
39 <el-option label="全部基地4" value="4"/> 43 size="small"
44 @change="handelSelect3">
45 <el-option label="全部" value="0"/>
46 <el-option v-for="val in list" :key="val.BASE" :label="val.BASE" :value="val.BASE"/>
40 </el-select> 47 </el-select>
41 </div> 48 </div>
42 </div> 49 </div>
43 <!-- <div class="title">-->
44 <!-- <el-select>-->
45 <!-- <el-option label="全部基地(可多选)" value="month"/>-->
46 <!-- </el-select>-->
47 <!-- </div>-->
48 <!-- <div class="title">-->
49 <!-- <el-select>-->
50 <!-- <el-option label="数据因素(可多选)" value="month"/>-->
51 <!-- </el-select>-->
52 <!-- </div>-->
53
54 </div> 50 </div>
55 <!-- <div class="po_right">-->
56 <!-- <el-radio-group v-model="radioB" size="small" @change="radioBChange">-->
57 <!-- <el-radio-button label="本月" value="month"/>-->
58 <!-- <el-radio-button label="本季度" value="quarter"/>-->
59 <!-- <el-radio-button label="本年" value="year"/>-->
60 <!-- </el-radio-group>-->
61 <!-- </div>-->
62
63 <div ref="payeeRef" style="width: 100%; height: 24vh;"></div> 51 <div ref="payeeRef" style="width: 100%; height: 24vh;"></div>
64 </div> 52 </div>
65 </div> 53 </div>
...@@ -72,7 +60,6 @@ import * as echarts from "echarts"; ...@@ -72,7 +60,6 @@ import * as echarts from "echarts";
72 import * as api from "@/apiPc/common" 60 import * as api from "@/apiPc/common"
73 import {getYS006} from '@/api/server.js' 61 import {getYS006} from '@/api/server.js'
74 62
75
76 const queryParams = ref({ 63 const queryParams = ref({
77 select: null, 64 select: null,
78 select2: null 65 select2: null
...@@ -85,17 +72,24 @@ const dataA = ref([]) ...@@ -85,17 +72,24 @@ const dataA = ref([])
85 const radioA = ref('month') 72 const radioA = ref('month')
86 const radioB = ref('month') 73 const radioB = ref('month')
87 74
75 const type3 = ref('0')
76 const type2 = ref([])
77
88 const list = ref([]) 78 const list = ref([])
79
89 const set1 = ref([]) 80 const set1 = ref([])
90 const arr1 = ref([]) 81
91 const arr2 = ref([]) 82 const s1 = ref([])
92 const arr3 = ref([]) 83 const s2 = ref([])
93 const arr4 = ref([]) 84 const s3 = ref([])
85 const s4 = ref([])
86
94 87
95 const h1 = ref([]) 88 const h1 = ref([])
96 const h2 = ref([]) 89 const h2 = ref([])
97 const h3 = ref([]) 90 const h3 = ref([])
98 91
92
99 let chartA 93 let chartA
100 let chartB 94 let chartB
101 let chartC 95 let chartC
...@@ -107,7 +101,7 @@ onMounted(() => { ...@@ -107,7 +101,7 @@ onMounted(() => {
107 window.addEventListener('resize', handleResize); 101 window.addEventListener('resize', handleResize);
108 handelGetYS006() 102 handelGetYS006()
109 // setA() 103 // setA()
110 setB() 104 // setB()
111 // setC() 105 // setC()
112 }) 106 })
113 107
...@@ -115,34 +109,108 @@ async function handelGetYS006() { ...@@ -115,34 +109,108 @@ async function handelGetYS006() {
115 const res = await getYS006() 109 const res = await getYS006()
116 list.value = res.data.baselist 110 list.value = res.data.baselist
117 set1.value = [] 111 set1.value = []
118 arr1.value = [] 112 s1.value = new Array(12).fill(0)
119 arr2.value = [] 113 s2.value = new Array(12).fill(0)
120 arr3.value = [] 114 s3.value = new Array(12).fill(0)
121 arr4.value = [] 115 s4.value = new Array(12).fill(0)
122 h1.value = [] 116
123 h2.value = [] 117 h1.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
124 h3.value = [] 118 h2.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
125 for (const val of list.value) { 119 h3.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
120 type2.value = []
121 for (const v1 of list.value) {
126 set1.value.push({ 122 set1.value.push({
127 value: val.TOTAL, 123 value: v1.TOTAL,
128 name: val.BASE 124 name: v1.BASE
129 }) 125 })
130 arr1.value.push(val.YSBALANCE) 126 type2.value.push(v1.BASE)
131 arr2.value.push(val.LASTTOTAL) 127 for (const v2 of v1.list) {
132 arr3.value.push(val.TOTAL) 128 const i2 = v2.MONTH - 1; // 转为 0~11 的索引
133 arr4.value.push(val.LASTTOTAL) 129 h1.value[i2] += v2.YSDSK || 0;
134 h1.value.push(val.YSDSK) 130 h2.value[i2] += v2.SFDDQ || 0;
135 h2.value.push(val.SFDDQ) 131 h3.value[i2] += v2.HTDQ || 0;
136 h3.value.push(val.HTDQ) 132 s1.value[i2] += v2.INCOME || 0;
133 s2.value[i2] += v2.LASTINCOME || 0;
134 s3.value[i2] += v2.LASTYSBALANCE || 0;
135 s4.value[i2] += v2.YSBALANCE || 0;
136
137 }
137 } 138 }
139
140 // for (const val of list.value) {
141 // listY3.value.push(val.BASE)
142 // set1.value.push({
143 // value: val.TOTAL,
144 // name: val.BASE
145 // })
146 // arr2.value.push(val.LASTTOTAL)
147 // arr3.value.push(val.TOTAL)
148 // arr4.value.push(val.LASTTOTAL)
149 //
150 // h1.value.push(val.YSDSK)//应代收款
151 // h2.value.push(val.SFDDQ)//收费单待签
152 // h3.value.push(val.HTDQ)//合同待签
153 //
154 // s1.push(val.INCOME)//今年收入
155 // s2.push(val.LASTINCOME)//去年收入
156 // s3.push(val.LASTYSBALANCE)//去年应收账款余额
157 // s4.push(val.YSBALANCE)//去年收入
158 // }
159 //
160
161 setA(set1.value)
162 setB(s1.value, s2.value, s3.value, s4.value)
163 setC(h1.value, h2.value, h3.value)
164 }
138 165
166 function handelSelect2() {
167 console.log(type2.value)
168 let arr = type2.value.map(val => list.value.find(item => item.BASE === val))
169 for (const v1 of arr) {
170 for (const v2 of v1.list) {
171 const i2 = v2.MONTH - 1; // 转为 0~11 的索引
172 s1.value[i2] += v2.INCOME || 0;
173 s2.value[i2] += v2.LASTINCOME || 0;
174 s3.value[i2] += v2.LASTYSBALANCE || 0;
175 s4.value[i2] += v2.YSBALANCE || 0;
176 }
177 }
178 setB(s1.value, s2.value, s3.value, s4.value)
179 }
139 180
140 setA(set1.value) 181 function handelSelect3() {
182 console.log(type3.value)
183 h1.value = []
184 h2.value = []
185 h3.value = []
186 if (type3.value == '0') {
187 // h1.value.push(val.YSDSK)//应代收款
188 // h2.value.push(val.SFDDQ)//收费单待签
189 // h3.value.push(val.HTDQ)//合同待签
190 h1.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
191 h2.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
192 h3.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
193
194 for (const department of list.value) {
195 for (const monthData of department.list) {
196 const monthIndex = monthData.MONTH - 1; // 转为 0~11 的索引
197 h1.value[monthIndex] += monthData.YSDSK || 0;
198 h2.value[monthIndex] += monthData.SFDDQ || 0;
199 h3.value[monthIndex] += monthData.HTDQ || 0;
200 }
201 }
202
203 } else {
204 // 找到对应的数据
205 let obj = list.value.find(item => item.BASE === type3.value)
206 for (const val of obj.list) {
207 h1.value.push(val.YSDSK)//应代收款
208 h2.value.push(val.SFDDQ)//收费单待签
209 h3.value.push(val.HTDQ)//合同待签
210 }
211 }
212
141 setC(h1.value, h2.value, h3.value) 213 setC(h1.value, h2.value, h3.value)
142 // resYear1.value = res.data.yeargroup
143 // handelBing1(res.data.yeargroup[0], res.data.yeargroup[1])
144 // handelZhu1(res.data.yeargroup[0], res.data.yeargroup[1])
145 // activeName1.value = res.data.yeargroup[1].YEAR
146 } 214 }
147 215
148 216
...@@ -203,7 +271,7 @@ const setA = (arr) => { ...@@ -203,7 +271,7 @@ const setA = (arr) => {
203 }, 271 },
204 formatter: function (name) { 272 formatter: function (name) {
205 let value = 0 273 let value = 0
206 for (let i = 0; i < option.series[2].data.length; i++) { 274 for (let i = 0; i < option.series[2].data?.length; i++) {
207 if (option.series[2].data[i].name === name) { 275 if (option.series[2].data[i].name === name) {
208 value = option.series[2].data[i].value; 276 value = option.series[2].data[i].value;
209 break; 277 break;
...@@ -244,7 +312,7 @@ const setA = (arr) => { ...@@ -244,7 +312,7 @@ const setA = (arr) => {
244 avoidLabelOverlap: false, 312 avoidLabelOverlap: false,
245 label: { 313 label: {
246 show: false, 314 show: false,
247 315
248 }, 316 },
249 emphasis: { 317 emphasis: {
250 scale: false 318 scale: false
...@@ -305,8 +373,7 @@ const setA = (arr) => { ...@@ -305,8 +373,7 @@ const setA = (arr) => {
305 chartA.setOption(option) 373 chartA.setOption(option)
306 autoHover(chartA, option, 2, 2000) 374 autoHover(chartA, option, 2, 2000)
307 } 375 }
308 376 const setB = (arr1, arr2, arr3, arr4) => {
309 const setB = () => {
310 chartB = echarts.init(lineRef.value) 377 chartB = echarts.init(lineRef.value)
311 const option = { 378 const option = {
312 tooltip: { 379 tooltip: {
...@@ -339,7 +406,7 @@ const setB = () => { ...@@ -339,7 +406,7 @@ const setB = () => {
339 type: 'solid' 406 type: 'solid'
340 } 407 }
341 }, 408 },
342 409
343 }, 410 },
344 ], 411 ],
345 yAxis: [ 412 yAxis: [
...@@ -358,7 +425,7 @@ const setB = () => { ...@@ -358,7 +425,7 @@ const setB = () => {
358 } 425 }
359 }, 426 },
360 } 427 }
361 428
362 ], 429 ],
363 series: [ 430 series: [
364 { 431 {
...@@ -368,7 +435,8 @@ const setB = () => { ...@@ -368,7 +435,8 @@ const setB = () => {
368 emphasis: { 435 emphasis: {
369 focus: 'series' 436 focus: 'series'
370 }, 437 },
371 data: [320, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390], 438 // data: [320, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390],
439 data: arr4,
372 itemStyle: { 440 itemStyle: {
373 color: { 441 color: {
374 type: 'linear', 442 type: 'linear',
...@@ -389,7 +457,8 @@ const setB = () => { ...@@ -389,7 +457,8 @@ const setB = () => {
389 emphasis: { 457 emphasis: {
390 focus: 'series' 458 focus: 'series'
391 }, 459 },
392 data: [120, 132, 101, 134, 90, 230, 210, 101, 134, 90, 230, 210], 460 // data: [120, 132, 101, 134, 90, 230, 210, 101, 134, 90, 230, 210],
461 data: arr3,
393 itemStyle: { 462 itemStyle: {
394 color: { 463 color: {
395 type: 'linear', 464 type: 'linear',
...@@ -410,7 +479,8 @@ const setB = () => { ...@@ -410,7 +479,8 @@ const setB = () => {
410 emphasis: { 479 emphasis: {
411 focus: 'series' 480 focus: 'series'
412 }, 481 },
413 data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,], 482 // data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,],
483 data: arr1,
414 itemStyle: { 484 itemStyle: {
415 color: { 485 color: {
416 type: 'linear', 486 type: 'linear',
...@@ -431,7 +501,8 @@ const setB = () => { ...@@ -431,7 +501,8 @@ const setB = () => {
431 emphasis: { 501 emphasis: {
432 focus: 'series' 502 focus: 'series'
433 }, 503 },
434 data: [150, 232, 201, 154, 190, 330, 410, 201, 154, 190, 330, 410], 504 // data: [150, 232, 201, 154, 190, 330, 410, 201, 154, 190, 330, 410],
505 data: arr2,
435 itemStyle: { 506 itemStyle: {
436 color: { 507 color: {
437 type: 'linear', 508 type: 'linear',
...@@ -629,7 +700,7 @@ onUnmounted(() => { ...@@ -629,7 +700,7 @@ onUnmounted(() => {
629 padding: calc(12 * 100vw / 1920) calc(50 * 100vw / 1920) 0; 700 padding: calc(12 * 100vw / 1920) calc(50 * 100vw / 1920) 0;
630 font-size: calc(20 * 100vw / 1920); 701 font-size: calc(20 * 100vw / 1920);
631 position: relative; 702 position: relative;
632 703
633 &::after { 704 &::after {
634 content: ''; 705 content: '';
635 width: 100%; 706 width: 100%;
...@@ -659,7 +730,7 @@ onUnmounted(() => { ...@@ -659,7 +730,7 @@ onUnmounted(() => {
659 background-size: 100% 100%; 730 background-size: 100% 100%;
660 position: relative; 731 position: relative;
661 overflow: hidden; 732 overflow: hidden;
662 733
663 .po_right { 734 .po_right {
664 position: absolute; 735 position: absolute;
665 right: calc(20 * 100vw / 1920); 736 right: calc(20 * 100vw / 1920);
...@@ -668,53 +739,53 @@ onUnmounted(() => { ...@@ -668,53 +739,53 @@ onUnmounted(() => {
668 width: 50%; 739 width: 50%;
669 display: flex; 740 display: flex;
670 justify-content: space-between; 741 justify-content: space-between;
671 742
672 :deep(.el-radio-button) { 743 :deep(.el-radio-button) {
673 --el-radio-button-checked-bg-color: linear-gradient(0deg, #2C67B7, #40A5F4); 744 --el-radio-button-checked-bg-color: linear-gradient(0deg, #2C67B7, #40A5F4);
674 --el-radio-button-checked-text-color: #fff; 745 --el-radio-button-checked-text-color: #fff;
675 --el-radio-button-disabled-checked-fill: #03DAFD; 746 --el-radio-button-disabled-checked-fill: #03DAFD;
676 --el-radio-button-checked-border-color: #0D599A; 747 --el-radio-button-checked-border-color: #0D599A;
677 748
678 .el-radio-button__inner { 749 .el-radio-button__inner {
679 color: #7ECEF4; 750 color: #7ECEF4;
680 background: transparent; 751 background: transparent;
681 border-color: #0D599A; 752 border-color: #0D599A;
682 } 753 }
683 754
684 .el-radio-button__original-radio:checked + .el-radio-button__inner { 755 .el-radio-button__original-radio:checked + .el-radio-button__inner {
685 color: #fff; 756 color: #fff;
686 background: linear-gradient(0deg, #2C67B7, #40A5F4); 757 background: linear-gradient(0deg, #2C67B7, #40A5F4);
687 } 758 }
688 } 759 }
689 } 760 }
690 761
691 .itemBox { 762 .itemBox {
692 width: 45%; 763 width: 45%;
693 background: #0B2239; 764 background: #0B2239;
694 box-shadow: 0 0 24px 0 rgba(130, 220, 255, 0.5), 0 0 16px 0 rgba(130, 220, 255, 0.27); 765 box-shadow: 0 0 24px 0 rgba(130, 220, 255, 0.5), 0 0 16px 0 rgba(130, 220, 255, 0.27);
695 border-radius: 5px; 766 border-radius: 5px;
696 border: 1px solid #12BFFF; 767 border: 1px solid #12BFFF;
697 768
698 .select { 769 .select {
699 background-color: transparent; 770 background-color: transparent;
700 771
701 :deep(.el-select__wrapper) { 772 :deep(.el-select__wrapper) {
702 background-color: transparent; 773 background-color: transparent;
703 box-shadow: 0 0 0 0; 774 box-shadow: 0 0 0 0;
704 border: none; 775 border: none;
705 } 776 }
706 777
707 /* 选项样式 */ 778 /* 选项样式 */
708 :deep(.el-select-dropdown__item) { 779 :deep(.el-select-dropdown__item) {
709 color: white !important; 780 color: white !important;
710 background-color: transparent !important; 781 background-color: transparent !important;
711 } 782 }
712 783
713 /* 鼠标悬停效果 */ 784 /* 鼠标悬停效果 */
714 :deep(.el-select-dropdown__item.hover) { 785 :deep(.el-select-dropdown__item.hover) {
715 background-color: rgba(255, 255, 255, 0.1) !important; 786 background-color: rgba(255, 255, 255, 0.1) !important;
716 } 787 }
717 788
718 /* placeholder */ 789 /* placeholder */
719 :deep(.el-select__placeholder) { 790 :deep(.el-select__placeholder) {
720 font-family: PingFang SC, serif; 791 font-family: PingFang SC, serif;
...@@ -725,13 +796,23 @@ onUnmounted(() => { ...@@ -725,13 +796,23 @@ onUnmounted(() => {
725 -webkit-background-clip: text; 796 -webkit-background-clip: text;
726 -webkit-text-fill-color: transparent 797 -webkit-text-fill-color: transparent
727 } 798 }
799
800 :deep(.el-tag--info) {
801 background-color: rgb(33, 123, 188, .1); /* 背景色 */
802 border-color: #1c81a6; /* 边框色 */
803 color: #fff; /* 文字颜色 */
804 }
805
806 :deep(.el-icon ) {
807 color: #fff;
808 }
728 } 809 }
729 } 810 }
730 } 811 }
731 812
732 .downDot { 813 .downDot {
733 position: relative; 814 position: relative;
734 815
735 &::after { 816 &::after {
736 content: ''; 817 content: '';
737 width: calc(6 * 100vw / 1920); 818 width: calc(6 * 100vw / 1920);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!