jufubao-admin-library 1.0.0-beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +90 -0
- package/library/gulpfile.js/const.js +51 -0
- package/library/gulpfile.js/index.js +237 -0
- package/library/gulpfile.js/util.js +114 -0
- package/library/viewModules/config.js +75 -0
- package/library/viewModules/viewStat/router/supplierStat.js +33 -0
- package/library/viewModules/viewStat/schemas/supplier.stat.js +70 -0
- package/library/viewModules/viewStat/schemas.js +18 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-all.vue +233 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-product.vue +129 -0
- package/library/viewModules/viewStat/viewsStat/index/components/stat-supplier.vue +124 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-category.vue +309 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-product.vue +316 -0
- package/library/viewModules/viewStat/viewsStat/index/components/table-supplier.vue +276 -0
- package/library/viewModules/viewStat/viewsStat/index/index.vue +117 -0
- package/library/viewModules/viewTask/router/tasks.js +34 -0
- package/library/viewModules/viewTask/schemas/tasks.js +52 -0
- package/library/viewModules/viewTask/viewTask/list.vue +195 -0
- package/library/viewModules/viewsEnterpriseBuy/router/enterprise_buy.js +91 -0
- package/library/viewModules/viewsEnterpriseBuy/schemas/enterprise_buy.js +420 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/OrderInfoButton.vue +550 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/cardList.vue +119 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/expressCopy.vue +259 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/operateHistory.vue +164 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/send_list.vue +395 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/storeList.vue +100 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/compontents/workHistory.vue +163 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/detail.vue +503 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/list.vue +635 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/order_detail.vue +860 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_create.vue +219 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/set_list.vue +237 -0
- package/library/viewModules/viewsEnterpriseBuy/viewsEnterpriseBuy/table-card.vue +180 -0
- package/library/viewModules/viewsFinance/router/balance.js +75 -0
- package/library/viewModules/viewsFinance/router/finance.js +30 -0
- package/library/viewModules/viewsFinance/schemas/trade.record.js +153 -0
- package/library/viewModules/viewsFinance/schemas/wallet.js +116 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listChannel.vue +220 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listOpenapi.vue +260 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listPartner.vue +217 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/components/listSupplier.vue +229 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_channel.vue +401 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_openapi.vue +364 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_partner.vue +633 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/detail_supplier.vue +417 -0
- package/library/viewModules/viewsFinance/viewsFinance/balance/list.vue +75 -0
- package/library/viewModules/viewsFinance/viewsFinance/index.vue +191 -0
- package/library/viewModules/viewsLimit/router/buyLimit/buyLimit.js +31 -0
- package/library/viewModules/viewsLimit/schemas/buyLimit.js +22 -0
- package/library/viewModules/viewsLimit/viewsLimit/index.vue +211 -0
- package/package.json +114 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
module.exports = {
|
|
3
|
+
name: "supplierStat",
|
|
4
|
+
title: "供应商统计",
|
|
5
|
+
vuex: true,
|
|
6
|
+
model: [
|
|
7
|
+
{
|
|
8
|
+
title: "统计-供应商统计-累计统计",
|
|
9
|
+
mapFn: "totalCounts",
|
|
10
|
+
path: "/stat-partner/v1/supplier-stat/total-counts",
|
|
11
|
+
isRule: false,
|
|
12
|
+
params: {},
|
|
13
|
+
disabled: true,
|
|
14
|
+
role: "STAT-PARTNER.SUPPLIER_STAT_TOTAL_COUNTS"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
title: "统计-供应商统计-累计统计刷新",
|
|
18
|
+
mapFn: "refreshTotalCounts",
|
|
19
|
+
path: "/stat-partner/v1/supplier-stat/total-counts-refresh",
|
|
20
|
+
isRule: false,
|
|
21
|
+
params: {},
|
|
22
|
+
disabled: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
title: "统计-供应商统计-商品周期数量",
|
|
26
|
+
mapFn: "productCycCounts",
|
|
27
|
+
path: "/stat-partner/v1/supplier/product-cyc-counts",
|
|
28
|
+
isRule: false,
|
|
29
|
+
params: {},
|
|
30
|
+
disabled: true,
|
|
31
|
+
role: "STAT-PARTNER.SUPPLIER_PRODUCT_CYC_COUNTS"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: "统计-供应商统计-供应商周期数量",
|
|
35
|
+
mapFn: "supplierCycCounts",
|
|
36
|
+
path: "/stat-partner/v1/supplier-stat/supplier-cyc-counts",
|
|
37
|
+
isRule: false,
|
|
38
|
+
params: {},
|
|
39
|
+
disabled: true,
|
|
40
|
+
role: "STAT-PARTNER.SUPPLIER_STAT_SUPPLIER_CYC_COUNTS"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "统计-供应商统计-供应商销售数据",
|
|
44
|
+
mapFn: "supplierCycSales",
|
|
45
|
+
path: "/stat-partner/v1/supplier-stat/supplier-cyc-sales",
|
|
46
|
+
isRule: false,
|
|
47
|
+
params: {},
|
|
48
|
+
disabled: true,
|
|
49
|
+
role: "STAT-PARTNER.SUPPLIER_STAT_SUPPLIER_CYC_SALES"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
title: "统计-供应商统计-商品销售数据",
|
|
53
|
+
mapFn: "productCycSales",
|
|
54
|
+
path: "/stat-partner/v1/supplier-stat/product-cyc-sales",
|
|
55
|
+
isRule: false,
|
|
56
|
+
params: {},
|
|
57
|
+
disabled: true,
|
|
58
|
+
role: "STAT-PARTNER.SUPPLIER_STAT_PRODUCT_CYC_SALES"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
title: "统计-供应商统计-商品分类销售数据",
|
|
62
|
+
mapFn: "productCategoryCycSales",
|
|
63
|
+
path: "/stat-partner/v1/supplier-stat/product-category-cyc-sales",
|
|
64
|
+
isRule: false,
|
|
65
|
+
params: {},
|
|
66
|
+
disabled: true,
|
|
67
|
+
role: "STAT-PARTNER.SUPPLIER_STAT_PRODUCT_CATEGORY_CYC_SALES"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
name: 'supplierStat',
|
|
5
|
+
title: '供应商统计',
|
|
6
|
+
vuex: true,
|
|
7
|
+
model:[
|
|
8
|
+
{
|
|
9
|
+
title: '统计-供应商统计-累计统计',
|
|
10
|
+
mapFn: "totalCounts",
|
|
11
|
+
path: '/stat-partner/v1/supplier-stat/total-counts',
|
|
12
|
+
isRule: false,
|
|
13
|
+
params: {
|
|
14
|
+
},
|
|
15
|
+
disabled: true,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<el-card class="stat_all_card">
|
|
4
|
+
<div slot="header" class="card_header">
|
|
5
|
+
<div>
|
|
6
|
+
<span class="b_tit">累计统计</span>
|
|
7
|
+
<span class="s_tit">数据截止:{{ statAll.last_updated_date_time }}</span>
|
|
8
|
+
</div>
|
|
9
|
+
<!-- <i class="el-icon-refresh" @click="toRefresh"></i> -->
|
|
10
|
+
</div>
|
|
11
|
+
<div class="stat_list">
|
|
12
|
+
<div class="stat_item">
|
|
13
|
+
<p class="_title">
|
|
14
|
+
供应商总数
|
|
15
|
+
<el-tooltip effect="light" content="总共供应商数量" placement="right">
|
|
16
|
+
<i class="xdicon_question-circle xd_admin_iconfont"></i>
|
|
17
|
+
</el-tooltip>
|
|
18
|
+
</p>
|
|
19
|
+
<div class="_cont">
|
|
20
|
+
<div class="_left">{{statAll.supplier_total_count}}</div>
|
|
21
|
+
<div class="_right one_level">
|
|
22
|
+
<div class="right_i right_top">正常{{statAll.supplier_online_count}}</div>
|
|
23
|
+
<div class="right_i right_bottom">关闭{{ statAll.supplier_offline_count }}</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="stat_item">
|
|
28
|
+
<p class="_title">
|
|
29
|
+
商品总数
|
|
30
|
+
<el-tooltip effect="light" content="总共商品数量,多规格商品计1个" placement="right">
|
|
31
|
+
<i class="xdicon_question-circle xd_admin_iconfont"></i>
|
|
32
|
+
</el-tooltip>
|
|
33
|
+
</p>
|
|
34
|
+
<div class="_cont">
|
|
35
|
+
<div class="_left">{{ statAll.product_total_count }}</div>
|
|
36
|
+
<div class="_right">
|
|
37
|
+
<div class="right_i right_top">
|
|
38
|
+
<div class="one_line">
|
|
39
|
+
{{statAll.product_manual_count}} (人工添加)
|
|
40
|
+
</div>
|
|
41
|
+
<div class="two_line">
|
|
42
|
+
<div>上架{{statAll.product_manual_online_count}}</div>
|
|
43
|
+
<div>下架{{ statAll.product_manual_offline_count }}</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="right_i right_bottom">
|
|
47
|
+
<div class="one_line">
|
|
48
|
+
{{statAll.product_channel_count}}(接口同步)
|
|
49
|
+
</div>
|
|
50
|
+
<div class="two_line">
|
|
51
|
+
<div>上架{{statAll.product_channel_online_count}}</div>
|
|
52
|
+
<div>下架{{statAll.product_channel_offline_count}}</div>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="stat_item">
|
|
59
|
+
<p class="_title">
|
|
60
|
+
SKU总数
|
|
61
|
+
<el-tooltip effect="light" content="总共商品规格数量,多规格商品计多个" placement="right">
|
|
62
|
+
<i class="xdicon_question-circle xd_admin_iconfont"></i>
|
|
63
|
+
</el-tooltip>
|
|
64
|
+
</p>
|
|
65
|
+
<div class="_cont">
|
|
66
|
+
<div class="_left">{{statAll.sku_total_count}}</div>
|
|
67
|
+
<div class="_right">
|
|
68
|
+
<div class="right_i right_top">
|
|
69
|
+
<div class="one_line">
|
|
70
|
+
{{statAll.sku_manual_count}} (人工添加)
|
|
71
|
+
</div>
|
|
72
|
+
<div class="two_line">
|
|
73
|
+
<div>上架{{statAll.sku_manual_online_count}}</div>
|
|
74
|
+
<div>下架{{statAll.sku_manual_offline_count}}</div>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
<div class="right_i right_bottom">
|
|
78
|
+
<div class="one_line">
|
|
79
|
+
{{statAll.sku_channel_count}}(接口同步)
|
|
80
|
+
</div>
|
|
81
|
+
<div class="two_line">
|
|
82
|
+
<div>上架{{statAll.sku_channel_online_count}}</div>
|
|
83
|
+
<div>下架{{statAll.sku_channel_offline_count}}</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</el-card>
|
|
92
|
+
</template>
|
|
93
|
+
<script>
|
|
94
|
+
|
|
95
|
+
import {mapActions} from 'vuex';
|
|
96
|
+
|
|
97
|
+
export default {
|
|
98
|
+
data(){
|
|
99
|
+
return {
|
|
100
|
+
statAll: {}
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
created(){
|
|
104
|
+
console.log('created')
|
|
105
|
+
this.p_totalCounts();
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
...mapActions("supplierStat", ["totalCounts", "refreshTotalCounts"]),
|
|
109
|
+
toRefresh(){
|
|
110
|
+
this.p_totalCounts();
|
|
111
|
+
//刷新接口移除
|
|
112
|
+
// let loading = this.$loading({});
|
|
113
|
+
// this.refreshTotalCounts().then(res => {
|
|
114
|
+
// loading.close()
|
|
115
|
+
// this.p_totalCounts();
|
|
116
|
+
// }).catch(err => {
|
|
117
|
+
// loading.close()
|
|
118
|
+
// })
|
|
119
|
+
},
|
|
120
|
+
p_totalCounts(){
|
|
121
|
+
let loading = this.$loading({});
|
|
122
|
+
this.totalCounts().then(res => {
|
|
123
|
+
this.statAll = res.data;
|
|
124
|
+
loading.close();
|
|
125
|
+
}).catch(err => {
|
|
126
|
+
loading.close();
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
</script>
|
|
132
|
+
|
|
133
|
+
<style lang="less" scoped>
|
|
134
|
+
|
|
135
|
+
.stat_all_card{
|
|
136
|
+
/deep/ .el-card__body{
|
|
137
|
+
overflow: auto;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.card_header{
|
|
141
|
+
display: flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: space-between;
|
|
144
|
+
& > i{
|
|
145
|
+
font-size: 24px;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
.b_tit{
|
|
150
|
+
font-size: 18px;
|
|
151
|
+
font-weight: 400;
|
|
152
|
+
color:#2E3033;
|
|
153
|
+
}
|
|
154
|
+
.s_tit{
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
color: #A1A7B3;
|
|
157
|
+
margin-left: 10px;
|
|
158
|
+
vertical-align: bottom;
|
|
159
|
+
}
|
|
160
|
+
.stat_list{
|
|
161
|
+
display: flex;
|
|
162
|
+
justify-content: space-around;
|
|
163
|
+
min-width: 800px;
|
|
164
|
+
.stat_item{
|
|
165
|
+
margin-right: 30px;
|
|
166
|
+
._title{
|
|
167
|
+
margin: 0;
|
|
168
|
+
font-size: 14px;
|
|
169
|
+
font-weight: 400;
|
|
170
|
+
color: #2E3033;
|
|
171
|
+
display: flex;
|
|
172
|
+
margin-bottom: 10px;
|
|
173
|
+
|
|
174
|
+
i{
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
margin-left: 4px;
|
|
177
|
+
color: #A1A7B3;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
._cont{
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: center;
|
|
183
|
+
color: #1A66FF;
|
|
184
|
+
font-weight: 500;
|
|
185
|
+
}
|
|
186
|
+
._left{
|
|
187
|
+
font-size: 32px;
|
|
188
|
+
font-weight: 500;
|
|
189
|
+
}
|
|
190
|
+
._right{
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-direction: column;
|
|
193
|
+
&.one_level{
|
|
194
|
+
.right_i{
|
|
195
|
+
background: none !important;
|
|
196
|
+
padding-bottom: 0 !important;
|
|
197
|
+
padding-top: 0 !important;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.right_i{
|
|
202
|
+
display: flex;
|
|
203
|
+
align-items: center;
|
|
204
|
+
height: 50px;
|
|
205
|
+
font-size: 18px;
|
|
206
|
+
padding-left: 30px;
|
|
207
|
+
|
|
208
|
+
&.right_top{
|
|
209
|
+
background: url("https://sandbox-img.jufubao.cn/uploads/20231031/2739c34c5d2d19d7d4aae2e26070817d.png") no-repeat;
|
|
210
|
+
background-position: left 60%;
|
|
211
|
+
background-size: 28px auto;
|
|
212
|
+
padding-bottom: 10px;
|
|
213
|
+
}
|
|
214
|
+
&.right_bottom{
|
|
215
|
+
background: url("https://sandbox-img.jufubao.cn/uploads/20231031/90c4c51e0621d876e6126d8696aa8966.png") no-repeat;
|
|
216
|
+
background-position: left 40%;
|
|
217
|
+
background-size: 28px auto;
|
|
218
|
+
padding-top: 10px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
.two_line{
|
|
223
|
+
margin-left: 30px;
|
|
224
|
+
& > div{
|
|
225
|
+
margin: 2px 0;
|
|
226
|
+
font-size: 12px;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card>
|
|
3
|
+
<div slot="header" class="card_header">
|
|
4
|
+
<div class="card_tit">
|
|
5
|
+
<span class="b_tit">商品数量</span>
|
|
6
|
+
<el-tooltip effect="light" content="按商品最新创建时间和最终下架时间统计 仅统计人工上下架商品" placement="right">
|
|
7
|
+
<i class="xdicon_question-circle xd_admin_iconfont"></i>
|
|
8
|
+
</el-tooltip>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<el-radio-group v-model="cyc_type" size="medium" @input="handleChangeType">
|
|
12
|
+
<el-radio-button label="month">按月</el-radio-button>
|
|
13
|
+
<el-radio-button label="year">按年</el-radio-button>
|
|
14
|
+
</el-radio-group>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
<div ref="chartWrap" class="chart_wrap">
|
|
19
|
+
</div>
|
|
20
|
+
</el-card>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
import * as echarts from 'echarts';
|
|
24
|
+
import { mapActions } from "vuex"
|
|
25
|
+
export default {
|
|
26
|
+
data(){
|
|
27
|
+
return {
|
|
28
|
+
cyc_type: "month"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
created(){
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
mounted(){
|
|
35
|
+
this.renderChart();
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
...mapActions("supplierStat", ['productCycCounts']),
|
|
39
|
+
renderChart(){
|
|
40
|
+
this.productCycCounts({cyc_type: this.cyc_type}).then(res => {
|
|
41
|
+
var chartDom = this.$refs['chartWrap'];
|
|
42
|
+
var myChart = echarts.init(chartDom);
|
|
43
|
+
var option = this.getChartOptions(res.data);
|
|
44
|
+
option && myChart.setOption(option);
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
getChartOptions(data){
|
|
48
|
+
let xAxisData = data.x.data;
|
|
49
|
+
let legendData = ['上架商品', '下架商品'];
|
|
50
|
+
let seriesData = [];
|
|
51
|
+
data.series.forEach(item => {
|
|
52
|
+
for(let i = 0; i < item.length; i++){
|
|
53
|
+
seriesData[i] = seriesData[i] || [];
|
|
54
|
+
seriesData[i].push(item[i].data);
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
console.log("seriesData", seriesData)
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
tooltip: {
|
|
61
|
+
trigger: 'axis',
|
|
62
|
+
// backgroundColor: 'rgba(255,255,255,0.9)',
|
|
63
|
+
// textStyle: {
|
|
64
|
+
// color: '#666'
|
|
65
|
+
// }
|
|
66
|
+
},
|
|
67
|
+
legend: {
|
|
68
|
+
data: legendData
|
|
69
|
+
},
|
|
70
|
+
grid: {
|
|
71
|
+
left: '3%',
|
|
72
|
+
right: '4%',
|
|
73
|
+
bottom: '3%',
|
|
74
|
+
containLabel: true
|
|
75
|
+
},
|
|
76
|
+
toolbox: {
|
|
77
|
+
feature: {
|
|
78
|
+
saveAsImage: {}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
xAxis: {
|
|
82
|
+
type: 'category',
|
|
83
|
+
boundaryGap: false,
|
|
84
|
+
smooth: true,
|
|
85
|
+
data: xAxisData
|
|
86
|
+
},
|
|
87
|
+
yAxis: {
|
|
88
|
+
type: 'value'
|
|
89
|
+
},
|
|
90
|
+
series: seriesData.map((item, index) => {
|
|
91
|
+
return {
|
|
92
|
+
name: legendData[index],
|
|
93
|
+
type: 'line',
|
|
94
|
+
smooth: true,
|
|
95
|
+
data: item
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
handleChangeType(val){
|
|
101
|
+
console.log("handleChangeType", val);
|
|
102
|
+
this.renderChart();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
<style lang="less" scoped>
|
|
108
|
+
.card_header{
|
|
109
|
+
display: flex;
|
|
110
|
+
.card_tit{
|
|
111
|
+
display: flex;
|
|
112
|
+
flex: 1;
|
|
113
|
+
align-items: center;
|
|
114
|
+
i{
|
|
115
|
+
margin-left: 4px;
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
color: #A1A7B3;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.b_tit{
|
|
122
|
+
font-size: 18px;
|
|
123
|
+
font-weight: 400;
|
|
124
|
+
color:#2E3033;
|
|
125
|
+
}
|
|
126
|
+
.chart_wrap{
|
|
127
|
+
height: 260px;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-card>
|
|
3
|
+
<div slot="header" class="card_header">
|
|
4
|
+
<div class="card_tit">
|
|
5
|
+
<span class="b_tit">供应商数量</span>
|
|
6
|
+
<el-tooltip effect="light" content="按供应商创建时间和最终关闭时间统计" placement="right">
|
|
7
|
+
<i class="xdicon_question-circle xd_admin_iconfont"></i>
|
|
8
|
+
</el-tooltip>
|
|
9
|
+
</div>
|
|
10
|
+
<div>
|
|
11
|
+
<el-radio-group v-model="cyc_type" size="medium" @input="handleChangeType">
|
|
12
|
+
<el-radio-button label="month">按月</el-radio-button>
|
|
13
|
+
<el-radio-button label="year">按年</el-radio-button>
|
|
14
|
+
</el-radio-group>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
<div ref="chartWrap" class="chart_wrap">
|
|
19
|
+
</div>
|
|
20
|
+
</el-card>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
import * as echarts from 'echarts';
|
|
24
|
+
import { mapActions } from "vuex"
|
|
25
|
+
export default {
|
|
26
|
+
data(){
|
|
27
|
+
return {
|
|
28
|
+
cyc_type: "month"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
created(){
|
|
32
|
+
|
|
33
|
+
},
|
|
34
|
+
mounted(){
|
|
35
|
+
this.renderChart();
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
...mapActions("supplierStat", ['supplierCycCounts']),
|
|
39
|
+
renderChart(){
|
|
40
|
+
this.supplierCycCounts({cyc_type: this.cyc_type}).then(res => {
|
|
41
|
+
var chartDom = this.$refs['chartWrap'];
|
|
42
|
+
var myChart = echarts.init(chartDom);
|
|
43
|
+
var option = this.getChartOptions(res.data);
|
|
44
|
+
option && myChart.setOption(option);
|
|
45
|
+
})
|
|
46
|
+
},
|
|
47
|
+
getChartOptions(data){
|
|
48
|
+
let xAxisData = data.x.data;
|
|
49
|
+
let legendData = ['新增供应商', '关闭供应商'];
|
|
50
|
+
let seriesData = [];
|
|
51
|
+
data.series.forEach(item => {
|
|
52
|
+
for(let i = 0; i < item.length; i++){
|
|
53
|
+
seriesData[i] = seriesData[i] || [];
|
|
54
|
+
seriesData[i].push(item[i].data);
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
return {
|
|
58
|
+
|
|
59
|
+
tooltip: {
|
|
60
|
+
trigger: 'axis'
|
|
61
|
+
},
|
|
62
|
+
legend: {
|
|
63
|
+
data: legendData
|
|
64
|
+
},
|
|
65
|
+
grid: {
|
|
66
|
+
left: '3%',
|
|
67
|
+
right: '4%',
|
|
68
|
+
bottom: '3%',
|
|
69
|
+
containLabel: true
|
|
70
|
+
},
|
|
71
|
+
toolbox: {
|
|
72
|
+
feature: {
|
|
73
|
+
saveAsImage: {}
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
xAxis: {
|
|
77
|
+
type: 'category',
|
|
78
|
+
boundaryGap: false,
|
|
79
|
+
smooth: true,
|
|
80
|
+
data: xAxisData
|
|
81
|
+
},
|
|
82
|
+
yAxis: {
|
|
83
|
+
type: 'value'
|
|
84
|
+
},
|
|
85
|
+
series: seriesData.map((item, index) => {
|
|
86
|
+
return {
|
|
87
|
+
name: legendData[index],
|
|
88
|
+
type: 'line',
|
|
89
|
+
smooth: true,
|
|
90
|
+
data: item
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
handleChangeType(val){
|
|
96
|
+
console.log(val);
|
|
97
|
+
this.renderChart();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
102
|
+
<style lang="less" scoped>
|
|
103
|
+
.card_header{
|
|
104
|
+
display: flex;
|
|
105
|
+
.card_tit{
|
|
106
|
+
display: flex;
|
|
107
|
+
flex: 1;
|
|
108
|
+
align-items: center;
|
|
109
|
+
i{
|
|
110
|
+
margin-left: 4px;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
color: #A1A7B3;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.b_tit{
|
|
117
|
+
font-size: 18px;
|
|
118
|
+
font-weight: 400;
|
|
119
|
+
color:#2E3033;
|
|
120
|
+
}
|
|
121
|
+
.chart_wrap{
|
|
122
|
+
height: 260px;
|
|
123
|
+
}
|
|
124
|
+
</style>
|