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

78 lines
2.4 KiB
Vue
Raw Normal View History

2024-07-07 22:42:40 +08:00
<script>
export default {
name: "AppStoreKeyGoods",
label: "表格",
data() {
return {
2024-07-15 09:51:18 +08:00
tableData: [],
2024-07-07 22:42:40 +08:00
columns: [
2024-07-08 18:53:50 +08:00
{label: "重点单品", prop: "goodsName"},
{label: "当日目标", prop: "targetNum", width: 70},
{label: "销售数量", prop: "saleNum", width: 70},
{label: "库存数量", prop: "stockNum", width: 70},
{label: "预计销售数量", prop: "preSaleNum", width: 70},
2024-07-07 22:42:40 +08:00
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
]
}
},
computed: {
tableConfig: v => {
return {
2024-07-08 18:53:50 +08:00
headerBGC: 'rgba(13, 48, 99, 0.6)', rowNum: 9,
2024-07-07 22:42:40 +08:00
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"),
2024-07-08 18:53:50 +08:00
data: v.tableData.map(e => v.columns.map(column => column.custom == 1 ? `<div class="pointer" style="color:${e.preSaleNum > e.stockNum ? 'red' : '#fff'}">周边库存</div>` :
column.format ? column.format(e) : e[column.prop])) || [],
2024-07-07 22:42:40 +08:00
}
},
},
2024-07-15 09:51:18 +08:00
watch: {
$storeBoard: {
deep: true, immediate: true, handler(v) {
this.tableData = v.storeKeyGoods || []
}
}
},
2024-07-08 18:53:50 +08:00
methods: {
2024-08-05 03:28:19 +08:00
openNearbyStores({thirdGoodsCode}) {
const {storeCode, longitude, latitude} = this.$storeBoard.store
2024-07-08 18:53:50 +08:00
return $http.post("/data-boot/la/screen/multipleStoreBoard/aroundStock", {
type: "1", ...this.search, storeCode, longitude, latitude, thirdGoodsCode,
}).then(res => {
if (res?.data) {
this.$storeBoard.aroundStock = res.data
this.$nextTick(() => this.$storeBoard.dialog = true)
}
})
}
}
2024-07-07 22:42:40 +08:00
}
</script>
<template>
<section class="AppStoreKeyGoods">
<div class="subTitle" v-text="'重点单品情况'"/>
2024-08-05 03:28:19 +08:00
<scroll-table :table-data="tableData" :columns="columns" @click="openNearbyStores" @click.native.stop/>
<!--<dv-scroll-board :config="tableConfig" @click="openNearbyStores" @click.native.stop/>-->
2024-07-07 22:42:40 +08:00
</section>
</template>
<style>
.AppStoreKeyGoods {
color: #fff;
box-sizing: border-box;
}
.AppStoreKeyGoods .subTitle {
line-height: 20px;
width: fit-content;
margin: 24px auto 12px;
background-image: url("http://10.0.97.209/img/kengee/kengee5.png");
background-repeat: no-repeat;
background-size: 100% 2px;
background-position: center bottom;
}
</style>