datain.vue
22.1 KB
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
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
<template>
<view class="page">
<!-- 图表 -->
<!-- <qiun-title-bar title="柱状图+渐变色" /> -->
<view class="charts-box" v-if="!isAdministrator && !isCompany ">
<view class="example-body">
<uni-datetime-picker v-model="range" type="daterange" @change="change" />
</view>
<view class="biao-item">
<view class="biao">
固投、利润、销售收入和总产值
</view>
<view class="charts">
<qiun-data-charts type="column" :opts="opts1" :chartData="chartsDataColumn1" />
</view>
</view>
<view class="biao-item">
<view class="biao">
数量和税收
</view>
<view class="charts">
<qiun-data-charts type="column" :opts="opts1" :chartData="chartsDataColumn2" />
</view>
</view>
<view class="biao-item">
<view class="biao">
园区企业量、园区服务、产品量专家人才、惠企政策等
</view>
<view class="charts">
<qiun-data-charts type="column" :opts="opts1" :chartData="chartsDataColumn4" />
</view>
</view>
<view class="biao-item">
<view class="biao">
进口总额和出口总额
</view>
<view class="charts">
<qiun-data-charts type="column" :opts="opts1" :chartData="chartsDataColumn3" />
</view>
</view>
<view class="biao-item">
<view class="biao">
平台访问统计
</view>
<view class="charts">
<qiun-data-charts type="column" :opts="opts1" :chartData="chartsDataColumn6" />
</view>
</view>
<view class="biao-item">
<view class="biao">
占地面积Top5
</view>
<view class="charts">
<qiun-data-charts type="bar" :opts="opts3" :chartData="chartsDataColumn5" />
</view>
</view>
<view class="biao-item">
<view class="biao">
产品数量统计
</view>
<view class="charts">
<qiun-data-charts type="pie" :opts="opts2" :chartData="chartData5" />
</view>
</view>
<view class="biao-item">
<view class="biao">
填报企业规模大览
</view>
<view class="charts">
<qiun-data-charts type="pie" :opts="opts2" :chartData="chartData2" />
</view>
</view>
<view class="biao-item">
<view class="biao">
填报企业行业分类大览
</view>
<view class="charts">
<qiun-data-charts type="pie" :opts="opts2" :chartData="chartData3" />
</view>
</view>
<view class="biao-item">
<view class="biao">
填报企业从业人数大览
</view>
<view class="charts">
<qiun-data-charts type="pie" :opts="opts2" :chartData="chartData4" />
</view>
</view>
<view class="user-list" >
<view class="list" @click="toCompanyInfoList()">
<view class="title">
<text>企业基础情况填报列表查看</text>
</view>
<view class="more-content">
<view class="more-content-img">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
</view>
<view class="listBox" v-else>
<view class="content">
<view class="user-list" v-show="isAdmin">
<view class="list" @click="toData" style="background-color:#D32D25;">
<view class="title" style="color:white">
<text>表单设计</text>
</view>
<view class="more-content">
<view class="more-content-img">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
<!-- <view class="user-list">
<view class="list" @click="toPostCom()">
<view class="title">
<text>企业信息采集</text>
</view>
<view class="more-content">
<view class="more-content-img">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view> -->
<view class="user-list">
<view class="list" @click="toPostCom()">
<view class="title">
<text>企业基础情况填报</text>
</view>
<view class="more-content">
<view class="more-content-img">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
<view class="user-list" v-show="isAdmin">
<view class="list" @click="toCompanyInfoList()">
<view class="title">
<text>企业基础情况填报列表查看</text>
</view>
<view class="more-content">
<view class="more-content-img">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
<view class="user-list" style="padding-top: 0;padding-bottom: 0;" v-if="!isCompany && isAdministrator" v-for="(item,index) in formList">
<view class="list" v-for="(it,index) in item.children">
<view class="title" @click="toForm(it)">
<text>{{it.fullName}}</text>
</view>
<view class="more-content">
<view class="buttons" v-show="isAdmin" style="margin-right: 20rpx;" @click="toTellInfo">
<button size="mini">企业选择</button>
</view>
<view class="buttons" v-show="isAdmin" style="margin-right: 20rpx;"
@click="tellNotice(it.id)">
<button size="mini" type="warn">通知</button>
</view>
<view class="more-content-img" @click="toForm(it)">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
<view class="user-list" style="padding-top: 0;padding-bottom: 0;" v-if="isCompany && !isAdministrator">
<view class="list" v-for="(it,index) in formList">
<view class="title" @click="toForm(it)">
<text>{{it.fullName}}</text>
</view>
<view class="more-content">
<view class="buttons" v-show="isAdmin" style="margin-right: 20rpx;" @click="toTellInfo">
<button size="mini">企业选择</button>
</view>
<view class="buttons" v-show="isAdmin" style="margin-right: 20rpx;"
@click="tellNotice(it.id)">
<button size="mini" type="warn">通知</button>
</view>
<view class="more-content-img" @click="toForm(it)">
<image src="../../static/right2.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import request from "@/utils/request"
export default {
data() {
return {
formList: [],
// newArr:[],
// 判断用户是否是管理员
isAdmin: false,
range: ['2024-02-20', '2024-2-26'],
// 开始日期
startDate: '2024-02-20',
// 结束日期
endDate: '2024-2-26',
isSystem: false,
chartsDataColumn1: {
categories: [],
series: [{
name: "固投",
data: []
},
{
name: "利润",
data: []
},
{
name: "销售收入",
data: []
},
{
name: "总产值",
data: []
},
]
},
chartsDataColumn2: {
categories: [],
series: [{
name: "数量",
data: []
},
{
name: "税收",
data: []
},
]
},
chartsDataColumn6: {
categories: [],
series: [{
name: "数量",
data: []
},
{
name: "税收",
data: []
},
]
},
chartsDataColumn4: {
categories: ['总和'],
series: [{
name: "园区企业量",
data: []
},
{
name: "规上企业量(工业)",
data: []
},
{
name: "规上企业(限上商贸/服务业)",
data: []
},
{
name: "园区服务/产品量",
data: []
},
{
name: "惠企政策",
data: []
},
{
name: "专家人才",
data: []
},
]
},
chartsDataColumn3: {
categories: [],
series: [{
name: "进口总额",
data: []
},
{
name: "出口总额",
data: []
},
]
},
chartsDataColumn5: {
categories: ['一汽解放汽车有限公司四川分公司', '四川华侨凤凰纸业有限公司', '德阳南控科技产业发展有限公司', '四川依科制药有限公司', '四川广汉宝湾国际物流有限公司'],
series: [{
name: "占地面积(亩)",
data: ['828', '700', '471', '380', '372']
}, ]
},
opts1: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [15, 15, 0, 5],
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true
},
yAxis: {
data: [{
min: 0
}]
},
extra: {
column: {
type: "group",
width: 30,
activeBgColor: "#000000",
activeBgOpacity: 0.08
}
}
},
chartData2: {
series: [{
data: []
}]
},
chartData4: {
series: [{
data: [{
name: '0-20人',
value: '0'
},
{
name: '20-50人',
value: '0'
},
{
name: '50-100人',
value: '0'
},
{
name: '100-200人',
value: '0'
},
{
name: '200人以上',
value: '0'
},
]
}]
},
chartData3: {
series: [{
data: []
}]
},
chartData5: {
series: [{
data: []
}]
},
opts2: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [5, 5, 5, 5],
enableScroll: false,
extra: {
pie: {
activeOpacity: 0.5,
activeRadius: 10,
offsetAngle: 0,
labelWidth: 15,
border: true,
borderWidth: 3,
borderColor: "#FFFFFF",
linearType: "custom"
}
}
},
opts3: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
padding: [15, 30, 0, 5],
enableScroll: false,
// enableScroll: true,
legend: {},
xAxis: {
boundaryGap: "justify",
disableGrid: false,
// disableGrid: true,
min: 0,
// axisLine: false,
axisLine: true,
max: 70
},
yAxis: {
// min:30
},
extra: {
bar: {
type: "stack",
width: 30,
meterBorde: 1,
meterFillColor: "#FFFFFF",
activeBgColor: "#000000",
activeBgOpacity: 0.08,
categoryGap: 2
}
}
},
companysId: [],
tellInfo: [],
isPostCompany:false,
isAdministrator:false,
isCompany:false,
// 普通用户
usUser:false
}
},
onUnload() {
uni.$off('idInfo')
uni.$off('tellInfo')
},
onShow() {
let data = uni.getStorageSync('idInfo')
// console.log('公司ID数据',uni.getStorageSync('idInfo'))
console.log('datain公司ID数据',data)
this.companysId = data
},
onLoad() {
this.getUser()
this.getPostQing()
// this.getFormList()
this.getHomeTopNumber()
this.getProNumber()
this.getCountNumber()
// uni.$on('idInfo', res => {
// console.log("选择公司页面返回的公司ID", res)
// if (res.length > 0)
// this.companysId = res
// console.log("传给后端的公司ID", this.companysId)
// })
// this.init()
// let data = uni.getStorageSync('idInfo')
// // console.log('公司ID数据',uni.getStorageSync('idInfo'))
// console.log('datain公司ID数据',data)
uni.$on('tellInfo', res => {
console.log("tell信息", res)
if (res.length > 0)
this.tellInfo = res
})
},
created() {
// this.getFormList()
},
methods: {
// init(){
// let data = uni.getStorageSync('idInfo')
// // console.log('公司ID数据',uni.getStorageSync('idInfo'))
// console.log('datain公司ID数据',data)
// },
change(e) {
console.log('change事件:', e);
this.startDate = e[0];
this.endDate = e[1]
console.log(this.startDate, this.endDate)
this.getPostQing()
},
// 跳转到企业信息采集列表
toCompanyInfoList(){
uni.navigateTo({
url:'/pages/companyInfoList/companyInfoList'
})
},
// 跳转到选择通知企业页面
toTellInfo() {
uni.navigateTo({
url: '/pages/tellInfo/tellInfo'
})
},
// 进行通知
tellNotice(id) {
// 进行通知
console.log("公司ID测试重复",this.companysId)
request({
url: '/api/extend/demo/SendMessageByApp',
method: 'post',
data: {
title: this.tellInfo[0],
companys: this.companysId,
desc: this.tellInfo[1],
reid: id,
type: '表单填报通知',
link: '/pages/apply/dynamicModel/index',
fangshi: '通知'
}
}).then(res => {
console.log('通知结果', res)
if (res.code == 200) {
uni.showToast({
icon: "success",
title: "通知成功"
})
this.companysId = []
}
})
},
// 获取pc端首页等数量
getHomeTopNumber() {
this.chartsDataColumn4.series[0].data = []
this.chartsDataColumn4.series[1].data = []
this.chartsDataColumn4.series[2].data = []
this.chartsDataColumn4.series[3].data = []
this.chartsDataColumn4.series[4].data = []
this.chartsDataColumn4.series[5].data = []
request({
url: '/api/SubDev/zyoaarticle/homeTopNumbers',
method: 'get',
data: {}
}).then(res => {
console.log('HomeTopNumber', res)
if (res.code == 200) {
this.chartsDataColumn4.series[0].data.push(res.data.count_yqqyl)
this.chartsDataColumn4.series[1].data.push(res.data.count_gsqyl_gy)
this.chartsDataColumn4.series[2].data.push(res.data.count_gsqyl_fwy)
this.chartsDataColumn4.series[3].data.push(res.data.count_yqfwcpl)
this.chartsDataColumn4.series[4].data.push(res.data.count_hqzc)
this.chartsDataColumn4.series[5].data.push(res.data.count_gdrc)
console.log(this.chartsDataColumn4)
}
})
},
// 获取产品数量统计
getProNumber() {
this.chartData5.series[0].data = []
request({
url: 'https://www.dygxq-es.cn/api/system/DataInterface/398719263910659333/Actions/Response?n=1709609644',
method: 'get',
data: {}
}).then(res => {
console.log('产品数量', res)
if (res.code == 200) {
this.chartData5.series[0].data = res.data.series[0].data.map(it => {
return {
name: it.name,
value: it.value
}
})
// for(let i=0;i<res.data.series[0].data.length;i++){
// this.chartData5.series[0].data.push({
// name:res.data.series[0].data[i].name,
// data:[res.data.series[0].data[i].value]
// })
// }
console.log('this.chartData5', this.chartData5)
}
})
},
// 获取平台访问统计
getCountNumber() {
this.chartsDataColumn6.series = []
request({
url: "https://www.dygxq-es.cn/api/system/DataInterface/398709672229471493/Actions/Response?n=1709609644",
method: 'get',
data: {}
}).then(res => {
console.log('平台访问统计', res)
if (res.code == 200) {
this.chartsDataColumn6.categories = ['每月访问统计']
for(let i=0;i<res.data.series[0].data.length;i++){
this.chartsDataColumn6.series.push({
name: `${i+1}月`,
data: [res.data.series[0].data[i]]
})
}
// this.chartsDataColumn6.series = res.data.series[0].data.map(it => {
// return {
// name: '',
// data: [it]
// }
// })
}
})
},
// 获取用户信息判断是否有表单设计和企业通知的ID,权限判断authority = 361476463456683269
getUser() {
if (uni.getStorageSync('user')) {
let userCode = uni.getStorageSync('user')
// console.log("用户的code", this.userCode)
this.userId = userCode.userInfo.userId
// this.userName = userCode.userInfo.userAccount
// this.userIcon = userCode.userInfo.headIcon
// this.organizeName = userCode.userInfo.organizeName
let authorityID = userCode.permissionList
// 判断是否有企业信息采集和查看权限
this.isAdmin = authorityID.some(it => it.modelId === '361476463456683269')
this.isPostCompany = authorityID.some(it => it.modelId === '361675070210311429')
this.isAdministrator = userCode.userInfo.isAdministrator
this.isCompany = userCode.userInfo.isCompany
if(this.isCompany && !this.isAdministrator){
console.log('普通用户')
this.usUser = true
this.getUsFormList()
}else{
this.usUser = false
console.log('管理员')
this.getFormList()
}
console.log('是否有表单设计和企业通知权限', this.isAdmin)
console.log(userCode)
} else {
uni.showToast({
title: '请登录',
icon: 'none'
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/index'
})
})
}
},
// 获取填报情况
getPostQing() {
let that = this
that.chartsDataColumn1.categories = []
that.chartsDataColumn2.categories = []
that.chartsDataColumn3.categories = []
that.chartsDataColumn3.series[0].data = []
that.chartsDataColumn3.series[1].data = []
that.chartsDataColumn2.series[0].data = []
that.chartsDataColumn2.series[1].data = []
that.chartsDataColumn1.series[0].data = []
that.chartsDataColumn1.series[1].data = []
that.chartsDataColumn1.series[2].data = []
that.chartsDataColumn1.series[3].data = []
that.chartData3.series[0].data = []
that.chartData2.series[0].data = []
that.chartData4.series[0].data = []
request({
url: '/api/SubDev/baseenterprisemanager/GetDataNumber',
method: 'get',
data: {
startDate: this.startDate,
endDate: this.endDate
}
}).then(res => {
if (res.code === 200) {
console.log('res', res)
for (let i = 0; i < res.data.GetCreateDateNumber.length; i++) {
that.chartsDataColumn1.categories.push(res.data.GetCreateDateNumber[i].Day)
that.chartsDataColumn2.categories.push(res.data.GetCreateDateNumber[i].Day)
that.chartsDataColumn3.categories.push(res.data.GetCreateDateNumber[i].Day)
that.chartsDataColumn3.series[0].data.push(res.data.GetCreateDateNumber[i].Imports)
that.chartsDataColumn3.series[1].data.push(res.data.GetCreateDateNumber[i]
.TotalExportValue)
that.chartsDataColumn2.series[0].data.push(res.data.GetCreateDateNumber[i].Number)
that.chartsDataColumn2.series[1].data.push(res.data.GetCreateDateNumber[i].Taxation)
that.chartsDataColumn1.series[0].data.push(res.data.GetCreateDateNumber[i]
.FixedInvestment)
that.chartsDataColumn1.series[1].data.push(res.data.GetCreateDateNumber[i].Profit)
that.chartsDataColumn1.series[2].data.push(res.data.GetCreateDateNumber[i]
.SalesRevenue)
that.chartsDataColumn1.series[3].data.push(res.data.GetCreateDateNumber[i]
.TotalOutputValue)
}
// 企业行业分布
for (let i = 0; i < res.data.GetIndustryNumber.length; i++) {
that.chartData3.series[0].data.push({
name: res.data.GetIndustryNumber[i].EnterpriseScale,
value: res.data.GetIndustryNumber[i].Number
})
}
// 企业规模
for (let i = 0; i < res.data.GetEnterpriseScalNumber.length; i++) {
that.chartData2.series[0].data.push({
name: res.data.GetEnterpriseScalNumber[i].EnterpriseScale,
value: res.data.GetEnterpriseScalNumber[i].Number
})
}
// 企业从业人数规模
that.chartData4 = {
series: [{
data: [{
name: '0-20人',
value: res.data.GetEmployees.top20
},
{
name: '20-50人',
value: res.data.GetEmployees.top50
},
{
name: '50-100人',
value: res.data.GetEmployees.top100
},
{
name: '100-200人',
value: res.data.GetEmployees.top200
},
{
name: '200人以上',
value: res.data.GetEmployees.top200Up
},
]
}]
}
}
})
},
// 企业用户使用--管理员通知后才能看见通知的表单
getUsFormList(){
console.log('普通用户获取')
request({
url: '/api/extend/demo/GetMyMessage',
method: 'get',
data: {}
}).then(res => {
console.log('通知列表', res)
if (res.code == 200) {
let newArr = []
// this.formList = []
let that = this
// let arr = JSON.parse(res.data[0].MessageContent.bodyJson)
let arr = res.data.filter(it=>{
it.MessageContent.bodyJson = JSON.parse(it.MessageContent.bodyJson)
return it.MessageContent.bodyJson.type == "表单填报通知"
})
for(let i=0;i<arr.length;i++){
request({
url:`/api/visualdev/base/${arr[i].MessageContent.bodyJson.reid}`,
method:'get',
data:{}
}).then(res=>{
console.log('获取详情',res)
if(res.code == 200){
if(res.data != null){
newArr.push(res.data)
// console.log('通知获取表单',newArr)
}
}
})
}
this.formList = newArr
// this.formList = JSON.parse(JSON.stringify(this.formList))
// console.log('json转换',arr)
console.log('通知获取表单',that.formList)
// this.messageList = res.data
}
})
},
// 获取表单列表---管理员使用
getFormList() {
console.log('管理员')
let that = this
request({
url: '/api/visualdev/Base',
method: 'get',
data: {
type: 2
},
}).then(res => {
console.log('管理员',res)
if (res.code === 600) {
uni.showToast({
icon: "exception",
title: '登录过期,请重新登录',
duration: 1500
})
}
this.formList = res.data.list
})
},
toData() {
uni.navigateTo({
url: '/pages/data/data'
})
},
// 去企业信息表单采集
toPostCom() {
uni.navigateTo({
url: '/pages/postCompany/postCompany'
})
},
// 去表单填写页面
toForm(item) {
// uni.navigateTo({
// url: `/pages/apply/dynamicModel/index?data=${JSON.stringify(it)}`
// })
uni.navigateTo({
// url: '/pages/apply/dynamicModel/index?id=' + item.id + '&fullName=' + item.fullName,
url: '/pages/apply/dynamicModel/index?id=' + item.id,
fail: (err) => {
this.$u.toast("暂无此页面")
}
})
},
}
}
</script>
<style scoped lang="scss">
@import 'datain.scss';
</style>