replaced clients/s with customer/s (2)

This commit is contained in:
Johanna Kuehner
2024-03-04 20:07:31 +01:00
parent 889eb3571f
commit fa29921afe
13 changed files with 77 additions and 77 deletions

View File

@ -5,8 +5,8 @@
<input v-if="editable" v-model="mvt.name" @change="updateMVT()" <input v-if="editable" v-model="mvt.name" @change="updateMVT()"
:class="['data', 'mvt-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']"> :class="['data', 'mvt-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
<div class="maintenance-visits-template-data"> <div class="maintenance-visits-template-data">
<div class="client-ID-type-user"> <div class="customer-ID-type-user">
<div class="data-field" id="client"> <div class="data-field" id="customer">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre> <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre>
<pre v-if="!editable" <pre v-if="!editable"
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ mvt.customer }}</pre> :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ mvt.customer }}</pre>
@ -208,8 +208,8 @@ const updateCustomerID = async () => {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${mvt.value.customer}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${mvt.value.customer}`);
customer.value = response.data; customer.value = response.data;
mvt.value.customerID = customer.value.customerID; mvt.value.customerID = customer.value.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', mvt.value.customerID); store.commit('toggleCustomerId', mvt.value.customerID);
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
@ -235,8 +235,8 @@ const updateNewCustomerID = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`);
newCustomerID.value = response.data.customerID; newCustomerID.value = response.data.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', newCustomerID.value) store.commit('toggleCustomerId', newCustomerID.value)
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<section v-if="searchable" :class="['mvt-search', darkMode ? 'section-darkmode' : 'section-lightmode']"> <section v-if="searchable" :class="['mvt-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
<div :class="['clientLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Template:</div> <div :class="['customerLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Template:</div>
<input v-model="mvtSearchFilter" @change="searchMVT()" <input v-model="mvtSearchFilter" @change="searchMVT()"
:class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> :class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
</section> </section>
@ -64,7 +64,7 @@ const goToChosenMVT = (id) => {
store.commit('changeToTemplate'); store.commit('changeToTemplate');
}; };
const clientFilter = computed(() => store.state.filteredByClient); const customerFilter = computed(() => store.state.filteredByCustomer);
const searchable = computed(() => store.state.searchable); const searchable = computed(() => store.state.searchable);
const mvtSearchFilter = ref(''); const mvtSearchFilter = ref('');
@ -73,8 +73,8 @@ const maintenanceVisitTemplates = ref([]);
//get all maintenance visit templates //get all maintenance visit templates
const getMaintenanceVisitTemplates = async () => { const getMaintenanceVisitTemplates = async () => {
if (!(clientFilter.value === '')) { if (!(customerFilter.value === '')) {
await getFilteredMVTByClient(); await getFilteredMVTByCustomer();
} else { } else {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllMaintenanceVisitTemplates`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllMaintenanceVisitTemplates`);
@ -105,10 +105,10 @@ const updateSearchTerm = async () => {
await getMaintenanceVisitTemplates(); await getMaintenanceVisitTemplates();
} }
//get all maintenance visit templates based on the searched client //get all maintenance visit templates based on the searched customer
const getFilteredMVTByClient = async () => { const getFilteredMVTByCustomer = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedMVTsByClient/${clientFilter.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedMVTsByCustomer/${customerFilter.value}`);
maintenanceVisitTemplates.value = response.data; maintenanceVisitTemplates.value = response.data;
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
@ -116,7 +116,7 @@ const getFilteredMVTByClient = async () => {
} }
watch(searchable, updateSearchTerm); watch(searchable, updateSearchTerm);
watch(clientFilter, getMaintenanceVisitTemplates); watch(customerFilter, getMaintenanceVisitTemplates);
onMounted(async () => { onMounted(async () => {
await getMaintenanceVisitTemplates(); await getMaintenanceVisitTemplates();
@ -190,7 +190,7 @@ export default {
font: 400 0.75rem/250% Overpass, sans-serif; font: 400 0.75rem/250% Overpass, sans-serif;
} }
.clientLabel { .customerLabel {
width: 5.5625em; width: 5.5625em;
height: 1.875em; height: 1.875em;
font-family: "Overpass"; font-family: "Overpass";

View File

@ -5,8 +5,8 @@
<input v-if="editable" v-model="pot.name" @change="updatePOT()" <input v-if="editable" v-model="pot.name" @change="updatePOT()"
:class="['data', 'pot-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']"> :class="['data', 'pot-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
<div class="production-orders-template-data"> <div class="production-orders-template-data">
<div class="client-ID"> <div class="customer-ID">
<div class="data-field" id="client"> <div class="data-field" id="customer">
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Customer:</pre> <pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Customer:</pre>
<pre v-if="!editable" <pre v-if="!editable"
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ pot.customer }}</pre> :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ pot.customer }}</pre>
@ -214,8 +214,8 @@ const updateCustomerID = async () => {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${pot.value.customer}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${pot.value.customer}`);
customer.value = response.data; customer.value = response.data;
pot.value.customerID = customer.value.customerID; pot.value.customerID = customer.value.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', pot.value.customerID); store.commit('toggleCustomerId', pot.value.customerID);
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
@ -241,8 +241,8 @@ const updateNewCustomerID = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`);
newCustomerID.value = response.data.customerID; newCustomerID.value = response.data.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', newCustomerID.value) store.commit('toggleCustomerId', newCustomerID.value)
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<section v-if="searchable" :class="['pot-search', darkMode ? 'section-darkmode' : 'section-lightmode']"> <section v-if="searchable" :class="['pot-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
<div :class="['clientLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Template:</div> <div :class="['customerLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Template:</div>
<input v-model="potSearchFilter" @change="searchPOT()" <input v-model="potSearchFilter" @change="searchPOT()"
:class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> :class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
</section> </section>
@ -59,7 +59,7 @@ const goToChosenPOT = (id) => {
store.commit('changeToTemplate'); store.commit('changeToTemplate');
}; };
const clientFilter = computed(() => store.state.filteredByClient); const customerFilter = computed(() => store.state.filteredByCustomer);
const searchable = computed(() => store.state.searchable); const searchable = computed(() => store.state.searchable);
const potSearchFilter = ref(''); const potSearchFilter = ref('');
@ -68,8 +68,8 @@ const productionOrderTemplates = ref([]);
//get all productionOrder templates //get all productionOrder templates
const getProductionOrderTemplates = async () => { const getProductionOrderTemplates = async () => {
if (!(clientFilter.value === '')) { if (!(customerFilter.value === '')) {
await getFilteredPOTByClient(); await getFilteredPOTByCustomer();
} else { } else {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`);
@ -100,17 +100,17 @@ const updateSearchTerm = async () => {
await getProductionOrderTemplates(); await getProductionOrderTemplates();
} }
//get all productionOrder templates based on the searched client //get all productionOrder templates based on the searched customer
const getFilteredPOTByClient = async () => { const getFilteredPOTByCustomer = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOTsByClient/${clientFilter.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOTsByCustomer/${customerFilter.value}`);
productionOrderTemplates.value = response.data; productionOrderTemplates.value = response.data;
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
watch(clientFilter, getProductionOrderTemplates); watch(customerFilter, getProductionOrderTemplates);
watch(searchable, updateSearchTerm); watch(searchable, updateSearchTerm);
onMounted(async () => { onMounted(async () => {
@ -314,7 +314,7 @@ th {
color: #000; color: #000;
} }
.clientLabel { .customerLabel {
width: 5.5625em; width: 5.5625em;
height: 1.875em; height: 1.875em;
font-family: "Overpass"; font-family: "Overpass";

View File

@ -5,8 +5,8 @@
<input v-if="editable" v-model="sol.solutionName" @change="updateSolution()" <input v-if="editable" v-model="sol.solutionName" @change="updateSolution()"
:class="['data', 'solution-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']"> :class="['data', 'solution-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
<div class="solution-data"> <div class="solution-data">
<div class="client-asset"> <div class="customer-asset">
<div class="data-field" id="client"> <div class="data-field" id="customer">
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre> <pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Customer:</pre>
<pre v-if="!editable" <pre v-if="!editable"
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ sol.customer }}</pre> :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ sol.customer }}</pre>
@ -163,8 +163,8 @@ const newDescription = ref('');
const newNotes = ref(''); const newNotes = ref('');
const newLastView = ref(''); const newLastView = ref('');
const newUser = ref(''); const newUser = ref('');
const changedClientId = computed(() => store.state.changedClientId); const changedCustomerId = computed(() => store.state.changedCustomerId);
const clientChanged = computed(() => store.state.clientChanged); const customerChanged = computed(() => store.state.customerChanged);
// get solution from id // get solution from id
const getSolutionById = async () => { const getSolutionById = async () => {
@ -178,28 +178,28 @@ const getSolutionById = async () => {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
await getConfigItemsFromClient(); await getConfigItemsFromCustomer();
} }
//get all config items from the selected client //get all config items from the selected customer
const getConfigItemsFromClient = async () => { const getConfigItemsFromCustomer = async () => {
if (!addBool.value) { if (!addBool.value) {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${sol.value.customerID}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${sol.value.customerID}`);
configItems.value = response.data; configItems.value = response.data;
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} else { } else {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${changedClientId.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromCustomer/${changedCustomerId.value}`);
configItems.value = response.data; configItems.value = response.data;
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
if (clientChanged.value) { if (customerChanged.value) {
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
} }
} }
@ -308,8 +308,8 @@ const updateCustomerID = async () => {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${sol.value.customer}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${sol.value.customer}`);
customer.value = response.data; customer.value = response.data;
sol.value.customerID = customer.value.customerID; sol.value.customerID = customer.value.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', sol.value.customerID); store.commit('toggleCustomerId', sol.value.customerID);
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
@ -321,13 +321,13 @@ const updateNewCustomerID = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`);
newCustomerID.value = response.data.customerID; newCustomerID.value = response.data.customerID;
store.commit('toggleClientChanged'); store.commit('toggleCustomerChanged');
store.commit('toggleClientId', newCustomerID.value); store.commit('toggleCustomerId', newCustomerID.value);
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
updateSol(); updateSol();
await getConfigItemsFromClient(); await getConfigItemsFromCustomer();
} }
// include delay to avoid 503 error // include delay to avoid 503 error
@ -338,7 +338,7 @@ const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
} }
watch(deleteBool, confirmDeleteSolution); watch(deleteBool, confirmDeleteSolution);
watch(clientChanged, getSolutionById); watch(customerChanged, getSolutionById);
onMounted(() => { onMounted(() => {
getSolutionById(); getSolutionById();

View File

@ -165,7 +165,7 @@ const newDescriptionSol = computed(() => store.state.newDescriptionSol);
const newStepTodo = computed(() => solTodos.value.length); const newStepTodo = computed(() => solTodos.value.length);
const chosenSolId = computed(() => store.state.chosenSolutionId); const chosenSolId = computed(() => store.state.chosenSolutionId);
const clientChanged = computed(() => store.state.clientChanged); const customerChanged = computed(() => store.state.customerChanged);
const changedCustomerId = computed(() => store.state.changedCustomerId); const changedCustomerId = computed(() => store.state.changedCustomerId);
const darkMode = ref(true) const darkMode = ref(true)
@ -217,7 +217,7 @@ const addSol = async () => {
} }
} }
if (newCustomerSol.value.length === 0) { if (newCustomerSol.value.length === 0) {
alert("Please choose a client!"); alert("Please choose a customer!");
return; return;
} }
let allFine = true; let allFine = true;
@ -267,7 +267,7 @@ const addSol = async () => {
// add new row of todo for the new solution // add new row of todo for the new solution
const addRowForNewSol = async () => { const addRowForNewSol = async () => {
if (newCustomerSol.value.length === 0) { if (newCustomerSol.value.length === 0) {
alert("Please choose a client first!"); alert("Please choose a customer first!");
return; return;
} }
await getConfigItemsFromCustomer(); await getConfigItemsFromCustomer();
@ -371,7 +371,7 @@ const getSolutionTodosById = async () => {
} }
} }
//get all config items from the selected client //get all config items from the selected customer
const getConfigItemsFromCustomer = async () => { const getConfigItemsFromCustomer = async () => {
if (!addBool.value) { if (!addBool.value) {
try { try {
@ -388,7 +388,7 @@ const getConfigItemsFromCustomer = async () => {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
if (clientChanged.value) { if (customerChanged.value) {
store.commit('toggleCustomerChanged'); store.commit('toggleCustomerChanged');
} }
} }
@ -419,7 +419,7 @@ const deleteSolTodo = async (id) => {
await getSolutionTodosById(); await getSolutionTodosById();
} }
watch(clientChanged, getSolutionById); watch(customerChanged, getSolutionById);
onMounted(() => { onMounted(() => {
getSolutionTodosById(); getSolutionTodosById();

View File

@ -64,7 +64,7 @@ const goToChosenSolution = (id) => {
store.commit('changeToSolution'); store.commit('changeToSolution');
}; };
const clientFilter = computed(() => store.state.filteredByClient); const customerFilter = computed(() => store.state.filteredByCustomer);
const searchable = computed(() => store.state.searchable); const searchable = computed(() => store.state.searchable);
const solutionSearchFilter = ref(''); const solutionSearchFilter = ref('');
@ -79,8 +79,8 @@ const updateSearchTerm = async () => {
//get all solutions //get all solutions
const getSolutions = async () => { const getSolutions = async () => {
if (!(clientFilter.value === '')) { if (!(customerFilter.value === '')) {
await getFilteredSolutionsByClient(); await getFilteredSolutionsByCustomer();
} else { } else {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllSolutions`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllSolutions`);
@ -91,10 +91,10 @@ const getSolutions = async () => {
} }
} }
//get all solutions based on the searched client //get all solutions based on the searched customer
const getFilteredSolutionsByClient = async () => { const getFilteredSolutionsByCustomer = async () => {
try { try {
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedSolutionsByClient/${clientFilter.value}`); const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedSolutionsByCustomer/${customerFilter.value}`);
solutions.value = response.data; solutions.value = response.data;
} catch (err) { } catch (err) {
console.log(err.response.statusText); console.log(err.response.statusText);
@ -115,7 +115,7 @@ const searchSolution = async () => {
} }
} }
watch(clientFilter, getSolutions); watch(customerFilter, getSolutions);
watch(searchable, updateSearchTerm); watch(searchable, updateSearchTerm);

View File

@ -163,7 +163,7 @@ const newDescriptionPOT = computed(() => store.state.newDescriptionPOT);
const newNotesPOT = computed(() => store.state.newNotesPOT); const newNotesPOT = computed(() => store.state.newNotesPOT);
const newStepTodo = computed(() => potTodos.value.length); const newStepTodo = computed(() => potTodos.value.length);
const chosenPOTId = computed(() => store.state.chosenPOTId); const chosenPOTId = computed(() => store.state.chosenPOTId);
const clientChanged = computed(() => store.state.clientChanged); const customerChanged = computed(() => store.state.customerChanged);
const changedCustomerId = computed(() => store.state.changedCustomerId); const changedCustomerId = computed(() => store.state.changedCustomerId);
const darkMode = ref(true) const darkMode = ref(true)
@ -215,7 +215,7 @@ const addPOT = async () => {
} }
} }
if (newCustomerPOT.value.length === 0) { if (newCustomerPOT.value.length === 0) {
alert("Please choose a client!"); alert("Please choose a customer!");
return; return;
} }
let allFine = true; let allFine = true;
@ -263,7 +263,7 @@ const addPOT = async () => {
// add new row of todo for the new pot // add new row of todo for the new pot
const addRowForNewPOT = async () => { const addRowForNewPOT = async () => {
if (newCustomerPOT.value.length === 0) { if (newCustomerPOT.value.length === 0) {
alert("Please choose a client first!"); alert("Please choose a customer first!");
return; return;
} }
await getConfigItemsFromCustomer(); await getConfigItemsFromCustomer();
@ -367,7 +367,7 @@ const getPOTTodosById = async () => {
} }
} }
//get all config items from the selected client //get all config items from the selected customer
const getConfigItemsFromCustomer = async () => { const getConfigItemsFromCustomer = async () => {
if (!addBool.value) { if (!addBool.value) {
try { try {
@ -384,7 +384,7 @@ const getConfigItemsFromCustomer = async () => {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
if (clientChanged.value) { if (customerChanged.value) {
store.commit('toggleCustomerChanged'); store.commit('toggleCustomerChanged');
} }
} }
@ -415,7 +415,7 @@ const deletePOTTodo = async (id) => {
await getPOTTodosById(); await getPOTTodosById();
} }
watch(clientChanged, getPOTById); watch(customerChanged, getPOTById);
onMounted(() => { onMounted(() => {
getPOTTodosById(); getPOTTodosById();

View File

@ -163,7 +163,7 @@ const newTypeMVT = computed(() => store.state.newTypeMVT);
const newNotesMVT = computed(() => store.state.newNotesMVT); const newNotesMVT = computed(() => store.state.newNotesMVT);
const newStepTodo = computed(() => mvtTodos.value.length); const newStepTodo = computed(() => mvtTodos.value.length);
const chosenMVTId = computed(() => store.state.chosenMVTId); const chosenMVTId = computed(() => store.state.chosenMVTId);
const clientChanged = computed(() => store.state.clientChanged); const customerChanged = computed(() => store.state.customerChanged);
const changedCustomerId = computed(() => store.state.changedCustomerId); const changedCustomerId = computed(() => store.state.changedCustomerId);
const darkMode = ref(true) const darkMode = ref(true)
@ -215,7 +215,7 @@ const addMVT = async () => {
} }
} }
if (newCustomerMVT.value.length === 0) { if (newCustomerMVT.value.length === 0) {
alert("Please choose a client!"); alert("Please choose a customer!");
return; return;
} }
let allFine = true; let allFine = true;
@ -263,7 +263,7 @@ const addMVT = async () => {
// add new row of todo for the new MVT // add new row of todo for the new MVT
const addRowForNewMVT = async () => { const addRowForNewMVT = async () => {
if (newCustomerMVT.value.length === 0) { if (newCustomerMVT.value.length === 0) {
alert("Please choose a client first!"); alert("Please choose a customer first!");
return; return;
} }
await getConfigItemsFromCustomer(); await getConfigItemsFromCustomer();
@ -367,7 +367,7 @@ const getMvtTodosById = async () => {
} }
} }
//get all config items from the selected client //get all config items from the selected customer
const getConfigItemsFromCustomer = async () => { const getConfigItemsFromCustomer = async () => {
if (!addBool.value) { if (!addBool.value) {
try { try {
@ -384,7 +384,7 @@ const getConfigItemsFromCustomer = async () => {
console.log(err.response.statusText); console.log(err.response.statusText);
} }
} }
if (clientChanged.value) { if (customerChanged.value) {
store.commit('toggleCustomerChanged'); store.commit('toggleCustomerChanged');
} }
} }
@ -415,7 +415,7 @@ const deleteMVTTodo = async (id) => {
await getMvtTodosById(); await getMvtTodosById();
} }
watch(clientChanged, getMVTById); watch(customerChanged, getMVTById);
onMounted(() => { onMounted(() => {
getMvtTodosById(); getMvtTodosById();

View File

@ -404,8 +404,8 @@ const store = createStore({
}, },
// function to update the asset filter // function to update the asset filter
updateFilterbyCustomer(state, client) { updateFilterbyCustomer(state, customer) {
state.filteredByCustomer = client state.filteredByCustomer = customer
}, },
// function to get to the add page // function to get to the add page

View File

@ -142,7 +142,7 @@ export default defineEventHandler(async (event) => {
} }
if (event.path.startsWith("/api/getSelectedMVTsByCustomer")) { if (event.path.startsWith("/api/getSelectedMVTsByCustomer")) {
// get selected maintenance visit templates object by client from backend // get selected maintenance visit templates object by customer from backend
let filteredCustomer = null; let filteredCustomer = null;
const path = event._path; const path = event._path;
const pathSegments = path.split('/'); const pathSegments = path.split('/');

View File

@ -141,7 +141,7 @@ export default defineEventHandler(async (event) => {
} }
if (event.path.startsWith("/api/getSelectedPOTsByCustomer")) { if (event.path.startsWith("/api/getSelectedPOTsByCustomer")) {
// get selected production order templates object by client from backend // get selected production order templates object by customer from backend
let filteredCustomer = null; let filteredCustomer = null;
const path = event._path; const path = event._path;
const pathSegments = path.split('/'); const pathSegments = path.split('/');

View File

@ -53,7 +53,7 @@ export default defineEventHandler(async (event) => {
} }
if (event.path.startsWith("/api/getSelectedSolutionsByCustomer")) { if (event.path.startsWith("/api/getSelectedSolutionsByCustomer")) {
// get selected solutions object by client from backend // get selected solutions object by customer from backend
let filteredCustomer = null; let filteredCustomer = null;
const path = event._path; const path = event._path;
const pathSegments = path.split('/'); const pathSegments = path.split('/');