From a921521f5c6d9c7616d04ea73e99739c95e45b6e Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:02:02 -0400 Subject: [PATCH] Create work order --- src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 2 ++ src/layouts/customer-details/customer-details.vue | 1 + src/store/index.js | 10 ++++++++++ 4 files changed, 14 insertions(+) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index c4efe9d45..f9e1dcb17 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -87,6 +87,7 @@ const storeActions = { SAVE_VAPS: "saveVaps", SAVE_CUSTOMER_DETAILS: "saveCustomerDetails", SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", + SAVE_WORK_ORDER_FLAG: "saveWorkOrderFlag", }; export { storeActions }; diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index fd568ead7..240a76762 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -1,4 +1,6 @@ const storeMutations = { + UPDATE_WORK_ORDER_FLAG: "updateWorkOrderFlag", + // VEHICLE MUTATIONS UPDATE_YEAR: "updateYear", UPDATE_MAKE: "updateMake", diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 55e1b01b8..82e9f6f4b 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -163,6 +163,7 @@ export default { false ); + this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); }, }, diff --git a/src/store/index.js b/src/store/index.js index 2116e1658..ab3f53455 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -25,6 +25,7 @@ import { // Export State const getDefaultState = () => { return { + submitAfterSave: false, order: { vehicle: { year: null, @@ -123,6 +124,10 @@ export const state = getDefaultState(); // Export Mutations export const mutations = { + updateWorkOrderFlag(state, submitAfterSave) { + state.submitAfterSave = submitAfterSave; + }, + // VEHICLE MUTATIONS updateYear(state, year) { state.order.vehicle.year = year; @@ -1400,6 +1405,7 @@ export const actions = { method: endpoints.SaveSession.method, endpoint: endpoints.SaveSession.url, payload: { + submitAfterSave: context.state.submitAfterSave, applicationUser: { crmCustomerId: applicationUser.crmCustomerId, experiments: applicationUser.experiments, @@ -1552,6 +1558,10 @@ export const actions = { ); }, + saveWorkOrderFlag(context, submitAfterSave) { + context.commit(storeMutations.UPDATE_WORK_ORDER_FLAG, submitAfterSave); + }, + // Business domain actions // Vehicle