productionOrders #19
@ -89,7 +89,7 @@ export const insertConfigItem = async (data, result) => {
|
|||||||
//get all selected config items by customer
|
//get all selected config items by customer
|
||||||
export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changedb WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM changedb WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ export const getSelectedConfigItemsByCustomer = async (selected, result) => {
|
|||||||
//get all selected config items by asset name
|
//get all selected config items by asset name
|
||||||
export const getSelectedConfigItemsByAssetName = async (selected, result) => {
|
export const getSelectedConfigItemsByAssetName = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM changedb WHERE assetName LIKE '%${selected}%' ORDER BY assetName ASC`;
|
let sql = `SELECT * FROM changedb WHERE LOWER(assetName) LIKE '%${selected.toLowerCase()}%' ORDER BY assetName ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const getCustomers = async (result) => {
|
|||||||
//get all selected customers
|
//get all selected customers
|
||||||
export const getSelectedCustomers = async (selected, result) => {
|
export const getSelectedCustomers = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM customers WHERE customername LIKE '%${selected}%' ORDER BY customername ASC`;
|
let sql = `SELECT * FROM customers WHERE LOWER(customername) LIKE '%${selected.toLowerCase()}%' ORDER BY customername ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export const getSelectedIssueSlipsByTicketnumber = async (selected, result) => {
|
|||||||
//get all selected issue slips by customer
|
//get all selected issue slips by customer
|
||||||
export const getSelectedIssueSlipsByCustomer = async (selected, result) => {
|
export const getSelectedIssueSlipsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issueslips WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM issueslips WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export const getSelectedIssueVariantsByIssueId = async (selected, result) => {
|
|||||||
//get all selected issue variants by name
|
//get all selected issue variants by name
|
||||||
export const getSelectedIssueVariantsByName = async (selected, result) => {
|
export const getSelectedIssueVariantsByName = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM issuevariants WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM issuevariants WHERE LOWER(name) LIKE '%${selected.toLowerCase()}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const getMaintenanceVisits = async (result) => {
|
|||||||
//get all selected maintenance visits by checklistname
|
//get all selected maintenance visits by checklistname
|
||||||
export const getSelectedMaintenanceVisitsByChecklistname = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenancevisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE LOWER(name) LIKE '%${selected.toLowerCase()}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMaintenanceVisitsByChecklistname = async (selected, resu
|
|||||||
//get all selected maintenance visits by customer
|
//get all selected maintenance visits by customer
|
||||||
export const getSelectedMaintenanceVisitsByCustomer = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenancevisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const getSelectedMaintenanceVisitsByDate = async (selected, result) => {
|
|||||||
//get all selected maintenance visits by state
|
//get all selected maintenance visits by state
|
||||||
export const getSelectedMaintenanceVisitsByState = async (selected, result) => {
|
export const getSelectedMaintenanceVisitsByState = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM maintenancevisits WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
let sql = `SELECT * FROM maintenancevisits WHERE LOWER(state) LIKE '%${selected.toLowerCase()}%' ORDER BY state ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const getMasterMaintenanceVisits = async (result) => {
|
|||||||
//get all selected master maintenance visits by customer
|
//get all selected master maintenance visits by customer
|
||||||
export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, result) => {
|
export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM mastermaintenancevisits WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM mastermaintenancevisits WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMasterMaintenanceVisitsByCustomer = async (selected, res
|
|||||||
//get all selected master maintenance visits by checklistname
|
//get all selected master maintenance visits by checklistname
|
||||||
export const getSelectedMasterMaintenanceVisitsByChecklistname = async (selected, result) => {
|
export const getSelectedMasterMaintenanceVisitsByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM mastermaintenancevisits WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM mastermaintenancevisits WHERE LOWER(name) LIKE '%${selected.toLowerCase()}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,8 +18,9 @@ export const getMasterProductionOrderTodoById = async (id, result) => {
|
|||||||
export const updateMasterProductionOrderTodoById = async (data, result) => {
|
export const updateMasterProductionOrderTodoById = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const id = data.primaryID;
|
const id = data.primaryID;
|
||||||
let sql = `UPDATE masterordertodos SET templateID = ?, asset = ? , task = ?, comment = ? WHERE primaryID = ?`;
|
let sql = `UPDATE masterordertodos SET templateID = ?, asset = ? , task = ?, comments = ? WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comment, id])
|
const results = await ownConn.query(sql, [data.templateID, data.asset, data.task, data.comments, id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -35,6 +36,7 @@ export const deleteMasterProductionOrderTodoById = async (id, result) => {
|
|||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterordertodos WHERE primaryID = ?`;
|
let sql = `DELETE FROM masterordertodos WHERE primaryID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -49,6 +51,7 @@ export const deleteMasterProductionOrderTodoByTemplateId = async (id, result) =>
|
|||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterordertodos WHERE templateID = ?`;
|
let sql = `DELETE FROM masterordertodos WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -79,7 +82,8 @@ export const updateMasterProductionOrderTodos = async (data, result) => {
|
|||||||
//insert master production order todo to databased
|
//insert master production order todo to databased
|
||||||
export const insertMasterProductionOrderTodo = async (data, result) => {
|
export const insertMasterProductionOrderTodo = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterordertodos(templateID, rowID, asset, task, comment) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
|
const results = await ownConn.query(`INSERT INTO masterordertodos(templateID, rowID, asset, task, comments) VALUES(?, ?, ?, ?, ?)`, [data.templateID, data.rowID, data.asset, data.task, data.comment])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export const getMasterProductionOrders = async (result) => {
|
|||||||
//get all selected master production orders by customer
|
//get all selected master production orders by customer
|
||||||
export const getSelectedMasterProductionOrdersByCustomer = async (selected, result) => {
|
export const getSelectedMasterProductionOrdersByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterproductionorders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM masterproductionorders WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ export const getSelectedMasterProductionOrdersByCustomer = async (selected, resu
|
|||||||
//get all selected master production orders by checklistname
|
//get all selected master production orders by checklistname
|
||||||
export const getSelectedMasterProductionOrdersByChecklistname = async (selected, result) => {
|
export const getSelectedMasterProductionOrdersByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM masterproductionorders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM masterproductionorders WHERE LOWER(name) LIKE '%${selected.toLowerCase()}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -62,6 +62,7 @@ export const updateMasterProductionOrderById = async (data, result) => {
|
|||||||
const id = data.templateID;
|
const id = data.templateID;
|
||||||
let sql = `UPDATE masterproductionorders SET name = ?, customerID = ? , customer = ?, lastView = ?, user = ?, description = ?, notes = ? WHERE templateID = ?`;
|
let sql = `UPDATE masterproductionorders SET name = ?, customerID = ? , customer = ?, lastView = ?, user = ?, description = ?, notes = ? WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes, id])
|
const results = await ownConn.query(sql, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes, id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -75,6 +76,7 @@ export const updateMasterProductionOrderById = async (data, result) => {
|
|||||||
export const insertMasterProductionOrder = async (data, result) => {
|
export const insertMasterProductionOrder = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO masterproductionorders(name, customerID, customer, lastView, user, description, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes])
|
const results = await ownConn.query(`INSERT INTO masterproductionorders(name, customerID, customer, lastView, user, description, notes) VALUES(?, ?, ?, ?, ?, ?, ?)`, [data.name, data.customerID, data.customer, data.lastView, data.user, data.description, data.notes])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -89,6 +91,7 @@ export const deleteMasterProductionOrderById = async (id, result) => {
|
|||||||
try {
|
try {
|
||||||
let sql = `DELETE FROM masterproductionorders WHERE templateID = ?`;
|
let sql = `DELETE FROM masterproductionorders WHERE templateID = ?`;
|
||||||
const results = await ownConn.query(sql, [id])
|
const results = await ownConn.query(sql, [id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export const getSelectedProductionOrdersByTicketnumber = async (selected, result
|
|||||||
//get all selected production orders by customer
|
//get all selected production orders by customer
|
||||||
export const getSelectedProductionOrdersByCustomer = async (selected, result) => {
|
export const getSelectedProductionOrdersByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionorders WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM productionorders WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ export const getSelectedProductionOrdersByCustomer = async (selected, result) =>
|
|||||||
//get all selected production orders by state
|
//get all selected production orders by state
|
||||||
export const getSelectedProductionOrdersByState = async (selected, result) => {
|
export const getSelectedProductionOrdersByState = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionorders WHERE state LIKE '%${selected}%' ORDER BY state ASC`;
|
let sql = `SELECT * FROM productionorders WHERE LOWER(state) LIKE '%${selected.toLowerCase()}%' ORDER BY state ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ export const getSelectedProductionOrdersByState = async (selected, result) => {
|
|||||||
//get all selected production orders by checklistname
|
//get all selected production orders by checklistname
|
||||||
export const getSelectedProductionOrdersByChecklistname = async (selected, result) => {
|
export const getSelectedProductionOrdersByChecklistname = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM productionorders WHERE name LIKE '%${selected}%' ORDER BY name ASC`;
|
let sql = `SELECT * FROM productionorders WHERE LOWER(name) LIKE '%${selected.toLowerCase()}%' ORDER BY name ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -102,6 +102,7 @@ export const deleteProductionOrderById = async (id, result) => {
|
|||||||
export const insertProductionOrder = async (data, result) => {
|
export const insertProductionOrder = async (data, result) => {
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.query(`INSERT INTO productionorders(name, templateID, customer, customerID, asset, state, creationDate, completionDate, user, templateDescription, templateNotes, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.customer, data.customerID, data.asset, data.state, data.creationDate, data.completionDate, data.user, data.templateDescription, data.templateNotes, data.timeSpent, data.notes])
|
const results = await ownConn.query(`INSERT INTO productionorders(name, templateID, customer, customerID, asset, state, creationDate, completionDate, user, templateDescription, templateNotes, timeSpent, notes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [data.name, data.templateID, data.customer, data.customerID, data.asset, data.state, data.creationDate, data.completionDate, data.user, data.templateDescription, data.templateNotes, data.timeSpent, data.notes])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@ -145,6 +146,7 @@ export const updateProductionOrderStateById = async (data, result) => {
|
|||||||
try {
|
try {
|
||||||
let sql = `UPDATE productionorders SET state = ? WHERE ticketNumber = ?`;
|
let sql = `UPDATE productionorders SET state = ? WHERE ticketNumber = ?`;
|
||||||
const results = await ownConn.query(sql, [data.state, id])
|
const results = await ownConn.query(sql, [data.state, id])
|
||||||
|
results.insertId = results.insertId.toString();
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|||||||
@ -73,7 +73,7 @@ export const updateSolutionById = async (data, result) => {
|
|||||||
//get all selected solutions by customer
|
//get all selected solutions by customer
|
||||||
export const getSelectedSolutionsByCustomer = async (selected, result) => {
|
export const getSelectedSolutionsByCustomer = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM solutions WHERE customer LIKE '%${selected}%' ORDER BY customer ASC`;
|
let sql = `SELECT * FROM solutions WHERE LOWER(customer) LIKE '%${selected.toLowerCase()}%' ORDER BY customer ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ export const getSelectedSolutionsByCustomer = async (selected, result) => {
|
|||||||
|
|
||||||
//get all selected solutions by solution name
|
//get all selected solutions by solution name
|
||||||
export const getSelectedSolutionsBySolutionName = async (selected, result) => {
|
export const getSelectedSolutionsBySolutionName = async (selected, result) => {
|
||||||
let sql = `SELECT * FROM solutions WHERE solutionName LIKE '%${selected}%' ORDER BY solutionName ASC`;
|
let sql = `SELECT * FROM solutions WHERE LOWER(solutionName) LIKE '%${selected.toLowerCase()}%' ORDER BY solutionName ASC`;
|
||||||
try {
|
try {
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
@ -101,7 +101,7 @@ export const getSelectedSolutionsBySolutionName = async (selected, result) => {
|
|||||||
//get all selected solutions by asset name
|
//get all selected solutions by asset name
|
||||||
export const getSelectedSolutionsByAssetName = async (selected, result) => {
|
export const getSelectedSolutionsByAssetName = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM solutions WHERE assetName LIKE '%${selected}%' ORDER BY assetName ASC`;
|
let sql = `SELECT * FROM solutions WHERE LOWER(assetName) LIKE '%${selected.toLowerCase()}%' ORDER BY assetName ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
@ -115,7 +115,7 @@ export const getSelectedSolutionsByAssetName = async (selected, result) => {
|
|||||||
//get all selected solutions by type
|
//get all selected solutions by type
|
||||||
export const getSelectedSolutionsByType = async (selected, result) => {
|
export const getSelectedSolutionsByType = async (selected, result) => {
|
||||||
try {
|
try {
|
||||||
let sql = `SELECT * FROM solutions WHERE type LIKE '%${selected}%' ORDER BY solutionName ASC`;
|
let sql = `SELECT * FROM solutions WHERE LOWER(type) LIKE '%${selected.toLowerCase()}%' ORDER BY solutionName ASC`;
|
||||||
const results = await ownConn.execute(sql)
|
const results = await ownConn.execute(sql)
|
||||||
result(null, results);
|
result(null, results);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -264,8 +264,8 @@ router.put("/masterProductionOrderTodos", updateMasterProductionOrderTodo);
|
|||||||
// Delete master production order todo
|
// Delete master production order todo
|
||||||
router.delete("/masterProductionOrderTodos/:id", deleteMasterProductionOrderTodo);
|
router.delete("/masterProductionOrderTodos/:id", deleteMasterProductionOrderTodo);
|
||||||
|
|
||||||
// Delete master production order todo by customer id
|
// Delete master production order todo by template id
|
||||||
router.delete("/masterProductionOrderTodosByCustomerid/:id", deleteMasterProductionOrderTodoByTemplateIds);
|
router.delete("/masterProductionOrderTodosByTemplateid/:id", deleteMasterProductionOrderTodoByTemplateIds);
|
||||||
|
|
||||||
// Update all master production order todos
|
// Update all master production order todos
|
||||||
router.put("/allMasterProductionOrderTodos", updateAllProductionOrderTodos)
|
router.put("/allMasterProductionOrderTodos", updateAllProductionOrderTodos)
|
||||||
|
|||||||
@ -13,9 +13,9 @@ import { useStore } from 'vuex';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const filtered = computed(() => store.state.assetFiltered);
|
const filtered = computed(() => store.state.filtered);
|
||||||
const filteredTerm = computed(() => store.state.filteredAssetbyClient);
|
const filteredTerm = computed(() => store.state.filteredByClient);
|
||||||
const clientFilter = ref(store.state.filteredAssetbyClient);
|
const clientFilter = ref(store.state.filteredByClient);
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ const updateFilterTerm = () => {
|
|||||||
|
|
||||||
// update the filtered term in the store
|
// update the filtered term in the store
|
||||||
const filterConfigItemList = () => {
|
const filterConfigItemList = () => {
|
||||||
store.commit('updateAssetFilterbyClient', clientFilter.value);
|
store.commit('updateFilterbyClient', clientFilter.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(filteredTerm, updateFilterTerm)
|
watch(filteredTerm, updateFilterTerm)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section v-if="!addAssetBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="!addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<h2 v-if="!editable" :class="['asset-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{
|
<h2 v-if="!editable" :class="['asset-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{
|
||||||
item.assetName }}</h2>
|
item.assetName }}</h2>
|
||||||
<input v-if="editable" v-model="item.assetName" @change="updateConfigItem()"
|
<input v-if="editable" v-model="item.assetName" @change="updateConfigItem()"
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section v-if="addAssetBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<input v-model="newAssetName" @change="updateAsset()"
|
<input v-model="newAssetName" @change="updateAsset()"
|
||||||
:class="['data', 'asset-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
|
:class="['data', 'asset-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
@ -153,10 +153,10 @@ import { useStore } from 'vuex';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const editable = computed(() => store.state.assetEditable);
|
const editable = computed(() => store.state.editable);
|
||||||
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
||||||
const deleteAssetBool = computed(() => store.state.deleteAsset);
|
const deleteBool = computed(() => store.state.deleteBool);
|
||||||
const addAssetBool = computed(() => store.state.newAsset);
|
const addBool = computed(() => store.state.new);
|
||||||
|
|
||||||
const darkMode = ref(true);
|
const darkMode = ref(true);
|
||||||
const item = ref({});
|
const item = ref({});
|
||||||
@ -176,7 +176,7 @@ const newState = ref('');
|
|||||||
|
|
||||||
// get config item from id
|
// get config item from id
|
||||||
const getItemById = async () => {
|
const getItemById = async () => {
|
||||||
if (!addAssetBool.value) {
|
if (!addBool.value) {
|
||||||
try {
|
try {
|
||||||
const response = await Axios.get(
|
const response = await Axios.get(
|
||||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
@ -275,17 +275,17 @@ const getCustomers = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const confirmDeleteAsset = async () => {
|
const confirmDeleteAsset = async () => {
|
||||||
if (deleteAssetBool.value === true) {
|
if (deleteBool.value === true) {
|
||||||
if (confirm("Do you really want to delete this config item? It cannot be undone!")) {
|
if (confirm("Do you really want to delete this config item? It cannot be undone!")) {
|
||||||
try {
|
try {
|
||||||
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteConfigItem/${chosenAssetId.value}`);
|
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteConfigItem/${chosenAssetId.value}`);
|
||||||
store.commit('undoDeleteAsset');
|
store.commit('undoDelete');
|
||||||
store.commit('changeToAssetlist');
|
store.commit('changeToAssetlist');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err.response.statusText);
|
console.log(err.response.statusText);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
store.commit('undoDeleteAsset');
|
store.commit('undoDelete');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -330,7 +330,7 @@ const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
|
|||||||
}, 1500);
|
}, 1500);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(deleteAssetBool, confirmDeleteAsset);
|
watch(deleteBool, confirmDeleteAsset);
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getItemById();
|
getItemById();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section v-if="assetSearchable" :class="['asset-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="searchable" :class="['asset-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['clientLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Config item</div>
|
<div :class="['clientLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Config item</div>
|
||||||
<input v-model="assetSearchFilter" @change="searchConfigItem()"
|
<input v-model="assetSearchFilter" @change="searchConfigItem()"
|
||||||
:class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
:class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
@ -31,9 +31,6 @@
|
|||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
<!-- <router-link to="/assets" class="button"
|
|
||||||
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']" > {{
|
|
||||||
item.assetName }} </router-link> -->
|
|
||||||
<nuxt-link to="/assets" id="nuxt-link" class="button"
|
<nuxt-link to="/assets" id="nuxt-link" class="button"
|
||||||
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||||
@click="goToChosenAsset(item.primaryID)">
|
@click="goToChosenAsset(item.primaryID)">
|
||||||
@ -66,8 +63,8 @@ const goToChosenAsset = (id) => {
|
|||||||
store.commit('setChosenAsset', id);
|
store.commit('setChosenAsset', id);
|
||||||
store.commit('changeToAsset');
|
store.commit('changeToAsset');
|
||||||
};
|
};
|
||||||
const clientFilter = computed(() => store.state.filteredAssetbyClient);
|
const clientFilter = computed(() => store.state.filteredByClient);
|
||||||
const assetSearchable = computed(() => store.state.assetSearchable);
|
const searchable = computed(() => store.state.searchable);
|
||||||
|
|
||||||
const assetSearchFilter = ref('');
|
const assetSearchFilter = ref('');
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
@ -118,7 +115,7 @@ const searchConfigItem = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
watch(clientFilter, getConfigItems);
|
watch(clientFilter, getConfigItems);
|
||||||
watch(assetSearchable, updateSearchTerm);
|
watch(searchable, updateSearchTerm);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getConfigItems();
|
await getConfigItems();
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section v-if="hardwareBoolean && !addAssetBool"
|
<section v-if="hardwareBoolean && !addBool"
|
||||||
:class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
:class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
@ -54,7 +54,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section v-if="addAssetBool" :class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="addBool" :class="['hardware-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="hardware">Hardware specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<div class="model-CPU">
|
<div class="model-CPU">
|
||||||
@ -111,9 +111,9 @@ import { useStore } from 'vuex';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const editable = computed(() => store.state.assetEditable);
|
const editable = computed(() => store.state.editable);
|
||||||
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
||||||
const addAssetBool = computed(() => store.state.newAsset);
|
const addBool = computed(() => store.state.new);
|
||||||
|
|
||||||
const newHardwareBool = ref(true);
|
const newHardwareBool = ref(true);
|
||||||
const newModel = ref('');
|
const newModel = ref('');
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section v-if="networkBoolean && !addAssetBool"
|
<section v-if="networkBoolean && !addBool"
|
||||||
:class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
:class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
@ -37,7 +37,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section v-if="addAssetBool" :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="addBool" :class="['network-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
<div :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']" id="network">Network specifications:</div>
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<div class="IPv4-MAC">
|
<div class="IPv4-MAC">
|
||||||
@ -66,7 +66,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section v-if="addAssetBool" id="saveNewItem">
|
<section v-if="addBool" id="saveNewItem">
|
||||||
<button :class="[darkMode ? 'saveNewItem-darkmode' : 'saveNewItem-lightmode']" @click="addItem()">Safe</button>
|
<button :class="[darkMode ? 'saveNewItem-darkmode' : 'saveNewItem-lightmode']" @click="addItem()">Safe</button>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
@ -80,9 +80,9 @@ import { useStore } from 'vuex';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const editable = computed(() => store.state.assetEditable);
|
const editable = computed(() => store.state.editable);
|
||||||
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
||||||
const addAssetBool = computed(() => store.state.newAsset);
|
const addBool = computed(() => store.state.new);
|
||||||
const newAssetName = computed(() => store.state.newAssetName);
|
const newAssetName = computed(() => store.state.newAssetName);
|
||||||
const newCustomerID = computed(() => store.state.newCustomerID);
|
const newCustomerID = computed(() => store.state.newCustomerID);
|
||||||
const newCustomer = computed(() => store.state.newCustomer);
|
const newCustomer = computed(() => store.state.newCustomer);
|
||||||
@ -120,7 +120,7 @@ const configItems = ref([]);
|
|||||||
|
|
||||||
// get config item from id
|
// get config item from id
|
||||||
const getItemById = async () => {
|
const getItemById = async () => {
|
||||||
if (!addAssetBool.value) {
|
if (!addBool.value) {
|
||||||
try {
|
try {
|
||||||
const response = await Axios.get(
|
const response = await Axios.get(
|
||||||
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getConfigItem/${chosenAssetId.value}`
|
||||||
@ -332,7 +332,7 @@ const addItem = async () => {
|
|||||||
MAC: newMAC.value,
|
MAC: newMAC.value,
|
||||||
subnetmask: newSubnetmask.value,
|
subnetmask: newSubnetmask.value,
|
||||||
});
|
});
|
||||||
store.commit('resetAssetStore');
|
store.commit('resetStore');
|
||||||
store.commit('changeToAssetlist');
|
store.commit('changeToAssetlist');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err.response.statusText);
|
console.log(err.response.statusText);
|
||||||
|
|||||||
@ -1,11 +1,70 @@
|
|||||||
<template>
|
<template>
|
||||||
<section :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="!addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<h2 :class="['production-orders-template-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">Template name</h2>
|
<h2 v-if="!editable" :class="['production-orders-template-name', darkMode ? 'h2-darkmode' : 'h2-lightmode']">{{
|
||||||
|
pot.name }}</h2>
|
||||||
|
<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']">
|
||||||
<div class="production-orders-template-data">
|
<div class="production-orders-template-data">
|
||||||
<div class="client-ID">
|
<div class="client-ID">
|
||||||
<div class="data-field" id="client">
|
<div class="data-field" id="client">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Client:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">Client:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']"> {{ pot.customer }}</pre>
|
||||||
|
<select v-if="editable" id="customersDropDownChosenCI" v-model="pot.customer"
|
||||||
|
@change="updateCustomerID()" :class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="cust in customers" :key="cust.primaryID">
|
||||||
|
{{ cust.customername }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="data-field" id="ID">
|
||||||
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">ID:</pre>
|
||||||
|
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ pot.templateID }}</pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="user">
|
||||||
|
<div class="data-field" id="empty">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="data-field" id="user">
|
||||||
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">User:</pre>
|
||||||
|
<pre v-if="!editable"
|
||||||
|
:class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">{{ pot.user }}</pre>
|
||||||
|
<input v-if="editable" v-model="pot.user" @change="updatePOT()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="production-orders-template-data">
|
||||||
|
<div class="additional">
|
||||||
|
<div class="description">
|
||||||
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
|
||||||
|
<input v-model="pot.description" :readonly="!editable" @change="updatePOT()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="additional">
|
||||||
|
<div class="notes">
|
||||||
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
|
||||||
|
<input v-model="pot.notes" :readonly="!editable" @change="updatePOT()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section v-if="addBool" :class="['information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
|
<input v-model="newName" @change="updateProductionOrder()"
|
||||||
|
:class="['data', 'production-orders-template-name-input', darkMode ? 'h2-darkmode' : 'h2-lightmode', darkMode ? 'h2-input-darkmode' : 'h2-input-lightmode', 'input']">
|
||||||
|
<div class="production-orders-template-data">
|
||||||
|
<div class="client-ID">
|
||||||
|
<div class="data-field" id="client">
|
||||||
|
<pre :class="['label', darkMode ? 'pre-darkmode' : 'pre-lightmode']">Client:</pre>
|
||||||
|
<select id="customersDropDownChosenCI" v-model="newCustomer" @change="updateNewCustomerID()"
|
||||||
|
:class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="cust in customers" :key="cust.primaryID">
|
||||||
|
{{ cust.customername }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="ID">
|
<div class="data-field" id="ID">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">ID:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">ID:</pre>
|
||||||
@ -18,7 +77,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="data-field" id="user">
|
<div class="data-field" id="user">
|
||||||
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">User:</pre>
|
<pre :class="['label', darkMode ? 'div-darkmode' : 'div-lightmode']">User:</pre>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']">...</pre>
|
<input v-model="newUser" @change="updateProductionOrder()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -26,24 +86,196 @@
|
|||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Description:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">...</pre>
|
<input v-model="newDescription" @change="updateProductionOrder()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="additional">
|
<div class="additional">
|
||||||
<div class="notes">
|
<div class="notes">
|
||||||
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
|
<h3 :class="['area-title', darkMode ? 'h3-darkmode' : 'h3-lightmode']">Notes:</h3>
|
||||||
<pre :class="['data', darkMode ? 'data-darkmode' : 'data-lightmode']" id="notes">...</pre>
|
<input v-model="newNotes" @change="updateProductionOrder()"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']" id="description">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const store = useStore();
|
||||||
|
const editable = computed(() => store.state.editable);
|
||||||
|
const chosenPOTId = computed(() => store.state.chosenPOTId);
|
||||||
|
const deleteBool = computed(() => store.state.deleteBool);
|
||||||
|
const addBool = computed(() => store.state.new);
|
||||||
|
|
||||||
|
const darkMode = ref(true);
|
||||||
|
const pot = ref({});
|
||||||
|
const customers = ref([]);
|
||||||
|
const customer = ref({});
|
||||||
|
const productionOrderTemplates = ref([]);
|
||||||
|
|
||||||
|
const newName = ref('');
|
||||||
|
const newCustomerID = ref('');
|
||||||
|
const newCustomer = ref('');
|
||||||
|
const newUser = ref('');
|
||||||
|
const newDescription = ref('');
|
||||||
|
const newNotes = ref('');
|
||||||
|
|
||||||
|
//get all customers
|
||||||
|
const getCustomers = 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const confirmDeletePOT = async () => {
|
||||||
|
if (deleteBool.value === true) {
|
||||||
|
if (confirm("Do you really want to delete this production order template? It cannot be undone!")) {
|
||||||
|
try {
|
||||||
|
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteProductionOrderTemplate/${chosenPOTId.value}`);
|
||||||
|
store.commit('undoDelete');
|
||||||
|
store.commit('changeToTemplatelist');
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deleteTodosPOT/${chosenPOTId.value}`);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
store.commit('undoDelete');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all productionOrder templates todos
|
||||||
|
const getProductionOrderTemplates = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`);
|
||||||
|
productionOrderTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updatePOT = async () => {
|
||||||
|
if (pot.value.name.trim() === "") {
|
||||||
|
alert("Please add a production order template name!");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
var counter = 0;
|
||||||
|
// check if production order template name already exists
|
||||||
|
productionOrderTemplates.value.forEach(p => {
|
||||||
|
if (p.name === pot.value.name) {
|
||||||
|
counter += 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (counter == 2) {
|
||||||
|
alert("This production order template name already exists. Please choose an unique production order template name or modify respectively delete the old one!");
|
||||||
|
pot.value.name = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updateProductionOrderTemplate`,
|
||||||
|
{
|
||||||
|
templateID: pot.value.templateID,
|
||||||
|
name: pot.value.name,
|
||||||
|
customerID: pot.value.customerID,
|
||||||
|
customer: pot.value.customer,
|
||||||
|
lastView: pot.value.lastView,
|
||||||
|
user: pot.value.user,
|
||||||
|
description: pot.value.description,
|
||||||
|
notes: pot.value.notes,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
await getPOTById();
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update customerid if customer was changed
|
||||||
|
const updateCustomerID = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${pot.value.customer}`);
|
||||||
|
customer.value = response.data;
|
||||||
|
pot.value.customerID = customer.value.customerID;
|
||||||
|
store.commit('toggleClientChanged');
|
||||||
|
store.commit('toggleClientId', pot.value.customerID);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
await updatePOT();
|
||||||
|
}
|
||||||
|
|
||||||
|
// get production order template from id
|
||||||
|
const getPOTById = async () => {
|
||||||
|
if (!addBool.value) {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${chosenPOTId.value}`
|
||||||
|
);
|
||||||
|
pot.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update customerid if customer was changed
|
||||||
|
const updateNewCustomerID = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCustomerByName/${newCustomer.value}`);
|
||||||
|
newCustomerID.value = response.data.customerID;
|
||||||
|
store.commit('toggleClientChanged');
|
||||||
|
store.commit('toggleClientId', newCustomerID.value)
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
updateProductionOrder();
|
||||||
|
}
|
||||||
|
|
||||||
|
// update production order template fields in the store
|
||||||
|
const updateProductionOrder = () => {
|
||||||
|
const productionOrderTemplate = {
|
||||||
|
name: newName.value,
|
||||||
|
customerId: newCustomerID.value,
|
||||||
|
customer: newCustomer.value,
|
||||||
|
user: newUser.value,
|
||||||
|
description: newDescription.value,
|
||||||
|
notes: newNotes.value
|
||||||
|
};
|
||||||
|
store.commit('updateProductionOrderTemplateComponent', productionOrderTemplate);
|
||||||
|
}
|
||||||
|
|
||||||
|
// include delay to avoid 503 error
|
||||||
|
const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
fetchDataFunc();
|
||||||
|
}, 1500);
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(deleteBool, confirmDeletePOT);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getPOTById();
|
||||||
|
getProductionOrderTemplates();
|
||||||
|
triggerBackendCallsWithDelay(getCustomers);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -73,7 +305,15 @@ export default {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pot-name-input {
|
||||||
|
padding: 1rem 0;
|
||||||
|
margin: 1rem;
|
||||||
|
font-size: initial;
|
||||||
|
letter-spacing: 5%;
|
||||||
|
text-decoration-line: underline;
|
||||||
|
font: italic 400 1rem/187.5% Overpass, -apple-system, Roboto, Helvetica,
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
.production-orders-template-name {
|
.production-orders-template-name {
|
||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
@ -84,6 +324,16 @@ export default {
|
|||||||
sans-serif;
|
sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.production-orders-template-name-input {
|
||||||
|
padding: 1rem 0;
|
||||||
|
margin: 1rem;
|
||||||
|
font-size: initial;
|
||||||
|
letter-spacing: 5%;
|
||||||
|
text-decoration-line: underline;
|
||||||
|
font: italic 400 1rem/187.5% Overpass, -apple-system, Roboto, Helvetica,
|
||||||
|
sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
.h2-darkmode {
|
.h2-darkmode {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
@ -98,7 +348,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
width: 95%;
|
width: 95%;
|
||||||
padding: 0 1.875rem;
|
padding: 0.8rem 1.875rem;
|
||||||
gap: 1.25rem;
|
gap: 1.25rem;
|
||||||
border-radius: 0.625rem;
|
border-radius: 0.625rem;
|
||||||
}
|
}
|
||||||
@ -137,6 +387,18 @@ export default {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.h2-input-darkmode {
|
||||||
|
background-color: #212121;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h2-input-lightmode {
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.production-orders-template-data {
|
.production-orders-template-data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -145,6 +407,22 @@ export default {
|
|||||||
align-self: stretch;
|
align-self: stretch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-darkmode {
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
background: #212121;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-lightmode {
|
||||||
|
border: none;
|
||||||
|
color: black;
|
||||||
|
background: #EBEBEB;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
|
|
||||||
.client-ID,
|
.client-ID,
|
||||||
.user {
|
.user {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -1,4 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<section v-if="searchable" :class="['pot-search', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
|
<div :class="['clientLabel', darkMode ? 'label-darkmode' : 'label-lightmode']">Config item</div>
|
||||||
|
<input v-model="potSearchFilter" @change="searchPOT()"
|
||||||
|
:class="['dataInput', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</section>
|
||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Last viewed:</div>
|
||||||
<table class="data-table" name="production-orders-template-table">
|
<table class="data-table" name="production-orders-template-table">
|
||||||
@ -23,7 +28,12 @@
|
|||||||
{{ template.customer }}</td>
|
{{ template.customer }}</td>
|
||||||
<td
|
<td
|
||||||
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
:class="['Name', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Name-darkmode' : 'Name-lightmode']">
|
||||||
{{ template.name }}</td>
|
<nuxt-link to="/productionOrders" id="nuxt-link" class="button"
|
||||||
|
:class="[darkMode ? 'button-darkmode' : 'button-lightmode']"
|
||||||
|
@click="goToChosenPOT(template.templateID)">
|
||||||
|
{{ template.name }}
|
||||||
|
</nuxt-link>
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
:class="['ID', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'ID-darkmode' : 'ID-lightmode']">
|
||||||
{{ template.templateID }}</td>
|
{{ template.templateID }}</td>
|
||||||
@ -36,25 +46,75 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
import Axios from '../axios.config.js';
|
import Axios from '../axios.config.js';
|
||||||
import clientsideConfig from '../../clientsideConfig.js';
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const darkMode = ref(true)
|
// get accesss to the store
|
||||||
|
const store = useStore()
|
||||||
|
const goToChosenPOT = (id) => {
|
||||||
|
store.commit('setChosenPOT', id);
|
||||||
|
store.commit('changeToTemplate');
|
||||||
|
};
|
||||||
|
|
||||||
|
const clientFilter = computed(() => store.state.filteredByClient);
|
||||||
|
const searchable = computed(() => store.state.searchable);
|
||||||
|
|
||||||
|
const potSearchFilter = ref('');
|
||||||
|
const darkMode = ref(true);
|
||||||
const productionOrderTemplates = ref([]);
|
const productionOrderTemplates = ref([]);
|
||||||
|
|
||||||
//get all productionOrder templates
|
//get all productionOrder templates
|
||||||
const getProductionOrderTemplates = async () => {
|
const getProductionOrderTemplates = async () => {
|
||||||
|
if (!(clientFilter.value === '')) {
|
||||||
|
await getFilteredPOTByClient();
|
||||||
|
} 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`);
|
||||||
productionOrderTemplates.value = response.data;
|
productionOrderTemplates.value = response.data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err.response.statusText);
|
console.log(err.response.statusText);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
//get all productionOrder templates based on the searched pot name
|
||||||
getProductionOrderTemplates();
|
const searchPOT = async () => {
|
||||||
|
if (potSearchFilter.value === '') {
|
||||||
|
await getProductionOrderTemplates();
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOTsByPOT/${potSearchFilter.value}`);
|
||||||
|
productionOrderTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// update search term
|
||||||
|
const updateSearchTerm = async () => {
|
||||||
|
potSearchFilter.value = '';
|
||||||
|
await getProductionOrderTemplates();
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all productionOrder templates based on the searched client
|
||||||
|
const getFilteredPOTByClient = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getSelectedPOTsByClient/${clientFilter.value}`);
|
||||||
|
productionOrderTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(clientFilter, getProductionOrderTemplates);
|
||||||
|
watch(searchable, updateSearchTerm);
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await getProductionOrderTemplates();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -66,6 +126,18 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.section-darkmode {
|
||||||
|
background-color: #2c2c2c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-lightmode {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.data {
|
.data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -79,6 +151,17 @@ export default {
|
|||||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dataInput {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: 0 0.625rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
|
||||||
|
letter-spacing: 5%;
|
||||||
|
font: 400 0.75rem/250% Overpass, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
.div-darkmode {
|
.div-darkmode {
|
||||||
background-color: #2c2c2c;
|
background-color: #2c2c2c;
|
||||||
}
|
}
|
||||||
@ -94,6 +177,11 @@ export default {
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#nuxt-link {
|
||||||
|
text-decoration: none;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
.table-row {
|
.table-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
@ -108,6 +196,16 @@ export default {
|
|||||||
border-bottom: 0.0625rem solid #000000;
|
border-bottom: 0.0625rem solid #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.data-darkmode {
|
||||||
|
background-color: #212121;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-lightmode {
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
.tr-head-lightmode {
|
.tr-head-lightmode {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
border-bottom: 0.0625rem solid #8e8e8e;
|
border-bottom: 0.0625rem solid #8e8e8e;
|
||||||
@ -130,6 +228,19 @@ td {
|
|||||||
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pot-search {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 0.625em 1.875em;
|
||||||
|
gap: 1.25em;
|
||||||
|
width: 30.125em;
|
||||||
|
height: 3.125em;
|
||||||
|
box-shadow: 0.25em 0.25em 0.25em rgba(0, 0, 0, 0.25);
|
||||||
|
border-radius: 0.625em;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.th-darkmode,
|
.th-darkmode,
|
||||||
.td-darkmode {
|
.td-darkmode {
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
@ -201,4 +312,16 @@ th {
|
|||||||
|
|
||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}</style>
|
}
|
||||||
|
|
||||||
|
.clientLabel {
|
||||||
|
width: 5.5625em;
|
||||||
|
height: 1.875em;
|
||||||
|
font-family: "Overpass";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 0.875em;
|
||||||
|
line-height: 1.875;
|
||||||
|
letter-spacing: 0.05em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<section v-if="softwareBoolean && !addAssetBool"
|
<section v-if="softwareBoolean && !addBool"
|
||||||
:class="['software-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
:class="['software-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section v-if="addAssetBool" :class="['software-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
<section v-if="addBool" :class="['software-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']" id="software">Software specifications:
|
||||||
<div class="asset-data">
|
<div class="asset-data">
|
||||||
<table class="data-table" id="asset-table-no-client">
|
<table class="data-table" id="asset-table-no-client">
|
||||||
@ -89,9 +89,9 @@ import { useStore } from 'vuex';
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const editable = computed(() => store.state.assetEditable);
|
const editable = computed(() => store.state.editable);
|
||||||
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
const chosenAssetId = computed(() => store.state.chosenAssetId);
|
||||||
const addAssetBool = computed(() => store.state.newAsset);
|
const addBool = computed(() => store.state.new);
|
||||||
|
|
||||||
const newSoftwareBool = ref(true);
|
const newSoftwareBool = ref(true);
|
||||||
const newSoftware = ref('');
|
const newSoftware = ref('');
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div :class="['data', darkMode ? 'div-darkmode' : 'div-lightmode']">
|
<section v-if="!addBool"
|
||||||
|
:class="['template-checklist-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
||||||
<table class="data-table" id="template-checkklist">
|
<table class="data-table" id="template-checkklist">
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -15,28 +16,412 @@
|
|||||||
Task</th>
|
Task</th>
|
||||||
<th :class="['Comments', darkMode ? 'th-darkmode' : 'th-lightmode']">Comments</th>
|
<th :class="['Comments', darkMode ? 'th-darkmode' : 'th-lightmode']">Comments</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
<tr v-for="todo in potTodos" :key="todo.primaryID"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
<td
|
<td
|
||||||
:class="['Step', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
:class="['Step', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
...</td>
|
{{ todo.rowID }}
|
||||||
|
</td>
|
||||||
|
<td v-if="!editable"
|
||||||
|
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
|
{{ todo.asset }}</td>
|
||||||
|
<td v-if="editable"
|
||||||
|
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
|
<select id="customersDropDownChosenCI" v-model="todo.asset" @change="updatePOTTodo(todo)"
|
||||||
|
:class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="ci in configItemList" :key="ci.primaryID">
|
||||||
|
{{ ci.assetName }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td v-if="!editable"
|
||||||
|
:class="['Task', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
||||||
|
{{ todo.task }}</td>
|
||||||
|
<td v-if="editable"
|
||||||
|
:class="['Task', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
||||||
|
<input type="text" v-model="todo.task" @change="updatePOTTodo(todo)"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
|
<td v-if="!editable" :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']"> {{ todo.comments
|
||||||
|
}}</td>
|
||||||
|
<td v-if="editable" :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']"> <input type="text"
|
||||||
|
v-model="todo.comments" @change="updatePOTTodo(todo)"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> <button
|
||||||
|
:class="[darkMode ? 'deletePOTTodos-darkmode' : 'deletePOTTodos-lightmode']"
|
||||||
|
@click="deletePOTTodo(todo.primaryID)">-</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr v-if="editable && addRow" :class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
|
<td
|
||||||
|
:class="['Step', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
|
{{ newStepTodo }}
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
...</td>
|
<select id="customersDropDownChosenCI" v-model="newAssetTodo"
|
||||||
|
:class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="ci in configItemList" :key="ci.primaryID">
|
||||||
|
{{ ci.assetName }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
<td
|
<td
|
||||||
:class="['Task', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
:class="['Task', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
||||||
...</td>
|
<input type="text" v-model="newTaskTodo"
|
||||||
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']">...</td>
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']"><input type="text"
|
||||||
|
v-model="newCommentsTodo"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> <button
|
||||||
|
:class="[darkMode ? 'savePOTTodos-darkmode' : 'savePOTTodos-lightmode']"
|
||||||
|
@click="addPOTTodo()">Save</button> <button
|
||||||
|
:class="[darkMode ? 'deleteLastPOTTodos-darkmode' : 'deleteLastPOTTodos-lightmode']"
|
||||||
|
@click="deleteNewRow()">-</button>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</section>
|
||||||
|
<section v-if="editable && !addBool" id="editPOTTodos">
|
||||||
|
<button :class="[darkMode ? 'editPOTTodos-darkmode' : 'editPOTTodos-lightmode']"
|
||||||
|
@click="addChecklistRow()">+</button>
|
||||||
|
</section>
|
||||||
|
<section v-if="addBool"
|
||||||
|
:class="['template-checklist-information', darkMode ? 'section-darkmode' : 'section-lightmode']">
|
||||||
|
<div :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Checklist:</div>
|
||||||
|
<table class="data-table" id="template-checkklist">
|
||||||
|
<tbody>
|
||||||
|
<tr :class="['table-row', darkMode ? 'tr-head-darkmode' : 'tr-head-lightmode']" id="table-head">
|
||||||
|
<th
|
||||||
|
:class="['Step', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
|
Step</th>
|
||||||
|
<th
|
||||||
|
:class="['Asset', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
|
Asset</th>
|
||||||
|
<th
|
||||||
|
:class="['Task', darkMode ? 'th-darkmode' : 'th-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
||||||
|
Task</th>
|
||||||
|
<th :class="['Comments', darkMode ? 'th-darkmode' : 'th-lightmode']">Comments</th>
|
||||||
|
</tr>
|
||||||
|
<tr v-for="(newT, index) in newTodos" :key="index"
|
||||||
|
:class="['table-row', darkMode ? 'tr-darkmode' : 'tr-lightmode']" id="row-1">
|
||||||
|
<td
|
||||||
|
:class="['Step', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Step-darkmode' : 'Step-lightmode']">
|
||||||
|
{{ newT.rowID }}
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
:class="['Asset', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Asset-darkmode' : 'Asset-lightmode']">
|
||||||
|
<select id="customersDropDownChosenCI" v-model="newT.asset"
|
||||||
|
:class="[darkMode ? 'select-darkmode' : 'select-lightmode']">
|
||||||
|
<option v-for="ci in configItemList" :key="ci.primaryID">
|
||||||
|
{{ ci.assetName }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td
|
||||||
|
:class="['Task', darkMode ? 'td-darkmode' : 'td-lightmode', darkMode ? 'Task-darkmode' : 'Task-lightmode']">
|
||||||
|
<input type="text" v-model="newT.task"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']">
|
||||||
|
</td>
|
||||||
|
<td :class="['Comments', darkMode ? 'td-darkmode' : 'td-lightmode']"> <input type="text"
|
||||||
|
v-model="newT.comments"
|
||||||
|
:class="['data', 'input', darkMode ? 'data-darkmode' : 'data-lightmode']"> <button
|
||||||
|
:class="[darkMode ? 'deletePOTTodos-darkmode' : 'deleteLastPOTTodos-lightmode']"
|
||||||
|
@click="deletePOTTodoFromNewTodos(index)">-</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</section>
|
||||||
|
<section v-if="addBool" id="editPOTTodos">
|
||||||
|
<button :class="[darkMode ? 'editPOTTodos-darkmode' : 'editPOTTodos-lightmode']"
|
||||||
|
@click="addRowForNewPOT()">+</button>
|
||||||
|
</section>
|
||||||
|
<section v-if="addBool" id="saveNewPOT">
|
||||||
|
<button :class="[darkMode ? 'saveNewPOT-darkmode' : 'saveNewPOT-lightmode']" @click="addPOT()">Safe</button>
|
||||||
|
</section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref } from 'vue';
|
import { ref, onMounted, watch } from 'vue';
|
||||||
|
import Axios from '../axios.config.js';
|
||||||
|
import clientsideConfig from '../../clientsideConfig.js';
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const addBool = computed(() => store.state.new);
|
||||||
|
const editable = computed(() => store.state.editable);
|
||||||
|
|
||||||
|
const newNamePOT = computed(() => store.state.newNamePOT);
|
||||||
|
const newCustomerIDPOT = computed(() => store.state.newCustomerIDPOT);
|
||||||
|
const newCustomerPOT = computed(() => store.state.newCustomerPOT);
|
||||||
|
const newLastViewPOT = computed(() => store.state.newLastViewPOT);
|
||||||
|
const newUserPOT = computed(() => store.state.newUserPOT);
|
||||||
|
const newDescriptionPOT = computed(() => store.state.newDescriptionPOT);
|
||||||
|
const newNotesPOT = computed(() => store.state.newNotesPOT);
|
||||||
|
const newStepTodo = computed(() => potTodos.value.length);
|
||||||
|
const chosenPOTId = computed(() => store.state.chosenPOTId);
|
||||||
|
const clientChanged = computed(() => store.state.clientChanged);
|
||||||
|
const changedClientId = computed(() => store.state.changedClientId);
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
const addRow = ref(false);
|
||||||
|
const configItemList = ref([]);
|
||||||
|
const productionOrderTemplates = ref([]);
|
||||||
|
const potTodos = ref([])
|
||||||
|
const pot = ref({})
|
||||||
|
const newAssetTodo = ref('');
|
||||||
|
const newTaskTodo = ref('');
|
||||||
|
const newCommentsTodo = ref('');
|
||||||
|
const newTodos = reactive([]);
|
||||||
|
const newRowId = computed(() => newTodos.length)
|
||||||
|
|
||||||
|
// delete new todo row
|
||||||
|
const deleteNewRow = () => {
|
||||||
|
newAssetTodo.value = '';
|
||||||
|
newTaskTodo.value = '';
|
||||||
|
newCommentsTodo.value = '';
|
||||||
|
addRow.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletePOTTodoFromNewTodos = (index) => {
|
||||||
|
newTodos.splice(index, 1);
|
||||||
|
newTodos.forEach((todo, i) => {
|
||||||
|
todo.rowID = i
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new production order template
|
||||||
|
const addPOT = async () => {
|
||||||
|
// check if all input data is valid
|
||||||
|
if (newNamePOT.value.trim() === "") {
|
||||||
|
alert("Please add a production order template name!");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
var counter = 0;
|
||||||
|
if (!(productionOrderTemplates.value.length == null)) {
|
||||||
|
// check if production order template name already exists
|
||||||
|
productionOrderTemplates.value.forEach(pot => {
|
||||||
|
if (pot.name === newNamePOT.value) {
|
||||||
|
counter += 1;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (counter == 1) {
|
||||||
|
alert("This production order template name already exists. Please choose an unique production order template name or modify respectively delete the old one!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (newCustomerPOT.value.length === 0) {
|
||||||
|
alert("Please choose a client!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let allFine = true;
|
||||||
|
newTodos.forEach(todo => {
|
||||||
|
if (todo.asset.length === 0) {
|
||||||
|
alert(`Please choose a config item for all todos.`);
|
||||||
|
allFine = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (!allFine) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const response = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/addPOT`,
|
||||||
|
{
|
||||||
|
name: newNamePOT.value,
|
||||||
|
customerID: newCustomerIDPOT.value,
|
||||||
|
customer: newCustomerPOT.value,
|
||||||
|
lastView: newLastViewPOT.value,
|
||||||
|
user: newUserPOT.value,
|
||||||
|
description: newDescriptionPOT.value,
|
||||||
|
notes: newNotesPOT.value,
|
||||||
|
});
|
||||||
|
store.commit('resetStore');
|
||||||
|
store.commit('changeToTemplatelist');
|
||||||
|
newTodos.forEach(async todo => {
|
||||||
|
try {
|
||||||
|
const res = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/addTodoPOT`,
|
||||||
|
{
|
||||||
|
templateID: response.data,
|
||||||
|
rowID: todo.rowID,
|
||||||
|
asset: todo.asset,
|
||||||
|
task: todo.task,
|
||||||
|
comment: todo.comments,
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new row of todo for the new pot
|
||||||
|
const addRowForNewPOT = async () => {
|
||||||
|
if (newCustomerPOT.value.length === 0) {
|
||||||
|
alert("Please choose a client first!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await getConfigItemsFromClient();
|
||||||
|
newTodos.push({
|
||||||
|
templateID: chosenPOTId.value,
|
||||||
|
rowID: newRowId.value,
|
||||||
|
asset: '',
|
||||||
|
task: '',
|
||||||
|
comments: ''
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//update data
|
||||||
|
const updatePOTTodo = async (todo) => {
|
||||||
|
if (todo.asset.length === 0) {
|
||||||
|
alert(`Please add the missing config item in row ${todo.rowID}!`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await Axios.put(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/updatePOTTodo`,
|
||||||
|
{
|
||||||
|
primaryID: todo.primaryID,
|
||||||
|
templateID: todo.templateID,
|
||||||
|
rowID: todo.rowID,
|
||||||
|
asset: todo.asset,
|
||||||
|
task: todo.task,
|
||||||
|
comments: todo.comments,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await getPOTById();
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new production order template todo
|
||||||
|
const addPOTTodo = async () => {
|
||||||
|
// check if all input data is valid
|
||||||
|
if (newAssetTodo.value.length === 0) {
|
||||||
|
alert("Please choose an asset for the new todo!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const response = await Axios.post(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/addTodoPOT`,
|
||||||
|
{
|
||||||
|
templateID: chosenPOTId.value,
|
||||||
|
rowID: newStepTodo.value,
|
||||||
|
asset: newAssetTodo.value,
|
||||||
|
task: newTaskTodo.value,
|
||||||
|
comment: newCommentsTodo.value,
|
||||||
|
});
|
||||||
|
addRow.value = false;
|
||||||
|
await getPOTTodosById();
|
||||||
|
newAssetTodo.value = '';
|
||||||
|
newTaskTodo.value = '';
|
||||||
|
newCommentsTodo.value = '';
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// add new row for the template checklist
|
||||||
|
const addChecklistRow = async () => {
|
||||||
|
await getConfigItemsFromClient();
|
||||||
|
if (addRow.value) {
|
||||||
|
alert('Please confirm the last added row first.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addRow.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all production order templates
|
||||||
|
const getProductionOrderTemplates = async () => {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getAllProductionOrderTemplates`);
|
||||||
|
productionOrderTemplates.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// include delay to avoid 503 error
|
||||||
|
const triggerBackendCallsWithDelay = async (fetchDataFunc) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
fetchDataFunc();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
// get production order template todos from id
|
||||||
|
const getPOTTodosById = async () => {
|
||||||
|
if (!addBool.value) {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getTodosProductionOrderTemplate/${chosenPOTId.value}`
|
||||||
|
);
|
||||||
|
potTodos.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//get all config items from the selected client
|
||||||
|
const getConfigItemsFromClient = async () => {
|
||||||
|
if (!addBool.value) {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${pot.value.customerID}`);
|
||||||
|
configItemList.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getCIFromClient/${changedClientId.value}`);
|
||||||
|
configItemList.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (clientChanged.value) {
|
||||||
|
store.commit('toggleClientChanged');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// get production order template from id
|
||||||
|
const getPOTById = async () => {
|
||||||
|
if (!addBool.value) {
|
||||||
|
try {
|
||||||
|
const response = await Axios.get(
|
||||||
|
`https://${clientsideConfig.url}:${clientsideConfig.port}/api/getProductionOrderTemplate/${chosenPOTId.value}`
|
||||||
|
);
|
||||||
|
pot.value = response.data;
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await getConfigItemsFromClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
const deletePOTTodo = async (id) => {
|
||||||
|
if (confirm("Do you really want to delete this production order template todo? It cannot be undone!")) {
|
||||||
|
try {
|
||||||
|
await Axios.delete(`https://${clientsideConfig.url}:${clientsideConfig.port}/api/deletePOTTodo/${id}`);
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err.response.statusText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await getPOTTodosById();
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(clientChanged, getPOTById);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getPOTTodosById();
|
||||||
|
getPOTById();
|
||||||
|
triggerBackendCallsWithDelay(getProductionOrderTemplates);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -49,25 +434,53 @@ export default {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.data {
|
.data {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: center;
|
padding: 0 0.625rem;
|
||||||
align-self: stretch;
|
border-radius: 0.3125rem;
|
||||||
width: 100%;
|
box-shadow: 0.0625rem 0.0625rem 0.25rem 0rem rgba(0, 0, 0, 0.25) inset;
|
||||||
padding: 1.25rem 1.875rem;
|
letter-spacing: 5%;
|
||||||
gap: 1.25rem;
|
font: 400 0.75rem/250% Overpass, sans-serif;
|
||||||
border-radius: 0.625rem;
|
|
||||||
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-darkmode {
|
.section-darkmode {
|
||||||
background-color: #2c2c2c;
|
background-color: #2c2c2c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-lightmode {
|
.section-lightmode {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.data-darkmode {
|
||||||
|
background-color: #212121;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-lightmode {
|
||||||
|
background-color: #EBEBEB;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-darkmode {
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
background: #212121;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-lightmode {
|
||||||
|
border: none;
|
||||||
|
color: black;
|
||||||
|
background: #EBEBEB;
|
||||||
|
padding: 0.4rem;
|
||||||
|
border-radius: 0.3125rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
.data-table {
|
.data-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 0.625rem;
|
padding: 0 0.625rem;
|
||||||
@ -125,6 +538,16 @@ th {
|
|||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.template-checklist-information {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 1.25rem 1.875rem;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
.Step {
|
.Step {
|
||||||
width: 8%;
|
width: 8%;
|
||||||
}
|
}
|
||||||
@ -163,6 +586,7 @@ th {
|
|||||||
|
|
||||||
.Comments {
|
.Comments {
|
||||||
width: 35%;
|
width: 35%;
|
||||||
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
@ -183,4 +607,144 @@ th {
|
|||||||
.label-lightmode {
|
.label-lightmode {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editPOTTodos-darkmode {
|
||||||
|
background: #2c2c2c;
|
||||||
|
color: #fff;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
padding: 0.825rem 0.7rem;
|
||||||
|
width: 4%;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.savePOTTodos-darkmode {
|
||||||
|
background: #212121;
|
||||||
|
color: #fff;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 10rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.saveNewPOT-darkmode {
|
||||||
|
background: #2c2c2c;
|
||||||
|
color: #fff;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
padding: 1rem 1.875rem;
|
||||||
|
width: 8%;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.deletePOTTodos-darkmode {
|
||||||
|
background: #212121;
|
||||||
|
color: #fff;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 15.8rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deleteLastPOTTodos-darkmode {
|
||||||
|
background: #212121;
|
||||||
|
color: #fff;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 2rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.editPOTTodos-lightmode {
|
||||||
|
background: #EBEBEB;
|
||||||
|
color: #212121;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
margin-left: 15rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.savePOTTodos-lightmode {
|
||||||
|
background: #EBEBEB;
|
||||||
|
color: #212121;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 10rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deletePOTTodos-lightmode {
|
||||||
|
background: #EBEBEB;
|
||||||
|
color: #212121;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 15.8rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deleteLastPOTTodos-lightmode {
|
||||||
|
background: #EBEBEB;
|
||||||
|
color: #212121;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
margin-left: 2rem;
|
||||||
|
padding-left: 0.9rem;
|
||||||
|
padding-right: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.saveNewPOT-lightmode {
|
||||||
|
background: #EBEBEB;
|
||||||
|
color: #212121;
|
||||||
|
font: 400 0.875rem/1.875rem Overpass, sans-serif;
|
||||||
|
border: none;
|
||||||
|
padding: 1rem 1.875rem;
|
||||||
|
width: 8%;
|
||||||
|
border-radius: 0.625rem;
|
||||||
|
box-shadow: 0.25rem 0.25rem 0.25rem 0rem rgba(0, 0, 0, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.deletePOTTodos-darkmode:hover,
|
||||||
|
.deleteLastPOTTodos-darkmode:hover,
|
||||||
|
|
||||||
|
.savePOTTodos-darkmode:hover,
|
||||||
|
.editPOTTodos-darkmode:hover,
|
||||||
|
.saveNewPOT-darkmode:hover {
|
||||||
|
background-color: #444444;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.deletePOTTodos-lightmode:hover,
|
||||||
|
.deleteLastPOTTodos-lightmode:hover,
|
||||||
|
|
||||||
|
.savePOTTodos-lightmode:hover,
|
||||||
|
.editPOTTodos-lightmode:hover,
|
||||||
|
.saveNewPOT-lightmode:hover {
|
||||||
|
background-color: #ACACAC;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
#saveNewPOT {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
#editPOTTodos {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<mxfile host="Electron" modified="2024-02-01T15:29:10.628Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="R4sGFqNy6FSLZX5LoMO_" version="22.0.3" type="device" pages="2">
|
<mxfile host="Electron" modified="2024-02-14T10:28:35.536Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="_zOGEdVgp7g5JHBy-mYE" version="22.0.3" type="device" pages="2">
|
||||||
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
||||||
<mxGraphModel dx="246" dy="2876" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
<mxGraphModel dx="393" dy="2849" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
@ -62,7 +62,7 @@
|
|||||||
<mxGeometry y="240" width="140" height="30" as="geometry" />
|
<mxGeometry y="240" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-29" value="changeDB" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-29" value="changeDB" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#00CC00;" parent="1" vertex="1">
|
||||||
<mxGeometry x="75" y="-560" width="140" height="840" as="geometry" />
|
<mxGeometry x="75" y="-560" width="140" height="870" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-67" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-67" value="primaryID*" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
<mxGeometry y="30" width="140" height="30" as="geometry" />
|
||||||
@ -130,21 +130,24 @@
|
|||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-63" value="version" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-63" value="version" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="660" width="140" height="30" as="geometry" />
|
<mxGeometry y="660" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="qbUp6gtjYndA0fy5zK6_-1" value="networkBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="-qW6OXXOOqjT1X6LnSAE-1" value="license" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="690" width="140" height="30" as="geometry" />
|
<mxGeometry y="690" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-53" value="IPv4" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="qbUp6gtjYndA0fy5zK6_-1" value="networkBool" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="720" width="140" height="30" as="geometry" />
|
<mxGeometry y="720" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-56" value="IPv6" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-53" value="IPv4" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="750" width="140" height="30" as="geometry" />
|
<mxGeometry y="750" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-54" value="MAC" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-56" value="IPv6" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="780" width="140" height="30" as="geometry" />
|
<mxGeometry y="780" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-55" value="subnetmask" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-54" value="MAC" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
<mxGeometry y="810" width="140" height="30" as="geometry" />
|
<mxGeometry y="810" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-55" value="subnetmask" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="DauqCNUrC7Z9yIe88X-r-29" vertex="1">
|
||||||
|
<mxGeometry y="840" width="140" height="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
<mxCell id="DauqCNUrC7Z9yIe88X-r-33" value="productionOrders" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#009900;" parent="1" vertex="1">
|
<mxCell id="DauqCNUrC7Z9yIe88X-r-33" value="productionOrders" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#009900;" parent="1" vertex="1">
|
||||||
<mxGeometry x="920" y="-85" width="140" height="450" as="geometry" />
|
<mxGeometry x="920" y="-85" width="140" height="450" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
|
|||||||
974
documentation/.$Datenbankmodell.drawio.dtmp
Normal file
974
documentation/.$Datenbankmodell.drawio.dtmp
Normal file
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
<mxfile host="Electron" modified="2024-02-14T10:28:35.536Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="_zOGEdVgp7g5JHBy-mYE" version="22.0.3" type="device" pages="2">
|
<mxfile host="Electron" modified="2024-02-27T19:18:30.556Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/22.0.3 Chrome/114.0.5735.289 Electron/25.8.4 Safari/537.36" etag="pTIMz7977P7LLgTl7RJZ" version="22.0.3" type="device" pages="2">
|
||||||
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
<diagram name="Seite-1" id="VLuSDTVFFHJCdRpH-1WC">
|
||||||
<mxGraphModel dx="393" dy="2849" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
<mxGraphModel dx="395" dy="2842" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||||
<root>
|
<root>
|
||||||
<mxCell id="0" />
|
<mxCell id="0" />
|
||||||
<mxCell id="1" parent="0" />
|
<mxCell id="1" parent="0" />
|
||||||
@ -580,7 +580,7 @@
|
|||||||
<mxCell id="WukdXvazNq34soQIU5Al-108" value="task" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-103" vertex="1">
|
<mxCell id="WukdXvazNq34soQIU5Al-108" value="task" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-103" vertex="1">
|
||||||
<mxGeometry y="150" width="140" height="30" as="geometry" />
|
<mxGeometry y="150" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="WukdXvazNq34soQIU5Al-109" value="comment" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-103" vertex="1">
|
<mxCell id="WukdXvazNq34soQIU5Al-109" value="comments" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="WukdXvazNq34soQIU5Al-103" vertex="1">
|
||||||
<mxGeometry y="180" width="140" height="30" as="geometry" />
|
<mxGeometry y="180" width="140" height="30" as="geometry" />
|
||||||
</mxCell>
|
</mxCell>
|
||||||
<mxCell id="WukdXvazNq34soQIU5Al-128" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="WukdXvazNq34soQIU5Al-126" target="DauqCNUrC7Z9yIe88X-r-22" edge="1">
|
<mxCell id="WukdXvazNq34soQIU5Al-128" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="WukdXvazNq34soQIU5Al-126" target="DauqCNUrC7Z9yIe88X-r-22" edge="1">
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Archive</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Archive</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="new" @click="addAsset">
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="new" @click="add">
|
||||||
<div class="icon" id="new-icon">
|
<div class="icon" id="new-icon">
|
||||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Add-New-Icon.svg" />
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Add-New-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
@ -68,7 +68,7 @@
|
|||||||
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Edit</pre>
|
<pre v-if="isExpanded" :class="['label', darkMode ? 'label-darkmode' : 'label-lightmode']">Edit</pre>
|
||||||
</Transition>
|
</Transition>
|
||||||
</button>
|
</button>
|
||||||
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="delete" @click="deleteAsset">
|
<button :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="delete" @click="deleteFunc">
|
||||||
<div class="icon" id="delete-icon">
|
<div class="icon" id="delete-icon">
|
||||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Delete-Icon.svg" />
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/actionbar-icons/Delete-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
@ -90,23 +90,23 @@ const isExpanded = ref(true)
|
|||||||
// get accesss to the store
|
// get accesss to the store
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const toggleEditable = () => {
|
const toggleEditable = () => {
|
||||||
store.commit('toggleEditableAsset');
|
store.commit('toggleEditable');
|
||||||
};
|
};
|
||||||
const deleteAsset = () => {
|
const deleteFunc = () => {
|
||||||
store.commit('doDeleteAsset');
|
store.commit('doDelete');
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleActionbar = () => {
|
const toggleActionbar = () => {
|
||||||
isExpanded.value = !isExpanded.value;
|
isExpanded.value = !isExpanded.value;
|
||||||
};
|
};
|
||||||
const toggleFiltered = () => {
|
const toggleFiltered = () => {
|
||||||
store.commit('toggleFilteredAsset');
|
store.commit('toggleFiltered');
|
||||||
};
|
};
|
||||||
const toggleSearched = () => {
|
const toggleSearched = () => {
|
||||||
store.commit('toggleAssetSearchable');
|
store.commit('toggleSearchable');
|
||||||
};
|
};
|
||||||
const addAsset = () => {
|
const add = () => {
|
||||||
store.commit('addNewAsset');
|
store.commit('add');
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</nav>
|
</nav>
|
||||||
<nav id="site-menu">
|
<nav id="site-menu">
|
||||||
<router-link to="/maintenanceVisits" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" id="checklists-button">
|
<router-link to="/maintenanceVisits" class="button" :class="[darkMode ? 'button-darkmode' : 'button-lightmode']" @click="defaultProductionOrderPage()" id="checklists-button">
|
||||||
<div class="icon" id="checklists-icon">
|
<div class="icon" id="checklists-icon">
|
||||||
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/navbar-icons/Checklists-Icon.svg" />
|
<img :class="[darkMode ? 'img-darkmode' : 'img-lightmode']" loading="lazy" src="../icons/navbar-icons/Checklists-Icon.svg" />
|
||||||
</div>
|
</div>
|
||||||
@ -77,10 +77,15 @@ const isExpanded = ref(true)
|
|||||||
// get accesss to the store
|
// get accesss to the store
|
||||||
const store = useStore()
|
const store = useStore()
|
||||||
const defaultAssetPage = () => {
|
const defaultAssetPage = () => {
|
||||||
store.commit('resetAssetStore');
|
store.commit('resetStore');
|
||||||
store.commit('changeToAssetlist');
|
store.commit('changeToAssetlist');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultProductionOrderPage = () => {
|
||||||
|
store.commit('resetStore');
|
||||||
|
store.commit('changeToTemplatelist')
|
||||||
|
}
|
||||||
|
|
||||||
const ToggleSidebar = () => {
|
const ToggleSidebar = () => {
|
||||||
isExpanded.value = !isExpanded.value;
|
isExpanded.value = !isExpanded.value;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
// export default function ({ route, redirect }) {
|
|
||||||
// // Check if user is not authenticated and trying to access a page other than /login
|
|
||||||
// if (!isAuthenticated() && route.path !== '/login') {
|
|
||||||
// return redirect('/login');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// function isAuthenticated() {
|
|
||||||
// // Implement authentication logic
|
|
||||||
// return false
|
|
||||||
// // Return true if authenticated, false otherwise
|
|
||||||
// }
|
|
||||||
@ -51,19 +51,21 @@ import TemplateSearch from "../components/TemplateSearch.vue";
|
|||||||
import ProductionOrdersInstanceTable from "../components/server/ProductionOrdersInstanceTable.vue";
|
import ProductionOrdersInstanceTable from "../components/server/ProductionOrdersInstanceTable.vue";
|
||||||
import ProductionOrdersInstance from "../components/server/ProductionOrdersInstance.vue";
|
import ProductionOrdersInstance from "../components/server/ProductionOrdersInstance.vue";
|
||||||
import InstanceChecklist from "../components/server/InstanceChecklist.vue";
|
import InstanceChecklist from "../components/server/InstanceChecklist.vue";
|
||||||
|
import { useStore } from 'vuex';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
|
const onTemplatelist = computed(() => store.state.onTemplatelist);
|
||||||
|
const onCustomerTemplatelist = computed(() => store.state.onCustomerTemplatelist);
|
||||||
|
const onTemplate = computed(() => store.state.onTemplate);
|
||||||
|
const onInstancelist = computed(() => store.state.onInstancelist);
|
||||||
|
const onInstance = computed(() => store.state.onInstance);
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: 'default'
|
layout: 'default'
|
||||||
})
|
})
|
||||||
|
|
||||||
const darkMode = ref(true)
|
const darkMode = ref(true)
|
||||||
|
|
||||||
// to render the right components
|
|
||||||
const onTemplatelist = ref(true)
|
|
||||||
const onCustomerTemplatelist = ref(false)
|
|
||||||
const onTemplate = ref(false)
|
|
||||||
const onInstancelist = ref(false)
|
|
||||||
const onInstance = ref(false)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
257
plugins/vuex.js
257
plugins/vuex.js
@ -3,17 +3,20 @@ import { createStore } from "vuex";
|
|||||||
const store = createStore({
|
const store = createStore({
|
||||||
state() {
|
state() {
|
||||||
return {
|
return {
|
||||||
assetEditable: false,
|
editable: false,
|
||||||
assetFiltered: false,
|
filtered: false,
|
||||||
assetSearchable: false,
|
searchable: false,
|
||||||
deleteAsset: false,
|
deleteBool: false,
|
||||||
|
new: false,
|
||||||
|
clientChanged: false,
|
||||||
|
changedClientId: -1,
|
||||||
|
filteredByClient: '',
|
||||||
|
|
||||||
onAssetlist: true,
|
onAssetlist: true,
|
||||||
onCustomerAssetlist: false,
|
onCustomerAssetlist: false,
|
||||||
onAsset: false,
|
onAsset: false,
|
||||||
onSolutionlistAsset: false,
|
onSolutionlistAsset: false,
|
||||||
chosenAssetId: -1,
|
chosenAssetId: -1,
|
||||||
filteredAssetbyClient: '',
|
|
||||||
newAsset: false,
|
|
||||||
newAssetName: '',
|
newAssetName: '',
|
||||||
newCustomerID: '',
|
newCustomerID: '',
|
||||||
newCustomer: '',
|
newCustomer: '',
|
||||||
@ -36,20 +39,54 @@ const store = createStore({
|
|||||||
newSoftware: '',
|
newSoftware: '',
|
||||||
newVersion: '',
|
newVersion: '',
|
||||||
newLicense: '',
|
newLicense: '',
|
||||||
|
|
||||||
|
onTemplatelist: true,
|
||||||
|
onCustomerTemplatelist: false,
|
||||||
|
onTemplate: false,
|
||||||
|
onInstancelist: false,
|
||||||
|
onInstance: false,
|
||||||
|
newNamePOT: '',
|
||||||
|
newCustomerIDPOT: '',
|
||||||
|
newCustomerPOT: '',
|
||||||
|
newLastViewPOT: '',
|
||||||
|
newUserPOT: '',
|
||||||
|
newDescriptionPOT: '',
|
||||||
|
newNotesPOT: '',
|
||||||
|
chosenPOTId: -1,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mutations: {
|
mutations: {
|
||||||
toggleEditableAsset(state) {
|
// functions to toggle with the actionbar
|
||||||
state.assetEditable = !state.assetEditable
|
toggleEditable(state) {
|
||||||
|
state.editable = !state.editable
|
||||||
},
|
},
|
||||||
toggleFilteredAsset(state) {
|
toggleFiltered(state) {
|
||||||
if (state.assetFiltered == false) {
|
if (state.filtered == false) {
|
||||||
state.assetFiltered = true
|
state.filtered = true
|
||||||
state.assetSearchable = false
|
state.searchable = false
|
||||||
} else {
|
} else {
|
||||||
state.assetFiltered = false
|
state.filtered = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toggleSearchable(state) {
|
||||||
|
if (state.searchable == false) {
|
||||||
|
state.searchable = true
|
||||||
|
state.filtered = false
|
||||||
|
} else {
|
||||||
|
state.searchable = false
|
||||||
|
}
|
||||||
|
state.filteredByClient = ''
|
||||||
|
},
|
||||||
|
toggleClientChanged(state) {
|
||||||
|
state.clientChanged = !state.clientChanged
|
||||||
|
},
|
||||||
|
toggleClientId(state, id) {
|
||||||
|
state.changedClientId = id
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// functions to change the asset pages
|
||||||
changeToAssetlist(state) {
|
changeToAssetlist(state) {
|
||||||
state.onAssetlist = true
|
state.onAssetlist = true
|
||||||
state.onCustomerAssetlist = false
|
state.onCustomerAssetlist = false
|
||||||
@ -74,68 +111,45 @@ const store = createStore({
|
|||||||
state.onAsset = false
|
state.onAsset = false
|
||||||
state.onSolutionlistAsset = true
|
state.onSolutionlistAsset = true
|
||||||
},
|
},
|
||||||
setChosenAsset(state, id) {
|
|
||||||
state.chosenAssetId = id
|
// functions to change the production order pages
|
||||||
|
changeToTemplatelist(state) {
|
||||||
|
state.onTemplatelist = true
|
||||||
|
state.onCustomerTemplatelist = false
|
||||||
|
state.onTemplate = false
|
||||||
|
state.onInstancelist = false
|
||||||
|
state.onInstance = false
|
||||||
},
|
},
|
||||||
resetAssetStore(state) {
|
changeToCustomerTemplatelist(state) {
|
||||||
state.assetEditable = false
|
state.onTemplatelist = false
|
||||||
state.assetFiltered = false
|
state.onCustomerTemplatelist = true
|
||||||
state.assetSearchable = false
|
state.onTemplate = false
|
||||||
state.deleteAsset = false
|
state.onInstancelist = false
|
||||||
state.chosenAssetId = -1
|
state.onInstance = false
|
||||||
state.filteredAssetbyClient = ''
|
|
||||||
state.newAsset = false
|
|
||||||
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 = ''
|
|
||||||
},
|
},
|
||||||
doDeleteAsset(state) {
|
changeToTemplate(state) {
|
||||||
state.deleteAsset = true
|
state.onTemplatelist = false
|
||||||
|
state.onCustomerTemplatelist = false
|
||||||
|
state.onTemplate = true
|
||||||
|
state.onInstancelist = false
|
||||||
|
state.onInstance = false
|
||||||
},
|
},
|
||||||
undoDeleteAsset(state) {
|
changeToInstancelist(state) {
|
||||||
state.deleteAsset = false
|
state.onTemplatelist = false
|
||||||
|
state.onCustomerTemplatelist = false
|
||||||
|
state.onTemplate = false
|
||||||
|
state.onInstancelist = true
|
||||||
|
state.onInstance = false
|
||||||
},
|
},
|
||||||
updateAssetFilterbyClient(state, client) {
|
changeToInstance(state) {
|
||||||
state.filteredAssetbyClient = client
|
state.onTemplatelist = false
|
||||||
},
|
state.onCustomerTemplatelist = false
|
||||||
toggleAssetSearchable(state) {
|
state.onTemplate = false
|
||||||
if (state.assetSearchable == false) {
|
state.onInstancelist = false
|
||||||
state.assetSearchable = true
|
state.onInstance = true
|
||||||
state.assetFiltered = false
|
|
||||||
} else {
|
|
||||||
state.assetSearchable = false
|
|
||||||
}
|
|
||||||
state.filteredAssetbyClient = ''
|
|
||||||
},
|
|
||||||
addNewAsset(state) {
|
|
||||||
state.newAsset = true
|
|
||||||
state.assetEditable = false
|
|
||||||
state.assetFiltered = false
|
|
||||||
state.assetSearchable = false
|
|
||||||
state.onAssetlist = false
|
|
||||||
state.onCustomerAssetlist = false
|
|
||||||
state.onAsset = true
|
|
||||||
state.onSolutionlistAsset = false
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// functions to update the asset
|
||||||
updateAssetComponent(state, asset) {
|
updateAssetComponent(state, asset) {
|
||||||
state.newAssetName = asset.assetName
|
state.newAssetName = asset.assetName
|
||||||
state.newCustomerID = asset.customerId
|
state.newCustomerID = asset.customerId
|
||||||
@ -161,7 +175,108 @@ const store = createStore({
|
|||||||
state.newSoftware = asset.software
|
state.newSoftware = asset.software
|
||||||
state.newVersion = asset.version
|
state.newVersion = asset.version
|
||||||
state.newLicense = asset.license
|
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
|
||||||
|
},
|
||||||
|
|
||||||
|
// 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 reset the pages
|
||||||
|
resetStore(state) {
|
||||||
|
state.editable = false
|
||||||
|
state.filtered = false
|
||||||
|
state.searchable = false
|
||||||
|
state.deleteBool = false
|
||||||
|
state.chosenAssetId = -1
|
||||||
|
state.filteredByClient = ''
|
||||||
|
state.new = false
|
||||||
|
state.clientChanged = false
|
||||||
|
state.changedClientId = -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 = false
|
||||||
|
state.newDescriptionPOT = ''
|
||||||
|
state.newNotesPOT = ''
|
||||||
|
state.newLastViewPOT = ''
|
||||||
|
},
|
||||||
|
|
||||||
|
// functions to (undo) delete an asset
|
||||||
|
doDelete(state) {
|
||||||
|
state.deleteBool = true
|
||||||
|
},
|
||||||
|
undoDelete(state) {
|
||||||
|
state.deleteBool = false
|
||||||
|
},
|
||||||
|
|
||||||
|
// function to update the asset filter
|
||||||
|
updateFilterbyClient(state, client) {
|
||||||
|
state.filteredByClient = client
|
||||||
|
},
|
||||||
|
|
||||||
|
// function to get to the add page
|
||||||
|
add(state) {
|
||||||
|
state.new = true
|
||||||
|
state.editable = false
|
||||||
|
state.filtered = false
|
||||||
|
state.searchable = false
|
||||||
|
|
||||||
|
// set the asset variables
|
||||||
|
state.onAssetlist = false
|
||||||
|
state.onCustomerAssetlist = false
|
||||||
|
state.onAsset = true
|
||||||
|
state.onSolutionlistAsset = false
|
||||||
|
|
||||||
|
// set the production order variables
|
||||||
|
state.onTemplatelist = false
|
||||||
|
state.onCustomerTemplatelist = false
|
||||||
|
state.onTemplate = true
|
||||||
|
state.onInstancelist = false
|
||||||
|
state.onInstance = false
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
22
server/api/addPOT.ts
Normal file
22
server/api/addPOT.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { insertId, errorMsg } from "../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return insertId
|
||||||
|
})
|
||||||
21
server/api/addTodoPOT.ts
Normal file
21
server/api/addTodoPOT.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { errorMsg } from "../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
})
|
||||||
22
server/api/deletePOTTodo/[id].ts
Normal file
22
server/api/deletePOTTodo/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return
|
||||||
|
})
|
||||||
22
server/api/deleteProductionOrderTemplate/[id].ts
Normal file
22
server/api/deleteProductionOrderTemplate/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return
|
||||||
|
})
|
||||||
22
server/api/deleteTodosPOT/[id].ts
Normal file
22
server/api/deleteTodosPOT/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return
|
||||||
|
})
|
||||||
22
server/api/getCIFromClient/[id].ts
Normal file
22
server/api/getCIFromClient/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { configItemsFromClient, errorMsg } from "../../middleware/configItems";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return configItemsFromClient
|
||||||
|
})
|
||||||
22
server/api/getProductionOrderTemplate/[id].ts
Normal file
22
server/api/getProductionOrderTemplate/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { pot, errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return pot
|
||||||
|
})
|
||||||
22
server/api/getSelectedPOTsByClient/[id].ts
Normal file
22
server/api/getSelectedPOTsByClient/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { selectedPOTsByClient, errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return selectedPOTsByClient
|
||||||
|
})
|
||||||
22
server/api/getSelectedPOTsByPOT/[id].ts
Normal file
22
server/api/getSelectedPOTsByPOT/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { selectedPOTsByPOT, errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return selectedPOTsByPOT
|
||||||
|
})
|
||||||
22
server/api/getTodosProductionOrderTemplate/[id].ts
Normal file
22
server/api/getTodosProductionOrderTemplate/[id].ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { potTodosByTemplateId, errorMsg } from "../../middleware/productionOrderTemplates";
|
||||||
|
import { OutgoingMessage } from 'http';
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
const headers: Record<string, Parameters<OutgoingMessage['setHeader']>[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',
|
||||||
|
};
|
||||||
|
setResponseHeaders(event, headers)
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
return potTodosByTemplateId
|
||||||
|
})
|
||||||
13
server/api/updatePOTTodo.ts
Normal file
13
server/api/updatePOTTodo.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { errorMsg } from "../middleware/productionOrderTemplates";
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
})
|
||||||
13
server/api/updateProductionOrderTemplate.ts
Normal file
13
server/api/updateProductionOrderTemplate.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { errorMsg } from "../middleware/productionOrderTemplates";
|
||||||
|
|
||||||
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
|
if (!(errorMsg === '')) {
|
||||||
|
throw createError({
|
||||||
|
statusCode: 400,
|
||||||
|
statusMessage: errorMsg,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setResponseStatus(event, 200)
|
||||||
|
})
|
||||||
@ -6,6 +6,7 @@ let configItems = [];
|
|||||||
let configItem = {};
|
let configItem = {};
|
||||||
let errorMsg = '';
|
let errorMsg = '';
|
||||||
let selectedConfigItemsByClient = [];
|
let selectedConfigItemsByClient = [];
|
||||||
|
let configItemsFromClient = [];
|
||||||
let selectedConfigItemsByAsset = [];
|
let selectedConfigItemsByAsset = [];
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
@ -82,6 +83,38 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getCIFromClient")) {
|
||||||
|
// get all config items from a client from backend
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/configItemByCustomerID/${itemId}`);
|
||||||
|
configItemsFromClient = 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/updateConfigItem")) {
|
if (event.path.startsWith("/api/updateConfigItem")) {
|
||||||
const body = await readBody(event)
|
const body = await readBody(event)
|
||||||
// update the config item in the backend
|
// update the config item in the backend
|
||||||
@ -235,4 +268,4 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export { configItems, configItem, selectedConfigItemsByClient, selectedConfigItemsByAsset, errorMsg };
|
export { configItems, configItem, selectedConfigItemsByClient, selectedConfigItemsByAsset, configItemsFromClient, errorMsg };
|
||||||
@ -3,12 +3,14 @@ import serversideConfig from '../../serversideConfig';
|
|||||||
import https from 'https';
|
import https from 'https';
|
||||||
|
|
||||||
let productionOrderTemplates = [];
|
let productionOrderTemplates = [];
|
||||||
|
let selectedPOTsByClient = [];
|
||||||
|
let selectedPOTsByPOT = [];
|
||||||
|
let potTodosByTemplateId = [];
|
||||||
|
let pot = [];
|
||||||
|
let insertId = -1;
|
||||||
let errorMsg = '';
|
let errorMsg = '';
|
||||||
|
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
|
|
||||||
if (event.path.startsWith("/api/getAllProductionOrderTemplates")) {
|
|
||||||
|
|
||||||
const agent = new https.Agent({
|
const agent = new https.Agent({
|
||||||
rejectUnauthorized: false,
|
rejectUnauthorized: false,
|
||||||
});
|
});
|
||||||
@ -21,6 +23,8 @@ export default defineEventHandler(async (event) => {
|
|||||||
httpsAgent: agent
|
httpsAgent: agent
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/getAllProductionOrderTemplates")) {
|
||||||
|
|
||||||
// get all production order templates object from backend
|
// get all production order templates object from backend
|
||||||
try {
|
try {
|
||||||
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders`);
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders`);
|
||||||
@ -46,6 +50,343 @@ export default defineEventHandler(async (event) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.path.startsWith("/api/addPOT")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
// add the pot in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.post(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders`, body);
|
||||||
|
insertId = res.data.insertId
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/getProductionOrderTemplate")) {
|
||||||
|
// get production order template object from backend
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders/${itemId}`);
|
||||||
|
pot = 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/updateProductionOrderTemplate")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
// update the production order template in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.put(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders`, body);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/getSelectedPOTsByClient")) {
|
||||||
|
// get selected production order templates object by client from backend
|
||||||
|
let filteredClient = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
filteredClient = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedMasterProductionOrdersByCustomer/${filteredClient}`);
|
||||||
|
selectedPOTsByClient = 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/getSelectedPOTsByPOT")) {
|
||||||
|
// get selected production order templates object by pot from backend
|
||||||
|
let filteredPOT = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
filteredPOT = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/selectedMasterProductionOrdersByChecklistname/${filteredPOT}`);
|
||||||
|
selectedPOTsByPOT = 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/deleteProductionOrderTemplate")) {
|
||||||
|
let potId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
potId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
// delete the pot in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.delete(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrders/${potId}`);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/getTodosProductionOrderTemplate")) {
|
||||||
|
// get production order template todos object from backend
|
||||||
|
let itemId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
itemId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.get(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrderTodos/${itemId}`);
|
||||||
|
potTodosByTemplateId = 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/addTodoPOT")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
// add the pot todo in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.post(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrderTodos`, body);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/updatePOTTodo")) {
|
||||||
|
const body = await readBody(event)
|
||||||
|
// update the production order template todo in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.put(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrderTodos`, body);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/deleteTodosPOT")) {
|
||||||
|
let potId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
potId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
// delete the pot in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.delete(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrderTodosByTemplateid/${potId}`);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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/deletePOTTodo")) {
|
||||||
|
let potId = null;
|
||||||
|
const path = event._path;
|
||||||
|
const pathSegments = path.split('/');
|
||||||
|
potId = pathSegments[pathSegments.length - 1];
|
||||||
|
|
||||||
|
// delete the pot in the backend
|
||||||
|
try {
|
||||||
|
let res = await axiosInstance.delete(`https://${serversideConfig.url}:${serversideConfig.port}/masterProductionOrderTodos/${potId}`);
|
||||||
|
} 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) {
|
||||||
|
console.log(err)
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export { productionOrderTemplates, errorMsg };
|
export { productionOrderTemplates, selectedPOTsByClient, selectedPOTsByPOT, pot, potTodosByTemplateId, insertId, errorMsg };
|
||||||
Reference in New Issue
Block a user