From 9a09ae1946667120b05d720b8a97b4563b9509bd Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:27:44 +0700 Subject: [PATCH 1/8] feat: make input not move on edit --- src/components/04_product-service/BasicInfoProduct.vue | 8 ++++---- src/components/04_product-service/PriceDataComponent.vue | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/04_product-service/BasicInfoProduct.vue b/src/components/04_product-service/BasicInfoProduct.vue index 1d6abc7a..2e23bf00 100644 --- a/src/components/04_product-service/BasicInfoProduct.vue +++ b/src/components/04_product-service/BasicInfoProduct.vue @@ -82,7 +82,7 @@ onMounted(async () => { { {
{ Date: Mon, 8 Jul 2024 16:29:37 +0700 Subject: [PATCH 2/8] feat: change path in product service --- src/i18n/en-US/product-service.ts | 2 + src/i18n/th-th/main.ts | 2 +- src/layouts/MainLayout.vue | 8 +++- src/pages/04_product-service/MainPage.vue | 57 +++++++---------------- src/stores/utils/index.ts | 6 ++- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/src/i18n/en-US/product-service.ts b/src/i18n/en-US/product-service.ts index c1e34332..a912978c 100644 --- a/src/i18n/en-US/product-service.ts +++ b/src/i18n/en-US/product-service.ts @@ -9,6 +9,8 @@ export default { service: 'Service', product: 'Product', + productGroup: 'Product Group: {name}', + productType: 'Product Type: {name}', messageTooltipNoProduct: 'No Product and Service Groups', messageTooltipProductCreate: 'Click + for product and service groups.', diff --git a/src/i18n/th-th/main.ts b/src/i18n/th-th/main.ts index 2aa8851d..ea26c3f7 100644 --- a/src/i18n/th-th/main.ts +++ b/src/i18n/th-th/main.ts @@ -9,7 +9,7 @@ export default { mainCustomerCaption: 'จัดการคนภายในองค์กร', mainProductTitle: 'สินค้าและบริการ', - mainProductCaption: 'รายการสินค้าและบริการ', + mainProductCaption: 'ประเภทสินค้าและบริการ', mainQuotationTitle: 'ใบเสนอราคา', mainQuotationCaption: 'รายการใบเสนอราคา', diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 1a26d58f..1188c616 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -265,7 +265,13 @@ onMounted(async () => { class="text-caption cursor-pointer" @click="item.handler?.()" > - {{ item.text ? $t(item.text) : '' }} + {{ + item.text + ? $t(item.text, { + ...(item.argsi18n || {}), + }) + : '' + }} { watch(productMode, () => { inputSearch.value = ''; currentStatus.value = 'All'; + const tmp: typeof utilsStore.currentTitle.path = []; + + if (productMode.value === 'type' || productMode.value === 'service') { + tmp.push({ + text: 'productGroup', + argsi18n: { name: pathGroupName.value }, + handler: () => { + productMode.value = 'type'; + }, + }); + } + if (productMode.value === 'service') { + tmp.push({ text: 'productType', argsi18n: { name: pathTypeName.value } }); + } + + utilsStore.currentTitle.path = tmp; }); watch(currentStatus, async () => { @@ -1183,47 +1199,6 @@ watch(inputSearchProductAndService, async () => {
- -
- -
- {{ pathGroupName }} -
-
- / -
-
- {{ pathTypeName }} -
-
-
{ const currentTitle = ref<{ title: string; - path: { text: string; handler?: () => unknown }[]; + path: { + text: string; + argsi18n?: Record; + handler?: () => unknown; + }[]; }>({ title: '', path: [ From e15fd825f9b423ab94fe4e6ce76ee9020dc7d848 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:33:16 +0700 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=20=20=E0=B9=80=E0=B8=9E=E0=B8=B4?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=20=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/en-US/customer-main-page.ts | 3 +++ src/i18n/th-th/customer-main-page.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/i18n/en-US/customer-main-page.ts b/src/i18n/en-US/customer-main-page.ts index 8d4547cf..24f703ef 100644 --- a/src/i18n/en-US/customer-main-page.ts +++ b/src/i18n/en-US/customer-main-page.ts @@ -8,6 +8,9 @@ export default { customerEmployeeTooltipCaption: 'Click + to add an employee', customerEmployerAdd: 'Add employer', customerEmployeeAdd: 'Add employee', + + nameEmployee:'Name Employee', + EMPLOYER: 'Employer', EMPLOYEE: 'Employee', customerEmployerStatTitle: 'Employer data summary', diff --git a/src/i18n/th-th/customer-main-page.ts b/src/i18n/th-th/customer-main-page.ts index 150b9f14..8f5edc4b 100644 --- a/src/i18n/th-th/customer-main-page.ts +++ b/src/i18n/th-th/customer-main-page.ts @@ -8,6 +8,9 @@ export default { customerEmployeeTooltipCaption: 'คลิก + เพื่อเพิ่มลูกจ้าง', customerEmployerAdd: 'เพิ่มนายจ้าง', customerEmployeeAdd: 'เพิ่มลูกจ้าง', + + nameEmployee:'ชื่อลูกจ้าง', + EMPLOYER: 'นายจ้าง', EMPLOYEE: 'ลูกจ้าง', customerEmployerStatTitle: 'สรุปจำนวนข้อมูลนายจ้าง', From afc08791c648c3e5cfecf688e5f0108af38bb89d Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:34:26 +0700 Subject: [PATCH 4/8] =?UTF-8?q?refactor:=20=E0=B9=81=E0=B8=81=E0=B9=89=20?= =?UTF-8?q?=E0=B8=AA=E0=B8=B5=E0=B8=95=E0=B8=AD=E0=B8=99=20=20INACTIVE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/home/PersonCard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/home/PersonCard.vue b/src/components/home/PersonCard.vue index 9c91f14c..b11c7172 100644 --- a/src/components/home/PersonCard.vue +++ b/src/components/home/PersonCard.vue @@ -235,8 +235,8 @@ defineEmits<{ &.person-box__disabled { - opacity: 0.7; - filter: grayscale(1); + opacity: 0.5; + filter: grayscale(0.9); .status-circle { background-color: var(--surface-1); From 6ea6cf231f8f6dce2307aaed145d05dd5ee51dd2 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:37:08 +0700 Subject: [PATCH 5/8] =?UTF-8?q?refactor:=20=E0=B9=80=E0=B8=9B=E0=B8=A5?= =?UTF-8?q?=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=99=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/01_branch-management/MainPage.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/01_branch-management/MainPage.vue b/src/pages/01_branch-management/MainPage.vue index b3f9ff0a..a85cbea1 100644 --- a/src/pages/01_branch-management/MainPage.vue +++ b/src/pages/01_branch-management/MainPage.vue @@ -1049,7 +1049,7 @@ watch(locale, () => { { --_branch-status-color: var(--red-4-hsl); --_branch-badge-bg: var(--red-4-hsl); filter: grayscale(1); - background-color: hsl(var(--gray-6-hsl) / 0.1); opacity: 0.5; } From 461cd9fab8a32c9960d1582c0e97eea13ae15cc6 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:37:54 +0700 Subject: [PATCH 6/8] =?UTF-8?q?refactor:=20=E0=B9=80=E0=B8=9E=E0=B8=B4?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=20=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/employee/types.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/stores/employee/types.ts b/src/stores/employee/types.ts index ad612870..42932fd5 100644 --- a/src/stores/employee/types.ts +++ b/src/stores/employee/types.ts @@ -2,6 +2,8 @@ import { District, Province, SubDistrict } from '../address'; import { Status } from '../types'; import { User } from '../user/types'; +import { Customer , CustomerBranch } from '../customer/types'; + export type Employee = { id: string; code: string; @@ -45,6 +47,8 @@ export type Employee = { district: District | null; province: Province | null; profileImageUrl: string | null; + customerBranch: CustomerBranch & { customer: Customer } ; + }; export type EmployeeCreate = { From 26d6c58390b2c74bc979026d91e01fd879396736 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:38:17 +0700 Subject: [PATCH 7/8] =?UTF-8?q?refactor:=20=E0=B9=80=E0=B8=9E=E0=B8=B4?= =?UTF-8?q?=E0=B9=88=E0=B8=A1=20=20list=20=20=E0=B8=82=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=20=E0=B8=A5=E0=B8=B9=E0=B8=81=E0=B8=88=E0=B9=89=E0=B8=B2?= =?UTF-8?q?=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/03_customer-management/MainPage.vue | 481 +++++++++++++++++- 1 file changed, 455 insertions(+), 26 deletions(-) diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index 576d9e90..57387cc1 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -6,6 +6,7 @@ import useCustomerStore from 'src/stores/customer'; import useEmployeeStore from 'src/stores/employee'; import useOptionStore from 'src/stores/options'; import useMyBranchStore from 'src/stores/my-branch'; +import useUserStore from 'src/stores/user'; import { Status } from 'src/stores/types'; @@ -65,10 +66,53 @@ const { t, locale } = useI18n(); const utilsStore = useUtilsStore(); const userCustomer = useCustomerStore(); const useMyBranch = useMyBranchStore(); +const userStore = useUserStore(); const { fetchListOptionBranch } = useMyBranch; -const columns = [ +const columnsEmployee = [ + { + name: 'firstName', + align: 'left', + label: 'nameEmployee', + field: 'firstName', + sortable: true, + }, + { + name: 'type', + align: 'left', + label: 'type', + field: 'type', + sortable: true, + }, + { + name: 'formDialogInputNationality', + align: 'left', + label: 'formDialogInputNationality', + field: 'nationality', + }, + { + name: 'formDialogEmployeeNRCNo', + align: 'left', + label: 'formDialogEmployeeNRCNo', + field: 'nrcNo', + }, + { + name: 'formDialogInputAge', + align: 'left', + label: 'formDialogInputAge', + field: 'dateOfBirth', + }, + + { + name: 'branchLabel', + align: 'left', + label: 'branchLabel', + field: 'customerBranch', + }, +] satisfies QTableProps['columns']; + +const columnsCustomer = [ { name: 'customerName', align: 'left', @@ -77,7 +121,7 @@ const columns = [ sortable: true, }, { - name: 'customerType', + name: 'type', align: 'left', label: 'type', field: 'customerType', @@ -168,7 +212,7 @@ const fieldSelectedCustomer = ref<{ label: string; value: string }>({ value: 'all', }); -const fieldDisplay = ref< +const fieldDisplayEmployer = ref< { label: string; value: string; @@ -181,7 +225,7 @@ const fieldDisplay = ref< { label: t('type'), - value: 'customerType', + value: 'type', }, { @@ -199,15 +243,69 @@ const fieldDisplay = ref< value: 'branchEmail', }, ]); + +const fieldDisplayEmployee = ref< + { + label: string; + value: string; + }[] +>([ + { + label: t('nameEmployee'), + value: 'firstName', + }, + { + label: t('type'), + value: 'type', + }, + + { + label: t('formDialogInputNationality'), + value: 'formDialogInputNationality', + }, + + { + label: t('formDialogEmployeeNRCNo'), + value: 'formDialogEmployeeNRCNo', + }, + + { + label: t('formDialogInputAge'), + value: 'formDialogInputAge', + }, + + { + label: t('branchLabel'), + value: 'branchLabel', + }, +]); + const fieldSelected = ref< ( | 'customerName' - | 'customerType' + | 'type' | 'personName' | 'telephoneNo' | 'branchEmail' + | 'firstName' + | 'formDialogInputNationality' + | 'formDialogEmployeeNRCNo' + | 'formDialogInputAge' + | 'branchLabel' )[] ->(['customerName', 'customerType', 'personName', 'telephoneNo', 'branchEmail']); +>([ + 'customerName', + 'type', + 'personName', + 'telephoneNo', + 'branchEmail', + 'firstName', + 'formDialogInputNationality', + 'formDialogInputNationality', + 'formDialogEmployeeNRCNo', + 'formDialogInputAge', + 'branchLabel', +]); const splitterModel = ref(15); const modeView = ref(true); @@ -391,8 +489,8 @@ const inputFile = (() => { return element; })(); -const listCustomer = ref<(Customer & { branch: CustomerBranch[] })[]>(); -const listEmployee = ref(); +const listCustomer = ref<(Customer & { branch: CustomerBranch[] })[]>([]); +const listEmployee = ref([]); const itemCard = [ { @@ -1124,7 +1222,7 @@ async function assignFormDataEmployee(id: string) { }; formDataEmployee.value = { - image: foundEmployee.profileImageUrl, + image: null, customerBranchId: foundEmployee.customerBranchId, nrcNo: foundEmployee.nrcNo, dateOfBirth: foundEmployee.dateOfBirth, @@ -1169,7 +1267,7 @@ async function assignFormDataEmployee(id: string) { } if (infoEmployeePersonCard.value) { - infoEmployeePersonCard.value[0].img = foundEmployee.profileImageUrl; + infoEmployeePersonCard.value[0].img = foundEmployee.profileImageUrl || ''; } } flowStore.rotate(); @@ -1536,12 +1634,15 @@ watch([inputSearch, currentStatus], async () => { { label: $t('statusINACTIVE'), value: 'INACTIVE' }, ]" > - { bordered :grid="modeView" :rows="listCustomer" - :columns="columns" + :columns="columnsCustomer" card-container-class=" q-col-gutter-md" row-key="name" :rows-per-page-options="[0]" @@ -1751,6 +1852,8 @@ watch([inputSearch, currentStatus], async () => {
+ { }, ], }" + :disabled="props.row.status === 'INACTIVE'" @history="openHistory(props.row.id)" @update-card=" () => { @@ -2237,7 +2334,332 @@ watch([inputSearch, currentStatus], async () => { class="col column justify-between q-px-md q-pt-md scroll" v-if="listEmployee.length !== 0" > - + + + + + + +
{ padding-inline: var(--size-2); } +.tags__parimary { + --_color: var(--blue-6-hsl); +} + .tags__purple { --_color: var(--violet-11-hsl); } @@ -3651,6 +4077,10 @@ watch([inputSearch, currentStatus], async () => { --_color: var(--teal-10-hsl); } +.dark .tags__parimary { + --_color: var(--blue-12-hsl); +} + .dark .tags__purple { --_color: var(--violet-10-hsl); } @@ -3666,8 +4096,7 @@ watch([inputSearch, currentStatus], async () => { .status-inactive { --_branch-status-color: var(--red-4-hsl); --_branch-badge-bg: var(--red-4-hsl); - filter: grayscale(1); - background-color: hsl(var(--gray-6-hsl) / 0.1); + filter: grayscale(0.5); opacity: 0.5; } From f3b0dc4e1d0c9ebd4eb6087fb3bbd4441846f36c Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:52:00 +0700 Subject: [PATCH 8/8] =?UTF-8?q?fix:=20=E0=B9=81=E0=B8=81=E0=B9=89=20=20?= =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5=E0=B9=88=E0=B8=A2=E0=B8=99?= =?UTF-8?q?=E0=B8=AA=E0=B8=96=E0=B8=B2=E0=B8=99=E0=B8=B0=E0=B9=80=E0=B9=80?= =?UTF-8?q?=E0=B8=A5=E0=B9=89=E0=B8=A7=E0=B9=84=E0=B8=A1=E0=B9=88=20?= =?UTF-8?q?=E0=B8=AD=E0=B8=B1=E0=B8=9E=E0=B9=80=E0=B8=94=E0=B8=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/04_product-service/MainPage.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue index d631d08c..0e10147c 100644 --- a/src/pages/04_product-service/MainPage.vue +++ b/src/pages/04_product-service/MainPage.vue @@ -469,7 +469,7 @@ async function toggleStatusProduct(id: string, status: Status) { status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', }); - await fetchListOfProduct(); + await alternativeFetch(); flowStore.rotate(); } @@ -478,7 +478,7 @@ async function toggleStatusService(id: string, status: Status) { status: status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE', }); - await fetchListOfService(); + await alternativeFetch(); flowStore.rotate(); } async function toggleStatusType(id: string, status: Status) { @@ -973,6 +973,11 @@ async function fetchStatus() { } async function alternativeFetch() { + + +console.log('asdasds'); + + if (productAndServiceTab.value === 'all') { await fetchListOfProductAndService(); flowStore.rotate();