Files
kengee-data-screen/src/views/AppKeyGoods.vue

65 lines
1.6 KiB
Vue
Raw Normal View History

<script>
export default {
name: "AppKeyGoods",
label: "市场看板-重点单品",
data() {
return {
tableData: [],
2024-06-29 13:30:06 +08:00
columns: [
2024-06-29 13:41:43 +08:00
{label: "重点单品", prop: "goodsCategoryName"},
2024-07-05 17:36:16 +08:00
{label: "销售额", prop: "saleNum", width: 70},
{label: "库存数量", prop: "stockNum", width: 70},
{label: "销售目标", prop: "targetSaleNum", width:70},
2024-06-29 13:41:43 +08:00
{label: "销售达成", prop: "saleAchieveRate"},
]
}
},
2024-06-29 13:30:06 +08:00
computed: {
2024-07-05 17:36:16 +08:00
search: v => v.$marketBoard.search,
tableConfig: v => {
return {
headerBGC: 'rgba(13, 48, 99, 0.6)',
// headerBGC: '#003B51',
oddRowBGC: window.evenRowBGC(), evenRowBGC: "transparent",
header: v.columns.map(e => e.label),
columnWidth: v.columns.map(e => e.width || "0;flex:1;min-width:0;"),
align: v.columns.map(e => e.align || "left"),
data: v.tableData.map(e => v.columns.map(column => e[column.prop])),
}
},
2024-06-29 13:30:06 +08:00
},
methods: {
getTableData() {
const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/marketKeyGoods", {
2024-07-05 17:36:16 +08:00
// ...this.search, limit: 999
2024-06-29 13:30:06 +08:00
})).then(res => {
if (res?.data) {
this.tableData = res.data?.records || []
}
})
}
},
watch:{
search: {
immediate:true,deep:true,handler(){
this.getTableData()
}
}
}
}
</script>
<template>
<section class="AppKeyGoods">
2024-07-05 17:36:16 +08:00
<dv-scroll-board :config="tableConfig" @click=""/>
</section>
</template>
<style>
.AppKeyGoods {
color: #fff;
box-sizing: border-box;
}
</style>