首页接口调试
This commit is contained in:
parent
b478fa87e9
commit
233684f22b
|
|
@ -3,7 +3,7 @@ import request from '@/utils/request'
|
|||
// 获取卡片列表信息
|
||||
export const getCardListApi = data => {
|
||||
return request({
|
||||
url: '/***',
|
||||
url: '/material/mainPage/demandAndSupply',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<svg-icon :icon-class="iconType" class="icon-box" />
|
||||
</div>
|
||||
<div class="right-text">
|
||||
<div>200</div>
|
||||
<div>{{ cardNum }}</div>
|
||||
<div>{{ cardTitle }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -24,6 +24,11 @@ export default {
|
|||
iconType: {
|
||||
type: String,
|
||||
default: 'project_num'
|
||||
},
|
||||
// 数量
|
||||
cardNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
<svg-icon :icon-class="iconType" class="icon-box" />
|
||||
{{ cardTitle }}
|
||||
</div>
|
||||
<div class="f-count">2000.00</div>
|
||||
<div class="f-count">{{ cardNum }}</div>
|
||||
<div class="f-14">
|
||||
较上月降低15.95
|
||||
较上月{{ isReduce ? '增高' : '降低' }}{{ ratio }}%
|
||||
|
||||
<svg-icon v-if="isReduce" icon-class="down_arrow" />
|
||||
<svg-icon v-else icon-class="up_arrow" />
|
||||
|
|
@ -36,6 +36,16 @@ export default {
|
|||
isReduce: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 数量
|
||||
cardNum: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
// 数量
|
||||
ratio: {
|
||||
type: Number,
|
||||
default: 0
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-M"
|
||||
value-format="yyyy-MM-DD"
|
||||
style="width: 95%"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
|
@ -64,8 +64,10 @@
|
|||
<div class="card-box-content-1">
|
||||
<div v-for="(card, index) in cardList_1" :key="index">
|
||||
<CardModel
|
||||
:ratio="card.ratio"
|
||||
:theme="card.theme"
|
||||
:iconType="card.icon"
|
||||
:cardNum="card.cardNum"
|
||||
:cardTitle="card.title"
|
||||
:isReduce="card.isReduce"
|
||||
@onOpenLevelTwoPages="onOpenLevelTwoPages"
|
||||
|
|
@ -77,6 +79,7 @@
|
|||
:theme="card.theme"
|
||||
:iconType="card.icon"
|
||||
:cardTitle="card.title"
|
||||
:cardNum="card.cardNum"
|
||||
v-for="(card, index) in cardList_3"
|
||||
/>
|
||||
</div>
|
||||
|
|
@ -154,19 +157,25 @@ export default {
|
|||
title: '需求量',
|
||||
theme: '#ffa94c',
|
||||
icon: 'demand_count',
|
||||
isReduce: false
|
||||
isReduce: false,
|
||||
cardNum: 0,
|
||||
ratio: 0
|
||||
},
|
||||
{
|
||||
title: '已供应量',
|
||||
theme: '#027db4',
|
||||
icon: 'supply_ready',
|
||||
isReduce: false
|
||||
isReduce: false,
|
||||
cardNum: 0,
|
||||
ratio: 0
|
||||
},
|
||||
{
|
||||
title: '待供应量',
|
||||
theme: '#fb6260',
|
||||
icon: 'supply_to_be',
|
||||
isReduce: true
|
||||
isReduce: true,
|
||||
cardNum: 0,
|
||||
ratio: 0
|
||||
}
|
||||
],
|
||||
cardList_2: [
|
||||
|
|
@ -205,17 +214,20 @@ export default {
|
|||
{
|
||||
title: '工程总数量(个)',
|
||||
theme: '#ffa94c',
|
||||
icon: 'project_num'
|
||||
icon: 'project_num',
|
||||
cardNum: 0
|
||||
},
|
||||
{
|
||||
title: '供应总件数(件)',
|
||||
theme: '#52c1f5',
|
||||
icon: 'quantity_num'
|
||||
icon: 'quantity_num',
|
||||
cardNum: 0
|
||||
},
|
||||
{
|
||||
title: '供应总价值(万元)',
|
||||
theme: '#73a0fa',
|
||||
icon: 'total_price'
|
||||
icon: 'total_price',
|
||||
cardNum: 0
|
||||
}
|
||||
],
|
||||
|
||||
|
|
@ -248,7 +260,32 @@ export default {
|
|||
startTime: this.queryDate && this.queryDate.length > 0 ? this.queryDate[0] : '',
|
||||
endTime: this.queryDate && this.queryDate.length > 0 ? this.queryDate[1] : ''
|
||||
}
|
||||
const res = await getCardListApi()
|
||||
const { data: res } = await getCardListApi(queryParams)
|
||||
const {
|
||||
demandNum,
|
||||
demandIncrease,
|
||||
suppliedQuantityNum,
|
||||
suppliedQuantityIncrease,
|
||||
suppliedToBeQuantityNum,
|
||||
suppliedToBeQuantityIncrease,
|
||||
projectNum,
|
||||
suppliedQuantityAllNum,
|
||||
suppliedQuantityPrice
|
||||
} = res
|
||||
this.cardList_1[0].cardNum = demandNum
|
||||
this.cardList_1[0].ratio = demandIncrease
|
||||
demandIncrease > 0 ? (this.cardList_1[0].isReduce = true) : (this.cardList_1[0].isReduce = false)
|
||||
this.cardList_1[1].cardNum = suppliedQuantityNum
|
||||
this.cardList_1[1].ratio = suppliedQuantityIncrease
|
||||
suppliedQuantityIncrease > 0 ? (this.cardList_1[1].isReduce = true) : (this.cardList_1[1].isReduce = false)
|
||||
this.cardList_1[2].cardNum = suppliedToBeQuantityNum
|
||||
this.cardList_1[2].ratio = suppliedToBeQuantityIncrease
|
||||
suppliedToBeQuantityIncrease > 0
|
||||
? (this.cardList_1[2].isReduce = true)
|
||||
: (this.cardList_1[2].isReduce = false)
|
||||
this.cardList_3[0].cardNum = projectNum
|
||||
this.cardList_3[1].cardNum = suppliedQuantityAllNum || 0
|
||||
this.cardList_3[2].cardNum = suppliedQuantityPrice || 0
|
||||
console.log(res, '--')
|
||||
},
|
||||
// 获取公司和工程
|
||||
|
|
@ -260,7 +297,7 @@ export default {
|
|||
},
|
||||
// 查询
|
||||
onHandleSearch() {
|
||||
console.log('this.queryParams', this.queryParams)
|
||||
this.getCardListFun()
|
||||
},
|
||||
// 重置
|
||||
onHandleReset() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue