diff --git a/backend/models/maintenanceVisitsModel.js b/backend/models/maintenanceVisitsModel.js
index cea93f5..70153b4 100644
--- a/backend/models/maintenanceVisitsModel.js
+++ b/backend/models/maintenanceVisitsModel.js
@@ -32,7 +32,7 @@ export const getSelectedMaintenanceVisitsByChecklistname = async (selected, resu
export const getSelectedMaintenanceVisitsByTemplate = async (selected, result) => {
try {
let sql = `SELECT * FROM maintenancevisits WHERE templateID = ? ORDER BY name ASC`;
- const results = await ownConn.execute(sql, [id])
+ const results = await ownConn.execute(sql, [selected])
result(null, results);
}
catch (err) {
diff --git a/backend/models/maintenanceVisitsTodosModel.js b/backend/models/maintenanceVisitsTodosModel.js
index 2b27975..ea8ad4f 100644
--- a/backend/models/maintenanceVisitsTodosModel.js
+++ b/backend/models/maintenanceVisitsTodosModel.js
@@ -61,7 +61,7 @@ export const updateMaintenanceVisitTodoById = async (data, result) => {
try {
const id = data.primaryID;
let sql = `UPDATE maintenancevisittodos SET step = ?, asset = ?, task = ?, comment = ?, done = ? WHERE primaryID = ?`;
- const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, id])
+ const results = await ownConn.query(sql, [data.step, data.asset, data.task, data.comment, data.done, id])
results.insertId = results.insertId.toString();
result(null, results);
}
diff --git a/components/Dashboard.vue b/components/Dashboard.vue
index 70afc58..182529d 100644
--- a/components/Dashboard.vue
+++ b/components/Dashboard.vue
@@ -2,14 +2,22 @@
@@ -24,6 +32,7 @@ const store = useStore();
const modeChanged = computed(() => store.state.updateDarkMode);
const modeChangedLocalstorage = computed(() => store.state.modeDashboard);
const darkMode = ref('');
+const loggedInUsername = ref('');
const getSession = async () => {
if (modeChangedLocalstorage.value) {
@@ -37,6 +46,18 @@ const getSession = async () => {
}
}
+const goToMVIList = () => {
+ store.commit('activateFilteredUserTerm');
+ store.commit('activateFiltered');
+ store.commit('changeToInstancelist');
+};
+
+const goToPOIList = () => {
+ store.commit('activateFilteredUserTerm');
+ store.commit('activateFiltered');
+ store.commit('changeToInstancelist');
+};
+
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
@@ -105,7 +126,8 @@ export default {
gap: 2.5rem;
}
-input {
+input,
+button {
display: flex;
flex-direction: row;
align-items: center;
@@ -120,6 +142,10 @@ input {
font: 400 0.875rem/2rem Overpass, sans-serif;
}
+button:hover {
+ cursor: pointer;
+}
+
.input-darkmode {
color: #fff;
background-color: #343434;
diff --git a/components/server/Accounting.vue b/components/server/Accounting.vue
index 9225982..e84acc5 100644
--- a/components/server/Accounting.vue
+++ b/components/server/Accounting.vue
@@ -487,12 +487,14 @@ const addIssueSlip = async () => {
const time = today.getHours() + ":" + today.getMinutes();
const dateTime = date + ' ' + time;
let allFine = true;
- newOIs.value.forEach(oi => {
- if (oi.article.length === 0 && oi.amount.length === 0 && oi.price.length === 0 && oi.comment.length === 0) {
- alert(`Please add data for all ordering info.`);
- allFine = false
- }
- })
+ if (newOIs.value.length != 0) {
+ newOIs.value.forEach(oi => {
+ if (oi.article.length === 0 && oi.amount.length === 0 && oi.price.length === 0 && oi.comment.length === 0) {
+ alert(`Please add data for all ordering info.`);
+ allFine = false
+ }
+ })
+ }
if (!allFine) {
return
}
@@ -526,22 +528,24 @@ const addIssueSlip = async () => {
egressBillDate: newEgressBillDate.value,
egressBill: newEgressBill.value,
});
- newOIs.value.forEach(async oi => {
- try {
- const res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/addOrderingInfo`,
- {
- issueSlipID: response.data,
- article: oi.article,
- amount: oi.amount,
- price: oi.price,
- comment: oi.comment,
- });
- } catch (err) {
- console.log(err);
- }
- store.commit('resetStore');
- store.commit('changeToIssueSliplist');
- })
+ if (newOIs.value.length != 0) {
+ newOIs.value.forEach(async oi => {
+ try {
+ const res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/addOrderingInfo`,
+ {
+ issueSlipID: response.data,
+ article: oi.article,
+ amount: oi.amount,
+ price: oi.price,
+ comment: oi.comment,
+ });
+ } catch (err) {
+ console.log(err);
+ }
+ })
+ }
+ store.commit('resetStore');
+ store.commit('changeToIssueSliplist');
} catch (err) {
console.log(err.response.statusText);
}
diff --git a/components/server/InstanceChecklist.vue b/components/server/InstanceChecklist.vue
index 8560bde..07ca131 100644
--- a/components/server/InstanceChecklist.vue
+++ b/components/server/InstanceChecklist.vue
@@ -14,12 +14,12 @@
:class="['Task', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
Task
+ :class="['Comments', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode && !addBool ? 'Comments-darkmode' : '', !darkMode && !addBool ? 'Comments-lightmode' : '']">
Comments |
Done |
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ todo.rowID }} |
@@ -29,12 +29,10 @@
{{ todo.task }} |
-
- {{ todo.comments }} |
-
+ |
+
|
{
notes: newNotesPOI.value,
});
store.commit('resetStore');
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
store.commit('seeAllIcon');
poiTodos.value.forEach(async todo => {
@@ -328,6 +327,14 @@ export default {
gap: 0.625rem;
}
+.table-row-data {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ padding: 0.625rem;
+ gap: 0.625rem;
+}
+
.saveNewPOI-darkmode {
background: #2c2c2c;
color: #fff;
@@ -391,6 +398,10 @@ td {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
+td {
+ height: 5rem;
+}
+
th {
font: 700 0.875rem/1.875rem Overpass, sans-serif;
}
@@ -501,4 +512,10 @@ th {
.label-lightmode {
color: #000;
}
+
+textarea {
+ resize: none;
+ width: 20rem;
+ height: 5rem;
+}
\ No newline at end of file
diff --git a/components/server/InstanceChecklistMVI.vue b/components/server/InstanceChecklistMVI.vue
index 7954105..dd4a197 100644
--- a/components/server/InstanceChecklistMVI.vue
+++ b/components/server/InstanceChecklistMVI.vue
@@ -14,12 +14,12 @@
:class="['Task', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
Task
|
+ :class="['Comments', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode && !addBool ? 'Comments-darkmode' : '', !darkMode && !addBool ? 'Comments-lightmode' : '']">
Comments |
Done |
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ todo.rowID }} |
@@ -29,12 +29,11 @@
{{ todo.task }} |
-
- {{ todo.comments }} |
-
+ |
+
|
store.state.newCustomerMVI);
const newTemplateNotesMVI = computed(() => store.state.newTemplateNotesMVI);
const newTypeMVI = computed(() => store.state.newTypeMVI);
const newTimeSpentMVI = computed(() => store.state.newTimeSpentMVI);
-const newNotesMVI = computed(() => store.state.newNotes);
+const newNotesMVI = computed(() => store.state.newNotesMVI);
const editable = computed(() => store.state.editable);
const darkMode = ref('');
@@ -97,7 +96,12 @@ const getMVITodosById = async () => {
const response = await Axios.get(
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getTodosMaintenanceVisitTemplate/${chosenMVTId.value}`
);
- mviTodos.value = response.data;
+ const mviTodosComment = response.data;
+ // change the commets to comments
+ mviTodos.value = mviTodosComment.map(obj => {
+ const { commets: comments, ...rest } = obj;
+ return { ...rest, comments };
+ });
store.commit('updateMaintenanceVisitInstanceTemplateID', chosenMVTId.value)
} catch (err) {
console.log(err.response.statusText);
@@ -107,7 +111,12 @@ const getMVITodosById = async () => {
const response = await Axios.get(
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getTodosMaintenanceVisitTemplate/${newTemplateIDMVI.value}`
);
- mviTodos.value = response.data;
+ const mviTodosComment = response.data;
+ // change the commets to comments
+ mviTodos.value = mviTodosComment.map(obj => {
+ const { commets: comments, ...rest } = obj;
+ return { ...rest, comments };
+ });
} catch (err) {
console.log(err.response.statusText);
}
@@ -117,7 +126,7 @@ const getMVITodosById = async () => {
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getTodosMaintenanceVisitInstance/${chosenMVIId.value}`
);
const mviTodosComment = response.data;
- // change the comment und step field name to comments and rowID
+ // change the comment and step field name to comments and rowID
mviTodos.value = mviTodosComment.map(obj => {
const { step: rowID, comment: comments, ...rest } = obj;
return { ...rest, rowID, comments };
@@ -231,6 +240,7 @@ const addMVI = async () => {
notes: newNotesMVI.value,
});
store.commit('resetStore');
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
store.commit('seeAllIcon');
mviTodos.value.forEach(async todo => {
@@ -328,6 +338,14 @@ export default {
gap: 0.625rem;
}
+.table-row-data {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ padding: 0.625rem;
+ gap: 0.625rem;
+}
+
.saveNewMVI-darkmode {
background: #2c2c2c;
color: #fff;
@@ -391,6 +409,10 @@ td {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
+td {
+ height: 5rem;
+}
+
th {
font: 700 0.875rem/1.875rem Overpass, sans-serif;
}
@@ -501,4 +523,10 @@ th {
.label-lightmode {
color: #000;
}
+
+textarea {
+ resize: none;
+ width: 20rem;
+ height: 5rem;
+}
\ No newline at end of file
diff --git a/components/server/IssueSlip.vue b/components/server/IssueSlip.vue
index 0d049e8..9dee195 100644
--- a/components/server/IssueSlip.vue
+++ b/components/server/IssueSlip.vue
@@ -19,8 +19,12 @@
Ticket No.:
- {{ issueSlip.ticketNo }}
+
+ {{ issueSlip.ticketNo }}
+
User:
@@ -67,14 +71,15 @@
- Ticket No.:
+ Production order:
-
+
User:
@@ -131,6 +136,7 @@ const newCustomer = ref('');
const newUser = ref('');
const newNotes = ref('');
const newDeliveryAddress = ref('');
+const chosenTemplate = ref('');
// get issue slip from id
const getIssueSlipById = async () => {
@@ -146,13 +152,24 @@ const getIssueSlipById = async () => {
}
}
+const goToChosenPOI = (id) => {
+ store.commit('setChosenPOI', id);
+ store.commit('changeToInstance');
+};
+
// update issue slip fields in the store
-const updateIS = () => {
- const is = {
+const updateIS = async (newPoiId = -1) => {
+ let is = {};
+ if (!(newPoiId == '-1')) {
+ // Find the object with the selected Name
+ const selectedObject = productionOrders.value.find(obj => obj.name === newPoiId);
+ // Get the ticketNumber
+ newTicketNo.value = selectedObject ? selectedObject.ticketNumber : null;
+ }
+ is = {
customerId: newCustomerID.value,
customer: newCustomer.value,
- // ticketNo: newTicketNo.value,
- ticketNo: 1,
+ ticketNo: newTicketNo.value,
notes: newNotes.value,
user: newUser.value,
deliveryAddress: newDeliveryAddress.value,
@@ -218,15 +235,14 @@ const getCustomers = async () => {
}
}
-//get all production orders
+//get all productionOrder instances
const getProductionOrders = async () => {
- // try {
- // const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllCustomers`
- // );
- // customers.value = response.data;
- // } catch (err) {
- // console.log(err.response.statusText);
- // }
+ try {
+ const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderInstances`);
+ productionOrders.value = response.data;
+ } catch (err) {
+ console.log(err.response.statusText);
+ }
}
const confirmDeleteIssueSlip = async () => {
@@ -498,4 +514,16 @@ export default {
padding: 0.4rem;
border-radius: 0.3125rem;
}
+
+#nuxt-link {
+ text-decoration: none;
+}
+
+.nuxt-link-darkmode {
+ color: white;
+}
+
+.nuxt-link-lightmode {
+ color: #000;
+}
\ No newline at end of file
diff --git a/components/server/MaintenanceVisitsInstance.vue b/components/server/MaintenanceVisitsInstance.vue
index a2ba2bb..51af744 100644
--- a/components/server/MaintenanceVisitsInstance.vue
+++ b/components/server/MaintenanceVisitsInstance.vue
@@ -308,6 +308,7 @@ const confirmDeleteMVI = async () => {
}
store.commit('undoDelete');
store.commit('resetStore');
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
store.commit('seeAllIcon');
} else {
@@ -472,6 +473,7 @@ onMounted(async () => {
getSession();
await getMVIById();
await getMVTById();
+ triggerBackendCallsWithDelay(getUsers);
triggerBackendCallsWithDelay(getCustomers);
});
@@ -685,4 +687,8 @@ export default {
padding: 0.625rem 1.875rem 0.625rem 1.25rem;
padding-top: 0rem;
}
+
+.templateNotes {
+ padding-left: 1.8rem;
+}
\ No newline at end of file
diff --git a/components/server/MaintenanceVisitsInstanceTable.vue b/components/server/MaintenanceVisitsInstanceTable.vue
index 6afb68e..d259e49 100644
--- a/components/server/MaintenanceVisitsInstanceTable.vue
+++ b/components/server/MaintenanceVisitsInstanceTable.vue
@@ -1,7 +1,7 @@
+
@@ -18,8 +18,8 @@
:class="['ID', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
ID
- Maintenance type |
+ :class="['Name', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
+ Name
State |
@@ -42,8 +42,13 @@
|
- {{ instance.maintenanceType }} |
+ :class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
+
+ {{ instance.name }}
+
+
{{ instance.state }} |
@@ -74,14 +79,15 @@ const chosenMVTId = computed(() => store.state.chosenMVTId);
const searchable = computed(() => store.state.searchable);
const filtered = computed(() => store.state.filtered);
const notAllInstancesIcon = computed(() => store.state.notAllInstancesIcon);
+const filteredUserTerm = computed(() => store.state.filteredUserTerm);
const userSearchFilter = ref('');
-const stateSearchFilter = ref('');
+const nameSearchFilter = ref('');
const maintenanceVisitInstances = ref([]);
const darkMode = ref('');
const mvt = ref({});
const MVIByUser = ref([]);
-const MVIByState = ref([]);
+const MVIByName = ref([]);
const goToChosenMVI = (id) => {
store.commit('setChosenMIT', id);
@@ -109,14 +115,22 @@ const getMaintenanceVisitInstances = async () => {
// update search term
const updateSearchTerm = async () => {
- stateSearchFilter.value = '';
+ nameSearchFilter.value = '';
await getMaintenanceVisitInstances();
}
// update filter term
const updateFilterTerm = async () => {
- userSearchFilter.value = '';
+ if (filteredUserTerm.value) {
+ store.commit('activateFiltered');
+ userSearchFilter.value = getItem('logged-in-user-username');
+ } else {
+ userSearchFilter.value = '';
+ }
await getMaintenanceVisitInstances();
+ if (filteredUserTerm.value) {
+ await filterInstancesByUser();
+ }
}
// get maintenance visit template from id
@@ -135,14 +149,14 @@ const getMVTById = async () => {
}
//get all instances based on the searched state
-const filterMVIByState = async () => {
- if (stateSearchFilter.value === '') {
+const filterMVIByName = async () => {
+ if (nameSearchFilter.value === '') {
await getMaintenanceVisitInstances();
} else {
try {
- const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedMVIByState/${stateSearchFilter.value}`);
- MVIByState.value = response.data;
- maintenanceVisitInstances.value = filterObjectsWithMatchingIds(maintenanceVisitInstances.value, MVIByState.value);
+ const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedMVIByName/${nameSearchFilter.value}`);
+ MVIByName.value = response.data;
+ maintenanceVisitInstances.value = filterObjectsWithMatchingIds(maintenanceVisitInstances.value, MVIByName.value);
} catch (err) {
console.log(err.response.statusText);
}
@@ -179,6 +193,11 @@ const getSession = async () => {
}
}
+const getAll = async () => {
+ store.commit('resetFilterSearch');
+ await getMaintenanceVisitInstances();
+}
+
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
@@ -190,7 +209,7 @@ function getItem(item) {
watch(modeChanged, getSession)
watch(searchable, updateSearchTerm);
watch(filtered, updateFilterTerm);
-watch(notAllInstancesIcon, getMaintenanceVisitInstances);
+watch(notAllInstancesIcon, getAll);
onMounted(async () => {
getSession();
@@ -319,15 +338,15 @@ th {
border-right: 0.0625rem solid #8e8e8e;
}
-.MaintenanceType {
+.Name {
width: 15%;
}
-.MaintenanceType-darkmode {
+.Name-darkmode {
border-right: 0.0625rem solid #000000;
}
-.MaintenanceType-lightmode {
+.Name-lightmode {
border-right: 0.0625rem solid #8e8e8e;
}
diff --git a/components/server/ProductionOrdersInstance.vue b/components/server/ProductionOrdersInstance.vue
index dc6a156..55ea5d2 100644
--- a/components/server/ProductionOrdersInstance.vue
+++ b/components/server/ProductionOrdersInstance.vue
@@ -330,6 +330,7 @@ const confirmDeletePOI = async () => {
}
store.commit('undoDelete');
store.commit('resetStore');
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
store.commit('seeAllIcon');
} else {
diff --git a/components/server/ProductionOrdersInstanceTable.vue b/components/server/ProductionOrdersInstanceTable.vue
index 722ece7..de99d7e 100644
--- a/components/server/ProductionOrdersInstanceTable.vue
+++ b/components/server/ProductionOrdersInstanceTable.vue
@@ -1,7 +1,7 @@
@@ -17,6 +17,9 @@
Ticket No. |
+
+ Name |
Asset |
@@ -41,6 +44,14 @@
{{ instance.ticketNumber }}
+
+
+ {{ instance.name }}
+
+ |
store.state.chosenPOTId);
const searchable = computed(() => store.state.searchable);
const filtered = computed(() => store.state.filtered);
const notAllInstancesIcon = computed(() => store.state.notAllInstancesIcon);
+const filteredUserTerm = computed(() => store.state.filteredUserTerm);
const userSearchFilter = ref('');
-const stateSearchFilter = ref('');
+const nameSearchFilter = ref('');
const productionOrderInstances = ref([]);
const darkMode = ref('');
const pot = ref({});
const POIByUser = ref([]);
-const POIByState = ref([]);
+const POIByName = ref([]);
const goToChosenPOI = (id) => {
store.commit('setChosenPOI', id);
@@ -115,14 +127,22 @@ const getProductionOrderInstances = async () => {
// update search term
const updateSearchTerm = async () => {
- stateSearchFilter.value = '';
+ nameSearchFilter.value = '';
await getProductionOrderInstances();
}
// update filter term
const updateFilterTerm = async () => {
- userSearchFilter.value = '';
+ if (filteredUserTerm.value) {
+ store.commit('activateFiltered');
+ userSearchFilter.value = getItem('logged-in-user-username');
+ } else {
+ userSearchFilter.value = '';
+ }
await getProductionOrderInstances();
+ if (filteredUserTerm.value) {
+ await filterInstancesByUser();
+ }
}
// get production order template from id
@@ -157,14 +177,14 @@ const goToChosenAsset = async (name) => {
};
//get all instances based on the searched state
-const filterPOIByState = async () => {
- if (stateSearchFilter.value === '') {
+const filterPOIByName = async () => {
+ if (nameSearchFilter.value === '') {
await getProductionOrderInstances();
} else {
try {
- const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOIsByState/${stateSearchFilter.value}`);
- POIByState.value = response.data;
- productionOrderInstances.value = filterObjectsWithMatchingIds(productionOrderInstances.value, POIByState.value);
+ const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOIsByName/${nameSearchFilter.value}`);
+ POIByName.value = response.data;
+ productionOrderInstances.value = filterObjectsWithMatchingIds(productionOrderInstances.value, POIByName.value);
} catch (err) {
console.log(err.response.statusText);
}
@@ -201,6 +221,11 @@ const getSession = async () => {
}
}
+const getAll = async () => {
+ store.commit('resetFilterSearch');
+ await getProductionOrderInstances();
+}
+
function getItem(item) {
if (process.client) {
return localStorage.getItem(item)
@@ -212,7 +237,7 @@ function getItem(item) {
watch(modeChanged, getSession)
watch(searchable, updateSearchTerm);
watch(filtered, updateFilterTerm);
-watch(notAllInstancesIcon, getProductionOrderInstances);
+watch(notAllInstancesIcon, getAll);
onMounted(async () => {
getSession();
@@ -307,7 +332,7 @@ th {
}
.TicketNo {
- width: 15.83%;
+ width: 12.83%;
}
.TicketNo-darkmode {
@@ -318,9 +343,20 @@ th {
border-right: 0.0625rem solid #8e8e8e;
}
+.Name {
+ width: 18.83%;
+}
+
+.Name-darkmode {
+ border-right: 0.0625rem solid #000000;
+}
+
+.Name-lightmode {
+ border-right: 0.0625rem solid #8e8e8e;
+}
.Asset {
- width: 31.66%;
+ width: 15.83%;
}
.Asset-darkmode {
diff --git a/components/server/TemplateChecklist.vue b/components/server/TemplateChecklist.vue
index 8daaba7..1738401 100644
--- a/components/server/TemplateChecklist.vue
+++ b/components/server/TemplateChecklist.vue
@@ -17,7 +17,7 @@
| Comments |
|
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ todo.rowID }}
@@ -42,22 +42,15 @@
|
- {{
- todo.comments
- }} |
-
+
+
|
-
|
@@ -77,10 +70,10 @@
|
- |
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ newT.rowID }}
@@ -130,10 +123,10 @@
|
-
+ -
|
@@ -573,6 +566,14 @@ export default {
gap: 0.625rem;
}
+.table-row-data {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ padding: 0.625rem;
+ gap: 0.625rem;
+}
+
.tr-head-darkmode {
border-top: none;
border-bottom: 0.0625rem solid #000000;
@@ -594,13 +595,16 @@ export default {
th,
td {
height: 1.875rem;
- /* height: 1px; */
text-align: left;
padding: 0;
letter-spacing: 5%;
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
+td {
+ height: 5rem;
+}
+
th {
font: 700 0.875rem/1.875rem Overpass, sans-serif;
}
@@ -702,9 +706,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 10rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.saveNewPOT-darkmode {
@@ -724,9 +730,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 15.8rem;
+ margin-left: 6rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deleteLastPOTTodos-darkmode {
@@ -735,9 +743,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 15.8rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
@@ -758,9 +768,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 10rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deletePOTTodos-lightmode {
@@ -769,9 +781,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 15.8rem;
+ margin-left: 6rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deleteLastPOTTodos-lightmode {
@@ -780,9 +794,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 2rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.saveNewPOT-lightmode {
@@ -824,44 +840,9 @@ th {
text-align: right;
}
-
-/* .input-span {
- border: none;
-} */
-
-/* .input,
-.textarea {
- border: 1px solid #ccc;
- font-family: inherit;
- font-size: inherit;
- padding: 1px 6px;
-} */
-
-/* .input-wrap {
- position: relative;
+textarea {
+ resize: none;
+ width: 20rem;
+ height: 5rem;
}
-
-.input-wrap .input {
- position: absolute;
- width: 100%;
- left: 0;
-}
-
-.width-machine {
- padding: 0 1rem;
-}
-
-.textarea {
- display: block;
- width: 100%;
- overflow: hidden;
- resize: both;
- min-height: 40px;
- line-height: 20px;
-}
-
-.textarea[contenteditable]:empty::before {
- content: "Placeholder still possible";
- color: gray;
-} */
\ No newline at end of file
diff --git a/components/server/TemplateChecklistMVT.vue b/components/server/TemplateChecklistMVT.vue
index e76c688..f6ce9a2 100644
--- a/components/server/TemplateChecklistMVT.vue
+++ b/components/server/TemplateChecklistMVT.vue
@@ -17,7 +17,7 @@
Comments |
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ todo.rowID }}
@@ -42,17 +42,15 @@
|
- {{
- todo.commets
- }} |
-
+
+ -
|
-
|
@@ -72,10 +70,10 @@
|
-
+
+ Save -
@@ -106,7 +104,7 @@
| Comments |
|
+ :class="['table-row-data', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
{{ newT.rowID }}
@@ -125,10 +123,10 @@
|
-
+
+ -
|
@@ -522,6 +520,14 @@ export default {
gap: 0.625rem;
}
+.table-row-data {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+ padding: 0.625rem;
+ gap: 0.625rem;
+}
+
.tr-head-darkmode {
border-top: none;
border-bottom: 0.0625rem solid #000000;
@@ -549,6 +555,10 @@ td {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
}
+td {
+ height: 5rem;
+}
+
th {
font: 700 0.875rem/1.875rem Overpass, sans-serif;
}
@@ -651,9 +661,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 10rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.saveNewMVT-darkmode {
@@ -673,9 +685,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 15.8rem;
+ margin-left: 6rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deleteLastMvtTodos-darkmode {
@@ -684,9 +698,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 2rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
@@ -707,9 +723,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 10rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deleteMvtTodos-lightmode {
@@ -718,9 +736,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 15.8rem;
+ margin-left: 6rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.deleteLastMvtTodos-lightmode {
@@ -729,9 +749,11 @@ th {
font: 400 0.875rem/1.875rem Overpass, sans-serif;
border: none;
border-radius: 0.625rem;
- margin-left: 2rem;
+ margin-left: 1rem;
padding-left: 0.9rem;
padding-right: 0.9rem;
+ height: 2.1rem;
+ margin-top: 1.5rem;
}
.saveNewMVT-lightmode {
@@ -772,4 +794,10 @@ th {
#editMvtTodos {
text-align: right;
}
+
+textarea {
+ resize: none;
+ width: 20rem;
+ height: 5rem;
+}
\ No newline at end of file
diff --git a/components/server/UserRightsList.vue b/components/server/UserRightsList.vue
deleted file mode 100644
index 41c18d3..0000000
--- a/components/server/UserRightsList.vue
+++ /dev/null
@@ -1,215 +0,0 @@
-
\ No newline at end of file
diff --git a/layouts/Actionbar.vue b/layouts/Actionbar.vue
index 74e6c19..e7cc993 100644
--- a/layouts/Actionbar.vue
+++ b/layouts/Actionbar.vue
@@ -211,9 +211,11 @@ const toggleActionbar = () => {
isExpanded.value = !isExpanded.value;
};
const toggleFiltered = () => {
+ store.commit('deactivateSearch');
store.commit('toggleFiltered');
};
const toggleSearched = () => {
+ store.commit('deactivateSearch');
store.commit('toggleSearchable');
};
const add = () => {
@@ -233,10 +235,12 @@ const changeToSolutions = () => {
}
const changeToInstancelist = () => {
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
}
const changeToAllInstances = () => {
+ store.commit('deactivateSearch');
store.commit('changeToInstancelist');
store.commit('seeAllIcon');
}
diff --git a/plugins/vuex.js b/plugins/vuex.js
index 6a3ce0d..05c91bb 100644
--- a/plugins/vuex.js
+++ b/plugins/vuex.js
@@ -12,6 +12,7 @@ const store = createStore({
customerChanged: false,
changedCustomerId: -1,
filteredByCustomer: '',
+ filteredUserTerm: false,
addIcon: false,
addSolutionIcon: false,
@@ -882,6 +883,19 @@ const store = createStore({
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) {
@@ -971,6 +985,7 @@ const store = createStore({
state.deleteBool = false
state.chosenAssetId = -1
state.filteredByCustomer = ''
+ state.filteredUserTerm = false
state.new = false
state.customerChanged = false
state.changedCustomerId = -1
diff --git a/server/api/getSelectedMVIByName/[id].ts b/server/api/getSelectedMVIByName/[id].ts
new file mode 100644
index 0000000..c996ab7
--- /dev/null
+++ b/server/api/getSelectedMVIByName/[id].ts
@@ -0,0 +1,23 @@
+import { selectedMITsByName, errorMsg } from "../../middleware/maintenanceVisitInstances";
+import { OutgoingMessage } from 'http';
+
+export default defineEventHandler(async (event) => {
+
+ const headers: Record[1]> = {
+ 'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
+ 'Access-Control-Allow-Headers': 'authorization, content-type',
+ 'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
+ 'Access-Control-Allow-Credentials': 'true',
+ };
+ setResponseHeaders(event, headers)
+
+ if (!(errorMsg === '')) {
+ throw createError({
+ statusCode: 400,
+ statusMessage: errorMsg,
+ })
+ }
+
+ setResponseStatus(event, 200)
+ return selectedMITsByName
+})
diff --git a/server/api/getSelectedPOIsByName/[id].ts b/server/api/getSelectedPOIsByName/[id].ts
new file mode 100644
index 0000000..ec84f1f
--- /dev/null
+++ b/server/api/getSelectedPOIsByName/[id].ts
@@ -0,0 +1,23 @@
+import { selectedPOIsByName, errorMsg } from "../../middleware/productionOrders";
+import { OutgoingMessage } from 'http';
+
+export default defineEventHandler(async (event) => {
+
+ const headers: Record[1]> = {
+ 'Access-Control-Allow-Origin': 'https://tueitapp.tueit.de',
+ 'Access-Control-Allow-Headers': 'authorization, content-type',
+ 'Access-Control-Allow-Methods': 'OPTIONS,GET,HEAD,PUT,PATCH,POST,DELETE',
+ 'Access-Control-Allow-Credentials': 'true',
+ };
+ setResponseHeaders(event, headers)
+
+ if (!(errorMsg === '')) {
+ throw createError({
+ statusCode: 400,
+ statusMessage: errorMsg,
+ })
+ }
+
+ setResponseStatus(event, 200)
+ return selectedPOIsByName
+})
diff --git a/server/middleware/maintenanceVisitInstances.ts b/server/middleware/maintenanceVisitInstances.ts
index a329c9d..c1d3efa 100644
--- a/server/middleware/maintenanceVisitInstances.ts
+++ b/server/middleware/maintenanceVisitInstances.ts
@@ -8,6 +8,7 @@ let selectedMITsByMVT = [];
let selectedMITsByState = [];
let selectedMITsByUser = [];
let selectedMITsByCustomer = [];
+let selectedMITsByName = [];
let mviTodosByTemplateId = [];
let mvi = [];
let insertId = -1;
@@ -176,7 +177,7 @@ export default defineEventHandler(async (event) => {
}
}
- if (event.path.startsWith("/api/getSelectedMITsByMVT")) {
+ if (event.path.startsWith("/api/getSelectedMVIByMVT")) {
// get selected maintenance visit instances object by mvt from backend
let filteredMVT = null;
const path = event._path;
@@ -241,7 +242,7 @@ export default defineEventHandler(async (event) => {
}
}
- if (event.path.startsWith("/api/getSelectedMITsByUser")) {
+ if (event.path.startsWith("/api/getSelectedMVIByUser")) {
// get selected maintenance visit instances object by user from backend
let filteredUser = null;
const path = event._path;
@@ -273,6 +274,38 @@ export default defineEventHandler(async (event) => {
}
}
+ if (event.path.startsWith("/api/getSelectedMVIByName")) {
+ // get selected maintenance visit instances object by name from backend
+ let filteredName = null;
+ const path = event._path;
+ const pathSegments = path.split('/');
+ filteredName = pathSegments[pathSegments.length - 1];
+
+ try {
+ let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedMaintenanceVisitsByChecklistname/${filteredName}`);
+ selectedMITsByName = res.data;
+ } catch (err) {
+ if (axios.isAxiosError(err)) {
+ const axiosError = err as AxiosError;
+
+ if (axiosError.response) {
+ // Axios error
+ console.error(axiosError.response.data.message);
+ errorMsg = axiosError.response.data.message;
+ } else if (axiosError.request) {
+ // If error was caused by the request
+ console.error(axiosError.request);
+ } else {
+ // Other errors
+ console.error('Error', axiosError.message);
+ }
+ } else {
+ // No AxiosError
+ console.error('Error', err);
+ }
+ }
+ }
+
if (event.path.startsWith("/api/getSelectedMITsByState")) {
// get selected maintenance visit instances object by state from backend
let filteredState = null;
@@ -522,4 +555,4 @@ export default defineEventHandler(async (event) => {
}
})
-export { maintenanceVisitInstances, selectedMITsByState, selectedMITsByUser, selectedMITsByMVT, selectedMITsByMIT, selectedMITsByCustomer, mviTodosByTemplateId, mvi, insertId, errorMsg };
\ No newline at end of file
+export { maintenanceVisitInstances, selectedMITsByState, selectedMITsByUser, selectedMITsByName, selectedMITsByMVT, selectedMITsByMIT, selectedMITsByCustomer, mviTodosByTemplateId, mvi, insertId, errorMsg };
\ No newline at end of file
diff --git a/server/middleware/productionOrders.ts b/server/middleware/productionOrders.ts
index cb7ef8f..dee04f5 100644
--- a/server/middleware/productionOrders.ts
+++ b/server/middleware/productionOrders.ts
@@ -8,6 +8,7 @@ let selectedPOIsByPOT = [];
let selectedPOIsByState = [];
let selectedPOIsByUser = [];
let selectedPOIsByCustomer = [];
+let selectedPOIsByName = [];
let poiTodosByTemplateId = [];
let poi = [];
let insertId = -1;
@@ -241,6 +242,38 @@ export default defineEventHandler(async (event) => {
}
}
+ if (event.path.startsWith("/api/getSelectedPOIsByName")) {
+ // get selected production order instances object by name from backend
+ let filteredName = null;
+ const path = event._path;
+ const pathSegments = path.split('/');
+ filteredName = pathSegments[pathSegments.length - 1];
+
+ try {
+ let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedProductionOrdersByChecklistname/${filteredName}`);
+ selectedPOIsByName = res.data;
+ } catch (err) {
+ if (axios.isAxiosError(err)) {
+ const axiosError = err as AxiosError;
+
+ if (axiosError.response) {
+ // Axios error
+ console.error(axiosError.response.data.message);
+ errorMsg = axiosError.response.data.message;
+ } else if (axiosError.request) {
+ // If error was caused by the request
+ console.error(axiosError.request);
+ } else {
+ // Other errors
+ console.error('Error', axiosError.message);
+ }
+ } else {
+ // No AxiosError
+ console.error('Error', err);
+ }
+ }
+ }
+
if (event.path.startsWith("/api/getSelectedPOIsByState")) {
// get selected production order instances object by state from backend
let filteredState = null;
@@ -458,4 +491,4 @@ export default defineEventHandler(async (event) => {
}
})
-export { productionOrderInstances, selectedPOIsByState, selectedPOIsByUser, selectedPOIsByPOT, selectedPOIsByPOI, selectedPOIsByCustomer, poiTodosByTemplateId, poi, insertId, errorMsg };
\ No newline at end of file
+export { productionOrderInstances, selectedPOIsByState, selectedPOIsByUser, selectedPOIsByPOT, selectedPOIsByPOI, selectedPOIsByName, selectedPOIsByCustomer, poiTodosByTemplateId, poi, insertId, errorMsg };
\ No newline at end of file