- + + {{ name }} - + + {{ uploading.loaded @@ -79,7 +80,7 @@ onMounted(() => { /> {{ idle ? `Pending` : progress !== 1 ? `Uploading...` : 'Completed' }} - + void | Promise<{ + ) => Promise<{ status: boolean; group: string; meta: { name: string; value: string }[]; diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 7bd226ac..eb2b877b 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -198,3 +198,10 @@ i.q-icon.mdi.mdi-chevron-down-circle.q-expansion-item__toggle-icon.q-expansion-i .q-focus-helper { visibility: hidden; } + +.clear-btn { + opacity: 0.6; + &:hover { + opacity: 1; + } +} diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts index 5546d0b8..9afb6737 100644 --- a/src/i18n/eng.ts +++ b/src/i18n/eng.ts @@ -507,6 +507,7 @@ export default { miss: 'MISS.', }, + taxpayyerNo: 'Taxpayer Identification Number', citizenId: 'Citizen ID', religion: 'Religion', issueDate: 'Issue Date', @@ -777,6 +778,8 @@ export default { seller: 'Seller', paymentChannels: 'Payment Channels', channelsThat: 'Channels That', + refNo: 'Reference Number', + bankAccount: 'Bank Account', bankAccountNumber: 'Bank Account Number', bankAccountName: 'Bank Account Name', inTheNameOf: 'In The Name Of', diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts index 64411146..3430d2f6 100644 --- a/src/i18n/tha.ts +++ b/src/i18n/tha.ts @@ -508,6 +508,7 @@ export default { religion: 'ศาสนา', issueDate: 'วันที่ออกหนังสือ', passportExpiryDate: 'วันหiมดอายุหนังสือเดินทาง', + taxpayyerNo: 'เลขที่ประจำตัวผู้เสียภาษี', ownerName: 'ชื่อนายจ้าง', firstName: 'ชื่อ ', @@ -775,6 +776,8 @@ export default { seller: 'ผู้ขาย', paymentChannels: 'ช่องทางชำระเงิน', channelsThat: 'ช่องทางที่', + refNo: 'เลขที่อ้างอิง', + bankAccount: 'บัญชีธนาคาร', bankAccountNumber: 'เลขบัญชีธนาคาร', bankAccountName: 'ชื่อบัญชี', inTheNameOf: 'ในนาม', diff --git a/src/pages/03_customer-management/BranchPage.vue b/src/pages/03_customer-management/BranchPage.vue index 3c2e07bb..dd8c4737 100644 --- a/src/pages/03_customer-management/BranchPage.vue +++ b/src/pages/03_customer-management/BranchPage.vue @@ -18,6 +18,8 @@ import { CustomerBranch, CustomerType } from 'stores/customer/types'; import { columnsEmployee } from './constant'; import { useCustomerBranchForm, useEmployeeForm } from './form'; +import DialogEmployee from 'src/components/03_customer-management/DialogEmployee.vue'; +import DrawerEmployee from 'src/components/03_customer-management/DrawerEmployee.vue'; import EmployerFormAuthorized from './components/employer/EmployerFormAuthorized.vue'; import FloatingActionButton from 'components/FloatingActionButton.vue'; import SideMenu from 'components/SideMenu.vue'; @@ -89,6 +91,11 @@ const prop = withDefaults( currentCitizenId?: string; gender: string; selectedImage: string; + fetchImageList: ( + id: string, + selectedName: string, + type: 'customer' | 'employee', + ) => Promise; }>(), { color: 'green', @@ -96,7 +103,6 @@ const prop = withDefaults( ); const currentBranchEmployee = ref(''); const listEmployee = ref([]); - const customerId = defineModel('customerId', { required: true }); defineEmits<{ @@ -106,16 +112,6 @@ defineEmits<{ (e: 'dialog'): void; }>(); -onMounted(async () => { - customerBranchFormState.value.currentCustomerId = route.params - .customerId as string; - await fetchList(); - - branch.value?.forEach((v) => { - currentBtnOpen.value.push(false); - }); -}); - const columns = [ { name: 'branchName', @@ -257,10 +253,6 @@ async function fetchEmployee(opts: { branchId: string; pageSize?: number }) { } } -onMounted(async () => { - await fetchList(); -}); - watch([customerId, inputSearch, currentStatus, pageSizeBranch], async () => { await fetchList(); }); @@ -280,6 +272,16 @@ watch( } }, ); + +onMounted(async () => { + customerBranchFormState.value.currentCustomerId = route.params + .customerId as string; + await fetchList(); + + branch.value?.forEach((v) => { + currentBtnOpen.value.push(false); + }); +}); @@ -473,7 +475,6 @@ watch( - {{ useOptionStore().mapOption(props.row.businessType) || '-' }} + {{ + props.row.businessType + ? props.row.businessType[ + $i18n.locale === 'eng' ? 'nameEN' : 'name' + ] + : '-' + }}
+ { + if ( + $q.screen.gt.xs || + currentPageEmployee === maxPageEmployee + ) + return; + currentPageEmployee = currentPageEmployee + 1; + fetchListEmployee().then(() => + done(currentPageEmployee >= maxPageEmployee), + ); + } + " + > + { + openHistory(item.id); + } + " + @view=" + async (item: any) => { + employeeFormState.drawerModal = true; + employeeFormState.isEmployeeEdit = false; + employeeFormStore.assignFormDataEmployee(item.id); + await fetchImageList( + item.id, + item.selectedImage || '', + 'employee', + ); + } + " + @edit="(item: any) => editEmployeeFormPersonal(item.id)" + @delete=" + (item: any) => { + deleteEmployeeById({ + id: item.id, + fetch: async () => + await fetchListEmployee( + currentTab === 'employer' + ? { + page: 1, + pageSize: 999, + customerId: customerFormState.currentCustomerId, + } + : { + fetchStats: true, + mobileFetch: $q.screen.xs, + }, + ), + }); + } + " + @toggle-status=" + async (item: any) => { + triggerChangeStatus(item.id, item.status, item.firstNameEN); + } + " + /> + + + + + + +