bb19620c by zhangmeng

看版

1 parent ea14d3b4
...@@ -327,13 +327,12 @@ async function handelGetYS005() { ...@@ -327,13 +327,12 @@ async function handelGetYS005() {
327 327
328 328
329 function getdata() { 329 function getdata() {
330 total = 0 330 clear()
331 api.getDegree().then(res => { 331 handelGetYS001()
332 list.value = res.data 332 handelGetYS002()
333 for (let n in list.value) { 333 handelGetYS003()
334 total = total + (list.value[n] || 0) 334 handelGetYS004()
335 } 335 handelGetYS005()
336 })
337 } 336 }
338 337
339 function handleResize() { 338 function handleResize() {
......
...@@ -42,7 +42,21 @@ ...@@ -42,7 +42,21 @@
42 <div class="chartCard mt30"> 42 <div class="chartCard mt30">
43 <div> 43 <div>
44 <div class="title">应收账款余额组成</div> 44 <div class="title">应收账款余额组成</div>
45 <div class="po_right" style="justify-content: end;"> 45
46 <div class="po_right">
47 <div class="itemBox">
48 <el-select
49 v-model="type4"
50 class="select"
51 collapse-tags
52 multiple
53 placeholder="全部基地"
54 size="small"
55 @change="handelSelect4">
56 <el-option :label="`${Year1}年`" value="1"/>
57 <el-option :label="`${Year2}年`" value="2"/>
58 </el-select>
59 </div>
46 <div class="itemBox"> 60 <div class="itemBox">
47 <el-select 61 <el-select
48 v-model="type3" 62 v-model="type3"
...@@ -67,6 +81,7 @@ import {autoToolTip} from "@/plugins/auto-toolTip"; ...@@ -67,6 +81,7 @@ import {autoToolTip} from "@/plugins/auto-toolTip";
67 import * as echarts from "echarts"; 81 import * as echarts from "echarts";
68 import * as api from "@/apiPc/common" 82 import * as api from "@/apiPc/common"
69 import {getYS006} from '@/api/server.js' 83 import {getYS006} from '@/api/server.js'
84 import {dayjs} from 'element-plus'
70 85
71 const props = defineProps({ 86 const props = defineProps({
72 url: { 87 url: {
...@@ -86,12 +101,9 @@ const obj = computed(() => props.obj) ...@@ -86,12 +101,9 @@ const obj = computed(() => props.obj)
86 const zhuRef = ref(null) 101 const zhuRef = ref(null)
87 const lineRef = ref(null) 102 const lineRef = ref(null)
88 const payeeRef = ref(null) 103 const payeeRef = ref(null)
89 const kindList = ref([])
90 const dataA = ref([])
91 const radioA = ref('month')
92 const radioB = ref('month')
93 104
94 const type3 = ref('0') 105 const type3 = ref('0')
106 const type4 = ref(['1'])
95 const type2 = ref([]) 107 const type2 = ref([])
96 const type1 = ref(['1', '2']) 108 const type1 = ref(['1', '2'])
97 109
...@@ -111,7 +123,18 @@ const h1 = ref([]) ...@@ -111,7 +123,18 @@ const h1 = ref([])
111 const h2 = ref([]) 123 const h2 = ref([])
112 const h3 = ref([]) 124 const h3 = ref([])
113 125
126 const h4 = ref([])
127 const h5 = ref([])
128 const h6 = ref([])
129
130 const Year1 = dayjs().year() - 1
131 const Year2 = dayjs().year()
132
133 const legend1 = [`${Year1}待收款`, `${Year1}收费单待签`, `${Year1}合同待签`]
134 const legend2 = [`${Year2}待收款`, `${Year2}收费单待签`, `${Year2}合同待签`]
135
114 136
137 console.log(Year1, Year2)
115 let chartA 138 let chartA
116 let chartB 139 let chartB
117 let chartC 140 let chartC
...@@ -141,6 +164,9 @@ async function handelGetYS006() { ...@@ -141,6 +164,9 @@ async function handelGetYS006() {
141 h1.value = [...new Array(12).fill(0)]// 初始化 12 个月,默认值 0 164 h1.value = [...new Array(12).fill(0)]// 初始化 12 个月,默认值 0
142 h2.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0 165 h2.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
143 h3.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0 166 h3.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0
167 h4.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
168 h5.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
169 h6.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0
144 // h3.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0 170 // h3.value = new Array(12).fill(0); // 初始化 12 个月,默认值 0
145 type2.value = [] 171 type2.value = []
146 for (const v1 of list.value) { 172 for (const v1 of list.value) {
...@@ -172,6 +198,13 @@ async function handelGetYS006() { ...@@ -172,6 +198,13 @@ async function handelGetYS006() {
172 obj.value += v2.HTDQ / 10000 || 0; 198 obj.value += v2.HTDQ / 10000 || 0;
173 obj.info += v2.YSWELLINFO; 199 obj.info += v2.YSWELLINFO;
174 h3.value[i] = {...obj} 200 h3.value[i] = {...obj}
201
202 h4.value[i] += v2.JNYSDSK / 10000 || 0
203 h5.value[i] += v2.JNSFDDQ / 10000 || 0
204 let obj2 = {...h3.value[i]}
205 obj2.value += v2.JNHTDQ / 10000 || 0;
206 obj2.info += v2.JNYSWELLINFO;
207 h6.value[i] = {...obj2}
175 s1.value[i] += v2.INCOME / 10000 || 0; 208 s1.value[i] += v2.INCOME / 10000 || 0;
176 s2.value[i] += v2.LASTINCOME / 10000 || 0; 209 s2.value[i] += v2.LASTINCOME / 10000 || 0;
177 s3.value[i] += v2.LASTYSBALANCE / 10000 || 0; 210 s3.value[i] += v2.LASTYSBALANCE / 10000 || 0;
...@@ -187,7 +220,20 @@ async function handelGetYS006() { ...@@ -187,7 +220,20 @@ async function handelGetYS006() {
187 type1.value.includes('2') ? s4.value : [] 220 type1.value.includes('2') ? s4.value : []
188 ) 221 )
189 // h3.value = h3.value.map((item) => JSON.parse(item)) 222 // h3.value = h3.value.map((item) => JSON.parse(item))
190 setC(h1.value, h2.value, h3.value) 223 // setC(h1.value, h2.value, h3.value, h4.value, h5.value, h6.value)
224 setC(
225 type4.value.includes('1') ? h1.value : [],
226 type4.value.includes('1') ? h2.value : [],
227 type4.value.includes('1') ? h3.value : [],
228 type4.value.includes('2') ? h4.value : [],
229 type4.value.includes('2') ? h5.value : [],
230 type4.value.includes('2') ? h6.value : [],
231 type4.value.includes('1') ? legend1 : [],
232 type4.value.includes('2') ? legend2 : [],
233 )
234
235 console.log(2222222, h3.value)
236 console.log(33333333, h6.value)
191 } 237 }
192 238
193 function handelSelect1() { 239 function handelSelect1() {
...@@ -228,6 +274,10 @@ function handelSelect3() { ...@@ -228,6 +274,10 @@ function handelSelect3() {
228 h1.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0 274 h1.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
229 h2.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0 275 h2.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
230 h3.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0 276 h3.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0
277 h4.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
278 h5.value = [...new Array(12).fill(0)] // 初始化 12 个月,默认值 0
279 h6.value = [...new Array(12).fill({value: 0, info: ''})] // 初始化 12 个月,默认值 0
280
231 if (type3.value == '0') { 281 if (type3.value == '0') {
232 // h1.value.push(val.YSDSK)//应待收款 282 // h1.value.push(val.YSDSK)//应待收款
233 // h2.value.push(val.SFDDQ)//收费单待签 283 // h2.value.push(val.SFDDQ)//收费单待签
...@@ -241,6 +291,13 @@ function handelSelect3() { ...@@ -241,6 +291,13 @@ function handelSelect3() {
241 obj.value += monthData.HTDQ / 10000 || 0; 291 obj.value += monthData.HTDQ / 10000 || 0;
242 obj.info += monthData.YSWELLINFO; 292 obj.info += monthData.YSWELLINFO;
243 h3.value[i] = {...obj} 293 h3.value[i] = {...obj}
294
295 h4.value[i] += v2.JNYSDSK / 10000 || 0
296 h5.value[i] += v2.JNSFDDQ / 10000 || 0
297 let obj2 = {...h3.value[i]}
298 obj2.value += v2.JNHTDQ / 10000 || 0;
299 obj2.info += v2.JNYSWELLINFO;
300 h6.value[i] = {...obj2}
244 } 301 }
245 } 302 }
246 // h3.value = h3.value.map((item) => JSON.parse(item)) 303 // h3.value = h3.value.map((item) => JSON.parse(item))
...@@ -249,6 +306,9 @@ function handelSelect3() { ...@@ -249,6 +306,9 @@ function handelSelect3() {
249 h3.value = [] 306 h3.value = []
250 h2.value = [] 307 h2.value = []
251 h1.value = [] 308 h1.value = []
309 h4.value = []
310 h5.value = []
311 h6.value = []
252 let obj = list.value.find(item => item.BASEJC === type3.value) 312 let obj = list.value.find(item => item.BASEJC === type3.value)
253 for (const val of obj.list) { 313 for (const val of obj.list) {
254 h1.value.push(val.YSDSK / 10000 || 0)//应待收款 314 h1.value.push(val.YSDSK / 10000 || 0)//应待收款
...@@ -257,53 +317,56 @@ function handelSelect3() { ...@@ -257,53 +317,56 @@ function handelSelect3() {
257 value: val.HTDQ / 10000 || 0, 317 value: val.HTDQ / 10000 || 0,
258 info: val.YSWELLINFO 318 info: val.YSWELLINFO
259 })//合同待签 319 })//合同待签
320
321 h4.value.push(val.JNYSDSK / 10000 || 0)//应待收款
322 h5.value.push(val.JNSFDDQ / 10000 || 0)//收费单待签
323 let obj2 = {...h3.value[i]}
324 obj2.value += v2.JNHTDQ / 10000 || 0;
325 obj2.info += v2.JNYSWELLINFO;
326 h6.value[i] = {...obj2}
327
260 } 328 }
261 } 329 }
262 330 setC(
263 setC(h1.value, h2.value, h3.value) 331 type4.value.includes('1') ? h1.value : [],
332 type4.value.includes('1') ? h2.value : [],
333 type4.value.includes('1') ? h3.value : [],
334 type4.value.includes('2') ? h4.value : [],
335 type4.value.includes('2') ? h5.value : [],
336 type4.value.includes('2') ? h6.value : [],
337 type4.value.includes('1') ? legend1 : [],
338 type4.value.includes('2') ? legend2 : [],
339 )
340 // setC(h1.value, h2.value, h3.value, h4.value, h5.value, h6.value)
264 } 341 }
265 342
343 function handelSelect4() {
344 // console.log(type4.value)
345 // if (type4.value)
346 setC(
347 type4.value.includes('1') ? h1.value : [],
348 type4.value.includes('1') ? h2.value : [],
349 type4.value.includes('1') ? h3.value : [],
350 type4.value.includes('2') ? h4.value : [],
351 type4.value.includes('2') ? h5.value : [],
352 type4.value.includes('2') ? h6.value : [],
353 type4.value.includes('1') ? legend1 : [],
354 type4.value.includes('2') ? legend2 : [],
355 )
356
357 }
266 358
267 const init = () => { 359 const init = () => {
268 clear() 360 clear()
269 if (!intervalA) { 361 if (!intervalA) {
270 handelGetYS006() 362 handelGetYS006()
271 } 363 }
272 intervalA = setInterval(getdata, 1000 * 60 * 60); 364 intervalA = setInterval(getdata(), 1000 * 60 * 60);
273 } 365 }
274 366
275 const getdata = () => { 367 const getdata = () => {
276 clear() 368 clear()
277 getAdata() 369 handelGetYS006()
278 getBdata()
279 }
280
281 const getAdata = () => {
282 api.getJieDai({type: radioA.value}).then(res => {
283 dataA.value = []
284 kindList.value = []
285 for (let n of res.data) {
286 if (n.count > 0) {
287 kindList.value.push(n.name)
288 dataA.value.push(n.count)
289 }
290 }
291 setA()
292 })
293 }
294
295 const getBdata = () => {
296 api.getJianSuo({type: radioB.value}).then(res => {
297 dataA.value = []
298 kindList.value = []
299 for (let n of res.data) {
300 if (n.count > 0) {
301 kindList.value.push(n.name)
302 dataA.value.push(n.count)
303 }
304 }
305 setB()
306 })
307 } 370 }
308 371
309 const setA = (arr, arr2, arr3) => { 372 const setA = (arr, arr2, arr3) => {
...@@ -528,7 +591,7 @@ const setB = (arr1, arr2, arr3, arr4) => { ...@@ -528,7 +591,7 @@ const setB = (arr1, arr2, arr3, arr4) => {
528 ], 591 ],
529 series: [ 592 series: [
530 { 593 {
531 name: '2025年应收账款余额', 594 name: `${Year2}年应收账款余额`,
532 type: 'bar', 595 type: 'bar',
533 barGap: 0, 596 barGap: 0,
534 emphasis: { 597 emphasis: {
...@@ -551,7 +614,7 @@ const setB = (arr1, arr2, arr3, arr4) => { ...@@ -551,7 +614,7 @@ const setB = (arr1, arr2, arr3, arr4) => {
551 barWidth: '15%' 614 barWidth: '15%'
552 }, 615 },
553 { 616 {
554 name: '2024年应收账款余额', 617 name: `${Year1}年应收账款余额`,
555 type: 'bar', 618 type: 'bar',
556 emphasis: { 619 emphasis: {
557 focus: 'series' 620 focus: 'series'
...@@ -574,7 +637,7 @@ const setB = (arr1, arr2, arr3, arr4) => { ...@@ -574,7 +637,7 @@ const setB = (arr1, arr2, arr3, arr4) => {
574 barWidth: '15%' 637 barWidth: '15%'
575 }, 638 },
576 { 639 {
577 name: '2025年收入', 640 name: `${Year2}年收入`,
578 type: 'bar', 641 type: 'bar',
579 emphasis: { 642 emphasis: {
580 focus: 'series' 643 focus: 'series'
...@@ -596,7 +659,7 @@ const setB = (arr1, arr2, arr3, arr4) => { ...@@ -596,7 +659,7 @@ const setB = (arr1, arr2, arr3, arr4) => {
596 barWidth: '15%' 659 barWidth: '15%'
597 }, 660 },
598 { 661 {
599 name: '2024年收入', 662 name: `${Year1}年收入`,
600 type: 'bar', 663 type: 'bar',
601 emphasis: { 664 emphasis: {
602 focus: 'series' 665 focus: 'series'
...@@ -616,13 +679,14 @@ const setB = (arr1, arr2, arr3, arr4) => { ...@@ -616,13 +679,14 @@ const setB = (arr1, arr2, arr3, arr4) => {
616 borderWidth: 1 679 borderWidth: 1
617 }, 680 },
618 barWidth: '15%' 681 barWidth: '15%'
682
619 }, 683 },
620 ] 684 ]
621 } 685 }
622 chartB.setOption(option) 686 chartB.setOption(option)
623 autoHover(chartB, option, 0, 2000) 687 autoHover(chartB, option, 0, 2000)
624 } 688 }
625 const setC = (h1, h2, h3) => { 689 const setC = (h1, h2, h3, h4, h5, h6, l1, l2) => {
626 chartC = echarts.init(payeeRef.value) 690 chartC = echarts.init(payeeRef.value)
627 const option = { 691 const option = {
628 tooltip: { 692 tooltip: {
...@@ -652,13 +716,29 @@ const setC = (h1, h2, h3) => { ...@@ -652,13 +716,29 @@ const setC = (h1, h2, h3) => {
652 `; 716 `;
653 } 717 }
654 }, 718 },
655 legend: { 719 legend: [
656 top: '10%', 720 {
657 textStyle: { 721 data: l1,
658 color: '#FFF' 722 left: 'center',
723 itemGap: 20,
724 top: '5%',
725 textStyle: {
726 color: '#FFF'
727 },
659 }, 728 },
660 }, 729 {
730 data: l2,
731 left: 'center',
732 itemGap: 20,
733 padding: [25, 0, 0, 0], // 上右下左内边距
734 top: '5%',
735 textStyle: {
736 color: '#FFF'
737 },
738 }
739 ],
661 grid: { 740 grid: {
741 top: '30%',
662 left: '3%', 742 left: '3%',
663 right: '4%', 743 right: '4%',
664 bottom: '3%', 744 bottom: '3%',
...@@ -704,9 +784,10 @@ const setC = (h1, h2, h3) => { ...@@ -704,9 +784,10 @@ const setC = (h1, h2, h3) => {
704 ], 784 ],
705 series: [ 785 series: [
706 { 786 {
707 name: '待收款', 787 name: `${Year1}待收款`,
708 type: 'bar', 788 type: 'bar',
709 stack: 'Ad', 789 stack: 'Ad',
790 barGap: 0,
710 emphasis: { 791 emphasis: {
711 focus: 'series' 792 focus: 'series'
712 }, 793 },
...@@ -725,9 +806,10 @@ const setC = (h1, h2, h3) => { ...@@ -725,9 +806,10 @@ const setC = (h1, h2, h3) => {
725 barWidth: '40%' 806 barWidth: '40%'
726 }, 807 },
727 { 808 {
728 name: '收费单待签', 809 name: `${Year1}收费单待签`,
729 type: 'bar', 810 type: 'bar',
730 stack: 'Ad', 811 stack: 'Ad',
812 barGap: 0,
731 emphasis: { 813 emphasis: {
732 focus: 'series' 814 focus: 'series'
733 }, 815 },
...@@ -746,9 +828,10 @@ const setC = (h1, h2, h3) => { ...@@ -746,9 +828,10 @@ const setC = (h1, h2, h3) => {
746 barWidth: '40%' 828 barWidth: '40%'
747 }, 829 },
748 { 830 {
749 name: '合同待签', 831 name: `${Year1}合同待签`,
750 type: 'bar', 832 type: 'bar',
751 stack: 'Ad', 833 stack: 'Ad',
834 barGap: 0,
752 emphasis: { 835 emphasis: {
753 focus: 'series' 836 focus: 'series'
754 }, 837 },
...@@ -766,21 +849,87 @@ const setC = (h1, h2, h3) => { ...@@ -766,21 +849,87 @@ const setC = (h1, h2, h3) => {
766 }, 849 },
767 barWidth: '40%' 850 barWidth: '40%'
768 }, 851 },
852
853 {
854 name: `${Year2}待收款`,
855 type: 'bar',
856 stack: 'Ad2',
857 barGap: 0,
858 emphasis: {
859 focus: 'series'
860 },
861 // data: [320, 332, 301, 334, 390, 330, 320, 320, 332, 301, 334, 390],
862 data: h4,
863 itemStyle: {
864 color: {
865 type: 'linear',
866 x: 0, y: 0, x2: 1, y2: 1, // 垂直渐变
867 colorStops: [
868 {offset: 0, color: 'rgba(46, 125, 50, 1)'},
869 {offset: 1, color: 'rgba(76, 175, 80, 1)'}
870 ]
871 },
872 },
873 barWidth: '40%'
874 },
875 {
876 name: `${Year2}收费单待签`,
877 type: 'bar',
878 barGap: 0,
879 stack: 'Ad2',
880 emphasis: {
881 focus: 'series'
882 },
883 // data: [120, 132, 101, 134, 90, 230, 210, 101, 134, 90, 230, 210],
884 data: h5,
885 itemStyle: {
886 color: {
887 type: 'linear',
888 x: 0, y: 0, x2: 1, y2: 1, // 垂直渐变
889 colorStops: [
890 {offset: 0, color: 'rgba(58, 123, 213, 1)'},
891 {offset: 1, color: 'rgba(96, 181, 255, 1)'}
892
893 // {offset: 0, color: 'rgba(142, 36, 170, 1)'},
894 // {offset: 1, color: 'rgba(213, 0, 249, 1)'}
895
896 // {offset: 0, color: 'rgba(255, 215, 0, 0.8)'},
897 // {offset: 1, color: 'rgba(255, 255, 0, 0.6)'}
898 ]
899 },
900 },
901 barWidth: '40%'
902 },
903 {
904 name: `${Year2}合同待签`,
905 type: 'bar',
906 stack: 'Ad2',
907 barGap: 0,
908 emphasis: {
909 focus: 'series'
910 },
911 // data: [220, 182, 191, 234, 290, 330, 310, 220, 182, 191, 234, 290,],
912 data: h6,
913 itemStyle: {
914 color: {
915 type: 'linear',
916 x: 0, y: 0, x2: 1, y2: 1, // 垂直渐变
917 colorStops: [
918 // {offset: 0, color: 'rgba(255, 87, 34, 0.8)'},
919 // {offset: 1, color: 'rgba(255, 138, 101, 0.6)'}
920 {offset: 0, color: 'rgba(138, 43, 226, 0.8)'},
921 {offset: 1, color: 'rgba(180, 120, 255, 0.6)'}
922 ]
923 },
924 },
925 barWidth: '40%'
926 },
769 ] 927 ]
770 } 928 }
771 chartC.setOption(option) 929 chartC.setOption(option)
772 autoHover(chartC, option, 0, 2000) 930 autoHover(chartC, option, 0, 2000)
773 } 931 }
774 932
775 const radioAChange = (e) => {
776 clear()
777 getAdata()
778 }
779
780 const radioBChange = (e) => {
781 clear()
782 getBdata()
783 }
784 933
785 const clear = () => { 934 const clear = () => {
786 if (autoToolTip) { 935 if (autoToolTip) {
......
...@@ -417,24 +417,10 @@ async function handelGetYS009() { ...@@ -417,24 +417,10 @@ async function handelGetYS009() {
417 } 417 }
418 418
419 const getdata = () => { 419 const getdata = () => {
420 getA() 420 handelGetYS007()
421 getB() 421 handelGetYS008()
422 handelGetYS009()
422 } 423 }
423 const getA = () => {
424 //定时更新
425 api.getJieYue({type: radioA.value}).then(res => {
426 dataA.value = []
427 kindList.value = []
428 for (let n of res.data) {
429 if (n.count > 0) {
430 kindList.value.push(n.name)
431 dataA.value.push(n.count)
432 }
433 }
434 setA()
435 })
436 }
437
438 424
439 const setA = (arrY, arr1, arr2, arr3, markLineName, BC) => { 425 const setA = (arrY, arr1, arr2, arr3, markLineName, BC) => {
440 chartA = echarts.init(zhuRef.value) 426 chartA = echarts.init(zhuRef.value)
...@@ -619,20 +605,6 @@ const setA = (arrY, arr1, arr2, arr3, markLineName, BC) => { ...@@ -619,20 +605,6 @@ const setA = (arrY, arr1, arr2, arr3, markLineName, BC) => {
619 chartA.setOption(option) 605 chartA.setOption(option)
620 autoHover(chartA, option, 0, 2000) 606 autoHover(chartA, option, 0, 2000)
621 } 607 }
622
623 const getB = () => {
624 api.getJieShou().then(res => {
625 dataA.value = []
626 kindList.value = []
627 for (let n of res.data) {
628 if (n.count > 0) {
629 kindList.value.push(n.name)
630 dataA.value.push(n.count)
631 }
632 }
633 setB()
634 })
635 }
636 const setB = (arrY, arr1, arr2) => { 608 const setB = (arrY, arr1, arr2) => {
637 chartB = echarts.init(lineRef.value) 609 chartB = echarts.init(lineRef.value)
638 const option = { 610 const option = {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!