Commit d4a62abc by 胡悦

接口联调

1 parent 6b5e9b21
......@@ -7,17 +7,17 @@
<div v-if="item.rate" class="statistics-top-rate">占比<span>{{item.rate}}</span></div>
</div>
<div class="statistics-bottom">
<template v-if="bottomType == 'money'">
<span> {{item.moneyName}}</span>
<span>¥{{item.moneyValue}}</span>
<template v-if="item.bottomType == 'money'">
<span> {{item.bottomLabel}}</span>
<span>¥{{item.bottomValue}}</span>
</template>
<template v-else-if="bottomType == 'default'">
<span>{{item.moneyName}}</span>
<span>{{item.moneyValue}}</span>
</template>
<template v-else-if="bottomType == 'slot'">
<template v-else-if="item.bottomType == 'slot'">
<slot name="bottom"></slot>
</template>
<template v-else>
<span>{{item.bottomLabel}}</span>
<span>{{item.bottomValue}}</span>
</template>
</div>
</div>
</div>
......@@ -29,11 +29,11 @@ export default {
props: {
list: {
type: Array
},
bottomType: {
type: String,
default: 'default'
}
// bottomType: {
// type: String,
// default: 'default'
// }
},
data() {
return {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-12 15:45:33
* @LastEditTime: 2023-07-13 15:56:27
-->
<template>
<div class="view-date">统计年份:
......@@ -17,12 +17,15 @@
<div class="year-item" :class="year == item ? 'active' : ''" v-for="(item,index) in dataList" :key="index" @click.s="selectYear(item)">{{item}}</div>
</div> -->
</div>
业务开始时间:2022年6月30日</div>
业务开始时间:{{businessTime}}</div>
</template>
<script type='text/ecmascript-6'>
import datas from '@/utils/data'
export default {
name: 'ViewDate',
props: {
businessTime: String
},
data() {
return {
isShow: false,
......@@ -38,7 +41,6 @@ export default {
this.isShow = !this.isShow
},
selectVal(val) {
console.log(val)
this.year = val
this.switchYear()
},
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-04 13:56:33
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 14:44:25
* @LastEditTime: 2023-07-13 15:47:43
-->
<template>
<div class="view-content">
<ViewDate></ViewDate>
<ViewDate :businessTime="businessTime"></ViewDate>
<div class="content">
<ContentLeft></ContentLeft>
<ContentRight></ContentRight>
......@@ -27,8 +27,14 @@ export default {
},
data() {
return {
businessTime: ''
}
},
created() {
this.$bus.$on('businessstarttime', data => {
this.businessTime = data
})
},
methods: {
}
}
......
......@@ -3,12 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 10:19:05
* @LastEditors: huyue
* @LastEditTime: 2023-07-06 11:07:11
* @LastEditTime: 2023-07-13 15:57:12
*/
import Vue from 'vue'
const componentsFiles = require.context(`./`, true, /.vue$/)
componentsFiles.keys().forEach(path => {
const component = componentsFiles(path).default
console.log(component.name)
Vue.component(component.name, component)
})
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-05 10:35:43
* @LastEditors: huyue
* @LastEditTime: 2023-07-13 15:12:36
* @LastEditTime: 2023-07-13 16:38:26
-->
<template>
<div class="left">
<StatisticsBox :list="solarList" bottomType="money"></StatisticsBox>
<StatisticsBox :list="solarList"></StatisticsBox>
<PurchaseTrends></PurchaseTrends>
<div class="left-bottom">
<MerchantTrends class="bottom-trends"></MerchantTrends>
......@@ -35,35 +35,50 @@ export default {
solarList: [
{
name: '总采购额',
valueName: 'amounttotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottemName: 'amounttotalThismonth',
bottomValue: '2,280,708',
bottomType: 'money'
},
{
name: '总采购额',
name: '商城采购额',
valueName: 'amountshop',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708',
rate: '51%'
bottomLabel: '本月采购额',
bottemName: 'amountshopThismonth',
bottomValue: '2,280,708',
rate: '51%',
rateName: 'shopRate',
bottomType: 'money'
},
{
name: '总采购额',
name: '自采采购额',
valueName: 'amountself',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708',
rate: '49%'
bottomLabel: '本月采购额',
bottemName: 'amountselfThismonth',
bottomValue: '2,280,708',
rate: '49%',
rateName: 'selfRate',
bottomType: 'money'
},
{
name: '总采购额',
name: '开通商户数',
valueName: 'opentotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月开通商户数',
bottemName: 'openThismonth',
bottomValue: '2,280,708'
},
{
name: '总采购额',
name: '采购商户数',
valueName: 'buytotal',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购商户数',
bottemName: 'buyThismonth',
bottomValue: '2,280,708'
}
]
}
......@@ -74,9 +89,15 @@ export default {
init() {
this.getSolarList()
},
getSolarList() {
this.api.solar.getAllPurchase({ req: { year: 2023 }}).then(res => {
console.log(res)
async getSolarList() {
const _data = await this.api.solar.getAllPurchase({ req: { year: 2023 }})
const _dataList = _data.data.dataList[0]
console.log(_dataList)
this.$bus.$emit('businessstarttime', _dataList.businessstarttime)
this.solarList.forEach(item => {
item.value = _dataList[item.valueName]
item.bottomValue = _dataList[item.bottemName]
if (item.rateName) item.rate = _dataList[item.rateName]
})
}
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-12 15:57:01
* @LastEditTime: 2023-07-13 16:39:55
-->
<template>
<div class="merchant-box">
......@@ -44,19 +44,33 @@ export default {
},
methods: {
init() {
const p = new Promise((resolve) => {
for (let i = 0; i < 12; i++) {
this.dataList.push({
month: i + 1 + '月',
data1: +(Math.random() * 20).toFixed(2),
data2: +(Math.random() * 40).toFixed(2)
})
}
resolve()
})
p.then(() => {
this.$refs.merchantTrendsRef.drawBar()
this.getTrendData()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 20).toFixed(2),
// data2: +(Math.random() * 40).toFixed(2)
// })
// }
// console.log(this.dataList)
// resolve()
// })
// p.then(() => {
// this.$refs.merchantTrendsRef.drawBar()
// })
},
async getTrendData() {
const _data = await this.api.solar.getAllOpenBuyTrend({ req: { year: 2023 }})
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.opennum,
data2: item.buynum
})
})
this.$refs.merchantTrendsRef.drawBar()
}
}
}
......
......@@ -3,11 +3,11 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-07 18:08:57
* @LastEditTime: 2023-07-13 17:12:23
-->
<template>
<div class="purchase-box">
<box-title title="采购额排名"></box-title>
<box-title title="近一年采购额趋势"></box-title>
<BarLineChart ref="purchaseRef" height="30.23vh" domId="purchase" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
<div class="legend">
<div class="legend-item shop">
......@@ -56,20 +56,34 @@ export default {
},
methods: {
init() {
const p = new Promise((resolve) => {
for (let i = 0; i < 12; i++) {
this.dataList.push({
month: i + 1 + '月',
data1: +(Math.random() * 2000).toFixed(2),
data2: +(Math.random() * 5000).toFixed(2),
data3: +(Math.random() * 50).toFixed(2)
})
}
resolve()
})
p.then(() => {
this.$refs.purchaseRef.drawBarLine()
this.getDataList()
// const p = new Promise((resolve) => {
// for (let i = 0; i < 12; i++) {
// this.dataList.push({
// month: i + 1 + '月',
// data1: +(Math.random() * 2000).toFixed(2),
// data2: +(Math.random() * 5000).toFixed(2),
// data3: +(Math.random() * 50).toFixed(2)
// })
// }
// resolve()
// })
// p.then(() => {
// this.$refs.purchaseRef.drawBarLine()
// })
},
async getDataList() {
const _data = await this.api.solar.getAllPurchaseTrend({ req: { year: 2023 }})
const _dataList = _data.data.dataList
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount,
data3: item.shopratio
})
})
this.$refs.purchaseRef.drawBarLine()
}
}
}
......
......@@ -6,8 +6,8 @@
</template>
<template #content>
<div class="solar-detail-content">
<view-date></view-date>
<StatisticsBox class="statistic-box" :list="solarDetailList" bottomType="money"></StatisticsBox>
<view-date></view-date>z
<StatisticsBox class="statistic-box" :list="solarDetailList"></StatisticsBox>
<!-- 采购趋势 -->
<div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title>
......@@ -76,32 +76,32 @@ export default {
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
{
name: '总采购额',
value: '2,280,708',
moneyName: '本月采购额',
moneyValue: '2,280,708'
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
// {
// name: '总采购额',
// value: '2,280,708',
// moneyName: '本月采购额',
// moneyValue: '2,280,708'
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// },
// {
// name: '总采购额',
// value: '2,280,708',
// moneyName: '本月采购额',
// moneyValue: '2,280,708'
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// }
],
// 商城采购饼图结构
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!