Commit 165aee7c by 匡雅琴

接口联调

1 parent 30ab0579
......@@ -45,6 +45,11 @@ const getMerchantPurchaseTrend = params => {
return window.$HTTP.get('solarfilm/getMerchantPurchaseTrend', params)
}
// 总体----获取所有门店入库使用情况
const getUsedWarehousing = params => {
return window.$HTTP.get('solarfilm/getUsedWarehousing', params)
}
export default {
getAllGoodsRatio,
getAllOpenBuyTrend,
......@@ -53,5 +58,6 @@ export default {
getAllRanking,
getMerchantGoodsRatio,
getMerchantPurchase,
getMerchantPurchaseTrend
getMerchantPurchaseTrend,
getUsedWarehousing
}
......@@ -7,9 +7,10 @@
</template>
<script>
import { changeMixin } from '@/mixins'
export default {
name: 'StorageContent',
mixins: [changeMixin],
data() {
return {
chart: {
......@@ -17,18 +18,7 @@ export default {
height: '17.7vh',
colors: ['#34AFFF', '#16E193']
},
listData: [
{
name: '已发货',
per: 0.36,
value: 1568
},
{
name: '未发货',
per: 0.25,
value: 4568
}
],
listData: [],
legentList: [
{
name: 'name'
......@@ -45,7 +35,21 @@ export default {
mounted() {},
methods: {}
methods: {
init() {
this.getUsedWarehousing()
},
// 获取所有门店入库
getUsedWarehousing() {
this.api.solar.getUsedWarehousing({ year: 2023 }).then(res => {
console.log(res, '000')
if (!res.code === '0') {
this.openMessage('获取所有门店入库失败')
return
}
})
}
}
}
</script>
......
......@@ -61,8 +61,9 @@ export default {
methods: {
init() {
}
},
}
}
</script>
......
......@@ -75,7 +75,7 @@ export default {
},
// 获取各类商品采购额排名
getAllRanking() {
this.api.solar.getAllRanking({ req: { year: 2023 }}).then(res => {
this.api.solar.getAllRanking({ year: 2023 }).then(res => {
console.log(res, '000')
if (!res.code === '0') {
this.openMessage('获取商品采购额排名失败')
......
......@@ -6,37 +6,38 @@
</template>
<template #content>
<div class="solar-detail-content">
<view-date></view-date>z
<view-date></view-date>
<StatisticsBox class="statistic-box" :list="solarDetailList"></StatisticsBox>
<!-- 采购趋势 -->
<div class="tendency-box">
<box-title title="近一年采购额趋势"></box-title>
<div class="legend">
<div class="legend-item shop">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
<span>商城</span>
<div class="legend-item shop">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
<span>商城</span>
</div>
<div class="legend-item self">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
自采
</div>
<div class="legend-item">
<img class="icon-line" src="@/assets/images/icon-line.png" alt="" />
商城采购占比
</div>
</div>
<div class="legend-item self">
<span class="legend-even">双</span>
<span class="legend-odd">单</span>
自采
</div>
<div class="legend-item">
<img class="icon-line" src="@/assets/images/icon-line.png" alt="">商城采购占比
</div>
</div>
<BarLineChart ref="purchaseTrend" height="36.45vh" domId="purchaseTrend" :dataList.sync="dataList" :tooltipFormatterObj="tooltipFormatterObj"></BarLineChart>
</div>
<!-- 商品占比 -->
<div class="propotion-box flex">
<div class="propotion-box-left">
<box-title title="商城采购商品占比"></box-title>
<RightViewContent class="content-box" :chart="shopmallChart" :listData="shopmallData" :legentList="shopmallLegend" :legendColors="shopmallChart.color"></RightViewContent>
<RightViewContent class="content-box" :chart="shopmallChart" :listData="shopmallData" :legentList="shopmallLegend" :legendColors="shopmallChart.colors"></RightViewContent>
</div>
<div class="propotion-box-right">
<box-title title="自采商品占比"></box-title>
<RightViewContent class="content-box" :chart="selfPickChart" :listData="selfPickData" :legentList="selfPickLegend" :legendColors="selfPickChart.color"></RightViewContent>
<RightViewContent class="content-box" :chart="selfPickChart" :listData="selfPickData" :legentList="selfPickLegend" :legendColors="selfPickChart.colors"></RightViewContent>
</div>
</div>
</div>
......@@ -86,34 +87,22 @@ export default {
bottomValue: '2,280,708'
},
{
name: '总采购额',
name: '商城采购额',
value: '2,280,708',
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
{
name: '总采购额',
name: '自采采购额',
value: '2,280,708',
bottomLabel: '本月采购额',
bottomValue: '2,280,708'
},
// {
// name: '总采购额',
// value: '2,280,708',
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// },
// {
// name: '总采购额',
// value: '2,280,708',
// bottomLabel: '本月采购额',
// bottomValue: '2,280,708'
// }
}
],
// 商城采购饼图结构
shopmallChart: {
id: 'shopmall',
keys: ['goodsname', 'per'],
keys: ['goodsname', 'purchaseamount'],
height: '16vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
......@@ -138,7 +127,7 @@ export default {
// 自采饼图结构
selfPickChart: {
id: 'selfPick',
keys: ['goodsname', 'per'],
keys: ['goodsname', 'purchaseamount'],
height: '16vh',
colors: ['#16E193', '#747DFF', '#E588FF', '#34AFFF', '#FFC200', '#EB6001']
},
......@@ -159,39 +148,24 @@ export default {
name: 'averprice',
hasIcon: '均价¥'
}
],
]
}
},
created() {
console.log(this.$route.params, '999')
this.merchantList = this.$route.params.merchantList
const { merchantid, merchantname } = this.$route.params.currentMerchant
this.tabName = merchantname
this.getMerchantGoodsRatio(merchantid)
this.getMerchantPurchase(merchantid)
// this.getMerchantPurchaseTrend(merchantid)
},
created() {},
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.purchaseTrend.drawBarLine()
})
},
console.log(this.$route.params, '999')
this.merchantList = this.$route.params.merchantList
const { merchantid, merchantname } = this.$route.params.currentMerchant
this.tabName = merchantname
this.getMerchantGoodsRatio(merchantid)
this.getMerchantPurchase(merchantid)
this.getMerchantPurchaseTrend(merchantid)
},
// 获取门店的商品采购占比(商城、自采)
getMerchantGoodsRatio(merchantid) {
this.api.solar.getMerchantGoodsRatio({ req: { year: 2023, MerchantId: merchantid }}).then(res => {
console.log(res);
this.api.solar.getMerchantGoodsRatio({ year: 2023, MerchantId: merchantid }).then(res => {
console.log(res)
if (!res.code === '0') {
this.openMessage('获取门店商品采购占比失败')
return
......@@ -202,8 +176,8 @@ export default {
},
// 获取每个门店的 总采购额(总计、本月) 、商城采购额(总计、本月) 、自采采购额(总计、本月)
getMerchantPurchase(merchantid) {
this.api.solar.getMerchantPurchase({ req: { year: 2023, MerchantId: merchantid }}).then(res => {
console.log(res);
this.api.solar.getMerchantPurchase({ year: 2023, MerchantId: merchantid }).then(res => {
console.log(res)
if (!res.code === '0') {
this.openMessage('获取门店商品采购占比失败')
return
......@@ -212,13 +186,21 @@ export default {
},
// 获取每个门店的商城采购额(占比)、自采采购额(占比) 趋势
getMerchantPurchaseTrend(merchantid) {
this.api.solar.getMerchantPurchaseTrend({ req: { year: 2023, MerchantId: merchantid }}).then(res => {
console.log(res);
this.api.solar.getMerchantPurchaseTrend({ year: 2023, MerchantId: merchantid }).then(res => {
console.log(res)
if (!res.code === '0') {
this.openMessage('获取门店商品采购占比失败')
return
}
this.dataList = res.data.dataList[0]
const _dataList = res.data.dataList
_dataList.forEach(item => {
this.dataList.push({
month: item.statDate,
data1: item.shopamount,
data2: item.selfamount
})
})
console.log(this.dataList)
this.$refs.purchaseTrend.drawBarLine()
})
}
......@@ -233,7 +215,7 @@ export default {
box-sizing: border-box;
padding: 1.78vh 24px;
gap: 0 16px;
.statistic-box{
.statistic-box {
margin-top: 1.78vh;
}
.tendency-box {
......@@ -258,52 +240,52 @@ export default {
}
}
.legend {
display: flex;
position: absolute;
right: 1.39vw;
top: 2.22vh;
&-item {
display: flex;
position: absolute;
right: 1.39vw;
top: 2.22vh;
&-item {
display: flex;
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
img {
width: 1.32vw;
height: 1vh;
margin-right: 0.28vw;
}
.icon-line {
width: 0.98vw;
height: 0.56vh;
}
.legend-even,
.legend-odd {
display: inline-block;
width: 0.83vw;
height: 1.33vh;
margin-right: 0.28vw;
font-size: 8px;
text-align: center;
}
align-items: center;
color: #fff;
margin-right: 1.67vw;
&:last-child {
margin-right: 0;
}
img {
width: 1.32vw;
height: 1vh;
margin-right: 0.28vw;
}
.icon-line {
width: 0.98vw;
height: 0.56vh;
}
.legend-even,
.legend-odd {
display: inline-block;
width: 0.83vw;
height: 1.33vh;
margin-right: 0.28vw;
font-size: 8px;
text-align: center;
}
}
.shop {
}
.shop {
.legend-even {
background-image: linear-gradient(180deg, #2AD190 1%, #00B7DF 100%);
background-image: linear-gradient(180deg, #2ad190 1%, #00b7df 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #22D8FF 0%, #5C56FF 100%);
background-image: linear-gradient(180deg, #22d8ff 0%, #5c56ff 100%);
}
}
.self {
.legend-even {
background-image: linear-gradient(180deg, #145F4E 1%, #035972 100%);
background-image: linear-gradient(180deg, #145f4e 1%, #035972 100%);
}
.legend-odd {
background-image: linear-gradient(180deg, #11627A 0%, #282F7A 100%);
background-image: linear-gradient(180deg, #11627a 0%, #282f7a 100%);
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!