Compare commits
33 Commits
fcb2fe3b47
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ee1bb3b9a | |||
| 2663ca9e73 | |||
|
|
c2743d926e | ||
|
|
4403ec5322 | ||
|
|
9c6248e5df | ||
|
|
1845f6cc9a | ||
|
|
a127b3ea47 | ||
|
|
f638418345 | ||
|
|
42c72225df | ||
|
|
e11d319ec3 | ||
| c2e4c39b56 | |||
| 0b1945c8f4 | |||
| f1620c710f | |||
| 1b28903621 | |||
| 39a8df2ea3 | |||
|
|
7aab2ccdf4 | ||
|
|
7b259f24db | ||
|
|
af296ebf51 | ||
|
|
398b3e799c | ||
|
|
e6253c9ac8 | ||
|
|
88b22acf20 | ||
|
|
984da801c8 | ||
|
|
055c6a4579 | ||
|
|
106ef3032c | ||
|
|
1c8a98eacd | ||
|
|
72510dbdc1 | ||
|
|
1874e145f6 | ||
|
|
d5c52c0098 | ||
|
|
197dc4bcdb | ||
|
|
aaf651b8ba | ||
|
|
fb8ca4d9e6 | ||
|
|
174aede4bc | ||
|
|
7bd7174966 |
13
src/App.vue
13
src/App.vue
@@ -22,7 +22,8 @@ html, body, #app {
|
||||
.pb-10 {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.mb-10{
|
||||
|
||||
.mb-10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -43,7 +44,10 @@ export default {
|
||||
const targetHeight = 1080;
|
||||
const ratio = targetWidth / targetHeight;
|
||||
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;
|
||||
let scale
|
||||
if (ratioHeight < originalHeight) {
|
||||
@@ -51,7 +55,6 @@ export default {
|
||||
} else {
|
||||
scale = originalHeight / targetHeight;
|
||||
}
|
||||
|
||||
element.style.transform = `scale(${scale})`;
|
||||
element.style.width = '1920px'
|
||||
element.style.height = '1080px'
|
||||
@@ -60,6 +63,10 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.scaleByAspect()
|
||||
window.addEventListener('resize', this.scaleByAspect)
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.scaleByAspect)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,245 +1,268 @@
|
||||
#app {
|
||||
font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
a, .green {
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
text-decoration: none;
|
||||
color: hsla(160, 100%, 37%, 1);
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
@media (hover: hover) {
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
a:hover {
|
||||
background-color: hsla(160, 100%, 37%, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
.AppSelect .el-input__inner {
|
||||
background: linear-gradient(180deg, rgba(12, 53, 111, 0) 0%, #0C356F 100%);
|
||||
border: 1px solid #1760AE;
|
||||
border-radius: 0;
|
||||
color: #fff;
|
||||
background: linear-gradient(180deg, rgba(12, 53, 111, 0) 0%, #0C356F 100%);
|
||||
border: 1px solid #1760AE;
|
||||
border-radius: 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.el-table:before, .el-table:after {
|
||||
background: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.el-table .gutter {
|
||||
background-color: transparent !important;
|
||||
border-color: transparent !important;
|
||||
background-color: transparent !important;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.fill {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
|
||||
.mb-8 {
|
||||
margin-bottom: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.mr-8 {
|
||||
margin-right: 8px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.dv-scroll-board {
|
||||
overflow: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.dv-scroll-board .header {
|
||||
align-items: center;
|
||||
padding: 6px 0;
|
||||
align-items: center;
|
||||
padding: 6px 0;
|
||||
}
|
||||
|
||||
.dv-scroll-board .header-item, .tableHead .item {
|
||||
height: initial !important;
|
||||
line-height: 17px !important;
|
||||
font-weight: bold;
|
||||
height: initial !important;
|
||||
line-height: 17px !important;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.dv-scroll-board .ceil {
|
||||
padding: 6px 10px !important;
|
||||
padding: 6px 10px !important;
|
||||
}
|
||||
|
||||
.dv-scroll-board .row-item {
|
||||
overflow: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.dv-scroll-board .ceil, .dv-scroll-board .header-item {
|
||||
text-wrap: unset !important;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
line-height: 17px
|
||||
text-wrap: unset !important;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
line-height: 17px
|
||||
}
|
||||
|
||||
.summary {
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
color: #66FFFF;
|
||||
background-image: linear-gradient(90deg, rgba(1, 196, 236, 0.5) 0%, rgba(1, 196, 236, 0.01) 100%);
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
color: #66FFFF;
|
||||
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 {
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
background-color: rgba(13, 48, 99, 0.6);
|
||||
height: 30px;
|
||||
align-items: center;
|
||||
background-color: rgba(13, 48, 99, 0.6);
|
||||
}
|
||||
|
||||
.summary .item, .tableHead .item {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding: 0 6px;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
line-height: 17px;
|
||||
flex-shrink: 0;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding: 0 6px;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
line-height: 17px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.summary .tableCell {
|
||||
color: #66FFFF !important;
|
||||
}
|
||||
|
||||
.summary .item {
|
||||
white-space: wrap;
|
||||
word-break: break-all;
|
||||
white-space: wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.dialogTable {
|
||||
position: fixed !important;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 600px !important;
|
||||
height: 300px;
|
||||
z-index: 9999;
|
||||
background-color: #07193D;
|
||||
box-shadow: #66FFFF 0 0 20px;
|
||||
position: fixed !important;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 600px !important;
|
||||
height: 300px;
|
||||
z-index: 9999;
|
||||
background-color: #07193D;
|
||||
box-shadow: #66FFFF 0 0 20px;
|
||||
}
|
||||
|
||||
|
||||
.scrollTable {
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
background: transparent !important;
|
||||
border-color: transparent;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
background: transparent !important;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.scrollTable .tableHeader {
|
||||
background: rgba(13, 48, 99, 0.6) !important;
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
background: rgba(13, 48, 99, 0.6) !important;
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.scrollTable tr {
|
||||
background-color: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
|
||||
.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 {
|
||||
color: #66FFFF;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
color: #66FFFF;
|
||||
background: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
.scrollTable:before {
|
||||
background: transparent !important;
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.scrollTable .el-table__cell.gutter, .scrollTable [name=gutter] {
|
||||
display: none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.scrollTable .simplebar-scrollbar:before {
|
||||
background: #ddd;
|
||||
background: #ddd;
|
||||
}
|
||||
|
||||
.scrollTable .el-table__body {
|
||||
width: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.scrollTable .el-table__body-wrapper {
|
||||
overflow-x: hidden !important;
|
||||
overflow-x: hidden !important;
|
||||
}
|
||||
|
||||
.scrollTable .tableCell {
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
color: #fff;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
.scrollTable .cell {
|
||||
text-wrap: unset !important;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
padding-left: 6px !important;
|
||||
padding-right: 6px !important;
|
||||
text-wrap: unset !important;
|
||||
word-break: break-all;
|
||||
font-size: 12px;
|
||||
padding-left: 6px !important;
|
||||
padding-right: 6px !important;
|
||||
}
|
||||
|
||||
.scrollTable .el-table__cell {
|
||||
padding: 3px 0 !important;
|
||||
padding: 3px 0 !important;
|
||||
}
|
||||
|
||||
.scrollTable tr.el-table__row--striped {
|
||||
--odd-bg: #09265B;
|
||||
background-color: #081F48;
|
||||
background-image: linear-gradient(
|
||||
-45deg, var(--odd-bg) 0, var(--odd-bg) 10%, transparent 10%, transparent 50%,
|
||||
var(--odd-bg) 50%, var(--odd-bg) 60%, transparent 60%, transparent);
|
||||
background-size: 10px 10px;
|
||||
--odd-bg: #09265B;
|
||||
background-color: #081F48;
|
||||
background-image: linear-gradient(
|
||||
-45deg, var(--odd-bg) 0, var(--odd-bg) 10%, transparent 10%, transparent 50%,
|
||||
var(--odd-bg) 50%, var(--odd-bg) 60%, transparent 60%, transparent);
|
||||
background-size: 10px 10px;
|
||||
}
|
||||
|
||||
.scrollTable tr.el-table__row--striped .tableCell {
|
||||
background-color: transparent !important;
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
.scrollTable tr:hover > .tableCell {
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
background-color: rgba(255, 255, 255, .1) !important;
|
||||
}
|
||||
|
||||
.AppSubTitle {
|
||||
height: 48px;
|
||||
padding: 8px 0 8px 38px;
|
||||
margin-bottom: 24px;
|
||||
box-sizing: border-box;
|
||||
line-height: 32px;
|
||||
background-image: url("http://10.0.97.209/img/kengee/kengee4.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
color: #fff;
|
||||
max-width: 400px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
position: relative;
|
||||
height: 48px;
|
||||
padding: 8px 0 8px 38px;
|
||||
margin-bottom: 12px;
|
||||
box-sizing: border-box;
|
||||
line-height: 32px;
|
||||
background-image: url("http://10.0.97.209/img/kengee/kengee4.png");
|
||||
background-repeat: no-repeat;
|
||||
background-size: 400px 100%;
|
||||
color: #fff;
|
||||
max-width: 100%;
|
||||
min-width: 400px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.AppSubTitle span {
|
||||
font-size: 12px;
|
||||
color: #215A8E;
|
||||
font-size: 12px;
|
||||
color: #215A8E;
|
||||
}
|
||||
|
||||
.AppSubTitle > .right {
|
||||
position: absolute;
|
||||
right: -30px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
|
||||
.AppSubTitle .el-select {
|
||||
width: 120px;
|
||||
width: 120px;
|
||||
}
|
||||
|
||||
@keyframes flashOpacity {
|
||||
0%, 100% {
|
||||
opacity: 1; /* 完全不透明 */
|
||||
}
|
||||
50% {
|
||||
opacity: 0; /* 完全透明 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 应用动画到元素 */
|
||||
.flash-opacity {
|
||||
.cell > span {
|
||||
animation: flashOpacity 1s infinite; /* 动画名称、持续时间、重复次数 */
|
||||
color: red
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
|
||||
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'}]
|
||||
Object.values(ctx).map(file => {
|
||||
if (file.default) {
|
||||
|
||||
@@ -65,18 +65,20 @@ window.evenRowBGC = (color = "#09265B") => `transparent;background-image: linear
|
||||
|
||||
Vue.prototype.$marketBoard = Vue.observable({
|
||||
screenId: '5b1849ac-4fc3-451a-844c-3362b47341ef',
|
||||
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"}
|
||||
thirdGoods: {},
|
||||
saleHour: undefined,
|
||||
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18", t: null}
|
||||
})
|
||||
Vue.prototype.$multipleStoreBoard = Vue.observable({
|
||||
carouselIndex: 0,
|
||||
search: {"groupCodeList": [], "hourNum": "", type: "1"}
|
||||
search: {"groupCodeList": [], "hourNum": "", type: "1", t: null}
|
||||
})
|
||||
Vue.prototype.$storeBoard = Vue.observable({
|
||||
currentDate: "20240705",
|
||||
dialog: false,
|
||||
aroundStock: [],
|
||||
query: {},
|
||||
search: {}
|
||||
search: {t: null}
|
||||
})
|
||||
Vue.component("HlsPlayer", {
|
||||
render: (h) => h('div', {style: {width: '100%', height: '100%'}}),
|
||||
@@ -133,6 +135,10 @@ Vue.component("scrollTable", {
|
||||
return h('el-table', {
|
||||
props: {
|
||||
headerCellClassName: 'tableHeader', cellClassName: 'tableCell', stripe: !0, height: '100%',
|
||||
rowClassName({row}) {
|
||||
const item = columns.find(e => e.flash == 1)
|
||||
return item?.prop && row[item.prop] <= 0 ? 'flash-opacity' : ''
|
||||
},
|
||||
...config, data: tableData,
|
||||
}, class: 'scrollTable',
|
||||
on: {
|
||||
@@ -146,12 +152,13 @@ Vue.component("scrollTable", {
|
||||
},
|
||||
methods: {
|
||||
initScroll() {
|
||||
const {SimpleBar} = window
|
||||
const dom = this.$el.querySelector('.el-table__body-wrapper')
|
||||
this.scroll = new SimpleBar(dom)
|
||||
dom.addEventListener('mouseover', this.stopAutoScroll)
|
||||
// dom.addEventListener('mouseout', this.autoScroll)
|
||||
// this.scroll.refresh();
|
||||
const {SimpleBar, $waitFor} = window
|
||||
$waitFor(this.$el.querySelector('.el-table__body-wrapper')).then(dom => {
|
||||
this.scroll = new SimpleBar(dom)
|
||||
dom.addEventListener('mouseover', this.stopAutoScroll)
|
||||
// dom.addEventListener('mouseout', this.autoScroll)
|
||||
// this.scroll.refresh();
|
||||
})
|
||||
},
|
||||
autoScroll() {
|
||||
if (this.timer) clearInterval(this.timer)
|
||||
@@ -165,7 +172,8 @@ Vue.component("scrollTable", {
|
||||
}, 60)
|
||||
},
|
||||
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)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -20,11 +20,12 @@ export default {
|
||||
],
|
||||
重点单品情况: [
|
||||
{label: "重点单品", prop: "goodsName"},
|
||||
{label: "当日目标", prop: "targetNum", width: 70},
|
||||
{label: "销售数量", prop: "saleNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70},
|
||||
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
||||
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
||||
{label: "今日销售数量", prop: "saleNum", width: 70},
|
||||
{label: "现在库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
||||
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||
],
|
||||
周边库存情况: [
|
||||
{label: "门店名称", prop: "storeName"},
|
||||
@@ -43,8 +44,9 @@ export default {
|
||||
methods: {
|
||||
getData() {
|
||||
const {$waitFor, $http} = window
|
||||
const {type, compareDate} = 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(() => {
|
||||
this.list = [
|
||||
{label: "西点柜", value: "104"},
|
||||
|
||||
@@ -16,13 +16,16 @@ export default {
|
||||
{label: "西点销售额", prop: "westSaleAmt", 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: "targetRate", align: 'right', headerAlign: 'left'},
|
||||
{label: "环比(目标完成比)", prop: "targetRate", align: 'center', headerAlign: 'left'},
|
||||
],
|
||||
summary: {}
|
||||
summary: {},
|
||||
filter: "",
|
||||
options: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
search: v => v.$marketBoard.search,
|
||||
dicts: v => window.$dicts || {},
|
||||
tableConfig: v => {
|
||||
return {
|
||||
headerBGC: 'rgba(13, 48, 99, 0.6)',
|
||||
@@ -52,20 +55,29 @@ export default {
|
||||
methods: {
|
||||
getTableData() {
|
||||
const {$http, $waitFor} = window
|
||||
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/groupMonitor", {
|
||||
...this.search, limit: 999
|
||||
return $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/groupMonitor", {
|
||||
...this.search, limit: 999, groupCodeList: [this.filter].filter(Boolean)
|
||||
})).then(res => {
|
||||
if (res?.data) {
|
||||
this.summary = res.data.total
|
||||
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: {
|
||||
search: {
|
||||
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>
|
||||
<section class="AppGroupMonitorTable">
|
||||
<!--<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"/>
|
||||
<div class="summary flex">
|
||||
<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 {
|
||||
height: calc(100% - 30px) !important;
|
||||
height: calc(100% - 80px) !important;
|
||||
}
|
||||
|
||||
.AppGroupMonitorTable .el-select {
|
||||
width: 140px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
const sort = [108, 109, 104, 101, 102, 103, 106, 107, 105].map(e => `${e}`)
|
||||
export default {
|
||||
name: "AppHourCount",
|
||||
label: "市场看板-全门店时段合计",
|
||||
@@ -10,6 +11,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
search: v => v.$marketBoard.search,
|
||||
saleHour: v => v.$marketBoard.saleHour,
|
||||
columns: v => {
|
||||
return [
|
||||
{label: '品类', prop: "categoryName", width: 100},
|
||||
@@ -69,11 +71,12 @@ export default {
|
||||
methods: {
|
||||
getTableData() {
|
||||
const {$http, $waitFor} = window
|
||||
const {saleHour: hourNum} = this
|
||||
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourCount", {
|
||||
...this.search, limit: 999
|
||||
...this.search, limit: 999, hourNum
|
||||
})).then(res => {
|
||||
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
|
||||
}
|
||||
})
|
||||
@@ -84,6 +87,9 @@ export default {
|
||||
immediate: true, deep: true, handler() {
|
||||
this.getTableData()
|
||||
}
|
||||
},
|
||||
saleHour() {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,7 +115,7 @@ export default {
|
||||
min-width: 480px;
|
||||
}
|
||||
|
||||
.AppHourCount .dv-scroll-board,.AppHourCount .scrollTable{
|
||||
height: calc(100% - 60px);
|
||||
.AppHourCount .dv-scroll-board, .AppHourCount .scrollTable {
|
||||
height: calc(100% - 50px) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script>
|
||||
const getHourRange = hour => `${hour.padStart(2, '0')}:00-${`${Number(hour) + 1}`.padStart(2, '0')}:00`
|
||||
export default {
|
||||
name: "AppHourSale",
|
||||
label: "市场看板-全门店时段销售",
|
||||
@@ -85,29 +86,32 @@ export default {
|
||||
methods: {
|
||||
getTableData() {
|
||||
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
|
||||
})).then(res => {
|
||||
if (res?.data) {
|
||||
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}) {
|
||||
this.handleMouseout()
|
||||
const hourNum = Number(hour?.substring(0, 2) || -2) + 1
|
||||
this.$set(this.$marketBoard, 'saleHour', hourNum < this.search.hourNum ? hourNum : undefined)
|
||||
const rowIndex = this.tableData.findIndex(e => e.hour == hour)
|
||||
const v = this
|
||||
const summary = {
|
||||
compareSaleAmt: 0, compareValidOrderNum: 0, currentSaleAmt: 0, currentValidOrderNum: 0, saleGrowthRate: 0
|
||||
}
|
||||
console.log(rowIndex)
|
||||
v.tableData.forEach((e, i) => {
|
||||
if (i <= rowIndex) {
|
||||
summary.compareSaleAmt += Number(e.compareSaleAmt || 0)
|
||||
summary.compareValidOrderNum += Number(e.compareValidOrderNum || 0)
|
||||
summary.currentSaleAmt += Number(e.currentSaleAmt || 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) {
|
||||
summary.compareSaleAmt = summary.compareSaleAmt.toFixed(2)
|
||||
@@ -117,46 +121,68 @@ export default {
|
||||
summary.saleGrowthRate = summary.saleGrowthRate.toFixed(2) + "%"
|
||||
}
|
||||
})
|
||||
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 ? "时段合计" : ""
|
||||
}
|
||||
const summaryRow = {}
|
||||
v.tableColumns.forEach(({prop}, i) => {
|
||||
summaryRow[prop] = i == 0 ? "时段合计" : (summary[prop] || '')
|
||||
})
|
||||
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) {
|
||||
const getTop = e => e.offsetParent ? getTop(e.offsetParent) + e.offsetTop : e.offsetTop
|
||||
const top = getTop(this.$el)
|
||||
// this.$set(this.hourSummaryStyle, "top", (evt.clientY - top + 10) + "px")
|
||||
handleRowStyle({row}) {
|
||||
if (row.hour == '时段合计') return 'summary'
|
||||
return ''
|
||||
},
|
||||
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: {
|
||||
search: {
|
||||
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>
|
||||
|
||||
<template>
|
||||
<section class="AppHourSale" @mousemove="handleMouseOver">
|
||||
<scroll-table :table-data="tableData" :columns="columns" @click="handleSta" @mouseout.native="hourSummaryStyle={display:'none'}"/>
|
||||
<section class="AppHourSale">
|
||||
<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'}"/>-->
|
||||
<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>
|
||||
<!-- <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>-->
|
||||
<div class="summary flex">
|
||||
<div class="item" v-for="(col,i) in summaryRow" :key="i" v-text="col.value" :style="col.style"/>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<script>
|
||||
import AppSubTitle from "@/views/AppSubTitle.vue";
|
||||
|
||||
export default {
|
||||
name: "AppKeyGoods",
|
||||
components: {AppSubTitle},
|
||||
label: "市场看板-重点单品",
|
||||
data() {
|
||||
return {
|
||||
@@ -11,7 +8,7 @@ export default {
|
||||
columns: [
|
||||
{label: "重点单品", prop: "goodsName"},
|
||||
{label: "销售数量", prop: "saleNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||
{label: "销售目标", prop: "targetSaleNum", width: 70},
|
||||
{label: "销售达成", prop: "saleAchieveRate"},
|
||||
],
|
||||
@@ -37,13 +34,16 @@ export default {
|
||||
getTableData() {
|
||||
const {$http, $waitFor} = window
|
||||
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
|
||||
})).then(res => {
|
||||
if (res?.data) {
|
||||
this.tableData = res.data?.records || []
|
||||
}
|
||||
})
|
||||
},
|
||||
relevanceMapData(selectGoods) {
|
||||
this.$set(this.$marketBoard, 'thirdGoods', selectGoods)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -52,6 +52,17 @@ export default {
|
||||
this.getTableData()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('click', evt => {
|
||||
const mapElement = document.querySelector('.AppMap')
|
||||
if (!this.$el.contains(evt.target) && !mapElement.contains(evt.target)) {
|
||||
this.relevanceMapData()
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
document.removeEventListener('click', this.relevanceMapData)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -65,7 +76,7 @@ export default {
|
||||
</el-select>
|
||||
</template>
|
||||
</app-sub-title>
|
||||
<scroll-table :table-data="tableData" :columns="columns"/>
|
||||
<scroll-table :table-data="tableData" :columns="columns" @click="relevanceMapData" @click.native.stop/>
|
||||
<!--<dv-scroll-board :config="tableConfig"/>-->
|
||||
</section>
|
||||
</template>
|
||||
@@ -75,4 +86,8 @@ export default {
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.AppKeyGoods .dv-scroll-board, .AppKeyGoods .scrollTable {
|
||||
height: calc(100% - 60px) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,32 +6,45 @@ export default {
|
||||
return {
|
||||
map: null,
|
||||
layers: [],
|
||||
geoJson: null
|
||||
geoJson: null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
search: v => v.$marketBoard.search
|
||||
search: v => v.$marketBoard.search,
|
||||
thirdGoods: v => v.$marketBoard.thirdGoods || {}
|
||||
},
|
||||
watch: {
|
||||
search: {
|
||||
deep: true, handler() {
|
||||
this.getData().then(() => this.refreshData())
|
||||
this.getData().then(() => this.refreshData("watch search"))
|
||||
}
|
||||
}
|
||||
},
|
||||
thirdGoods: {
|
||||
deep: true, handler() {
|
||||
this.getData().then(() => this.refreshData("watch thirdGoods"))
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
loadLib() {
|
||||
const {$loadScript} = window
|
||||
return Promise.all([
|
||||
'/presource/datascreen/js/turf.min.js',
|
||||
].map(e => $loadScript('js', e)))
|
||||
},
|
||||
getContent([x, y, bakeStockAmt = 0, preSaleNum = 0, stockNum = 0] = []) {
|
||||
if (this.thirdGoods.thirdGoodsCode) {
|
||||
return [`库存数量:${stockNum}`]
|
||||
}
|
||||
return [`现烤库存金额:${bakeStockAmt}`, `现烤销售机会:${preSaleNum}`]
|
||||
},
|
||||
getData() {
|
||||
const {$http, $waitFor} = window
|
||||
const {groupCodeList, currentDate, hourNum} = this.search
|
||||
const {search: {groupCodeList, currentDate, hourNum}, thirdGoods: {thirdGoodsCode}} = this
|
||||
const maps = []
|
||||
return $waitFor($http).then(() => Promise.all([
|
||||
$http.post("/data-boot/la/screen/marketBoard/storeReport", {
|
||||
groupCodeList, currentDate, hourNum
|
||||
groupCodeList, currentDate, hourNum, thirdGoodsCode
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
return this.layers = res.data || []
|
||||
@@ -52,67 +65,71 @@ export default {
|
||||
})
|
||||
},
|
||||
initMap() {
|
||||
const {echarts, turf} = window
|
||||
const {echarts, turf, $waitFor} = window
|
||||
const boundary = turf.union(this.geoJson)
|
||||
boundary.properties.name = "boundary"
|
||||
this.geoJson.features.unshift(boundary)
|
||||
echarts.registerMap('zhengzhou', this.geoJson)
|
||||
this.map = echarts.init(this.$el)
|
||||
const areaColor = {
|
||||
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
|
||||
{offset: 0, color: 'rgba(61,127,255,0.35)'},
|
||||
{offset: 1, color: '#09E2F8'},
|
||||
]
|
||||
}
|
||||
const label = {
|
||||
show: true,
|
||||
backgroundColor: {type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{offset: 0, color: 'rgba(9,63,107,0.79)'}, {offset: 1, color: 'rgba(13,58,99,0.03)'}]},
|
||||
borderRadius: 2,
|
||||
padding: 8,
|
||||
position: 'right',
|
||||
formatter: params => {
|
||||
const {name, value: [x, y, bakeStockAmt = 0, preSaleNum = 0]} = params
|
||||
return `{a|${name}\n现烤库存金额:${bakeStockAmt}\n现烤销售机会:${preSaleNum}}`
|
||||
},
|
||||
rich: {
|
||||
a: {color: '#fff', fontSize: 12, lineHeight: 14}
|
||||
$waitFor(this.$el).then(() => {
|
||||
this.map = echarts.init(this.$el)
|
||||
if (!this.map) return setTimeout(() => this.initMap(), 500)
|
||||
const areaColor = {
|
||||
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
|
||||
{offset: 0, color: 'rgba(61,127,255,0.35)'},
|
||||
{offset: 1, color: '#09E2F8'},
|
||||
]
|
||||
}
|
||||
}
|
||||
this.map.setOption({
|
||||
geo: {
|
||||
map: 'zhengzhou', roam: true, emphasis: {disabled: true},
|
||||
itemStyle: {areaColor: "transparent", borderColor: '#97CAE6'},
|
||||
silent: true,
|
||||
label: {show: true, color: '#fff'},
|
||||
regions: [
|
||||
{name: "boundary", itemStyle: {areaColor, shadowColor: "#1A80BF", shadowOffsetY: 2}, label: {show: false}}
|
||||
],
|
||||
},
|
||||
series: [
|
||||
{type: 'scatter', coordinateSystem: 'geo', itemStyle: {color: '#66FFFF'}, label},
|
||||
{type: 'effectScatter', coordinateSystem: 'geo', itemStyle: {color: '#FFD15C'}, label}
|
||||
],
|
||||
tooltip: {
|
||||
trigger: 'item', formatter: params => {
|
||||
const {name, marker, value: [x, y, bakeStockAmt = 0, preSaleNum = 0]} = params
|
||||
return `${marker} ${name}<br/>现烤库存金额:${bakeStockAmt}<br/>现烤销售机会:${preSaleNum}`
|
||||
const label = {
|
||||
show: true,
|
||||
backgroundColor: {type: 'linear', x: 0, y: 0, x2: 1, y2: 0, colorStops: [{offset: 0, color: 'rgba(9,63,107,0.79)'}, {offset: 1, color: 'rgba(13,58,99,0.03)'}]},
|
||||
borderRadius: 2,
|
||||
padding: 8,
|
||||
position: 'right',
|
||||
formatter: (params) => {
|
||||
const {name, value} = params
|
||||
return `{a|${name}\n${this.getContent(value).join("\n")}}`
|
||||
},
|
||||
},
|
||||
})
|
||||
this.map.on('click', evt => {
|
||||
const storeCode = evt.data.storeCode
|
||||
if (storeCode) {
|
||||
this.$storeBoard.search.storeCode = storeCode
|
||||
this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8'
|
||||
rich: {
|
||||
a: {color: '#fff', fontSize: 12, lineHeight: 14}
|
||||
}
|
||||
}
|
||||
this.map.setOption({
|
||||
geo: {
|
||||
map: 'zhengzhou', roam: true, emphasis: {disabled: true},
|
||||
itemStyle: {areaColor: "transparent", borderColor: '#97CAE6'},
|
||||
silent: true,
|
||||
label: {show: true, color: '#fff'},
|
||||
regions: [
|
||||
{name: "boundary", itemStyle: {areaColor, shadowColor: "#1A80BF", shadowOffsetY: 2}, label: {show: false}}
|
||||
],
|
||||
},
|
||||
series: [
|
||||
{type: 'scatter', coordinateSystem: 'geo', itemStyle: {color: '#66FFFF'}, label},
|
||||
{type: 'effectScatter', coordinateSystem: 'geo', itemStyle: {color: '#FFD15C'}, label}
|
||||
],
|
||||
tooltip: {
|
||||
trigger: 'item', formatter: params => {
|
||||
const {name, marker, value} = params
|
||||
return `${marker} ${name}<br/>${this.getContent(value).join("<br/>")}`
|
||||
},
|
||||
},
|
||||
})
|
||||
this.map.on('click', evt => {
|
||||
const storeCode = evt.data.storeCode
|
||||
if (storeCode) {
|
||||
this.$storeBoard.search.storeCode = storeCode
|
||||
this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8'
|
||||
}
|
||||
})
|
||||
this.refreshData("initMap")
|
||||
})
|
||||
this.refreshData()
|
||||
},
|
||||
convertData(layers) {
|
||||
const result = {normal: [], abnormal: []}
|
||||
layers.forEach(e => {
|
||||
const item = {name: e.storeName, storeCode: e.storeCode, value: [e.longitude, e.latitude, e.bakeStockAmt, e.preSaleNum]}
|
||||
if (e.bakeStockAmt > 0) {
|
||||
const item = {name: e.storeName, storeCode: e.storeCode, value: [e.longitude, e.latitude, e.bakeStockAmt, e.preSaleNum, e.stockNum]}
|
||||
// 有库存或者有现烤库存金额 就算正常
|
||||
if (e.bakeStockAmt > 0 || e.stockNum > 0) {
|
||||
result.normal.push(item)
|
||||
} else {
|
||||
result.abnormal.push(item)
|
||||
@@ -120,14 +137,16 @@ export default {
|
||||
})
|
||||
return Object.values(result).map(data => ({data}))
|
||||
},
|
||||
refreshData() {
|
||||
this.map.setOption({series: this.convertData(this.layers)})
|
||||
}
|
||||
refreshData(from) {
|
||||
console.log("refreshData调用位置:", from)
|
||||
const {thirdGoods: {goodsName}} = this
|
||||
const title = {left: 20, top: 20, text: goodsName ? `{sub|选择产品:}${goodsName}` : '', textStyle: {color: "#fff", rich: {sub: {color: "#fff", fontSize: 16}}}}
|
||||
if (!this.map) return this.initMap()
|
||||
this.map?.setOption({title, series: this.convertData(this.layers)})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.loadLib().then(() => Promise.all([
|
||||
this.getData(),
|
||||
])).then(() => this.initMap())
|
||||
this.loadLib().then(() => this.getData()).then(() => this.initMap())
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -24,7 +24,7 @@ export default {
|
||||
setTimeout(() => {
|
||||
const compareDate = dayjs().subtract(7, "day").format("YYYYMMDD"),
|
||||
currentDate = dayjs().format("YYYYMMDD"),
|
||||
hourNum = new Date().getHours(),
|
||||
hourNum = new Date().getHours()+1,
|
||||
groupCodeList = ""
|
||||
this.form = {compareDate, currentDate, hourNum, groupCodeList}
|
||||
this.$set(this.$marketBoard, 'search', {compareDate, currentDate, hourNum, groupCodeList: []})
|
||||
|
||||
@@ -24,6 +24,13 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
reset() {
|
||||
$http.post("/data-boot/la/screen/multipleStoreBoard/move").then(res => {
|
||||
if (res?.data) {
|
||||
this.$message.success("已重置")
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'form.interval'(v) {
|
||||
@@ -40,7 +47,8 @@ export default {
|
||||
this.getOptions().then(() => {
|
||||
setTimeout(() => {
|
||||
const {dayjs} = window
|
||||
const hourNum = new Date().getHours(), groupCodeList = "", interval = 60000
|
||||
const hourNum = new Date().getHours()+1, groupCodeList = "", interval = 60000
|
||||
// const currentDate = dayjs().subtract(7, 'day').format("YYYYMMDD")
|
||||
const currentDate = dayjs().format("YYYYMMDD")
|
||||
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval}
|
||||
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval})
|
||||
@@ -52,6 +60,9 @@ export default {
|
||||
|
||||
<template>
|
||||
<el-form class="AppMultipleStoreBoardFilter flex" size="small" label-width="70px">
|
||||
<el-form-item label-width="0">
|
||||
<el-button @click="reset">一键归位</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="品类">
|
||||
<el-select v-model="form.categoryId" @change="v=>$multipleStoreBoard.search.categoryId=v" clearable placeholder="全部">
|
||||
<el-option v-for="item in dicts.品类" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<script>
|
||||
const screens = [
|
||||
{id: '5b1849ac-4fc3-451a-844c-3362b47341ef', label: '市场看板', bg: 'http://10.0.97.209/img/kengee/kengee16.png'},
|
||||
{id: '7d26854c-769d-418b-9bae-5c1105e716a9', label: '多店监控', bg: 'http://10.0.97.209/img/kengee/kengee17.png'},
|
||||
{id: 'a90522ef-869b-40ea-8542-d1fc9674a1e8', label: '单店监控', bg: 'http://10.0.97.209/img/kengee/kengee18.png'},
|
||||
{id: '5b1849ac-4fc3-451a-844c-3362b47341ef', label: '市场看板', bg: 'http://10.0.97.209/img/kengee/kengee16.png', ob: '$marketBoard'},
|
||||
{id: '7d26854c-769d-418b-9bae-5c1105e716a9', label: '多店监控', bg: 'http://10.0.97.209/img/kengee/kengee17.png', ob: '$multipleStoreBoard'},
|
||||
{id: 'a90522ef-869b-40ea-8542-d1fc9674a1e8', label: '单店监控', bg: 'http://10.0.97.209/img/kengee/kengee18.png', ob: '$storeBoard'},
|
||||
]
|
||||
export default {
|
||||
name: "AppNavbar",
|
||||
label: "标题栏",
|
||||
data() {
|
||||
return {screens}
|
||||
return {screens, timer: null}
|
||||
},
|
||||
computed: {
|
||||
groupId: v => v.$marketBoard.screenId,
|
||||
@@ -26,6 +26,16 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.timer = setInterval(() => {
|
||||
const screen = this.screens.find(e => e.id === this.groupId)
|
||||
this.$set(this[screen.ob].search, 't', Date.now())
|
||||
console.log(screen.ob, this[screen.ob].search.t)
|
||||
}, 5000)
|
||||
},
|
||||
destroyed() {
|
||||
this.timer && clearInterval(this.timer)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -31,7 +31,8 @@ export default {
|
||||
methods: {
|
||||
getData() {
|
||||
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) {
|
||||
this.info = res.data
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
this.getOptions().then(() => {
|
||||
setTimeout(() => {
|
||||
const {dayjs} = window
|
||||
const hourNum = new Date().getHours(),
|
||||
const hourNum = new Date().getHours()+1,
|
||||
storeCode = this.$storeBoard.search.storeCode || this.options?.[0].storeCode
|
||||
const currentDate = dayjs().format("YYYYMMDD")
|
||||
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-select>
|
||||
</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"/>
|
||||
<el-form-item label="门店">
|
||||
<el-select v-model="form.storeCode" @change="v=>$storeBoard.search.storeCode=v" clearable placeholder="全部" class="storeSelect" filterable>
|
||||
|
||||
@@ -9,7 +9,7 @@ export default {
|
||||
{label: "重点单品", prop: "goodsName"},
|
||||
{label: "当日目标", prop: "targetNum", width: 70},
|
||||
{label: "销售数量", prop: "saleNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||
{label: "预计销售数量", prop: "preSaleNum", width: 70},
|
||||
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||
]
|
||||
|
||||
@@ -8,21 +8,20 @@ export default {
|
||||
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"},
|
||||
{label: "门店", prop: "storeName", width: 100},
|
||||
{label: "昨日门店净收货额", prop: "yesterdayNetAmt"},
|
||||
{label: "昨日现烤销售", prop: "yesterdayBakeSaleAmt"},
|
||||
{label: "昨日现烤报损", prop: "yesterdayBakeBsAmt"},
|
||||
{label: "门店现在现烤库存金额", prop: "bakeStockAmt"},
|
||||
{label: "现在现烤销售额", prop: "bakeSaleAmt"},
|
||||
],
|
||||
filter: "",
|
||||
options: [],
|
||||
summary: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
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 => {
|
||||
return {
|
||||
headerBGC: 'rgba(13, 48, 99, 0.6)',
|
||||
@@ -53,20 +52,29 @@ export default {
|
||||
methods: {
|
||||
getTableData() {
|
||||
const {$http, $waitFor} = window
|
||||
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/storeMonitor", {
|
||||
...this.search, limit: 999
|
||||
return $waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/storeMonitor", {
|
||||
...this.search, limit: 999, groupCodeList: [this.filter].filter(Boolean)
|
||||
})).then(res => {
|
||||
if (res?.data) {
|
||||
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: {
|
||||
search: {
|
||||
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>
|
||||
<section class="AppStoreMonitor">
|
||||
<div class="flex" style="margin-bottom: 22px">
|
||||
<div class="fill"/>
|
||||
<el-select placeholder="全部" v-model="filter" size="small" clearable class="AppSelect">
|
||||
<el-option v-for="(name,i) in options" :key="i" :label="name" :value="name"/>
|
||||
</el-select>
|
||||
</div>
|
||||
<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"/>
|
||||
<!--<dv-scroll-board :config="tableConfig"/>-->
|
||||
<div class="summary flex">
|
||||
@@ -97,8 +106,8 @@ export default {
|
||||
width: 660px;
|
||||
}
|
||||
|
||||
.AppStoreMonitor .dv-scroll-board,.AppStoreMonitor .scrollTable{
|
||||
height: calc(100% - 30px - 55px) !important;
|
||||
.AppStoreMonitor .dv-scroll-board, .AppStoreMonitor .scrollTable {
|
||||
height: calc(100% - 80px) !important;
|
||||
}
|
||||
|
||||
.AppStoreMonitor .el-select {
|
||||
|
||||
@@ -1,4 +1,14 @@
|
||||
<script>
|
||||
function throttle(func, limit = 500) {
|
||||
let timer;
|
||||
return function () {
|
||||
if (timer) {
|
||||
clearTimeout(timer)
|
||||
}
|
||||
timer = setTimeout(func, limit);
|
||||
}
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "AppStoresTable",
|
||||
label: "多店监控",
|
||||
@@ -14,19 +24,21 @@ export default {
|
||||
columns: {
|
||||
品类销售情况: [
|
||||
{label: "品类", prop: "secondCategoryName"},
|
||||
{label: "销售额", prop: "currentSaleAmt", width: 70},
|
||||
{label: "库存金额", prop: "currentStockAmt", width: 80},
|
||||
{label: "同/环比销售额", prop: "compareSaleAmt", width: 70},
|
||||
{label: "同/环比库存金额", prop: "compareStockAmt", width: 70},
|
||||
{label: "前四周日均销售额", prop: "avg4WeekSaleAmt", width: 70},
|
||||
{label: "销售额", prop: "currentSaleAmt"},
|
||||
{label: "库存金额", prop: "currentStockAmt"},
|
||||
// {label: "同/环比销售额", prop: "compareSaleAmt", width: 70},
|
||||
// {label: "同/环比库存金额", prop: "compareStockAmt", width: 70},
|
||||
// {label: "前四周日均销售额", prop: "avg4WeekSaleAmt", width: 70},
|
||||
],
|
||||
重点单品情况: [
|
||||
{label: "重点单品", prop: "name"},
|
||||
{label: "当日目标", prop: "targetNum", width: 70},
|
||||
{label: "销售数量", prop: "saleNum", width: 70},
|
||||
{label: "库存数量", prop: "stockNum", width: 70},
|
||||
// {label: "当日目标", prop: "targetNum", width: 70},
|
||||
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
||||
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
||||
{label: "今日销售数量", prop: "saleNum", width: 70},
|
||||
{label: "现在库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
||||
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||
],
|
||||
周边库存情况: [
|
||||
{label: "门店名称", prop: "storeName"},
|
||||
@@ -42,7 +54,12 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
search: v => v.$multipleStoreBoard.search,
|
||||
search: v => {
|
||||
const search = JSON.parse(JSON.stringify(v.$multipleStoreBoard.search))
|
||||
delete search.t
|
||||
return search
|
||||
},
|
||||
refreshTimer: v => v.search.t,
|
||||
storeList: v => {
|
||||
const list = []
|
||||
let group = []
|
||||
@@ -70,12 +87,21 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
refreshTimer() {
|
||||
console.log("刷新")
|
||||
this.refreshData().then(() => {
|
||||
const v = this.search
|
||||
if (v.interval > 0 && v.changeWay == '1') {
|
||||
this.$refs.carousel?.$forceUpdate()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
const {$http, $waitFor} = window
|
||||
const {groupCodeList, type, compareDate} = this.search
|
||||
const {type, compareDate} = this.search
|
||||
console.log("筛选条件:", this.search)
|
||||
return $waitFor($http && (type != 3 || compareDate)).then(() => this.getStores())
|
||||
.then(codes => Promise.all([this.getCameras(), this.getStoreKeyGoods(), this.getCategorySales()]).then(() => codes))
|
||||
@@ -106,21 +132,27 @@ export default {
|
||||
})
|
||||
},
|
||||
getStoreKeyGoods() {
|
||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
|
||||
type: "1", ...this.search,
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.storeKeyGoods = res.data
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
throttle(() => $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
|
||||
type: "1", ...this.search,
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.storeKeyGoods = res.data
|
||||
resolve()
|
||||
}
|
||||
}))()
|
||||
})
|
||||
},
|
||||
getCategorySales() {
|
||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
|
||||
type: "1", ...this.search,
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.categorySales = res.data
|
||||
}
|
||||
return new Promise(resolve => {
|
||||
throttle(() => $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
|
||||
type: "1", ...this.search,
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.categorySales = res.data
|
||||
resolve()
|
||||
}
|
||||
}))()
|
||||
})
|
||||
},
|
||||
gotoDetail(store, i) {
|
||||
@@ -162,6 +194,14 @@ export default {
|
||||
} else if (e.code == "ArrowRight") {
|
||||
this.$refs.carousel.next()
|
||||
}
|
||||
},
|
||||
async refreshData() {
|
||||
return Promise.all([this.getStoreKeyGoods(), this.getCategorySales()]).then(() => {
|
||||
this.stores.map(store => {
|
||||
store.keyGoods = this.storeKeyGoods.filter(e => e.storeCode == store.storeCode) || []
|
||||
store.categorySale = this.categorySales.filter(e => e.storeCode == store.storeCode) || []
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -12,32 +12,35 @@ import AppHourCount from "@/views/AppHourCount.vue";
|
||||
export default {
|
||||
name: "AppMarketBoard",
|
||||
label: "市场看板",
|
||||
components: { AppHourCount, AppHourSale, AppStoreMonitor, AppGroupMonitorTable, AppKeyGoods, AppSalesPerformance, AppMap, AppNavbar, AppMarketBoardFilter}
|
||||
components: {AppHourCount, AppHourSale, AppStoreMonitor, AppGroupMonitorTable, AppKeyGoods, AppSalesPerformance, AppMap, AppNavbar, AppMarketBoardFilter}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<section class="AppMarketBoard">
|
||||
<app-navbar class="mb-10"/>
|
||||
<app-market-board-filter/>
|
||||
<div class="flex" style="gap:20px">
|
||||
<div class="fill">
|
||||
<div class="flex gap">
|
||||
<div style="width: 430px;">
|
||||
<app-sub-title/>
|
||||
<app-sales-performance style="margin-bottom: 20px"/>
|
||||
<app-key-goods/>
|
||||
<app-sales-performance style="margin-bottom: 10px"/>
|
||||
<app-key-goods style="height: 208px"/>
|
||||
</div>
|
||||
<div class="fill">
|
||||
<app-market-board-filter/>
|
||||
<app-map style="height: calc(100% - 50px)"/>
|
||||
</div>
|
||||
<app-map class="fill"/>
|
||||
</div>
|
||||
<div class="flex gap">
|
||||
<div class="flex gap" style="height: 394px">
|
||||
<app-group-monitor-table class="fill"/>
|
||||
<app-store-monitor class="fill"/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 480px;">
|
||||
<app-hour-sale/>
|
||||
<app-hour-count/>
|
||||
<app-sub-title text="全门店时段销售"/>
|
||||
<app-hour-sale style="height: 600px"/>
|
||||
<app-hour-count style="height: 260px"/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -48,7 +51,8 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.gap{
|
||||
|
||||
.gap {
|
||||
gap: 20px;
|
||||
}
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<section class="AppMultipleStoreBoard">
|
||||
<app-navbar/>
|
||||
<app-navbar class="mb-10"/>
|
||||
<app-multiple-store-board-filter/>
|
||||
<app-stores-table class="fill"/>
|
||||
</section>
|
||||
Reference in New Issue
Block a user