Update query parameters management and comment out unused button
Improved navigation by dynamically updating query parameters at key steps in the POS process for better state handling. Additionally, commented out the unused "ExportOrderToDraftButton" to clean up the UI logic.
This commit is contained in:
@@ -78,6 +78,8 @@ export const nextStep = async () => {
|
||||
if (step.value === 2) {
|
||||
// If the current step is 2, set the product category to addons
|
||||
setProductsCategory(4);
|
||||
// Set the step to 3 in the query parameters
|
||||
window.history.pushState({}, '', `?id=${order_id.value}&customer_id=${customer_id.value}&step=3`);
|
||||
}
|
||||
if (step.value === 3) {
|
||||
// Show a "Success" dialog, that closes after 2 seconds, then redirects to the next page
|
||||
@@ -199,6 +201,8 @@ export const createOrder = () => {
|
||||
order_id.value = parseInt(response.data.data.id);
|
||||
// Set the order id in the local storage (To be make F5 safe)
|
||||
localStorage.setItem('pos_order_id', order_id.value);
|
||||
// Set the query parameters
|
||||
window.history.pushState({}, '', `?id=${order_id.value}&customer_id=${customer_id.value}&step=2`);
|
||||
return true;
|
||||
}).catch((error) => {
|
||||
parseError(error, 'stepError');
|
||||
@@ -653,6 +657,8 @@ export const showDeleteEverythingDialog = () => {
|
||||
|
||||
/** Clear cache */
|
||||
export const clearCache = () => {
|
||||
// Reset the query parameters
|
||||
window.history.pushState({}, '', `?step=1`);
|
||||
// Clear the customer data
|
||||
customer_id.value = '';
|
||||
customer_name.value = '';
|
||||
|
||||
@@ -347,7 +347,7 @@ const isBookedWithEconomic = () => {
|
||||
</WhiteBox>
|
||||
<ButtonsBox>
|
||||
<!-- Economic module actions -->
|
||||
<ExportOrderToDraftButton :order_id="orderId" class="is-fullwidth" v-if="!isInvoiced() && invoiceAllOrdersIndividually() && !invoiceUsingStripe()" />
|
||||
<!--<ExportOrderToDraftButton :order_id="orderId" class="is-fullwidth" v-if="!isInvoiced() && invoiceAllOrdersIndividually() && !invoiceUsingStripe()" /> -->
|
||||
<getOrderInvoicePDFButton :invoice_id="economicModule.invoice_id" class="is-fullwidth" v-if="isBookedWithEconomic()" />
|
||||
<!-- If the order is invoiced with Stripe, then show a button to get the invoice -->
|
||||
<ExportOrderToInvoiceStripeButton :order_id="orderId" class="is-fullwidth" v-if="!isInvoiced() && invoiceUsingStripe()" />
|
||||
|
||||
Reference in New Issue
Block a user