Compare commits

...

20 Commits

Author SHA1 Message Date
1b28903621 还原 2024-11-02 11:50:30 +08:00
39a8df2ea3 调整缩放的问题 2024-11-02 11:48:44 +08:00
aixianling
7aab2ccdf4 调整一下默认时段 2024-10-29 17:30:04 +08:00
aixianling
7b259f24db 调整一下,避免呗遮挡 2024-10-29 17:05:48 +08:00
aixianling
af296ebf51 解决初始化下拉选项的问题 2024-10-23 10:53:15 +08:00
aixianling
398b3e799c 需求变更,增加默认时段合计 2024-10-23 10:44:40 +08:00
aixianling
e6253c9ac8 优化渲染顺序 2024-10-23 10:42:53 +08:00
aixianling
88b22acf20 单店面板加入特定时间 2024-10-23 09:48:22 +08:00
aixianling
984da801c8 优化调整 2024-10-23 09:44:53 +08:00
aixianling
055c6a4579 需求变更-5 优化体验 2024-10-22 17:18:41 +08:00
aixianling
106ef3032c 需求变更-4:字段重新对 2024-10-22 16:46:01 +08:00
aixianling
1c8a98eacd 需求变更-5 2024-10-22 16:37:18 +08:00
aixianling
72510dbdc1 需求变更-9 2024-10-22 16:03:37 +08:00
aixianling
1874e145f6 需求变更-8 2024-10-22 15:56:49 +08:00
aixianling
d5c52c0098 需求变更-7 2024-10-22 15:50:39 +08:00
aixianling
197dc4bcdb 需求变更-6 2024-10-22 15:36:53 +08:00
aixianling
aaf651b8ba 需求变更-6 2024-10-22 15:36:46 +08:00
aixianling
fb8ca4d9e6 需求变更-4 2024-10-22 15:14:10 +08:00
aixianling
174aede4bc 需求变更-3 2024-10-22 14:52:47 +08:00
aixianling
7bd7174966 需求变更-1 2024-10-22 10:54:10 +08:00
18 changed files with 302 additions and 217 deletions

View File

@@ -22,7 +22,8 @@ html, body, #app {
.pb-10 { .pb-10 {
padding-bottom: 10px; padding-bottom: 10px;
} }
.mb-10{
.mb-10 {
margin-bottom: 10px; margin-bottom: 10px;
} }
@@ -43,7 +44,10 @@ export default {
const targetHeight = 1080; const targetHeight = 1080;
const ratio = targetWidth / targetHeight; const ratio = targetWidth / targetHeight;
const element = this.$el.querySelector('.components'); const element = this.$el.querySelector('.components');
const {width: originalWidth, height: originalHeight} = element.getBoundingClientRect(); if (!element) return
let {width: originalWidth, height: originalHeight} = this.$el.getBoundingClientRect();
originalWidth = originalWidth - 200
console.log("当前面板大小:", originalWidth, originalHeight)
const ratioHeight = originalWidth / ratio; const ratioHeight = originalWidth / ratio;
let scale let scale
if (ratioHeight < originalHeight) { if (ratioHeight < originalHeight) {
@@ -51,7 +55,6 @@ export default {
} else { } else {
scale = originalHeight / targetHeight; scale = originalHeight / targetHeight;
} }
element.style.transform = `scale(${scale})`; element.style.transform = `scale(${scale})`;
element.style.width = '1920px' element.style.width = '1920px'
element.style.height = '1080px' element.style.height = '1080px'
@@ -60,6 +63,10 @@ export default {
}, },
mounted() { mounted() {
this.scaleByAspect() this.scaleByAspect()
window.addEventListener('resize', this.scaleByAspect)
},
beforeDestroy() {
window.removeEventListener('resize', this.scaleByAspect)
} }
} }
</script> </script>

View File

