1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00

error correction with default point of sale with sales representative (#582)

* error correction with default point of sale with sales representative

* minimal change
This commit is contained in:
Elsio Sanchez 2021-02-09 11:37:18 -04:00 committed by GitHub
parent 19d4bb123d
commit e2bbc598a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -130,9 +130,7 @@ export default {
}
},
created() {
if (this.isEmptyValue(this.currentPoint)) {
this.$store.dispatch('listPointOfSalesFromServer')
}
this.$store.dispatch('listPointOfSalesFromServer')
this.unsubscribe = this.subscribeChanges()
},
mounted() {

View File

@ -136,7 +136,12 @@ const pointOfSales = {
return currentPOS.uuid
},
// current pos info
getCurrentPOS: (state) => {
getCurrentPOS: (state, getters) => {
const userUuid = getters['user/getUserUuid']
const sellingPointsList = state.pointOfSales.sellingPointsList.length
if (sellingPointsList > 1) {
return state.pointOfSales.sellingPointsList.find(elem => elem.salesRepresentative.uuid === userUuid)
}
if (isEmptyValue(state.pointOfSales)) {
return undefined
}