update ui

This commit is contained in:
ameerulrasyid 2025-03-07 14:31:19 +08:00
parent 0225c22696
commit d316a42a5e
2 changed files with 9 additions and 52 deletions

View File

@ -1419,9 +1419,15 @@
}, },
toggleCategory(itemId) { toggleCategory(itemId) {
this.categoryVisible[itemId] = !this.categoryVisible[itemId]; this.categoryVisible[itemId] = !this.categoryVisible[itemId];
this.detailsVisible = {};
this.historyVisible = {};
}, },
toggleHistory(itemId) { toggleHistory(itemId) {
this.historyVisible = {};
this.historyVisible[itemId] = !this.historyVisible[itemId]; this.historyVisible[itemId] = !this.historyVisible[itemId];
}, },
toggleDetails(movementId) { toggleDetails(movementId) {
this.detailsVisible[movementId] = !this.detailsVisible[movementId]; this.detailsVisible[movementId] = !this.detailsVisible[movementId];

View File

@ -301,7 +301,7 @@
"className": "align-middle", "className": "align-middle",
}, },
{ {
"title": "Product Name", "title": "Product",
"data": "productName", "data": "productName",
"render": function (data, type, full, meta) { "render": function (data, type, full, meta) {
if (!data) { if (!data) {
@ -456,7 +456,7 @@
"data": "requestID", "data": "requestID",
}, },
{ {
"title": "Product Name", "title": "Product",
"data": "productName", "data": "productName",
"render": function (data, type, full, meta) { "render": function (data, type, full, meta) {
if (!data) { if (!data) {
@ -468,7 +468,6 @@
var isImage = /\.(jpeg|jpg|png|gif)$/i.test(imageSrc); var isImage = /\.(jpeg|jpg|png|gif)$/i.test(imageSrc);
var isPdf = /\.pdf$/i.test(imageSrc); var isPdf = /\.pdf$/i.test(imageSrc);
// var imageSrc = full.productImage; Fallback to data if imgsrc is unavailable // var imageSrc = full.productImage; Fallback to data if imgsrc is unavailable
console.log(full);
if (isImage) { if (isImage) {
return ` <div class="row"><td>${data}</td></div> return ` <div class="row"><td>${data}</td></div>
@ -678,42 +677,6 @@
} }
}, },
async fetchCompanies() {
try {
const response = await fetch('/AdminAPI/GetDepartmentWithCompanyList', {
method: 'POST', // Specify the HTTP method
headers: {
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error('Failed to fetch companies');
}
this.companies = await response.json();
} catch (error) {
console.error('Error fetching products:', error);
}
},
async fetchSuppliers() {
try {
const response = await fetch('/InvMainAPI/SupplierList', {
method: 'POST', // Specify the HTTP method
headers: {
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error('Failed to fetch suppliers');
}
this.suppliers = await response.json(); // Get the full response object
} catch (error) {
console.error('Error fetching suppliers:', error);
}
},
async fetchStation() { async fetchStation() {
try { try {
const response = await fetch('/InvMainAPI/StationList', { const response = await fetch('/InvMainAPI/StationList', {
@ -765,19 +728,7 @@
console.error('Error fetching suppliers:', error); console.error('Error fetching suppliers:', error);
} }
}, },
async fetchCurrencyData() {
try {
// Fetch currency data from the API
const response = await fetch('https://openexchangerates.org/api/currencies.json'); // Example API
this.currencies = await response.json();
} catch (error) {
console.error('Error fetching currency data:', error);
}
},
convertCurrency() {
// Your currency conversion logic here
console.log('Selected currency:', this.currency);
},
// FRONT END FUNCTIONS // FRONT END FUNCTIONS
//----------------------// //----------------------//