Commit 165aee7c by 匡雅琴

接口联调

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