++ Cassa - parte 1

This commit is contained in:
Surya Paolo
2024-01-02 15:24:57 +01:00
parent a2cab9ca60
commit 89d095d1c9
18 changed files with 441 additions and 376 deletions

View File

@@ -300,7 +300,11 @@ export default defineComponent({
title: 'Ordine'
}).onOk(async () => {
statusnow.value = await productStore.UpdateOrderCartStatus({ order_id: order._id, status })
let options = {
// userIdStore: order.items ? order.items[0].order.storehouse.username : '',
}
statusnow.value = await productStore.UpdateOrderCartStatus({ order_id: order._id, status, options })
if (statusnow.value === status) {
order.status = statusnow.value

View File

@@ -39,18 +39,17 @@ export default defineComponent({
const getArrProducts = computed(() => {
let arrprod = productStore.getProducts(cosa.value)
let catstr = cat.value;
if ((!search.value || (search.value && search.value.length < 2)) && !catstr) {
let lowerSearchText = search.value.toLowerCase().trim();
if ((!lowerSearchText || (lowerSearchText && lowerSearchText.length < 2)) && !catstr) {
return arrprod
}
let lowerSearchText = search.value.toLowerCase();
return arrprod.filter((product: IProduct) => {
let lowerName = product.productInfo.name!.toLowerCase();
let hasCategoria = !catstr || (catstr && product.productInfo.idCatProds?.includes(catstr));
// Use a regular expression to match whole words
let codeMatch = new RegExp(`\\b${search.value}\\b`, 'i');
let codeMatch = new RegExp(`\\b${lowerSearchText}\\b`, 'i');
let nameMatch = new RegExp(`\\b${lowerSearchText}`, 'i');
// Check if any word in lowerName starts with lowerSearchText