mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-13 15:15:53 +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:
parent
19d4bb123d
commit
e2bbc598a7
@ -130,9 +130,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.isEmptyValue(this.currentPoint)) {
|
|
||||||
this.$store.dispatch('listPointOfSalesFromServer')
|
this.$store.dispatch('listPointOfSalesFromServer')
|
||||||
}
|
|
||||||
this.unsubscribe = this.subscribeChanges()
|
this.unsubscribe = this.subscribeChanges()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -136,7 +136,12 @@ const pointOfSales = {
|
|||||||
return currentPOS.uuid
|
return currentPOS.uuid
|
||||||
},
|
},
|
||||||
// current pos info
|
// 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)) {
|
if (isEmptyValue(state.pointOfSales)) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user