From e19d3f05f118b26b2affe56fc92a01dcdebcf8ae Mon Sep 17 00:00:00 2001 From: Thanaphon Frappet Date: Wed, 9 Jul 2025 15:06:30 +0700 Subject: [PATCH] refactor: remove customer name --- src/pages/03_customer-management/BranchPage.vue | 1 - src/pages/03_customer-management/MainPage.vue | 1 - .../components/employer/EmployerFormAbout.vue | 14 -------------- .../components/employer/EmployerFormBranch.vue | 1 - src/pages/03_customer-management/form.ts | 5 ----- src/pages/10_invoice/constants.ts | 2 +- src/pages/11_credit-note/MainPage.vue | 2 +- src/pages/12_debit-note/MainPage.vue | 2 +- src/stores/customer/types.ts | 2 -- 9 files changed, 3 insertions(+), 27 deletions(-) diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index 2831bc68..3c2e07bb 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -856,7 +856,6 @@ watch( v-model:last-name-en="customerBranchFormData.lastNameEN" v-model:gender="customerBranchFormData.gender" v-model:birth-date="customerBranchFormData.birthDate" - v-model:customer-name="customerBranchFormData.customerName" v-model:legal-person-no="customerBranchFormData.legalPersonNo" v-model:branch-code="customerBranchFormData.code" v-model:register-name="customerBranchFormData.registerName" diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue index c32986d4..a9e001cc 100644 --- a/src/pages/03_customer-management/MainPage.vue +++ b/src/pages/03_customer-management/MainPage.vue @@ -4410,7 +4410,6 @@ const emptyCreateDialog = ref(false); await customerStore.createBranch({ ...customerFormData.customerBranch[idx], customerId: customerFormState.editCustomerId, - id: undefined, }); } else { await customerStore.editBranchById( diff --git a/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue b/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue index 8e38e81b..f98df3da 100644 --- a/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue +++ b/src/pages/03_customer-management/components/employer/EmployerFormAbout.vue @@ -167,20 +167,6 @@ watch(
- - { contactTel: v.contactTel, officeTel: v.officeTel, agentUserId: v.agentUserId || undefined, - customerName: v.customerName, authorizedName: v.authorizedName, authorizedNameEN: v.authorizedNameEN, @@ -328,8 +327,6 @@ export const useCustomerForm = defineStore('form-customer', () => { currentFormData.value.customerBranch?.at(0)?.agentUserId || undefined, status: 'CREATED', - customerName: - currentFormData.value.customerBranch?.at(0)?.customerName || '', registerName: currentFormData.value.customerBranch?.at(0)?.registerName || '', registerNameEN: @@ -571,7 +568,6 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { agentUserId: undefined, status: 'CREATED', - customerName: '', registerName: '', registerNameEN: '', registerDate: undefined, @@ -657,7 +653,6 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => { officeTel: _data.officeTel, agentUserId: _data.agentUserId || undefined, codeCustomer: _data.codeCustomer, - customerName: _data.customerName, homeCode: _data.homeCode, authorizedName: _data.authorizedName, authorizedNameEN: _data.authorizedNameEN, diff --git a/src/pages/10_invoice/constants.ts b/src/pages/10_invoice/constants.ts index e21573f6..f7d350d7 100644 --- a/src/pages/10_invoice/constants.ts +++ b/src/pages/10_invoice/constants.ts @@ -29,7 +29,7 @@ export const columns = [ name: 'customer', align: 'center', label: 'general.customer', - field: (v: Invoice) => v.quotation.customerBranch.customerName, + field: (v: Invoice) => v.quotation.customerBranch.registerName, }, { diff --git a/src/pages/11_credit-note/MainPage.vue b/src/pages/11_credit-note/MainPage.vue index a5a7c48e..cbaeb520 100644 --- a/src/pages/11_credit-note/MainPage.vue +++ b/src/pages/11_credit-note/MainPage.vue @@ -406,7 +406,7 @@ watch( value: item.row.quotation.customerBranch.customer .customerType === 'CORP' - ? item.row.quotation.customerBranch.customerName + ? item.row.quotation.customerBranch.registerName : $i18n.locale === 'tha' ? `${item.row.quotation.customerBranch.firstName} ${item.row.quotation.customerBranch.lastName}` : `${item.row.quotation.customerBranch.firstNameEN} ${item.row.quotation.customerBranch.lastNameEN}`, diff --git a/src/pages/12_debit-note/MainPage.vue b/src/pages/12_debit-note/MainPage.vue index 8820a891..a1199e91 100644 --- a/src/pages/12_debit-note/MainPage.vue +++ b/src/pages/12_debit-note/MainPage.vue @@ -425,7 +425,7 @@ watch( label: $t('quotation.customer'), value: item.row.customerBranch.customer.customerType === 'CORP' - ? item.row.customerBranch.customerName + ? item.row.customerBranch.registerName : $i18n.locale === 'tha' ? `${item.row.customerBranch.firstName} ${item.row.customerBranch.lastName}` : `${item.row.customerBranch.firstNameEN} ${item.row.customerBranch.lastNameEN}`, diff --git a/src/stores/customer/types.ts b/src/stores/customer/types.ts index 52be5c6e..5da29902 100644 --- a/src/stores/customer/types.ts +++ b/src/stores/customer/types.ts @@ -72,7 +72,6 @@ export type CustomerBranch = { namePrefix: string; telephoneNo: string; codeCustomer: string; - customerName: string; updatedByUserId: string; createdByUserId: string; code: string; @@ -135,7 +134,6 @@ export type CustomerBranchCreate = { officeTel?: string; agentUserId?: string; status: Status; - customerName?: string; registerName?: string; registerNameEN?: string; registerDate?: string | Date | null;