From 8185a47da6b319631a75952e19553332308caec8 Mon Sep 17 00:00:00 2001
From: Net <93821485+somnetsak123@users.noreply.github.com>
Date: Mon, 24 Jun 2024 13:07:00 +0700
Subject: [PATCH] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=82?=
=?UTF-8?q?=E0=B8=99=E0=B8=B2=E0=B8=94=E0=B8=81=E0=B8=B2=E0=B8=A3=E0=B9=81?=
=?UTF-8?q?=E0=B8=AA=E0=B8=94=E0=B8=87=E0=B8=AA=E0=B8=B4=E0=B8=99=E0=B8=84?=
=?UTF-8?q?=E0=B9=89=E0=B8=B2=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=9A=E0=B8=A3?=
=?UTF-8?q?=E0=B8=B4=E0=B8=81=E0=B8=B2=E0=B8=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../TotalProductCardComponent.vue | 2 +-
src/pages/04_product-service/MainPage.vue | 108 +++++++++++-------
2 files changed, 70 insertions(+), 40 deletions(-)
diff --git a/src/components/04_product-service/TotalProductCardComponent.vue b/src/components/04_product-service/TotalProductCardComponent.vue
index 80300205..d374f5be 100644
--- a/src/components/04_product-service/TotalProductCardComponent.vue
+++ b/src/components/04_product-service/TotalProductCardComponent.vue
@@ -43,7 +43,7 @@ withDefaults(
no-padding
bordered
:class="{ 'is-add-product': isAddProduct }"
- style="box-shadow: var(--shadow-3); width: 240px; height: 286px"
+ style="box-shadow: var(--shadow-3); min-height: 300px"
@click="$emit('select', data)"
>
diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue
index e06e263e..8ccb34fe 100644
--- a/src/pages/04_product-service/MainPage.vue
+++ b/src/pages/04_product-service/MainPage.vue
@@ -132,6 +132,7 @@ const productMode = ref<'group' | 'type' | 'service' | 'product'>('group');
const productGroup = ref
();
const productType = ref();
const product = ref();
+const resultSearchProduct = ref();
const service = ref();
const productAndServiceTab = ref('all');
@@ -231,6 +232,16 @@ async function searchGroup() {
}
}
+async function searchProductAndService() {}
+
+async function searchProduct() {
+ const result = await fetchListProduct({ query: searchTotalProduct.value });
+
+ if (result) {
+ resultSearchProduct.value = result.result;
+ }
+}
+
async function fetchListType() {
const res = await fetchListProductServiceType({
productGroupId: currentId.value,
@@ -669,7 +680,10 @@ onMounted(async () => {
await fetchListGroups();
});
-watch(productMode, () => (inputSearch.value = ''));
+watch(productMode, () => {
+ inputSearch.value = '';
+ currentStatus.value = 'All';
+});
watch(currentStatus, async () => {
if (productMode.value === 'group') {
@@ -1122,21 +1136,21 @@ watch(currentStatus, async () => {
{{ $t('all') }}
{{ $t('statusACTIVE') }}
{{ $t('statusINACTIVE') }}
@@ -1156,20 +1170,26 @@ watch(currentStatus, async () => {
{
:id="i.id"
typeProduct="product"
:title="i.name"
- :status="i.status === 'INACTIVE' ? true : false"
+ :isDisabled="i.status === 'INACTIVE' ? true : false"
@menuViewDetail="
() => {
currentIdProduct = i.id;
@@ -1209,11 +1229,23 @@ watch(currentStatus, async () => {
{
:code="i.code"
:id="i.id"
:title="i.name"
- :status="i.status === 'INACTIVE' ? true : false"
+ :isDisabled="i.status === 'INACTIVE' ? true : false"
:created-at="i.createdAt"
@menuViewDetail="
() => {
@@ -1337,7 +1369,11 @@ watch(currentStatus, async () => {
selectProduct = [];
}
"
- :close="() => {}"
+ :close="
+ () => {
+ searchTotalProduct = '';
+ }
+ "
>
-
+
{
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="searchTotalProduct"
debounce="500"
- @update:model-value=""
+ @update:model-value="searchProduct()"
>
@@ -1365,19 +1401,13 @@ watch(currentStatus, async () => {
-
+