import { createStore } from "vuex"; const store = createStore({ state() { return { editable: false, editableUser: false, filtered: false, searchable: false, deleteBool: false, new: false, customerChanged: false, changedCustomerId: -1, filteredByCustomer: '', filteredUserTerm: false, addIcon: false, addSolutionIcon: false, solutionIcon: false, addInstanceIcon: false, filterIcon: false, searchIcon: false, instancesIcon: false, attachmentsIcon: false, sellIcon: false, archiveIcon: false, departmentsIcon: false, addEmployeeIcon: false, addDepartmentIcon: false, employeesIcon: false, editIcon: false, editUserIcon: false, deleteIcon: false, notAllInstancesIcon: false, onAssetlist: true, onAsset: false, onSolutionlistAsset: false, chosenAssetId: -1, newAsset: false, newAssetName: '', newCustomerID: '', newCustomer: '', newLocation: '', newRemoteLocation: '', newType: '', newDescription: '', newNotes: '', newState: '', newLastView: '', newUser: '', hardwareBool: false, newModel: '', newSerialnumber: '', newCPU: '', newRAM: '', newStorageConfiguration: '', newMiscellaneous: '', softwareBool: false, newSoftware: '', newVersion: '', newLicense: '', onTemplatelist: true, onTemplate: false, onInstancelist: false, onInstance: false, newNamePOT: '', newCustomerIDPOT: '', newCustomerPOT: '', newLastViewPOT: '', newUserPOT: '', newDescriptionPOT: '', newNotesPOT: '', chosenPOTId: -1, newNameMVT: '', newCustomerIDMVT: '', newCustomerMVT: '', newLastViewMVT: '', newUserMVT: '', newTypeMVT: '', newNotesMVT: '', chosenMVTId: -1, chosenMITId: -1, chosenPOIId: -1, onSolutionlist: true, onSolution: false, chosenSolutionId: -1, newSolutionNameSol: '', newCustomerIDSol: '', newCustomerSol: '', newAssetNameSol: '', newTypeSol: '', newLastViewSol: '', newUserSol: '', newDescriptionSol: '', newNotesSol: '', onIssueSliplist: true, onIssueSlip: false, chosenIssueSlipId: -1, newTicketNoIS: '', newCustomerIdIS: '', newCustomerIS: '', newNotesIS: '', newUserIS: '', newDeliveryAddressIS: '', newOIs: [], newSupplierRequestDateIS: '', newSupplierRequestIS: '', newSupplierOfferDateIS: '', newSupplierOfferIS: '', newClientOfferDateIS: '', newClientOfferIS: '', newClientOrderDateIS: '', newClientOrderIS: '', newSupplierOrderDateIS: '', newSupplierOrderIS: '', newIngressDateIS: '', newIngressIS: '', newEgressDateIS: '', newEgressIS: '', newIngressBillDateIS: '', newIngressBillIS: '', newEgressBillDateIS: '', newEgressBillIS: '', onIssueItemList: true, onIssueItem: false, onIssueItemVariant: false, chosenIssueId: -1, newNameII: '', newTypeII: '', newStateII: '', newAmountII: '', newPropertiesII: '', chosenIssueVariantId: -1, onEmployeelist: true, onEmployee: false, chosenEmployeeId: -1, newUsernameEmp: '', newPasswordEmp: '', newPasswordRepeatedEmp: '', newFullNameEmp: '', newEmailEmp: '', newPhonenumberEmp: '', newAddressEmp: '', newCityEmp: '', newPostcodeEmp: '', onCustomerlist: true, onCustomer: false, onCustomerEmployeelist: false, onCustomerEmployee: false, onDepartmentlist: false, onDepartment: false, chosenCustomerId: -1, chosenCustomerEmployeeId: -1, chosenDepartmentId: -1, loggedInUserId: '', loggedInUserUsername: '', loggedInUserRegistered: '', loggedInUserLastLogin: '', loggedInUserFullName: '', loggedInUserEmail: '', loggedInUserPhonenumber: '', loggedInUserAddress: '', loggedInUserCity: '', loggedInUserPostcode: '', loggedInUserAdminBool: false, loggedInUserTechnicianBool: false, loggedInUserReaderBool: false, localStorageChanged: false, mode: false, modeQuickAccess: false, modeDashboard: false, modeNavbar: false, modeLayout: false, changeToSet: false, updateDarkMode: false, newNamePOI: '', newTemplateIDPOI: '', newCustomerIDPOI: '', newCustomerPOI: '', newAssetPOI: '', newStatePOI: '', newCreationDatePOI: '', newCompletionDatePOI: '', newUserPOI: '', newTemplateDescriptionPOI: '', newTemplateNotesPOI: '', newTimeSpentPOI: '', newNotesPOI: '', newNameMVI: '', newTemplateIDMVI: '', newMaintenanceTypeMVI: '', newStateMVI: '', newCreationDateMVI: '', newCompletionDateMVI: '', newUserMVI: '', newCustomerIDMVI: '', newCustomerMVI: '', newTemplateNotesMVI: '', newTypeMVI: '', newTimeSpentMVI: '', newNotesMVI: '', }; }, mutations: { // functions to toggle with the actionbar toggleEditable(state) { state.editable = !state.editable }, toggleEditableUser(state) { state.editableUser = !state.editableUser }, toggleChangeToSet(state) { state.changeToSet = !state.changeToSet }, toggleUpdateDarkMode(state) { state.updateDarkMode = !state.updateDarkMode }, resetUpdateDarkMode(state) { state.updateDarkMode = false }, resetChangeToSet(state) { state.changeToSet = false }, toggleFiltered(state) { if (state.filtered == false) { state.filtered = true state.searchable = false } else { state.filtered = false } }, toggleSearchable(state) { if (state.searchable == false) { state.searchable = true state.filtered = false } else { state.searchable = false } state.filteredByCustomer = '' }, toggleCustomerChanged(state) { state.customerChanged = !state.customerChanged }, toggleCustomerId(state, id) { state.changedCustomerId = id }, // functions to change the asset pages changeToAssetlist(state) { state.onAssetlist = true state.onAsset = false state.onSolutionlistAsset = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomerAssetlist(state) { state.onAssetlist = false state.onAsset = false state.onSolutionlistAsset = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToAsset(state) { state.onAssetlist = false state.onAsset = true state.onSolutionlistAsset = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = true state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = true state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToSolutionlistAsset(state) { state.onAssetlist = false state.onAsset = false state.onSolutionlistAsset = true state.addIcon = false state.addSolutionIcon = true state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, // functions to change the production order and maintenance visit pages changeToTemplatelist(state) { state.onTemplatelist = true state.onTemplate = false state.onInstancelist = false state.onInstance = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomerTemplatelist(state) { state.onTemplatelist = false state.onTemplate = false state.onInstancelist = false state.onInstance = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToTemplate(state) { state.onTemplatelist = false state.onTemplate = true state.onInstancelist = false state.onInstance = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = true state.filterIcon = false state.searchIcon = false state.instancesIcon = true state.attachmentsIcon = true state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToInstancelist(state) { state.onTemplatelist = false state.onTemplate = false state.onInstancelist = true state.onInstance = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = true state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = true }, changeToInstance(state) { state.onTemplatelist = false state.onTemplate = false state.onInstancelist = false state.onInstance = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = true state.sellIcon = false state.archiveIcon = true state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = true }, seeAllIcon(state) { state.notAllInstancesIcon = false state.chosenPOTId = -1 state.chosenMVTId = -1 }, addNewAsset(state) { state.newAsset = true state.editable = false state.editableUser = false state.filtered = false state.searchable = false state.onAssetlist = false state.onAsset = true state.onSolutionlistAsset = false }, // functions to change the solution pages changeToSolutionlist(state) { state.onSolutionlist = true state.onSolution = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.departmentsIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomerSolutionlist(state) { state.onSolutionlist = false state.onSolution = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToSolution(state) { state.onSolutionlist = false state.onSolution = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = true state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, // functions to change the issue slip pages changeToIssueSliplist(state) { state.onIssueSliplist = true state.onIssueSlip = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomerIssueSliplist(state) { state.onIssueSliplist = false state.onIssueSlip = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToIssueSlip(state) { state.onIssueSliplist = false state.onIssueSlip = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = true state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, // functions to change the issue pages changeToIssueItemList(state) { state.onIssueItemList = true state.onIssueItem = false state.onIssueItemVariant = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToIssueItem(state) { state.onIssueItemList = false state.onIssueItem = true state.onIssueItemVariant = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = true state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToIssueItemVariant(state) { state.onIssueItemList = false state.onIssueItem = false state.onIssueItemVariant = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = true state.archiveIcon = true state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, // functions to change the user pages changeToEmployeelist(state) { state.onEmployeelist = true state.onEmployee = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToEmployee(state) { state.onEmployeelist = false state.onEmployee = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, // functions to change the customer pages changeToCustomerlist(state) { state.onCustomerlist = true state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = false state.addIcon = true state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomer(state) { state.onCustomerlist = false state.onCustomer = true state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = true state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = true state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToCustomerEmployeelist(state) { state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = true state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = true state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = true state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToCustomerEmployee(state) { state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = true state.onDepartmentlist = false state.onDepartment = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToDepartmentlist(state) { state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = true state.onDepartment = false state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = true state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = true state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = false state.notAllInstancesIcon = false }, changeToDepartment(state) { state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = true state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = true state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = false state.deleteIcon = true state.notAllInstancesIcon = false }, changeToSettings(state) { state.addIcon = false state.addSolutionIcon = false state.solutionIcon = false state.addInstanceIcon = false state.filterIcon = false state.searchIcon = false state.instancesIcon = false state.attachmentsIcon = false state.sellIcon = false state.archiveIcon = false state.editIcon = false state.departmentsIcon = false state.addDepartmentIcon = false state.addEmployeeIcon = false state.employeesIcon = false state.editUserIcon = true state.deleteIcon = false state.notAllInstancesIcon = false }, // functions to update the asset updateAssetComponent(state, asset) { state.newAssetName = asset.assetName state.newCustomerID = asset.customerId state.newCustomer = asset.customer state.newLocation = asset.location state.newRemoteLocation = asset.remoteLocation state.newType = asset.type state.newDescription = asset.description state.newNotes = asset.notes state.newState = asset.state }, updateHardwareComponent(state, asset) { state.hardwareBool = asset.hardwareBool state.newModel = asset.model state.newSerialnumber = asset.serialnumber state.newCPU = asset.CPU state.newRAM = asset.RAM state.newStorageConfiguration = asset.storageConfig state.newMiscellaneous = asset.miscellaneous }, updateSoftwareComponent(state, asset) { state.softwareBool = asset.softwareBool state.newSoftware = asset.software state.newVersion = asset.version state.newLicense = asset.license }, // functions to update the production order template updateProductionOrderTemplateComponent(state, pot) { state.newNamePOT = pot.name state.newCustomerIDPOT = pot.customerId state.newCustomerPOT = pot.customer state.newUserPOT = pot.user state.newDescriptionPOT = pot.description state.newNotesPOT = pot.notes }, // functions to update the maintenance visit template updateMaintenanceVisitTemplateComponent(state, mvt) { state.newNameMVT = mvt.name state.newCustomerIDMVT = mvt.customerId state.newCustomerMVT = mvt.customer state.newUserMVT = mvt.user state.newTypeMVT = mvt.type state.newNotesMVT = mvt.notes }, // functions to update the solution updateSolutionComponent(state, sol) { state.newSolutionNameSol = sol.solutionName state.newCustomerIDSol = sol.customerId state.newCustomerSol = sol.customer state.newAssetNameSol = sol.assetName state.newLastViewSol = sol.lastView state.newTypeSol = sol.type state.newDescriptionSol = sol.description state.newNotesSol = sol.notes state.newUserSol = sol.user }, // functions to update the issue slip component updateIssueSlipComponent(state, is) { state.newTicketNoIS = is.ticketNo state.newCustomerIdIS = is.customerId state.newCustomerIS = is.customer state.newNotesIS = is.notes state.newUserIS = is.user state.newDeliveryAddressIS = is.deliveryAddress }, // functions to update the accounting info component updateOrderingInfoComponent(state, o) { state.newOIs = o.ois }, // functions to update the accounting component updateAccountingComponent(state, is) { state.newSupplierRequestDateIS = is.supplierRequestDate state.newSupplierRequestIS = is.supplierRequest state.newSupplierOfferDateIS = is.supplierOfferDate state.newSupplierOfferIS = is.supplierOffer state.newClientOfferDateIS = is.clientOfferDate state.newClientOfferIS = is.clientOffer state.newClientOrderDateIS = is.clientOrderDate state.newClientOrderIS = is.clientOrder state.newSupplierOrderDateIS = is.supplierOrderDate state.newSupplierOrderIS = is.supplierOrder state.newIngressDateIS = is.ingressDate state.newIngressIS = is.ingress state.newEgressDateIS = is.egressDate state.newEgressIS = is.egress state.newIngressBillDateIS = is.ingressBillDate state.newIngressBillIS = is.ingressBill state.newEgressBillDateIS = is.egressBillDate state.newEgressBillIS = is.egressBill }, // functions to update the issue component updateIssueComponent(state, is) { state.newNameII = is.name state.newTypeII = is.type state.newStateII = is.state state.newAmountII = is.amount state.newPropertiesII = is.properties }, // functions to update the employee component updateEmployeeComponent(state, employee) { state.newUsernameEmp = employee.username state.newPasswordEmp = employee.password state.newPasswordRepeatedEmp = employee.passwordRepeated state.newFullNameEmp = employee.fullName state.newEmailEmp = employee.email state.newPhonenumberEmp = employee.phonenumber state.newAddressEmp = employee.address state.newCityEmp = employee.city state.newPostcodeEmp = employee.postcode }, // function to update production order instance component updateProductionOrderInstanceComponent(state, productionOrderInstance) { state.newNamePOI = productionOrderInstance.name state.newTemplateIDPOI = productionOrderInstance.templateID state.newCustomerIDPOI = productionOrderInstance.customerID state.newCustomerPOI = productionOrderInstance.customer state.newAssetPOI = productionOrderInstance.asset state.newStatePOI = productionOrderInstance.state state.newCreationDatePOI = productionOrderInstance.creationDate state.newCompletionDatePOI = productionOrderInstance.completionDate state.newUserPOI = productionOrderInstance.user state.newTemplateDescriptionPOI = productionOrderInstance.templateDescription state.newTemplateNotesPOI = productionOrderInstance.templateNotes state.newTimeSpentPOI = productionOrderInstance.timeSpent state.newNotesPOI = productionOrderInstance.notes }, updateProductionOrderInstanceTemplateID(state, id) { state.newTemplateIDPOI = id }, // function to update maintenance visit instance component updateMaintenanceVisitInstanceComponent(state, maintenanceVisitInstance) { state.newNameMVI = maintenanceVisitInstance.name state.newTemplateIDMVI = maintenanceVisitInstance.templateID state.newMaintenanceTypeMVI = maintenanceVisitInstance.maintenanceType state.newStateMVI = maintenanceVisitInstance.state state.newCreationDateMVI = maintenanceVisitInstance.creationDate state.newCompletionDateMVI = maintenanceVisitInstance.completionDate state.newUserMVI = maintenanceVisitInstance.user state.newCustomerIDMVI = maintenanceVisitInstance.customerID state.newCustomerMVI = maintenanceVisitInstance.customer state.newTemplateNotesMVI = maintenanceVisitInstance.templateNotes state.newTypeMVI = maintenanceVisitInstance.type state.newTimeSpentMVI = maintenanceVisitInstance.timeSpent state.newNotesMVI = maintenanceVisitInstance.notes }, updateMaintenanceVisitInstanceTemplateID(state, id) { state.newTemplateIDMVI = id }, setLocalStorageChanged(state) { state.localStorageChanged = !state.localStorageChanged }, resetLocalStorageChanged(state) { state.localStorageChanged = false }, setModeChanged(state) { state.mode = !state.mode }, resetModeChanged(state) { state.mode = false }, setModeQuickAccessChanged(state) { state.modeQuickAccess = !state.modeQuickAccess }, resetModeQuickAccessChanged(state) { state.modeQuickAccess = false }, setModeDashboardChanged(state) { state.modeDashboard = !state.modeDashboard }, resetModeDashboardChanged(state) { state.modeDashboard = false }, setModeNavbarChanged(state) { state.modeNavbar = !state.modeNavbar }, resetModeNavbarChanged(state) { state.modeNavbar = false }, setModeLayoutChanged(state) { state.modeLayout = !state.modeLayout }, resetModeLayoutChanged(state) { state.modeLayout = false }, resetFilterSearch(state) { state.filtered = false state.searchable = false }, activateFilteredUserTerm(state) { state.filteredUserTerm = true }, activateFiltered(state) { state.filtered = true }, deactivateSearch(state) { state.filteredUserTerm = false }, // function to set the logged in user setLoggedInUser(state, user) { state.loggedInUserId = user.id state.loggedInUserUsername = user.username state.loggedInUserRegistered = user.registered state.loggedInUserLastLogin = user.lastLogin state.loggedInUserFullName = user.fullName state.loggedInUserEmail = user.email state.loggedInUserPhonenumber = user.phonenumber state.loggedInUserAddress = user.address state.loggedInUserCity = user.city state.loggedInUserPostcode = user.postcode if (user.adminBool == 1) { state.loggedInUserAdminBool = true } else { state.loggedInUserAdminBool = false } if (user.technicianBool == 1) { state.loggedInUserTechnicianBool = true } else { state.loggedInUserTechnicianBool = false } if (user.readerBool == 1) { state.loggedInUserReaderBool = true } else { state.loggedInUserReaderBool = false } }, // function to set the chosen asset setChosenAsset(state, id) { state.chosenAssetId = id }, // function to set the chosen production order template setChosenPOT(state, id) { state.chosenPOTId = id }, // function to set the chosen maintenance visit template setChosenMVT(state, id) { state.chosenMVTId = id }, // function to set the chosen maintenance visit instance setChosenMIT(state, id) { state.chosenMITId = id }, // function to set the chosen production order instance setChosenPOI(state, id) { state.chosenPOIId = id }, // function to set the chosen solution setChosenSolution(state, id) { state.chosenSolutionId = id }, // function to set the chosen issue slip setChosenIssueSlip(state, id) { state.chosenIssueSlipId = id }, // function to set the chosen issue setChosenIssue(state, id) { state.chosenIssueId = id }, // function to set the chosen issue variant setChosenIssueVariant(state, id) { state.chosenIssueVariantId = id }, // function to set the chosen user setChosenEmployee(state, id) { state.chosenEmployeeId = id }, // function to set the chosen customer and its employees and departments setChosenCustomer(state, id) { state.chosenCustomerId = id }, setChosenCustomerEmployee(state, id) { state.chosenCustomerEmployeeId = id }, setChosenCustomerDepartment(state, id) { state.chosenDepartmentId = id }, // function to reset the pages resetStore(state) { state.editable = false state.editableUser = false state.filtered = false state.searchable = false state.deleteBool = false state.chosenAssetId = -1 state.filteredByCustomer = '' state.filteredUserTerm = false state.new = false state.customerChanged = false state.changedCustomerId = -1 // reset the asset page variables state.newAssetName = '' state.newCustomerID = '' state.newCustomer = '' state.newLocation = '' state.newRemoteLocation = '' state.newType = '' state.newDescription = '' state.newNotes = '' state.newState = '' state.newLastView = '' state.newUser = '' state.hardwareBool = false state.newModel = '' state.newSerialnumber = '' state.newCPU = '' state.newRAM = '' state.newStorageConfiguration = '' state.newMiscellaneous = '' state.softwareBool = false state.newSoftware = '' state.newVersion = '' state.newLicense = '' // reset the production order template page variables state.newNamePOT = '' state.newCustomerIDPOT = '' state.newCustomerPOT = '' state.newUserPOT = '' state.newDescriptionPOT = '' state.newNotesPOT = '' state.newLastViewPOT = '' state.chosenPOTId = -1 // reset the maintenance visit template page variables state.newNameMVT = '' state.newCustomerIDMVT = '' state.newCustomerMVT = '' state.newUserMVT = '' state.newTypeMVT = '' state.newNotesMVT = '' state.newLastViewMVT = '' state.chosenMVTId = -1 // reset the maintenance visit and production order instance page variables state.chosenMITId = -1 state.chosenPOIId = -1 // reset the solution page variables state.newSolutionNameSol = '' state.newCustomerIDSol = '' state.newCustomerSol = '' state.newAssetNameSol = '' state.newLastViewSol = '' state.newTypeSol = '' state.newDescriptionSol = '' state.newNotesSol = '' state.newUserSol = '' state.chosenSolutionId = -1 // reset the issue slip page variables state.chosenIssueSlipId = -1 state.newCustomerIdIS = '' state.newCustomerIS = '' state.newTicketNoIS = '' state.newNotesIS = '' state.newUserIS = '' state.newOIs = [] state.newDeliveryAddressIS = '' state.newSupplierRequestIS = '' state.newSupplierOfferIS = '' state.newClientOfferIS = '' state.newClientOrderIS = '' state.newSupplierOrderIS = '' state.newIngressIS = '' state.newEgressIS = '' state.newIngressBillIS = '' state.newEgressBillIS = '' state.newSupplierRequestDateIS = '' state.newSupplierOfferDateIS = '' state.newClientOfferDateIS = '' state.newClientOrderDateIS = '' state.newSupplierOrderDateIS = '' state.newIngressDateIS = '' state.newEgressDateIS = '' state.newIngressBillDateIS = '' state.newEgressBillDateIS = '' // reset the issue page variables state.chosenIssueId = -1 state.chosenIssueVariantId = -1 state.newNameII = '' state.newTypeII = '' state.newStateII = '' state.newAmountII = '' state.newPropertiesII = '' // reset the employee page variables state.chosenEmployeeId = -1 state.newUsernameEmp = '' state.newPasswordEmp = '' state.newPasswordRepeatedEmp = '' state.newFullNameEmp = '' state.newEmailEmp = '' state.newPhonenumberEmp = '' state.newAddressEmp = '' state.newCityEmp = '' state.newPostcodeEmp = '' // reset the poi page variables state.newNamePOI = '' state.newTemplateIDPOI = '' state.newCustomerIDPOI = '' state.newCustomerPOI = '' state.newAssetPOI = '' state.newStatePOI = '' state.newCreationDatePOI = '' state.newCompletionDatePOI = '' state.newUserPOI = '' state.newTemplateDescriptionPOI = '' state.newTemplateNotesPOI = '' state.newTimeSpentPOI = '' state.newNotesPOI = '' // reset the mvi page variables state.newNameMVI = '' state.newTemplateIDMVI = '' state.newMaintenanceTypeMVI = '' state.newStateMVI = '' state.newCreationDateMVI = '' state.newCompletionDateMVI = '' state.newUserMVI = '' state.newCustomerIDMVI = '' state.newCustomerMVI = '' state.newTemplateNotesMVI = '' state.newTypeMVI = '' state.newTimeSpentMVI = '' state.newNotesMVI = '' // reset the customer page variables state.chosenCustomerId = -1 state.chosenCustomerEmployeeId = -1 state.chosenDepartmentId = -1 }, // function to reset the pages except chosen customer id resetStoreNotCustomer(state) { state.editable = false state.editableUser = false state.filtered = false state.searchable = false state.deleteBool = false state.chosenAssetId = -1 state.filteredByCustomer = '' state.filteredUserTerm = false state.new = false state.customerChanged = false state.changedCustomerId = -1 // reset the asset page variables state.newAssetName = '' state.newCustomerID = '' state.newCustomer = '' state.newLocation = '' state.newRemoteLocation = '' state.newType = '' state.newDescription = '' state.newNotes = '' state.newState = '' state.newLastView = '' state.newUser = '' state.hardwareBool = false state.newModel = '' state.newSerialnumber = '' state.newCPU = '' state.newRAM = '' state.newStorageConfiguration = '' state.newMiscellaneous = '' state.softwareBool = false state.newSoftware = '' state.newVersion = '' state.newLicense = '' // reset the production order template page variables state.newNamePOT = '' state.newCustomerIDPOT = '' state.newCustomerPOT = '' state.newUserPOT = '' state.newDescriptionPOT = '' state.newNotesPOT = '' state.newLastViewPOT = '' state.chosenPOTId = -1 // reset the maintenance visit template page variables state.newNameMVT = '' state.newCustomerIDMVT = '' state.newCustomerMVT = '' state.newUserMVT = '' state.newTypeMVT = '' state.newNotesMVT = '' state.newLastViewMVT = '' state.chosenMVTId = -1 // reset the maintenance visit and production order instance page variables state.chosenMITId = -1 state.chosenPOIId = -1 // reset the solution page variables state.newSolutionNameSol = '' state.newCustomerIDSol = '' state.newCustomerSol = '' state.newAssetNameSol = '' state.newLastViewSol = '' state.newTypeSol = '' state.newDescriptionSol = '' state.newNotesSol = '' state.newUserSol = '' state.chosenSolutionId = -1 // reset the issue slip page variables state.chosenIssueSlipId = -1 state.newCustomerIdIS = '' state.newCustomerIS = '' state.newTicketNoIS = '' state.newNotesIS = '' state.newUserIS = '' state.newOIs = [] state.newDeliveryAddressIS = '' state.newSupplierRequestIS = '' state.newSupplierOfferIS = '' state.newClientOfferIS = '' state.newClientOrderIS = '' state.newSupplierOrderIS = '' state.newIngressIS = '' state.newEgressIS = '' state.newIngressBillIS = '' state.newEgressBillIS = '' state.newSupplierRequestDateIS = '' state.newSupplierOfferDateIS = '' state.newClientOfferDateIS = '' state.newClientOrderDateIS = '' state.newSupplierOrderDateIS = '' state.newIngressDateIS = '' state.newEgressDateIS = '' state.newIngressBillDateIS = '' state.newEgressBillDateIS = '' // reset the issue page variables state.chosenIssueId = -1 state.chosenIssueVariantId = -1 state.newNameII = '' state.newTypeII = '' state.newStateII = '' state.newAmountII = '' state.newPropertiesII = '' // reset the employee page variables state.chosenEmployeeId = -1 state.newUsernameEmp = '' state.newPasswordEmp = '' state.newPasswordRepeatedEmp = '' state.newFullNameEmp = '' state.newEmailEmp = '' state.newPhonenumberEmp = '' state.newAddressEmp = '' state.newCityEmp = '' state.newPostcodeEmp = '' // reset the poi page variables state.newNamePOI = '' state.newTemplateIDPOI = '' state.newCustomerIDPOI = '' state.newCustomerPOI = '' state.newAssetPOI = '' state.newStatePOI = '' state.newCreationDatePOI = '' state.newCompletionDatePOI = '' state.newUserPOI = '' state.newTemplateDescriptionPOI = '' state.newTemplateNotesPOI = '' state.newTimeSpentPOI = '' state.newNotesPOI = '' // reset the mvi page variables state.newNameMVI = '' state.newTemplateIDMVI = '' state.newMaintenanceTypeMVI = '' state.newStateMVI = '' state.newCreationDateMVI = '' state.newCompletionDateMVI = '' state.newUserMVI = '' state.newCustomerIDMVI = '' state.newCustomerMVI = '' state.newTemplateNotesMVI = '' state.newTypeMVI = '' state.newTimeSpentMVI = '' state.newNotesMVI = '' // reset the customer page variables state.chosenCustomerEmployeeId = -1 state.chosenDepartmentId = -1 }, // function to logout logout(state) { state.loggedInUserId = '' state.loggedInUserUsername = '' state.loggedInUserRegistered = '' state.loggedInUserLastLogin = '' state.loggedInUserFullName = '' state.loggedInUserEmail = '' state.loggedInUserPhonenumber = '' state.loggedInUserAddress = '' state.loggedInUserCity = '' state.loggedInUserPostcode = '' state.loggedInUserAdminBool = false state.loggedInUserTechnicianBool = false state.loggedInUserReaderBool = false }, // functions to (undo) delete an asset doDelete(state) { state.deleteBool = true }, undoDelete(state) { state.deleteBool = false }, // function to update the asset filter updateFilterbyCustomer(state, customer) { state.filteredByCustomer = customer }, // function to get to the add page add(state) { state.new = true state.editable = false state.editableUser = false state.filtered = false state.searchable = false // set the asset variables state.onAssetlist = false state.onAsset = true state.onSolutionlistAsset = false // set the production order and maintenance visit variables state.onTemplatelist = false state.onTemplate = true state.onInstancelist = false state.onInstance = false // set the solution variables state.onSolutionlist = false state.onSolution = true // set the issue slips variables state.onIssueSliplist = false state.onIssueSlip = true // set the issue variables state.onIssueItemList = false state.onIssueItemVariant = false state.onIssueItem = true // set the employee variables state.onEmployeelist = false state.onEmployee = true //set the customers variables state.onCustomerlist = false state.onCustomer = true state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = false }, // function to get to the add page of instances addInstance(state) { state.new = true state.editable = false state.editableUser = false state.filtered = false state.searchable = false // set the production order and maintenance visit variables state.onTemplatelist = false state.onTemplate = false state.onInstancelist = false state.onInstance = true }, // function to get to the add page of customer employees addEmployee(state) { state.new = true state.editable = false state.editableUser = false state.filtered = false state.searchable = false // set the customer employees variables state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = true state.onDepartmentlist = false state.onDepartment = false }, // function to get to the add page of customer departments addDepartment(state) { state.new = true state.editable = false state.editableUser = false state.filtered = false state.searchable = false // set the customer departments variables state.onCustomerlist = false state.onCustomer = false state.onCustomerEmployeelist = false state.onCustomerEmployee = false state.onDepartmentlist = false state.onDepartment = true }, }, }); export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.use(store); // Install the store instance as a plugin });