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

Bugfix/fix point router on initial load (#630)

* add complete order from collection

* call the edit line fields only when they are displayed

* unnecessary calling of customer fields

* minimal changes

* Add point id to the route on initial load

Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com>
This commit is contained in:
Elsio Sanchez 2021-03-05 12:08:57 -04:00 committed by GitHub
parent 472ffc523a
commit eb4b746a9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 6 deletions

View File

@ -584,7 +584,7 @@ export function requestProcessOrder({
amount: parameter.amount, amount: parameter.amount,
tender_type_code: parameter.tenderTypeCode, tender_type_code: parameter.tenderTypeCode,
payment_ate: parameter.paymentDate, payment_ate: parameter.paymentDate,
currency_uid: parameter.currency_uuid currency_uid: parameter.currencyUuid
} }
}) })
} }

View File

@ -606,7 +606,7 @@ export default {
amount: this.amontSend, amount: this.amontSend,
paymentDate, paymentDate,
tenderTypeCode, tenderTypeCode,
currencyUuid: this.currencyDisplay(currencyToPay).currencyUuid currencyUuid: this.currencyDisplay(currencyToPay)
}) })
} }
this.addCollect() this.addCollect()
@ -739,6 +739,9 @@ export default {
if (display) { if (display) {
return display return display
} }
if (currency === this.currencyPoint.id) {
return this.currencyPoint.uuid
}
return currency return currency
}, },
convertCurrency() { convertCurrency() {

View File

@ -116,9 +116,6 @@ export default {
if (this.isEmptyValue(this.$store.getters.getSellingPointsList)) { if (this.isEmptyValue(this.$store.getters.getSellingPointsList)) {
let posToSet let posToSet
// set pos id with query path // set pos id with query path
if (!this.isEmptyValue(this.$route.query) && !this.isEmptyValue(this.$route.query.pos)) {
posToSet = Number(this.$route.query.pos)
}
this.$store.dispatch('listPointOfSalesFromServer', posToSet) this.$store.dispatch('listPointOfSalesFromServer', posToSet)
} }

View File

@ -133,6 +133,11 @@ export default {
this.listOrderLines(value) this.listOrderLines(value)
} }
}, },
currentPoint(value) {
if (!this.isEmptyValue(value)) {
this.$store.dispatch('setCurrentPOS', value)
}
},
/** /**
* Used when loading/reloading the app without the order uuid * Used when loading/reloading the app without the order uuid
* @param {oject|boolean} bPartnerToSet * @param {oject|boolean} bPartnerToSet
@ -166,6 +171,17 @@ export default {
if (!this.isEmptyValue(this.$route.query)) { if (!this.isEmptyValue(this.$route.query)) {
this.reloadOrder(true, this.$route.query.action) this.reloadOrder(true, this.$route.query.action)
} }
if (!this.isEmptyValue(this.$route.query.pos) && !this.isEmptyValue(this.allOrderLines) && this.isEmptyValue(this.$route.query.action)) {
this.$router.push({
params: {
...this.$route.params
},
query: {
...this.$route.query,
action: this.getOrder.uuid
}
}, () => {})
}
}, },
methods: { methods: {
formatDate, formatDate,
@ -311,7 +327,7 @@ export default {
this.createOrderLine(response.uuid) this.createOrderLine(response.uuid)
} }
this.$store.dispatch('listOrdersFromServer', { this.$store.dispatch('listOrdersFromServer', {
posUuid: this.$store.getters.getCurrentPOS.uuid posUuid: this.currentPoint.uuid
}) })
}).catch(() => {}) }).catch(() => {})
}) })