Compare commits
13 Commits
1b28903621
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ee1bb3b9a | |||
| 2663ca9e73 | |||
|
|
c2743d926e | ||
|
|
4403ec5322 | ||
|
|
9c6248e5df | ||
|
|
1845f6cc9a | ||
|
|
a127b3ea47 | ||
|
|
f638418345 | ||
|
|
42c72225df | ||
|
|
e11d319ec3 | ||
| c2e4c39b56 | |||
| 0b1945c8f4 | |||
| f1620c710f |
@@ -249,3 +249,20 @@ a, .green {
|
|||||||
.AppSubTitle .el-select {
|
.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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -65,19 +65,20 @@ 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: "",
|
thirdGoods: {},
|
||||||
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18"}
|
saleHour: undefined,
|
||||||
|
search: {"groupCodeList": [], "currentDate": "20240701", "compareDate": "20240630", "hourNum": "18", t: null}
|
||||||
})
|
})
|
||||||
Vue.prototype.$multipleStoreBoard = Vue.observable({
|
Vue.prototype.$multipleStoreBoard = Vue.observable({
|
||||||
carouselIndex: 0,
|
carouselIndex: 0,
|
||||||
search: {"groupCodeList": [], "hourNum": "", type: "1"}
|
search: {"groupCodeList": [], "hourNum": "", type: "1", t: null}
|
||||||
})
|
})
|
||||||
Vue.prototype.$storeBoard = Vue.observable({
|
Vue.prototype.$storeBoard = Vue.observable({
|
||||||
currentDate: "20240705",
|
currentDate: "20240705",
|
||||||
dialog: false,
|
dialog: false,
|
||||||
aroundStock: [],
|
aroundStock: [],
|
||||||
query: {},
|
query: {},
|
||||||
search: {}
|
search: {t: null}
|
||||||
})
|
})
|
||||||
Vue.component("HlsPlayer", {
|
Vue.component("HlsPlayer", {
|
||||||
render: (h) => h('div', {style: {width: '100%', height: '100%'}}),
|
render: (h) => h('div', {style: {width: '100%', height: '100%'}}),
|
||||||
@@ -134,6 +135,10 @@ Vue.component("scrollTable", {
|
|||||||
return h('el-table', {
|
return h('el-table', {
|
||||||
props: {
|
props: {
|
||||||
headerCellClassName: 'tableHeader', cellClassName: 'tableCell', stripe: !0, height: '100%',
|
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,
|
...config, data: tableData,
|
||||||
}, class: 'scrollTable',
|
}, class: 'scrollTable',
|
||||||
on: {
|
on: {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default {
|
|||||||
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
||||||
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
||||||
{label: "今日销售数量", prop: "saleNum", width: 70},
|
{label: "今日销售数量", prop: "saleNum", width: 70},
|
||||||
{label: "现在库存数量", prop: "stockNum", width: 70},
|
{label: "现在库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||||
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
||||||
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
search: v => v.$marketBoard.search,
|
search: v => v.$marketBoard.search,
|
||||||
|
saleHour: v => v.$marketBoard.saleHour,
|
||||||
columns: v => {
|
columns: v => {
|
||||||
return [
|
return [
|
||||||
{label: '品类', prop: "categoryName", width: 100},
|
{label: '品类', prop: "categoryName", width: 100},
|
||||||
@@ -70,8 +71,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getTableData() {
|
getTableData() {
|
||||||
const {$http, $waitFor} = window
|
const {$http, $waitFor} = window
|
||||||
|
const {saleHour: hourNum} = this
|
||||||
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourCount", {
|
$waitFor($http).then(() => $http.post("/data-boot/la/screen/marketBoard/hourCount", {
|
||||||
...this.search, limit: 999
|
...this.search, limit: 999, hourNum
|
||||||
})).then(res => {
|
})).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.tableData = res.data?.page?.records?.sort((a, b) => sort.indexOf(a.categoryId) - sort.indexOf(b.categoryId)) || []
|
this.tableData = res.data?.page?.records?.sort((a, b) => sort.indexOf(a.categoryId) - sort.indexOf(b.categoryId)) || []
|
||||||
@@ -85,6 +87,9 @@ export default {
|
|||||||
immediate: true, deep: true, handler() {
|
immediate: true, deep: true, handler() {
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
saleHour() {
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -97,6 +97,8 @@ export default {
|
|||||||
},
|
},
|
||||||
handleSta({hour}) {
|
handleSta({hour}) {
|
||||||
this.handleMouseout()
|
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 rowIndex = this.tableData.findIndex(e => e.hour == hour)
|
||||||
const v = this
|
const v = this
|
||||||
const summary = {
|
const summary = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default {
|
|||||||
columns: [
|
columns: [
|
||||||
{label: "重点单品", prop: "goodsName"},
|
{label: "重点单品", prop: "goodsName"},
|
||||||
{label: "销售数量", prop: "saleNum", width: 70},
|
{label: "销售数量", prop: "saleNum", width: 70},
|
||||||
{label: "库存数量", prop: "stockNum", width: 70},
|
{label: "库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||||
{label: "销售目标", prop: "targetSaleNum", width: 70},
|
{label: "销售目标", prop: "targetSaleNum", width: 70},
|
||||||
{label: "销售达成", prop: "saleAchieveRate"},
|
{label: "销售达成", prop: "saleAchieveRate"},
|
||||||
],
|
],
|
||||||
@@ -41,6 +41,9 @@ export default {
|
|||||||
this.tableData = res.data?.records || []
|
this.tableData = res.data?.records || []
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
relevanceMapData(selectGoods) {
|
||||||
|
this.$set(this.$marketBoard, 'thirdGoods', selectGoods)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -49,6 +52,17 @@ export default {
|
|||||||
this.getTableData()
|
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>
|
</script>
|
||||||
@@ -62,7 +76,7 @@ export default {
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</app-sub-title>
|
</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"/>-->
|
<!--<dv-scroll-board :config="tableConfig"/>-->
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@@ -72,6 +86,7 @@ export default {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.AppKeyGoods .dv-scroll-board, .AppKeyGoods .scrollTable {
|
.AppKeyGoods .dv-scroll-board, .AppKeyGoods .scrollTable {
|
||||||
height: calc(100% - 60px) !important;
|
height: calc(100% - 60px) !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,32 +6,45 @@ export default {
|
|||||||
return {
|
return {
|
||||||
map: null,
|
map: null,
|
||||||
layers: [],
|
layers: [],
|
||||||
geoJson: null
|
geoJson: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
search: v => v.$marketBoard.search
|
search: v => v.$marketBoard.search,
|
||||||
|
thirdGoods: v => v.$marketBoard.thirdGoods || {}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
search: {
|
search: {
|
||||||
deep: true, handler() {
|
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: {
|
methods: {
|
||||||
loadLib() {
|
loadLib() {
|
||||||
|
const {$loadScript} = window
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
'/presource/datascreen/js/turf.min.js',
|
'/presource/datascreen/js/turf.min.js',
|
||||||
].map(e => $loadScript('js', e)))
|
].map(e => $loadScript('js', e)))
|
||||||
},
|
},
|
||||||
|
getContent([x, y, bakeStockAmt = 0, preSaleNum = 0, stockNum = 0] = []) {
|
||||||
|
if (this.thirdGoods.thirdGoodsCode) {
|
||||||
|
return [`库存数量:${stockNum}`]
|
||||||
|
}
|
||||||
|
return [`现烤库存金额:${bakeStockAmt}`, `现烤销售机会:${preSaleNum}`]
|
||||||
|
},
|
||||||
getData() {
|
getData() {
|
||||||
const {$http, $waitFor} = window
|
const {$http, $waitFor} = window
|
||||||
const {groupCodeList, currentDate, hourNum} = this.search
|
const {search: {groupCodeList, currentDate, hourNum}, thirdGoods: {thirdGoodsCode}} = this
|
||||||
const maps = []
|
const maps = []
|
||||||
return $waitFor($http).then(() => Promise.all([
|
return $waitFor($http).then(() => Promise.all([
|
||||||
$http.post("/data-boot/la/screen/marketBoard/storeReport", {
|
$http.post("/data-boot/la/screen/marketBoard/storeReport", {
|
||||||
groupCodeList, currentDate, hourNum
|
groupCodeList, currentDate, hourNum, thirdGoodsCode
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
return this.layers = res.data || []
|
return this.layers = res.data || []
|
||||||
@@ -52,12 +65,14 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
initMap() {
|
initMap() {
|
||||||
const {echarts, turf} = window
|
const {echarts, turf, $waitFor} = window
|
||||||
const boundary = turf.union(this.geoJson)
|
const boundary = turf.union(this.geoJson)
|
||||||
boundary.properties.name = "boundary"
|
boundary.properties.name = "boundary"
|
||||||
this.geoJson.features.unshift(boundary)
|
this.geoJson.features.unshift(boundary)
|
||||||
echarts.registerMap('zhengzhou', this.geoJson)
|
echarts.registerMap('zhengzhou', this.geoJson)
|
||||||
|
$waitFor(this.$el).then(() => {
|
||||||
this.map = echarts.init(this.$el)
|
this.map = echarts.init(this.$el)
|
||||||
|
if (!this.map) return setTimeout(() => this.initMap(), 500)
|
||||||
const areaColor = {
|
const areaColor = {
|
||||||
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
|
type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [
|
||||||
{offset: 0, color: 'rgba(61,127,255,0.35)'},
|
{offset: 0, color: 'rgba(61,127,255,0.35)'},
|
||||||
@@ -70,9 +85,9 @@ export default {
|
|||||||
borderRadius: 2,
|
borderRadius: 2,
|
||||||
padding: 8,
|
padding: 8,
|
||||||
position: 'right',
|
position: 'right',
|
||||||
formatter: params => {
|
formatter: (params) => {
|
||||||
const {name, value: [x, y, bakeStockAmt = 0, preSaleNum = 0]} = params
|
const {name, value} = params
|
||||||
return `{a|${name}\n现烤库存金额:${bakeStockAmt}\n现烤销售机会:${preSaleNum}}`
|
return `{a|${name}\n${this.getContent(value).join("\n")}}`
|
||||||
},
|
},
|
||||||
rich: {
|
rich: {
|
||||||
a: {color: '#fff', fontSize: 12, lineHeight: 14}
|
a: {color: '#fff', fontSize: 12, lineHeight: 14}
|
||||||
@@ -94,8 +109,8 @@ export default {
|
|||||||
],
|
],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'item', formatter: params => {
|
trigger: 'item', formatter: params => {
|
||||||
const {name, marker, value: [x, y, bakeStockAmt = 0, preSaleNum = 0]} = params
|
const {name, marker, value} = params
|
||||||
return `${marker} ${name}<br/>现烤库存金额:${bakeStockAmt}<br/>现烤销售机会:${preSaleNum}`
|
return `${marker} ${name}<br/>${this.getContent(value).join("<br/>")}`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@@ -106,13 +121,15 @@ export default {
|
|||||||
this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8'
|
this.$marketBoard.screenId = 'a90522ef-869b-40ea-8542-d1fc9674a1e8'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.refreshData()
|
this.refreshData("initMap")
|
||||||
|
})
|
||||||
},
|
},
|
||||||
convertData(layers) {
|
convertData(layers) {
|
||||||
const result = {normal: [], abnormal: []}
|
const result = {normal: [], abnormal: []}
|
||||||
layers.forEach(e => {
|
layers.forEach(e => {
|
||||||
const item = {name: e.storeName, storeCode: e.storeCode, value: [e.longitude, e.latitude, e.bakeStockAmt, e.preSaleNum]}
|
const item = {name: e.storeName, storeCode: e.storeCode, value: [e.longitude, e.latitude, e.bakeStockAmt, e.preSaleNum, e.stockNum]}
|
||||||
if (e.bakeStockAmt > 0) {
|
// 有库存或者有现烤库存金额 就算正常
|
||||||
|
if (e.bakeStockAmt > 0 || e.stockNum > 0) {
|
||||||
result.normal.push(item)
|
result.normal.push(item)
|
||||||
} else {
|
} else {
|
||||||
result.abnormal.push(item)
|
result.abnormal.push(item)
|
||||||
@@ -120,14 +137,16 @@ export default {
|
|||||||
})
|
})
|
||||||
return Object.values(result).map(data => ({data}))
|
return Object.values(result).map(data => ({data}))
|
||||||
},
|
},
|
||||||
refreshData() {
|
refreshData(from) {
|
||||||
this.map.setOption({series: this.convertData(this.layers)})
|
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() {
|
mounted() {
|
||||||
this.loadLib().then(() => Promise.all([
|
this.loadLib().then(() => this.getData()).then(() => this.initMap())
|
||||||
this.getData(),
|
|
||||||
])).then(() => this.initMap())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
reset() {
|
||||||
|
$http.post("/data-boot/la/screen/multipleStoreBoard/move").then(res => {
|
||||||
|
if (res?.data) {
|
||||||
|
this.$message.success("已重置")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'form.interval'(v) {
|
'form.interval'(v) {
|
||||||
@@ -41,7 +48,8 @@ export default {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const {dayjs} = window
|
const {dayjs} = window
|
||||||
const hourNum = new Date().getHours()+1, groupCodeList = "", interval = 60000
|
const hourNum = new Date().getHours()+1, groupCodeList = "", interval = 60000
|
||||||
const currentDate = dayjs().subtract(7, 'day').format("YYYYMMDD")
|
// const currentDate = dayjs().subtract(7, 'day').format("YYYYMMDD")
|
||||||
|
const currentDate = dayjs().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)
|
||||||
@@ -52,6 +60,9 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<el-form class="AppMultipleStoreBoardFilter flex" size="small" label-width="70px">
|
<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-form-item label="品类">
|
||||||
<el-select v-model="form.categoryId" @change="v=>$multipleStoreBoard.search.categoryId=v" clearable placeholder="全部">
|
<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"/>
|
<el-option v-for="item in dicts.品类" :key="item.value" :label="item.label" :value="item.value"/>
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
const screens = [
|
const screens = [
|
||||||
{id: '5b1849ac-4fc3-451a-844c-3362b47341ef', label: '市场看板', bg: 'http://10.0.97.209/img/kengee/kengee16.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'},
|
{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'},
|
{id: 'a90522ef-869b-40ea-8542-d1fc9674a1e8', label: '单店监控', bg: 'http://10.0.97.209/img/kengee/kengee18.png', ob: '$storeBoard'},
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: "AppNavbar",
|
name: "AppNavbar",
|
||||||
label: "标题栏",
|
label: "标题栏",
|
||||||
data() {
|
data() {
|
||||||
return {screens}
|
return {screens, timer: null}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
groupId: v => v.$marketBoard.screenId,
|
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>
|
</script>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default {
|
|||||||
{label: "重点单品", prop: "goodsName"},
|
{label: "重点单品", prop: "goodsName"},
|
||||||
{label: "当日目标", prop: "targetNum", width: 70},
|
{label: "当日目标", prop: "targetNum", width: 70},
|
||||||
{label: "销售数量", prop: "saleNum", 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: "预计销售数量", prop: "preSaleNum", width: 70},
|
||||||
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
{label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
|
function throttle(func, limit = 500) {
|
||||||
|
let timer;
|
||||||
|
return function () {
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
timer = setTimeout(func, limit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AppStoresTable",
|
name: "AppStoresTable",
|
||||||
label: "多店监控",
|
label: "多店监控",
|
||||||
@@ -26,7 +36,7 @@ export default {
|
|||||||
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
{label: "昨日销售数量", prop: "yesterdaySaleNum", width: 70},
|
||||||
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
{label: "上周同天销售数量", prop: "lastWeekSaleNum", width: 70},
|
||||||
{label: "今日销售数量", prop: "saleNum", width: 70},
|
{label: "今日销售数量", prop: "saleNum", width: 70},
|
||||||
{label: "现在库存数量", prop: "stockNum", width: 70},
|
{label: "现在库存数量", prop: "stockNum", width: 70, flash: 1},
|
||||||
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
{label: "剩余时间预计销售数量", prop: "preSaleNum"},
|
||||||
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
// {label: "提醒", custom: 1, width: 70, align: 'center', prop: "remind"},
|
||||||
],
|
],
|
||||||
@@ -44,7 +54,12 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
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 => {
|
storeList: v => {
|
||||||
const list = []
|
const list = []
|
||||||
let group = []
|
let group = []
|
||||||
@@ -72,6 +87,15 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
refreshTimer() {
|
||||||
|
console.log("刷新")
|
||||||
|
this.refreshData().then(() => {
|
||||||
|
const v = this.search
|
||||||
|
if (v.interval > 0 && v.changeWay == '1') {
|
||||||
|
this.$refs.carousel?.$forceUpdate()
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -108,21 +132,27 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getStoreKeyGoods() {
|
getStoreKeyGoods() {
|
||||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
|
return new Promise(resolve => {
|
||||||
|
throttle(() => $http.post("/data-boot/la/screen/multipleStoreBoard/storeKeyGoods", {
|
||||||
type: "1", ...this.search,
|
type: "1", ...this.search,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.storeKeyGoods = res.data
|
this.storeKeyGoods = res.data
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
|
}))()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCategorySales() {
|
getCategorySales() {
|
||||||
return $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
|
return new Promise(resolve => {
|
||||||
|
throttle(() => $http.post("/data-boot/la/screen/multipleStoreBoard/categorySale", {
|
||||||
type: "1", ...this.search,
|
type: "1", ...this.search,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.categorySales = res.data
|
this.categorySales = res.data
|
||||||
|
resolve()
|
||||||
}
|
}
|
||||||
|
}))()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gotoDetail(store, i) {
|
gotoDetail(store, i) {
|
||||||
@@ -164,6 +194,14 @@ export default {
|
|||||||
} else if (e.code == "ArrowRight") {
|
} else if (e.code == "ArrowRight") {
|
||||||
this.$refs.carousel.next()
|
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() {
|
mounted() {
|
||||||
|
|||||||
Reference in New Issue
Block a user