++ Cassa - parte 1
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user