mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 23:20:12 +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) {
|
indexTable(value) {
|
||||||
this.setCurrent(this.listWithPrice[value])
|
this.setCurrent(this.listWithPrice[value])
|
||||||
|
},
|
||||||
|
currentPoint(value) {
|
||||||
|
if (!this.isEmptyValue(value)) {
|
||||||
|
this.loadProductsPricesList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
|
this.$store.commit('setListProductPrice', {
|
||||||
if (this.isReadyFromGetData) {
|
isLoaded: false
|
||||||
this.loadProductsPricesList()
|
})
|
||||||
}
|
this.timeOut = setTimeout(() => {
|
||||||
|
this.validatePos(this.currentPoint)
|
||||||
|
}, 3000)
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.unsubscribe()
|
this.unsubscribe()
|
||||||
@ -374,6 +381,25 @@ export default {
|
|||||||
}, 1000)
|
}, 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) {
|
if (isToLoad) {
|
||||||
this.loadProductsPricesList()
|
this.loadProductsPricesList()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
currentPoint(value) {
|
||||||
|
if (!this.isEmptyValue(value)) {
|
||||||
|
this.loadProductsPricesList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
|
this.$store.commit('setListProductPrice', {
|
||||||
if (this.isReadyFromGetData) {
|
isLoaded: false
|
||||||
this.loadProductsPricesList()
|
})
|
||||||
}
|
this.timeOut = setTimeout(() => {
|
||||||
if (this.isEmptyValue(this.listWithPrice)) {
|
this.validatePos(this.currentPoint)
|
||||||
this.$store.dispatch('listProductPriceFromServer', {
|
}, 3000)
|
||||||
containerUuid: 'Products-Price-List',
|
|
||||||
pageNumber: 1,
|
|
||||||
searchValue: ''
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.unsubscribe()
|
this.unsubscribe()
|
||||||
@ -209,6 +209,24 @@ export default {
|
|||||||
}, 1000)
|
}, 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