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

108 lines
3.1 KiB
Vue
Raw Normal View History

<script>
export default {
name: "AppStoreMonitor",
label: "市场看板-门店运营监控表",
data() {
return {
tableData: [],
columns: [
{label: "课区", prop: "groupName"},
{label: "课长", prop: "supervisorName"},
{label: "门店", prop: "storeName"},
{label: "门店现烤净收货额", prop: "bakeNetAmt"},
{label: "门店现烤销售额", prop: "bakeSaleAmt"},
{label: "门店现烤报损额", prop: "bakeBsAmt"},
{label: "门店现烤领用额", prop: "bakeLyAmt"},
{label: "门店现烤惜食", prop: "bakeXsSaleAmt"},
2024-06-30 20:10:23 +08:00
],
2024-07-05 17:36:16 +08:00
filter: "",
summary: {}
}
},
computed: {
2024-06-30 20:10:23 +08:00
search: v => v.$marketBoard.search,
2024-07-05 17:36:16 +08:00
list: v => v.tableData.filter(e => !v.filter || e.supervisorName == v.filter) || [],
options: v => [...new Set(v.tableData.map(e => e.supervisorName))],
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.list.map(e => v.columns.map(column => e[column.prop])),
}
},
summaryRow: v => v.columns.map((column, i) => {
const isNumber = v => /^-?\d+(\.\d+)?%?$/.test(v)
const style = {textAlign: column.align}
if (column.width > 0) {
style.width = `${column.width}px`
} else {
style.flex = 1
style.minWidth = 0
}
return {
style,
value: isNumber(v.summary[column.prop]) ? v.summary[column.prop] :
i == 0 ? v.summary.groupName : ""
}
})
},
methods: {
getTableData() {
const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/storeMonitor", {
...this.search, limit: 999
})).then(res => {
if (res?.data) {
2024-07-05 17:36:16 +08:00
this.summary = res.data.total
this.tableData = res.data?.page?.records || []
}
})
}
},
2024-06-30 20:10:23 +08:00
watch: {
search: {
2024-06-30 20:10:23 +08:00
immediate: true, deep: true, handler() {
this.getTableData()
}
}
}
}
</script>
<template>
<section class="AppStoreMonitor">
2024-06-30 20:10:23 +08:00
<div class="flex" style="margin-bottom: 22px">
<div class="fill"/>
<el-select placeholder="全部" v-model="filter" size="small" clearable class="AppSelect">
2024-07-05 17:36:16 +08:00
<el-option v-for="(name,i) in options" :key="i" :label="name" :value="name"/>
2024-06-30 20:10:23 +08:00
</el-select>
</div>
2024-08-05 03:28:19 +08:00
<scroll-table :table-data="tableData" :columns="columns"/>
<!--<dv-scroll-board :config="tableConfig"/>-->
2024-07-05 17:36:16 +08:00
<div class="summary flex">
<div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/>
</div>
</section>
</template>
<style>
.AppStoreMonitor {
2024-07-05 17:36:16 +08:00
flex-shrink: 0 !important;
color: #fff;
box-sizing: border-box;
2024-08-05 03:28:19 +08:00
width: 660px;
}
2024-08-05 03:28:19 +08:00
.AppStoreMonitor .dv-scroll-board,.AppStoreMonitor .scrollTable{
2024-07-05 17:36:16 +08:00
height: calc(100% - 30px - 55px) !important;
}
2024-06-30 20:10:23 +08:00
.AppStoreMonitor .el-select {
width: 120px;
}
</style>