mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
Correct Point Of Sale Alerts (#718)
* correct point of sale alerts * minimal changes
This commit is contained in:
parent
af96cc5d53
commit
af8e927b5f
@ -241,14 +241,21 @@ export default {
|
||||
},
|
||||
indexTable(value) {
|
||||
this.setCurrent(this.listWithPrice[value])
|
||||
},
|
||||
currentPoint(value) {
|
||||
if (!this.isEmptyValue(value)) {
|
||||
this.loadProductsPricesList()
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.unsubscribe = this.subscribeChanges()
|
||||
|
||||
if (this.isReadyFromGetData) {
|
||||
this.loadProductsPricesList()
|
||||
}
|
||||
this.$store.commit('setListProductPrice', {
|
||||
isLoaded: false
|
||||
})
|
||||
this.timeOut = setTimeout(() => {
|
||||
this.validatePos(this.currentPoint)
|
||||
}, 3000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.unsubscribe()
|
||||
@ -374,6 +381,25 @@ export default {
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @param {object} PointOfSales
|
||||
*/
|
||||
validatePos(PointOfSales) {
|
||||
console.log(this.isEmptyValue(PointOfSales), this.isReadyFromGetData)
|
||||
if (this.isEmptyValue(PointOfSales)) {
|
||||
const message = this.$t('notifications.errorPointOfSale')
|
||||
this.$store.commit('setListProductPrice', {
|
||||
isLoaded: true,
|
||||
productPricesList: []
|
||||
})
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message,
|
||||
duration: 1500,
|
||||
showClose: true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -132,21 +132,21 @@ export default {
|
||||
if (isToLoad) {
|
||||
this.loadProductsPricesList()
|
||||
}
|
||||
},
|
||||
currentPoint(value) {
|
||||
if (!this.isEmptyValue(value)) {
|
||||
this.loadProductsPricesList()
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.unsubscribe = this.subscribeChanges()
|
||||
|
||||
if (this.isReadyFromGetData) {
|
||||
this.loadProductsPricesList()
|
||||
}
|
||||
if (this.isEmptyValue(this.listWithPrice)) {
|
||||
this.$store.dispatch('listProductPriceFromServer', {
|
||||
containerUuid: 'Products-Price-List',
|
||||
pageNumber: 1,
|
||||
searchValue: ''
|
||||
})
|
||||
}
|
||||
this.$store.commit('setListProductPrice', {
|
||||
isLoaded: false
|
||||
})
|
||||
this.timeOut = setTimeout(() => {
|
||||
this.validatePos(this.currentPoint)
|
||||
}, 3000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.unsubscribe()
|
||||
@ -209,6 +209,24 @@ export default {
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* @param {object} PointOfSales
|
||||
*/
|
||||
validatePos(PointOfSales) {
|
||||
if (this.isEmptyValue(PointOfSales)) {
|
||||
const message = this.$t('notifications.errorPointOfSale')
|
||||
this.$store.commit('setListProductPrice', {
|
||||
isLoaded: true,
|
||||
productPricesList: []
|
||||
})
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message,
|
||||
duration: 1500,
|
||||
showClose: true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user