Commit 866f93bf by 匡雅琴

Merge branch 'v1.0.0' of http://192.168.3.233:8090/h5/glsk-data-view-pd into v1.0.0

2 parents 92df765e 83b31f78
/*
* @Description: 基础数据
* @Author: huyue
* @Date: 2023-07-04 11:46:53
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 14:39:49
*/
const DefaultData = {
yearList: ['2023', '2022', '2021', '2020'],
yearList: ['2023', '2022'],
businessList: [
{
label: '业务数据 | 1.0太阳膜采购',
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 10:29:38
* @LastEditTime: 2023-07-14 14:28:17
-->
<template>
<div class="merchant-box">
......@@ -45,22 +45,9 @@ export default {
methods: {
init() {
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() {
this.dataList = []
const _data = await this.api.solar.getAllOpenBuyTrend({ year: this.$store.state.app.solarYear })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2023-07-06 16:19:15
* @LastEditors: huyue
* @LastEditTime: 2023-07-14 10:29:34
* @LastEditTime: 2023-07-14 14:27:08
-->
<template>
<div class="purchase-box">
......@@ -57,22 +57,9 @@ export default {
methods: {
init() {
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() {
this.dataList = []
const _data = await this.api.solar.getAllPurchaseTrend({ year: this.$store.state.app.solarYear })
const _dataList = _data.data.dataList
_dataList.forEach(item => {
......
......@@ -83,21 +83,30 @@ export default {
solarDetailList: [
{
name: '总采购额',
valueName: 'amounttotal',
value: '2,280,708',
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
bottemName: 'amounttotalThismonth',
bottomValue: '2,280,708',
bottomType: 'money'
},
{
name: '商城采购额',
valueName: 'amountshop',
value: '2,280,708',
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
bottemName: 'amountshopThismonth',
bottomValue: '2,280,708',
bottomType: 'money'
},
{
name: '自采采购额',
valueName: 'amountself',
value: '2,280,708',
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
bottemName: 'amountselfThismonth',
bottomValue: '2,280,708',
bottomType: 'money'
}
],
// 商城采购饼图结构
......@@ -188,6 +197,11 @@ export default {
this.openMessage('获取门店商品采购占比失败')
return
}
const _dataList = res.data.dataList[0]
this.solarDetailList.forEach(item => {
item.value = _dataList[item.valueName]
item.bottomValue = _dataList[item.bottemName]
})
})
},
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
......@@ -207,7 +221,6 @@ export default {
data3: item.shopratio
})
})
console.log(this.dataList)
this.$refs.purchaseTrend.drawBarLine()
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!