@@ -1,245 +1,251 @@
#app { #app {
font-weight: normal; font-weight: normal;
} }
a, .green { a, .green {
text-decoration: none; text-decoration: none;
color: hsla(160, 100%, 37%, 1); color: hsla(160, 100%, 37%, 1);
transition: 0.4s; transition: 0.4s;
} }
@media (hover: hover) { @media (hover: hover) {
a:hover { a:hover {
background-color: hsla(160, 100%, 37%, 0.2); background-color: hsla(160, 100%, 37%, 0.2);
} }
} }
.AppSelect .el-input__inner { .AppSelect .el-input__inner {
background: linear-gradient(180deg, rgba(12, 53, 111, 0) 0%, #0C356F 100%); background: linear-gradient(180deg, rgba(12, 53, 111, 0) 0%, #0C356F 100%);
border: 1px solid #1760AE; border: 1px solid #1760AE;
border-radius: 0; border-radius: 0;
color: #fff; color: #fff;
} }
.el-table:before, .el-table:after { .el-table:before, .el-table:after {
background: transparent; background: transparent;
} }
.el-table .gutter { .el-table .gutter {
background-color: transparent !important; background-color: transparent !important;
border-color: transparent !important; border-color: transparent !important;
} }
.flex { .flex {
display: flex; display: flex;
} }
.fill { .fill {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
min-width: 0; min-width: 0;
} }
.pointer { .pointer {
cursor: pointer; cursor: pointer;
} }
.grid { .grid {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
} }
.mb-8 { .mb-8 {
margin-bottom: 8px; margin-bottom: 8px;
} }
.mr-8 { .mr-8 {
margin-right: 8px; margin-right: 8px;
} }
.dv-scroll-board { .dv-scroll-board {
overflow: hidden; overflow: hidden;
} }
.dv-scroll-board .header { .dv-scroll-board .header {
align-items: center; align-items: center;
padding: 6px 0; padding: 6px 0;
} }
.dv-scroll-board .header-item, .tableHead .item { .dv-scroll-board .header-item, .tableHead .item {
height: initial !important; height: initial !important;
line-height: 17px !important; line-height: 17px !important;
font-weight: bold; font-weight: bold;
} }
.dv-scroll-board .ceil { .dv-scroll-board .ceil {
padding: 6px 10px !important; padding: 6px 10px !important;
} }
.dv-scroll-board .row-item { .dv-scroll-board .row-item {
overflow: hidden; overflow: hidden;
} }
.dv-scroll-board .ceil, .dv-scroll-board .header-item { .dv-scroll-board .ceil, .dv-scroll-board .header-item {
text-wrap: unset !important; text-wrap: unset !important;
word-break: break-all; word-break: break-all;
font-size: 12px; font-size: 12px;
line-height: 17px line-height: 17px
} }
.summary { .summary {
height: 30px; height: 30px;
align-items: center; align-items: center;
color: #66FFFF; color: #66FFFF;
background-image: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%); background-image: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%) !important;
background-size: 100% 100% !important;
} }
.tableHead { .tableHead {
height: 30px; height: 30px;
align-items: center; align-items: center;
background-color: rgba(13, 48, 99, 0.6); background-color: rgba(13, 48, 99, 0.6);
} }
.summary .item, .tableHead .item { .summary .item, .tableHead .item {
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
padding: 0 6px; padding: 0 6px;
align-items: center; align-items: center;
box-sizing: border-box; box-sizing: border-box;
line-height: 17px; line-height: 17px;
flex-shrink: 0; flex-shrink: 0;
}
.summary .tableCell {
color: #66FFFF !important;
} }
.summary .item { .summary .item {
white-space: wrap; white-space: wrap;
word-break: break-all; word-break: break-all;
} }
.dialogTable { .dialogTable {
position: fixed !important; position: fixed !important;
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 600px !important; width: 600px !important;
height: 300px; height: 300px;
z-index: 9999; z-index: 9999;
background-color: #07193D; background-color: #07193D;
box-shadow: #66FFFF 0 0 20px; box-shadow: #66FFFF 0 0 20px;
} }
.scrollTable { .scrollTable {
color: #fff; color: #fff;
box-sizing: border-box; box-sizing: border-box;
background: transparent !important; background: transparent !important;
border-color: transparent; border-color: transparent;
} }
.scrollTable .tableHeader { .scrollTable .tableHeader {
background: rgba(13, 48, 99, 0.6) !important; background: rgba(13, 48, 99, 0.6) !important;
color: #fff; color: #fff;
border-color: transparent !important; border-color: transparent !important;
} }
.scrollTable tr { .scrollTable tr {
background-color: transparent !important; background-color: transparent !important;
} }
.scrollTable .el-table__footer-wrapper tr { .scrollTable .el-table__footer-wrapper tr {
background: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%); background: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%);
} }
.scrollTable .el-table__footer-wrapper .is-leaf { .scrollTable .el-table__footer-wrapper .is-leaf {
color: #66FFFF; color: #66FFFF;
background: transparent; background: transparent;
border-color: transparent; border-color: transparent;
} }
.scrollTable:before { .scrollTable:before {
background: transparent !important; background: transparent !important;
} }
.scrollTable .el-table__cell.gutter, .scrollTable [name=gutter] { .scrollTable .el-table__cell.gutter, .scrollTable [name=gutter] {
display: none; display: none;
} }
.scrollTable .simplebar-scrollbar:before { .scrollTable .simplebar-scrollbar:before {
background: #ddd; background: #ddd;
} }
.scrollTable .el-table__body { .scrollTable .el-table__body {
width: 100% !important; width: 100% !important;
} }
.scrollTable .el-table__body-wrapper { .scrollTable .el-table__body-wrapper {
overflow-x: hidden !important; overflow-x: hidden !important;
} }
.scrollTable .tableCell { .scrollTable .tableCell {
color: #fff; color: #fff;
border-color: transparent !important; border-color: transparent !important;
} }
.scrollTable .cell { .scrollTable .cell {
text-wrap: unset !important; text-wrap: unset !important;
word-break: break-all; word-break: break-all;
font-size: 12px; font-size: 12px;
padding-left: 6px !important; padding-left: 6px !important;
padding-right: 6px !important; padding-right: 6px !important;
} }
.scrollTable .el-table__cell { .scrollTable .el-table__cell {
padding: 3px 0 !important; padding: 3px 0 !important;
} }
.scrollTable tr.el-table__row--striped { .scrollTable tr.el-table__row--striped {
--odd-bg: #09265B; --odd-bg: #09265B;
background-color: #081F48; background-color: #081F48;
background-image: linear-gradient( background-image: linear-gradient(
-45deg, var(--odd-bg) 0, var(--odd-bg) 10%, transparent 10%, transparent 50%, -45deg, var(--odd-bg) 0, var(--odd-bg) 10%, transparent 10%, transparent 50%,
var(--odd-bg) 50%, var(--odd-bg) 60%, transparent 60%, transparent); var(--odd-bg) 50%, var(--odd-bg) 60%, transparent 60%, transparent);
background-size: 10px 10px; background-size: 10px 10px;
} }
.scrollTable tr.el-table__row--striped .tableCell { .scrollTable tr.el-table__row--striped .tableCell {
background-color: transparent !important; background-color: transparent !important;
} }
.scrollTable tr:hover > .tableCell { .scrollTable tr:hover > .tableCell {
background-color: rgba(255, 255, 255, .1) !important; background-color: rgba(255, 255, 255, .1) !important;
} }
.AppSubTitle { .AppSubTitle {
height: 48px; height: 48px;
padding: 8px 0 8px 38px; padding: 8px 0 8px 38px;
margin-bottom: 24px; margin-bottom: 12px;
box-sizing: border-box; box-sizing: border-box;
line-height: 32px; line-height: 32px;
background-image: url("http://10.0.97.209/img/kengee/kengee4.png"); background-image: url("http://10.0.97.209/img/kengee/kengee4.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 400px 100%;
color: #fff; color: #fff;
max-width: 400px; max-width: 100%;
display: flex; min-width: 400px;
align-items: center; display: flex;
gap: 16px; align-items: center;
position: relative; gap: 16px;
position: relative;
} }
.AppSubTitle span { .AppSubTitle span {
font-size: 12px; font-size: 12px;
color: #215A8E; color: #215A8E;
} }
.AppSubTitle > .right { .AppSubTitle > .right {
position: absolute; position: absolute;
right: -30px; right: 0;
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.AppSubTitle .el-select { .AppSubTitle .el-select {
width: 120px; width: 120px;
} }

View File

@@ -2,7 +2,7 @@ import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
Vue.use(VueRouter) Vue.use(VueRouter)
const ctx = import.meta.glob('../views/App*.vue', {eager: true}) const ctx = import.meta.glob('../views/**/App*.vue', {eager: true})
const routes = [{path: '/', name: 'home'}] const routes = [{path: '/', name: 'home'}]
Object.values(ctx).map(file => { Object.values(ctx).map(file => {
if (file.default) { if (file.default) {

View File

@@ -65,6 +65,7 @@ window.evenRowBGC = (color = "#09265B") => `transparent;background-image: linear
Vue.prototype.$marketBoard = Vue.observable({ Vue.prototype.$marketBoard = Vue.observable({
screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef', screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef',
goodsCategoryId: "",
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"} search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"}
}) })
Vue.prototype.$multipleStoreBoard = Vue.observable({ Vue.prototype.$multipleStoreBoard = Vue.observable({
@@ -146,12 +147,13 @@ Vue.component("scrollTable", {
}, },
methods: { methods: {
initScroll() { initScroll() {
const {SimpleBar} = window const {SimpleBar, $waitFor} = window
const dom = this.$el.querySelector('.el-table__body-wrapper') $waitFor(this.$el.querySelector('.el-table__body-wrapper')).then(dom => {
this.scroll = new SimpleBar(dom) this.scroll = new SimpleBar(dom)
dom.addEventListener('mouseover', this.stopAutoScroll) dom.addEventListener('mouseover', this.stopAutoScroll)
// dom.addEventListener('mouseout', this.autoScroll) // dom.addEventListener('mouseout', this.autoScroll)
// this.scroll.refresh(); // this.scroll.refresh();
})
}, },
autoScroll() { autoScroll() {
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
@@ -165,7 +167,8 @@ Vue.component("scrollTable", {
}, 60) }, 60)
}, },
stopAutoScroll() { stopAutoScroll() {
this.$el.querySelector('.simplebar-vertical').style.display = 'block' const {$waitFor} = window
$waitFor(this.$el.querySelector('.simplebar-vertical')).then(dom => dom.style.display = 'block')
if (this.timer) clearInterval(this.timer) if (this.timer) clearInterval(this.timer)
} }
}, },

View File

@@ -20,11 +20,12 @@ export default {
], ],
重点单品情况: [ 重点单品情况: [
{label: "重点单品", prop: "goodsName"}, {label: "重点单品", prop: "goodsName"},
{label: "当日目标", prop: "targetNum", width: 70}, {label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
{label: "销售数量", prop: "saleNum", width: 70}, {label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
{label: "库存数量", prop: "stockNum", width: 70}, {label: "今日销售数量", prop: "saleNum", width: 70},
{label: "现在库存数量", prop: "stockNum", width: 70},
{label: "剩余时间预计销售数量", prop: "preSaleNum"}, {label: "剩余时间预计销售数量", prop: "preSaleNum"},
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"}, // {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
], ],
周边库存情况: [ 周边库存情况: [
{label: "门店名称", prop: "storeName"}, {label: "门店名称", prop: "storeName"},
@@ -43,8 +44,9 @@ export default {
methods: { methods: {
getData() { getData() {
const {$waitFor, $http} = window const {$waitFor, $http} = window
const {type, compareDate} = this.search
console.log("筛选条件:", this.search) console.log("筛选条件:", this.search)
$waitFor($http).then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()])) $waitFor($http && (type != 3 || compareDate)).then(() => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]))
.then(() => { .then(() => {
this.list = [ this.list = [
{label: "西点柜", value: "104"}, {label: "西点柜", value: "104"},

View File

@@ -16,13 +16,16 @@ export default {
{label: "西点销售额", prop: "westSaleAmt", width: 60, align: 'right', headerAlign: 'left'}, {label: "西点销售额", prop: "westSaleAmt", width: 60, align: 'right', headerAlign: 'left'},
{label: "现烤销售额", prop: "bakeSaleAmt", width: 60, align: 'right', headerAlign: 'left'}, {label: "现烤销售额", prop: "bakeSaleAmt", width: 60, align: 'right', headerAlign: 'left'},
{label: "现烤损货比", prop: "lossAmtRate", width: 60, align: 'right', headerAlign: 'left'}, {label: "现烤损货比", prop: "lossAmtRate", width: 60, align: 'right', headerAlign: 'left'},
{label: "环比(目标完成比)", prop: "targetRate", align: 'right', headerAlign: 'left'}, {label: "环比(目标完成比)", prop: "targetRate", align: 'center', headerAlign: 'left'},
], ],
summary: {} summary: {},
filter: "",
options: []
} }
}, },
computed: { computed: {
search: v => v.$marketBoard.search, search: v => v.$marketBoard.search,
dicts: v => window.$dicts || {},
tableConfig: v => { tableConfig: v => {
return { return {
headerBGC: 'rgba(13, 48, 99, 0.6)', headerBGC: 'rgba(13, 48, 99, 0.6)',
@@ -52,20 +55,29 @@ export default {
methods: { methods: {
getTableData() { getTableData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/groupMonitor", { return $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/groupMonitor", {
...this.search, limit: 999 ...this.search, limit: 999, groupCodeList: [this.filter].filter(Boolean)
})).then(res => { })).then(res => {
if (res?.data) { if (res?.data) {
this.summary = res.data.total this.summary = res.data.total
this.tableData = res.data?.page?.records || [] this.tableData = res.data?.page?.records || []
} }
}) })
},
getOptions() {
const ops = {}
this.tableData.forEach(e => {
ops[e.groupCode] = e.groupName
})
return Object.entries(ops).map(([key, value]) => ({label: value, value: key}))
} }
}, },
watch: { watch: {
search: { search: {
immediate: true, deep: true, handler() { immediate: true, deep: true, handler() {
this.getTableData() this.getTableData().then(() => {
if (this.options.length == 0) this.options = this.getOptions()
})
} }
} }
} }
@@ -75,6 +87,13 @@ export default {
<template> <template>
<section class="AppGroupMonitorTable"> <section class="AppGroupMonitorTable">
<!--<dv-scroll-board :config="tableConfig"/>--> <!--<dv-scroll-board :config="tableConfig"/>-->
<app-sub-title text="课区运营监控表">
<template #right>
<el-select placeholder="全部" v-model="filter" size="small" clearable class="AppSelect" @change="getTableData">
<el-option v-for="(op,i) in options" :key="i" v-bind="op"/>
</el-select>
</template>
</app-sub-title>
<scroll-table :table-data="tableData" :columns="columns"/> <scroll-table :table-data="tableData" :columns="columns"/>
<div class="summary flex"> <div class="summary flex">
<div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/> <div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/>
@@ -89,6 +108,10 @@ export default {
} }
.AppGroupMonitorTable .dv-scroll-board, .AppGroupMonitorTable .scrollTable { .AppGroupMonitorTable .dv-scroll-board, .AppGroupMonitorTable .scrollTable {
height: calc(100% - 30px) !important; height: calc(100% - 80px) !important;
}
.AppGroupMonitorTable .el-select {
width: 140px !important;
} }
</style> </style>

View File

@@ -1,4 +1,5 @@
<script> <script>
const sort = [108, 109, 104, 101, 102, 103, 106, 107, 105].map(e => `${e}`)
export default { export default {
name: "AppHourCount", name: "AppHourCount",
label: "市场看板-全门店时段合计", label: "市场看板-全门店时段合计",
@@ -73,7 +74,7 @@ export default {
...this.search, limit: 999 ...this.search, limit: 999
})).then(res => { })).then(res => {
if (res?.data) { if (res?.data) {
this.tableData = res.data?.page?.records || [] this.tableData = res.data?.page?.records?.sort((a, b) => sort.indexOf(a.categoryId) - sort.indexOf(b.categoryId)) || []
this.summary = res.data?.total this.summary = res.data?.total
} }
}) })
@@ -109,7 +110,7 @@ export default {
min-width: 480px; min-width: 480px;
} }
.AppHourCount .dv-scroll-board,.AppHourCount .scrollTable{ .AppHourCount .dv-scroll-board, .AppHourCount .scrollTable {
height: calc(100% - 60px); height: calc(100% - 50px) !important;
} }
</style> </style>

View File

@@ -1,4 +1,5 @@
<script> <script>
const getHourRange = hour => `${hour.padStart(2, '0')}:00-${`${Number(hour) + 1}`.padStart(2, '0')}:00`
export default { export default {
name: "AppHourSale", name: "AppHourSale",
label: "市场看板-全门店时段销售", label: "市场看板-全门店时段销售",
@@ -85,29 +86,30 @@ export default {
methods: { methods: {
getTableData() { getTableData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourSale", { return $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourSale", {
...this.search, limit: 999 ...this.search, limit: 999
})).then(res => { })).then(res => {
if (res?.data) { if (res?.data) {
this.summary = res.data.total this.summary = res.data.total
this.tableData = res.data?.page?.records?.map(e => ({...e, hour: `${e.hour.padStart(2, '0')}:00-${`${Number(e.hour) + 1}`.padStart(2, '0')}:00`})) || [] return this.tableData = res.data?.page?.records?.map(e => ({...e, hour: getHourRange(e.hour), index: e.hour})).sort((a, b) => a.index - b.index) || []
} }
}) })
}, },
handleSta({hour}) { handleSta({hour}) {
this.handleMouseout()
const rowIndex = this.tableData.findIndex(e => e.hour == hour) const rowIndex = this.tableData.findIndex(e => e.hour == hour)
const v = this const v = this
const summary = { const summary = {
compareSaleAmt: 0, compareValidOrderNum: 0, currentSaleAmt: 0, currentValidOrderNum: 0, saleGrowthRate: 0 compareSaleAmt: 0, compareValidOrderNum: 0, currentSaleAmt: 0, currentValidOrderNum: 0, saleGrowthRate: 0
} }
console.log(rowIndex)
v.tableData.forEach((e, i) => { v.tableData.forEach((e, i) => {
if (i <= rowIndex) { if (i <= rowIndex) {
summary.compareSaleAmt += Number(e.compareSaleAmt || 0) summary.compareSaleAmt += Number(e.compareSaleAmt || 0)
summary.compareValidOrderNum += Number(e.compareValidOrderNum || 0) summary.compareValidOrderNum += Number(e.compareValidOrderNum || 0)
summary.currentSaleAmt += Number(e.currentSaleAmt || 0) summary.currentSaleAmt += Number(e.currentSaleAmt || 0)
summary.currentValidOrderNum += Number(e.currentValidOrderNum || 0) summary.currentValidOrderNum += Number(e.currentValidOrderNum || 0)
summary.saleGrowthRate += Number(e.saleGrowthRate.replace("%", "") || 0) const {currentSaleAmt, compareSaleAmt} = summary
summary.saleGrowthRate = Number((currentSaleAmt - compareSaleAmt) / compareSaleAmt * 100 || 0)
} }
if (i == rowIndex) { if (i == rowIndex) {
summary.compareSaleAmt = summary.compareSaleAmt.toFixed(2) summary.compareSaleAmt = summary.compareSaleAmt.toFixed(2)
@@ -117,46 +119,68 @@ export default {
summary.saleGrowthRate = summary.saleGrowthRate.toFixed(2) + "%" summary.saleGrowthRate = summary.saleGrowthRate.toFixed(2) + "%"
} }
}) })
this.hourSummary = v.tableColumns.map((column, i) => { const summaryRow = {}
const isNumber = v => /^-?\d+(\.\d+)?%?$/.test(v) v.tableColumns.forEach(({prop}, i) => {
const style = {textAlign: column.align} summaryRow[prop] = i == 0 ? "时段合计" : (summary[prop] || '')
if (column.width > 0) {
style.width = `${column.width}px`
} else {
style.flex = 1
style.minWidth = 0
}
return {
style,
value: isNumber(summary[column.prop]) ? summary[column.prop] :
i == 0 ? "时段合计" : ""
}
}) })
this.hourSummaryStyle.display = "flex" v.tableData.splice(rowIndex + 1, 0, summaryRow)
// this.hourSummary = v.tableColumns.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(summary[column.prop]) ? summary[column.prop] :
// i == 0 ? "时段合计" : ""
// }
// })
// this.hourSummaryStyle.display = "flex"
}, },
handleMouseOver(evt) { handleRowStyle({row}) {
const getTop = e => e.offsetParent ? getTop(e.offsetParent) + e.offsetTop : e.offsetTop if (row.hour == '时段合计') return 'summary'
const top = getTop(this.$el) return ''
// this.$set(this.hourSummaryStyle, "top", (evt.clientY - top + 10) + "px") },
handleMouseout() {
// this.hourSummaryStyle = {display: 'none'}
const i = this.tableData.findIndex(e => e.hour == '时段合计')
if (i == -1) return;
this.tableData.splice(i, 1)
},
initHourSta() {
const {dayjs} = window
const hour = getHourRange(`${dayjs().hour()}`)
this.handleSta({hour})
} }
}, },
watch: { watch: {
search: { search: {
immediate: true, deep: true, handler() { immediate: true, deep: true, handler() {
this.getTableData() this.getTableData().then(() => this.initHourSta())
} }
} }
},
mounted() {
document.addEventListener('click', evt => {
if (!this.$el.contains(evt.target)) {
this.initHourSta()
}
})
} }
} }
</script> </script>
<template> <template>
<section class="AppHourSale" @mousemove="handleMouseOver"> <section class="AppHourSale">
<scroll-table :table-data="tableData" :columns="columns" @click="handleSta" @mouseout.native="hourSummaryStyle={display:'none'}"/> <scroll-table :table-data="tableData" :columns="columns" @click="handleSta" @click.native.stop :config="{rowClassName:handleRowStyle}"/>
<!--<dv-scroll-board :config="tableConfig" @mouseover="handleSta" @mouseout.native="hourSummaryStyle={display:'none'}"/>--> <!--<dv-scroll-board :config="tableConfig" @mouseover="handleSta" @mouseout.native="hourSummaryStyle={display:'none'}"/>-->
<div class="summary flex hourSummary" :style="hourSummaryStyle"> <!-- <div class="summary flex hourSummary" :style="hourSummaryStyle">-->
<div class="item" v-for="(col,i) in hourSummary" :key="i" v-text="col.value" :style="col.style"/> <!-- <div class="item" v-for="(col,i) in hourSummary" :key="i" v-text="col.value" :style="col.style"/>-->
</div> <!-- </div>-->
<div class="summary flex"> <div class="summary flex">
<div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/> <div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/>
</div> </div>

View File

@@ -1,9 +1,6 @@
<script> <script>
import AppSubTitle from "@/views/AppSubTitle.vue";
export default { export default {
name: "AppKeyGoods", name: "AppKeyGoods",
components: {AppSubTitle},
label: "市场看板-重点单品", label: "市场看板-重点单品",
data() { data() {
return { return {
@@ -37,7 +34,7 @@ export default {
getTableData() { getTableData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
const {goodsCategoryId} = this const {goodsCategoryId} = this
$waitFor($http).then(() => $http.post("/data-boot/ca/screen/scStoreKeyGoods/list", { $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/marketKeyGoods", {
...this.search, limit: 999, goodsCategoryId ...this.search, limit: 999, goodsCategoryId
})).then(res => { })).then(res => {
if (res?.data) { if (res?.data) {
@@ -75,4 +72,7 @@ export default {
color: #fff; color: #fff;
box-sizing: border-box; box-sizing: border-box;
} }
.AppKeyGoods .dv-scroll-board, .AppKeyGoods .scrollTable {
height: calc(100% - 60px) !important;
}
</style> </style>

View File

@@ -24,7 +24,7 @@ export default {
setTimeout(() => { setTimeout(() => {
const compareDate = dayjs().subtract(7, "day").format("YYYYMMDD"), const compareDate = dayjs().subtract(7, "day").format("YYYYMMDD"),
currentDate = dayjs().format("YYYYMMDD"), currentDate = dayjs().format("YYYYMMDD"),
hourNum = new Date().getHours(), hourNum = new Date().getHours()+1,
groupCodeList = "" groupCodeList = ""
this.form = {compareDate, currentDate, hourNum, groupCodeList} this.form = {compareDate, currentDate, hourNum, groupCodeList}
this.$set(this.$marketBoard, 'search', {compareDate, currentDate, hourNum, groupCodeList: []}) this.$set(this.$marketBoard, 'search', {compareDate, currentDate, hourNum, groupCodeList: []})

View File

@@ -40,8 +40,8 @@ export default {
this.getOptions().then(() => { this.getOptions().then(() => {
setTimeout(() => { setTimeout(() => {
const {dayjs} = window const {dayjs} = window
const hourNum = new Date().getHours(), groupCodeList = "", interval = 60000 const hourNum = new Date().getHours()+1, groupCodeList = "", interval = 60000
const currentDate = dayjs().format("YYYYMMDD") const currentDate = dayjs().subtract(7, 'day').format("YYYYMMDD")
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval} this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval}
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval}) this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval})
}, 500) }, 500)

View File

@@ -31,7 +31,8 @@ export default {
methods: { methods: {
getData() { getData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post('/data-boot/la/screen/singleStoreBoard/overview', {...this.search}).then(res => { const {type, compareDate} = this.search
$waitFor($http&& (type != 3 || compareDate)).then(() => $http.post('/data-boot/la/screen/singleStoreBoard/overview', {...this.search}).then(res => {
if (res?.data) { if (res?.data) {
this.info = res.data this.info = res.data
} }

View File

@@ -26,7 +26,7 @@ export default {
this.getOptions().then(() => { this.getOptions().then(() => {
setTimeout(() => { setTimeout(() => {
const {dayjs} = window const {dayjs} = window
const hourNum = new Date().getHours(), const hourNum = new Date().getHours()+1,
storeCode = this.$storeBoard.search.storeCode || this.options?.[0].storeCode storeCode = this.$storeBoard.search.storeCode || this.options?.[0].storeCode
const currentDate = dayjs().format("YYYYMMDD") const currentDate = dayjs().format("YYYYMMDD")
this.form = {hourNum, storeCode, type: "1", currentDate} this.form = {hourNum, storeCode, type: "1", currentDate}
@@ -49,6 +49,9 @@ export default {
<el-option v-for="item in dicts.类型" :key="item.value" :label="item.label" :value="item.value"/> <el-option v-for="item in dicts.类型" :key="item.value" :label="item.label" :value="item.value"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="特定日期" v-if="form.type==3">
<el-date-picker v-model="form.compareDate" @change="v=>$set($storeBoard.search, 'compareDate', v)" clearable type="date" value-format="yyyyMMdd"/>
</el-form-item>
<div class="fill" v-text="storeName"/> <div class="fill" v-text="storeName"/>
<el-form-item label="门店"> <el-form-item label="门店">
<el-select v-model="form.storeCode" @change="v=>$storeBoard.search.storeCode=v" clearable placeholder="全部" class="storeSelect" filterable> <el-select v-model="form.storeCode" @change="v=>$storeBoard.search.storeCode=v" clearable placeholder="全部" class="storeSelect" filterable>

View File

@@ -8,21 +8,20 @@ export default {
columns: [ columns: [
{label: "课区", prop: "groupName"}, {label: "课区", prop: "groupName"},
{label: "课长", prop: "supervisorName"}, {label: "课长", prop: "supervisorName"},
{label: "门店", prop: "storeName"}, {label: "门店", prop: "storeName", width: 100},
{label: "门店现烤净收货额", prop: "bakeNetAmt"}, {label: "昨日门店净收货额", prop: "yesterdayNetAmt"},
{label: "门店现烤销售", prop: "bakeSaleAmt"}, {label: "昨日现烤销售", prop: "yesterdayBakeSaleAmt"},
{label: "门店现烤报损", prop: "bakeBsAmt"}, {label: "昨日现烤报损", prop: "yesterdayBakeBsAmt"},
{label: "门店现烤领用额", prop: "bakeLyAmt"}, {label: "门店现在现烤库存金额", prop: "bakeStockAmt"},
{label: "门店现烤惜食", prop: "bakeXsSaleAmt"}, {label: "现在现烤销售额", prop: "bakeSaleAmt"},
], ],
filter: "", filter: "",
options: [],
summary: {} summary: {}
} }
}, },
computed: { computed: {
search: v => v.$marketBoard.search, search: v => v.$marketBoard.search,
list: v => v.tableData.filter(e => !v.filter || e.supervisorName == v.filter) || [],
options: v => [...new Set(v.tableData.map(e => e.supervisorName))],
tableConfig: v => { tableConfig: v => {
return { return {
headerBGC: 'rgba(13, 48, 99, 0.6)', headerBGC: 'rgba(13, 48, 99, 0.6)',
@@ -53,20 +52,29 @@ export default {
methods: { methods: {
getTableData() { getTableData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/storeMonitor", { return $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/storeMonitor", {
...this.search, limit: 999 ...this.search, limit: 999, groupCodeList: [this.filter].filter(Boolean)
})).then(res => { })).then(res => {
if (res?.data) { if (res?.data) {
this.summary = res.data.total this.summary = res.data.total
this.tableData = res.data?.page?.records || [] return this.tableData = res.data?.page?.records || []
} }
}) })
},
getOptions() {
const ops = {}
this.tableData.forEach(e => {
ops[e.groupCode] = e.supervisorName
})
return Object.entries(ops).map(([key, value]) => ({label: value, value: key}))
} }
}, },
watch: { watch: {
search: { search: {
immediate: true, deep: true, handler() { immediate: true, deep: true, handler() {
this.getTableData() this.getTableData().then(() => {
if (this.options.length == 0) this.options = this.getOptions()
})
} }
} }
} }
@@ -75,12 +83,13 @@ export default {
<template> <template>
<section class="AppStoreMonitor"> <section class="AppStoreMonitor">
<div class="flex" style="margin-bottom: 22px"> <app-sub-title text="门店运营监控表">
<div class="fill"/> <template #right>
<el-select placeholder="全部" v-model="filter" size="small" clearable class="AppSelect"> <el-select placeholder="全部" v-model="filter" size="small" clearable class="AppSelect" @change="getTableData">
<el-option v-for="(name,i) in options" :key="i" :label="name" :value="name"/> <el-option v-for="(op,i) in options" :key="i" v-bind="op"/>
</el-select> </el-select>
</div> </template>
</app-sub-title>
<scroll-table :table-data="tableData" :columns="columns"/> <scroll-table :table-data="tableData" :columns="columns"/>
<!--<dv-scroll-board :config="tableConfig"/>--> <!--<dv-scroll-board :config="tableConfig"/>-->
<div class="summary flex"> <div class="summary flex">
@@ -97,8 +106,8 @@ export default {
width: 660px; width: 660px;
} }
.AppStoreMonitor .dv-scroll-board,.AppStoreMonitor .scrollTable{ .AppStoreMonitor .dv-scroll-board, .AppStoreMonitor .scrollTable {
height: calc(100% - 30px - 55px) !important; height: calc(100% - 80px) !important;
} }
.AppStoreMonitor .el-select { .AppStoreMonitor .el-select {

View File

@@ -14,19 +14,21 @@ export default {
columns: { columns: {
品类销售情况: [ 品类销售情况: [
{label: "品类", prop: "secondCategoryName"}, {label: "品类", prop: "secondCategoryName"},
{label: "销售额", prop: "currentSaleAmt", width: 70}, {label: "销售额", prop: "currentSaleAmt"},
{label: "库存金额", prop: "currentStockAmt", width: 80}, {label: "库存金额", prop: "currentStockAmt"},
{label: "同/环比销售额", prop: "compareSaleAmt", width: 70}, // {label: "同/环比销售额", prop: "compareSaleAmt", width: 70},
{label: "同/环比库存金额", prop: "compareStockAmt", width: 70}, // {label: "同/环比库存金额", prop: "compareStockAmt", width: 70},
{label: "前四周日均销售额", prop: "avg4WeekSaleAmt", width: 70}, // {label: "前四周日均销售额", prop: "avg4WeekSaleAmt", width: 70},
], ],
重点单品情况: [ 重点单品情况: [
{label: "重点单品", prop: "name"}, {label: "重点单品", prop: "name"},
{label: "当日目标", prop: "targetNum", width: 70}, // {label: "当日目标", prop: "targetNum", width: 70},
{label: "销售数量", prop: "saleNum", width: 70}, {label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
{label: "库存数量", prop: "stockNum", width: 70}, {label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
{label: "今日销售数量", prop: "saleNum", width: 70},
{label: "现在库存数量", prop: "stockNum", width: 70},
{label: "剩余时间预计销售数量", prop: "preSaleNum"}, {label: "剩余时间预计销售数量", prop: "preSaleNum"},
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"}, // {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
], ],
周边库存情况: [ 周边库存情况: [
{label: "门店名称", prop: "storeName"}, {label: "门店名称", prop: "storeName"},
@@ -75,7 +77,7 @@ export default {
methods: { methods: {
getData() { getData() {
const {$http, $waitFor} = window const {$http, $waitFor} = window
const {groupCodeList, type, compareDate} = this.search const {type, compareDate} = this.search
console.log("筛选条件:", this.search) console.log("筛选条件:", this.search)
return $waitFor($http && (type != 3 || compareDate)).then(() => this.getStores()) return $waitFor($http && (type != 3 || compareDate)).then(() => this.getStores())
.then(codes => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]).then(() => codes)) .then(codes => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]).then(() => codes))

View File

@@ -12,32 +12,35 @@ import AppHourCount from "@/views/AppHourCount.vue";
export default { export default {
name: "AppMarketBoard", name: "AppMarketBoard",
label: "市场看板", label: "市场看板",
components: { AppHourCount, AppHourSale, AppStoreMonitor, AppGroupMonitorTable, AppKeyGoods, AppSalesPerformance, AppMap, AppNavbar, AppMarketBoardFilter} components: {AppHourCount, AppHourSale, AppStoreMonitor, AppGroupMonitorTable, AppKeyGoods, AppSalesPerformance, AppMap, AppNavbar, AppMarketBoardFilter}
} }
</script> </script>
<template> <template>
<section class="AppMarketBoard"> <section class="AppMarketBoard">
<app-navbar class="mb-10"/> <app-navbar class="mb-10"/>
<app-market-board-filter/>
<div class="flex" style="gap:20px"> <div class="flex" style="gap:20px">
<div class="fill"> <div class="fill">
<div class="flex gap"> <div class="flex gap">
<div style="width: 430px;"> <div style="width: 430px;">
<app-sub-title/> <app-sub-title/>
<app-sales-performance style="margin-bottom: 20px"/> <app-sales-performance style="margin-bottom: 10px"/>
<app-key-goods/> <app-key-goods style="height: 208px"/>
</div>
<div class="fill">
<app-market-board-filter/>
<app-map style="height: calc(100% - 50px)"/>
</div> </div>
<app-map class="fill"/>
</div> </div>
<div class="flex gap"> <div class="flex gap" style="height: 394px">
<app-group-monitor-table class="fill"/> <app-group-monitor-table class="fill"/>
<app-store-monitor class="fill"/> <app-store-monitor class="fill"/>
</div> </div>
</div> </div>
<div style="width: 480px;"> <div style="width: 480px;">
<app-hour-sale/> <app-sub-title text="全门店时段销售"/>
<app-hour-count/> <app-hour-sale style="height: 600px"/>
<app-hour-count style="height: 260px"/>
</div> </div>
</div> </div>
</section> </section>
@@ -48,7 +51,8 @@ export default {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.gap{
.gap {
gap: 20px; gap: 20px;
} }
</style> </style>

View File

@@ -12,7 +12,7 @@ export default {
<template> <template>
<section class="AppMultipleStoreBoard"> <section class="AppMultipleStoreBoard">
<app-navbar/> <app-navbar class="mb-10"/>
<app-multiple-store-board-filter/> <app-multiple-store-board-filter/>
<app-stores-table class="fill"/> <app-stores-table class="fill"/>
</section> </section>