Merge refactor/i18n into develop

This commit is contained in:
Methapon Metanipat 2024-08-26 16:24:08 +07:00
parent 3da5bf9079
commit c681b19e39
99 changed files with 2192 additions and 2987 deletions

View file

@ -54,34 +54,34 @@ const columns = [
{
name: 'orderNumber',
align: 'center',
label: 'orderNumber',
label: 'general.orderNumber',
field: 'branchNo',
},
{
name: 'branchLabelName',
align: 'left',
label: 'office',
label: 'branch.office',
field: 'name',
sortable: true,
},
{
name: 'branchLabelAddress',
align: 'left',
label: 'address',
label: 'general.address',
field: 'address',
sortable: true,
},
{
name: 'branchLabelTel',
align: 'left',
label: 'formDialogInputTelephone',
label: 'general.telephone',
field: 'telephoneNo',
},
{
name: 'branchLabelType',
align: 'left',
label: 'type',
label: 'general.type',
field: 'isHeadOffice',
},
] satisfies QTableProps['columns'];
@ -182,13 +182,13 @@ async function calculateStats() {
{
icon: 'mdi-office-building-outline',
count: _stats.hq,
label: 'branchHQLabel',
label: 'branch.card.branchHQLabel',
color: 'pink',
},
{
icon: 'mdi-home-group',
count: _stats.br,
label: 'branchLabel',
label: 'branch.card.branchLabel',
color: 'purple',
},
];
@ -196,10 +196,10 @@ async function calculateStats() {
}
onMounted(async () => {
utilsStore.currentTitle.title = 'branchManagement';
utilsStore.currentTitle.title = 'menu.branch';
utilsStore.currentTitle.path = [
{
text: 'branchManagementCaption',
text: 'branch.page.captionManage',
i18n: true,
handler: () => {
fieldSelectedBranch.value.value = 'branchHQLabel';
@ -257,7 +257,7 @@ const fieldSelectedBranch = ref<{
label: string;
value: string;
}>({
label: t('branchHQLabel'),
label: t('branch.form.title.branchHQLabel'),
value: 'branchHQLabel',
});
@ -516,13 +516,13 @@ async function triggerChangeStatus(
color: status !== 'INACTIVE' ? 'warning' : 'info',
icon:
status !== 'INACTIVE' ? 'mdi-alert' : 'mdi-message-processing-outline',
title: t('confirmChangeStatusTitle'),
title: t('dialog.title.confirmChangeStatus'),
actionText:
status !== 'INACTIVE' ? t('switchOffLabel') : t('switchOnLabel'),
status !== 'INACTIVE' ? t('general.close') : t('general.open'),
message:
status !== 'INACTIVE'
? t('confirmChangeStatusOffMessage')
: t('confirmChangeStatusOnMessage'),
? t('dialog.message.confirmChangeStatusOff')
: t('dialog.message.confirmChangeStatusOn'),
action: async () => {
const res = await branchStore.editById(id, {
status: status !== 'INACTIVE' ? 'INACTIVE' : 'ACTIVE',
@ -623,21 +623,16 @@ function changeTitle(
formType: 'edit' | 'create' | 'delete' | 'view',
typeBranch: 'headOffice' | 'subBranch',
) {
if (typeBranch === 'headOffice') {
return formType === 'create'
? t('formDialogTitleCreateHeadOffice')
: formType === 'view'
? t('formDialogTitleViewHeadOffice')
: t('formDialogTitleEditHeadOffice');
}
if (typeBranch === 'subBranch') {
return formType === 'create'
? t('formDialogTitleCreateSubBranch')
: formType === 'view'
? t('formDialogTitleViewSubBranch')
: t('formDialogTitleEditSubBranch');
}
return '';
const _type =
typeBranch === 'headOffice'
? 'branch.card.branchHQLabel'
: 'branch.card.branchHQLabel';
return formType === 'create'
? t('form.title.create', { name: t(_type) })
: formType === 'view'
? t(_type)
: t('general.edit');
}
function handleHold(node: BranchWithChildren) {
@ -672,7 +667,7 @@ watch(
watch(currentHq, () => {
const tmp: typeof utilsStore.currentTitle.path = [
{
text: 'branchManagementCaption',
text: 'branch.page.captionManage',
i18n: true,
handler: () => {
expandedTree.value = expandedTree.value.filter(
@ -701,7 +696,7 @@ watch(currentHq, () => {
<template>
<div class="column full-height no-wrap">
<div class="text-body-2 q-mb-xs flex items-center">
{{ $t('branchStatTitle') }}
{{ $t('general.dataSum') }}
<q-btn
class="q-ml-xs"
icon="mdi-pin-outline"
@ -745,15 +740,16 @@ watch(currentHq, () => {
<div class="self-end q-ma-md">
<TooltipComponent
class="self-end"
title="branchNoMainOfficeYet"
caption="branchClickToCreateMainOffice"
title="general.noData"
caption="general.clickToCreate"
imgSrc="personnel-table-"
/>
</div>
<div class="col flex items-center justify-center">
<EmptyAddButton
label="branchAdd"
label="general.add"
:i18nArgs="{ text: $t('branch.form.title.branchLabel') }"
@trigger="() => triggerCreate('headOffice')"
/>
</div>
@ -901,7 +897,7 @@ watch(currentHq, () => {
for="input-search"
outlined
dense
:label="$t('search')"
:label="$t('general.search')"
class="q-mr-md col-12 col-md-4"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearch"
@ -929,10 +925,10 @@ watch(currentHq, () => {
:for="'field-select-status'"
emit-value
:options="[
{ label: $t('all'), value: 'all' },
{ label: $t('statusACTIVE'), value: 'statusACTIVE' },
{ label: $t('general.all'), value: 'all' },
{ label: $t('status.ACTIVE'), value: 'statusACTIVE' },
{
label: $t('statusINACTIVE'),
label: $t('status.INACTIVE'),
value: 'statusINACTIVE',
},
]"
@ -943,9 +939,12 @@ watch(currentHq, () => {
id="select-field"
for="select-field"
:options="
fieldDisplay.map((v) => ({ label: $t(v), value: v }))
fieldDisplay.map((v) => ({
label: $t(`branch.card.${v}`),
value: v,
}))
"
:display-value="$t('displayField')"
:display-value="$t('general.displayField')"
:hide-dropdown-icon="$q.screen.lt.sm"
class="col q-mx-sm"
v-model="fieldSelected"
@ -1018,7 +1017,7 @@ watch(currentHq, () => {
.filter((v) => {
if (
statusFilter === 'statusACTIVE' &&
v.status === 'INACTIVE'
v.status !== 'ACTIVE'
) {
return false;
}
@ -1029,7 +1028,7 @@ watch(currentHq, () => {
return false;
}
const terms = `${v.code} ${$i18n.locale === 'en-US' ? v.nameEN : v.name} ${v.telephoneNo}`;
const terms = `${v.code} ${$i18n.locale === 'eng' ? v.nameEN : v.name} ${v.telephoneNo}`;
if (inputSearch && !terms.includes(inputSearch)) {
return false;
}
@ -1185,8 +1184,8 @@ watch(currentHq, () => {
<q-td v-if="fieldSelected.includes('branchLabelType')">
{{
props.row.isHeadOffice
? $t('branchHQLabel')
: $t('branchLabel')
? $t('branch.card.branchHQLabel')
: $t('branch.card.branchLabel')
}}
</q-td>
<q-td>
@ -1232,7 +1231,7 @@ watch(currentHq, () => {
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -1270,7 +1269,7 @@ watch(currentHq, () => {
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
@ -1297,7 +1296,7 @@ watch(currentHq, () => {
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('general.delete') }}
</span>
</q-item>
@ -1329,8 +1328,8 @@ watch(currentHq, () => {
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -1378,20 +1377,20 @@ watch(currentHq, () => {
:data="{
branchLabelCode: props.row.code,
branchLabelName:
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? props.row.nameEN
: props.row.name,
branchLabelTel: props.row.contact
.map((c: BranchContact) => c.telephoneNo)
.join(','),
branchLabelAddress:
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.addressEN || ''} ${props.row.subDistrict?.nameEN || ''} ${props.row.district?.nameEN || ''} ${props.row.province?.nameEN || ''}`
: `${props.row.address || ''} ${props.row.subDistrict?.name || ''} ${props.row.district?.name || ''} ${props.row.province?.name || ''}`,
branchLabelType: $t(
props.row.isHeadOffice
? 'branchHQLabel'
: 'branchLabel',
? 'branch.branchHQLabel'
: 'branch.branchLabel',
),
branchImgUrl: `/branch/${props.row.id}/branch-image`,
}"
@ -1443,7 +1442,7 @@ watch(currentHq, () => {
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -1481,7 +1480,7 @@ watch(currentHq, () => {
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
@ -1508,7 +1507,7 @@ watch(currentHq, () => {
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('generaldelete') }}
</span>
</q-item>
@ -1540,8 +1539,8 @@ watch(currentHq, () => {
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -1628,19 +1627,19 @@ watch(currentHq, () => {
<SideMenu
:menu="[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'form-information',
},
{
name: $t('formDialogTitleContact'),
name: $t('branch.form.group.contact'),
anchor: 'form-contact',
},
{
name: $t('formDialogTitleAddress'),
name: $t('form.address'),
anchor: 'form-address',
},
{
name: $t('formDialogTitleLocation'),
name: $t('branch.form.group.location'),
anchor: 'form-location',
},
{
@ -1648,7 +1647,7 @@ watch(currentHq, () => {
anchor: 'form-qr',
},
{
name: $t('bankBook'),
name: $t('branch.form.group.bankAccount'),
anchor: 'form-bank',
},
]"
@ -1676,7 +1675,7 @@ watch(currentHq, () => {
:outlined="true"
:readonly="formType === 'view'"
:view="isSubCreate"
title="formDialogTitleInformation"
title="form.field.basicInformation"
/>
<FormBranchContact
id="form-contact"
@ -1687,7 +1686,7 @@ watch(currentHq, () => {
v-model:contact-name="formData.contactName"
v-model:line-id="formData.lineId"
:separator="true"
title="formDialogTitleContact"
title="branch.form.group.contact"
:dense="true"
:outlined="true"
/>
@ -1698,11 +1697,7 @@ watch(currentHq, () => {
outlined
separator
prefix-id="default"
:title="
$t(
`${!formData.codeHeadOffice ? 'formDialogTitleAddress' : 'branchLabelAddress'}`,
)
"
:title="$t('form.address')"
v-model:address="formData.address"
v-model:addressEN="formData.addressEN"
v-model:province-id="formData.provinceId"
@ -1716,7 +1711,7 @@ watch(currentHq, () => {
:separator="true"
v-model:latitude="formData.latitude"
v-model:longitude="formData.longitude"
title="formDialogTitleLocation"
title="branch.form.group.location"
/>
<FormQr
id="form-qr"
@ -1732,7 +1727,7 @@ watch(currentHq, () => {
/>
<FormBank
id="form-bank"
title="bankBook"
title="branch.form.group.bankAccount"
dense
v-model:bank-book-list="formBankBook"
/>
@ -1754,8 +1749,7 @@ watch(currentHq, () => {
ref="formDialogRef"
v-model:drawerOpen="modalDrawer"
:category="changeTitle(formType, formTypeBranch)"
:title="$i18n.locale === 'en-US' ? formData.nameEN : formData.name"
:titleFormAddress="$t('formDialogTitleAddress')"
:title="$i18n.locale === 'eng' ? formData.nameEN : formData.name"
:addressSeparator="true"
:undo="() => undo()"
:isEdit="formType === 'edit'"
@ -1853,19 +1847,19 @@ watch(currentHq, () => {
<SideMenu
:menu="[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'info-information',
},
{
name: $t('formDialogTitleContact'),
name: $t('branch.form.group.contact'),
anchor: 'info-contact',
},
{
name: $t('formDialogTitleAddress'),
name: $t('form.address'),
anchor: 'info-address',
},
{
name: $t('formDialogTitleLocation'),
name: $t('branch.form.group.location'),
anchor: 'info-location',
},
{
@ -1873,7 +1867,7 @@ watch(currentHq, () => {
anchor: 'info-qr',
},
{
name: $t('bankBook'),
name: $t('branch.form.group.bankAccount'),
anchor: 'info-bank',
},
]"
@ -1904,12 +1898,12 @@ watch(currentHq, () => {
:outlined="true"
:readonly="formType === 'view'"
view
title="formDialogTitleInformation"
title="form.field.basicInformation"
class="q-mb-xl"
/>
<FormBranchContact
id="info-contact"
title="formDialogTitleContact"
title="branch.form.group.contact"
v-model:telephone-no="formData.telephoneNo"
v-model:contact="formData.contact"
v-model:email="formData.email"
@ -1928,11 +1922,7 @@ watch(currentHq, () => {
outlined
separator
prefix-id="default"
:title="
$t(
`${!formData.headOfficeId ? 'formDialogTitleAddress' : 'branchLabelAddress'}`,
)
"
:title="$t('form.address')"
:readonly="formType === 'view'"
v-model:address="formData.address"
v-model:addressEN="formData.addressEN"
@ -1944,7 +1934,7 @@ watch(currentHq, () => {
/>
<FormLocation
id="info-location"
title="formDialogTitleLocation"
title="branch.form.group.location"
v-model:latitude="formData.latitude"
v-model:longitude="formData.longitude"
:readonly="formType === 'view'"
@ -1966,7 +1956,7 @@ watch(currentHq, () => {
<FormBank
id="info-bank"
:readonly="formType === 'view'"
title="bankBook"
title="branch.form.group.bankAccount"
dense
v-model:bank-book-list="formBankBook"
class="q-mb-xl"
@ -2103,8 +2093,8 @@ watch(currentHq, () => {
<q-item-section>
{{
currentNode.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</q-item-section>
</q-item>

View file

@ -96,32 +96,32 @@ const modeView = ref(false);
const fieldSelectedOption = ref<{ label: string; value: string }[]>([
{
label: 'orderNumber',
label: 'general.order',
value: 'orderNumber',
},
{
label: 'fullname',
label: 'general.fullName',
value: 'name',
},
{
label: 'type',
label: 'general.type',
value: 'type',
},
{
label: 'telephone',
label: 'general.telephone',
value: 'telephoneNo',
},
{
label: 'personnelCardAge',
label: 'personnel.age',
value: 'birthDate',
},
{
label: 'formDialogInputEmail',
label: 'form.email',
value: 'email',
},
{
label: 'userRole',
label: 'personnel.form.userRole',
value: 'userRole',
},
]);
@ -247,45 +247,45 @@ const columns = [
{
name: 'orderNumber',
align: 'center',
label: 'orderNumber',
label: 'general.order',
field: 'branchNo',
},
{
name: 'name',
align: 'left',
label: 'fullname',
label: 'general.fullName',
field: 'firstName',
},
{
name: 'type',
align: 'left',
label: 'type',
label: 'general.type',
field: 'type',
},
{
name: 'telephoneNo',
align: 'left',
label: 'telephone',
label: 'general.telephone',
field: 'telephoneNo',
},
{
name: 'birthDate',
align: 'left',
label: 'personnelCardAge',
label: 'personnel.age',
field: 'birthDate',
},
{
name: 'email',
align: 'left',
label: 'formDialogInputEmail',
label: 'form.email',
field: 'email',
},
{
name: 'userRole',
align: 'left',
label: 'userRole',
label: 'personnel.form.userRole',
field: 'userRole',
},
] satisfies QTableProps['columns'];
@ -367,7 +367,7 @@ async function openDialog(
id: user.id,
img: `${user.profileImageUrl}`,
name:
locale.value === 'en-US'
locale.value === 'eng'
? `${user.firstNameEN} ${user.lastNameEN}`
: `${user.firstName} ${user.lastName}`,
male: user.gender === 'male',
@ -542,13 +542,13 @@ async function triggerChangeStatus(id: string, status: string) {
color: status !== 'INACTIVE' ? 'warning' : 'info',
icon:
status !== 'INACTIVE' ? 'mdi-alert' : 'mdi-message-processing-outline',
title: t('confirmChangeStatusTitle'),
title: t('dialog.title.confirmChangeStatus'),
actionText:
status !== 'INACTIVE' ? t('switchOffLabel') : t('switchOnLabel'),
status !== 'INACTIVE' ? t('general.close') : t('general.open'),
message:
status !== 'INACTIVE'
? t('confirmChangeStatusOffMessage')
: t('confirmChangeStatusOnMessage'),
? t('dialog.message.confirmChangeStatusOff')
: t('dialog.message.confirmChangeStatusOn'),
action: async () => {
await toggleStatus(id).then(resolve).catch(reject);
},
@ -563,8 +563,10 @@ async function assignFormData(idEdit: string) {
if (foundUser) {
currentUser.value = foundUser;
infoPersonId.value = currentUser.value.id;
imageUrl.value = currentUser.value.profileImageUrl;
if (currentUser.value) {
infoPersonId.value = currentUser.value.id;
imageUrl.value = currentUser.value.profileImageUrl;
}
formData.value = {
branchId: foundUser.branch[0]?.id,
provinceId: foundUser.provinceId,
@ -645,10 +647,8 @@ function openImageDialog() {
}
onMounted(async () => {
utilsStore.currentTitle.title = 'personnelManagement';
utilsStore.currentTitle.path = [
{ text: 'personnelManagementCaption', i18n: true },
];
utilsStore.currentTitle.title = 'personnel.title';
utilsStore.currentTitle.path = [{ text: 'personnel.caption', i18n: true }];
modeView.value = $q.screen.lt.md ? true : false;
await fetchUserList();
@ -747,7 +747,7 @@ watch(
<ButtonAddComponent style="z-index: 999">
<q-fab-action
id="btn-add-personne"
:label="$t('personnelAdd')"
:label="$t('personnel.addTitle')"
external-label
label-position="left"
@click="openDialog('FORM')"
@ -760,7 +760,7 @@ watch(
<!-- stat -->
<div class="column full-height no-wrap">
<div class="text-body-2 q-mb-xs flex items-center">
{{ $t('personnelStatTitle') }}
{{ $t('general.dataSum') }}
<q-badge
v-if="typeStats"
rounded
@ -800,7 +800,7 @@ watch(
selectorLabel === 'ALL'
? Object.entries(typeStats).map(([key, val]) => ({
count: val,
label: key,
label: `personnel.${key}`,
icon: 'mdi-account-outline',
color:
(
@ -814,7 +814,7 @@ watch(
}))
: [
{
label: selectorLabel,
label: `personnel.${selectorLabel}`,
count: typeStats[selectorLabel],
icon: 'mdi-account-outline',
color:
@ -850,7 +850,7 @@ watch(
for="input-search"
outlined
dense
:label="$t('search')"
:label="$t('general.search')"
class="q-mr-md col-12 col-md-3"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearch"
@ -880,9 +880,9 @@ watch(
:for="'field-select-status'"
:hide-dropdown-icon="$q.screen.lt.sm"
:options="[
{ label: $t('all'), value: 'all' },
{ label: $t('statusACTIVE'), value: 'statusACTIVE' },
{ label: $t('statusINACTIVE'), value: 'statusINACTIVE' },
{ label: $t('general.all'), value: 'all' },
{ label: $t('general.active'), value: 'statusACTIVE' },
{ label: $t('general.inactive'), value: 'statusINACTIVE' },
]"
></q-select>
@ -898,7 +898,7 @@ watch(
label: $t(v.label),
}))
"
:display-value="$t('displayField')"
:display-value="$t('general.displayField')"
:hide-dropdown-icon="$q.screen.lt.sm"
v-model="fieldSelected"
option-label="label"
@ -982,12 +982,12 @@ watch(
"
>
<div
class="row"
class="row text-capitalize"
:class="
selectorLabel === 'ALL' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('all') }}
{{ $t('general.all') }}
</div>
</q-tab>
<q-tab
@ -1003,12 +1003,12 @@ watch(
"
>
<div
class="row"
class="row text-capitalize"
:class="
selectorLabel === 'USER' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('USER') }}
{{ $t('personnel.USER') }}
</div>
</q-tab>
<q-tab
@ -1024,12 +1024,12 @@ watch(
"
>
<div
class="row"
class="row text-capitalize"
:class="
selectorLabel === 'MESSENGER' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('MESSENGER') }}
{{ $t('personnel.MESSENGER') }}
</div>
</q-tab>
<q-tab
@ -1045,12 +1045,12 @@ watch(
"
>
<div
class="row"
class="row text-capitalize"
:class="
selectorLabel === 'DELEGATE' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('DELEGATE') }}
{{ $t('personnel.DELEGATE') }}
</div>
</q-tab>
<q-tab
@ -1066,12 +1066,12 @@ watch(
"
>
<div
class="row"
class="row text-capitalize"
:class="
selectorLabel === 'AGENCY' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('AGENCY') }}
{{ $t('personnel.AGENCY') }}
</div>
</q-tab>
</q-tabs>
@ -1180,7 +1180,7 @@ watch(
<div class="column">
<div class="col ellipsis" style="max-width: 20vw">
{{
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.firstNameEN} ${props.row.lastNameEN}`.trim()
: `${props.row.firstName} ${props.row.lastName}`.trim()
}}
@ -1190,7 +1190,7 @@ watch(
:delay="300"
>
{{
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.firstNameEN} ${props.row.lastNameEN}`.trim()
: `${props.row.firstName} ${props.row.lastName}`.trim()
}}
@ -1231,12 +1231,14 @@ watch(
>
{{
$t(
{
USER: 'USER',
MESSENGER: 'MESSENGER',
DELEGATE: 'DELEGATE',
AGENCY: 'AGENCY',
}[props.row.userType as string] || 'USER',
`personnel.${
{
USER: 'USER',
MESSENGER: 'MESSENGER',
DELEGATE: 'DELEGATE',
AGENCY: 'AGENCY',
}[props.row.userType as string] || 'USER'
}`,
)
}}
</span>
@ -1307,7 +1309,7 @@ watch(
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -1331,7 +1333,7 @@ watch(
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
@ -1357,7 +1359,7 @@ watch(
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('general.delete') }}
</span>
</q-item>
@ -1382,8 +1384,8 @@ watch(
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -1404,7 +1406,7 @@ watch(
code: props.row.code,
name:
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.firstNameEN} ${props.row.lastNameEN}`.trim()
: `${props.row.firstName} ${props.row.lastName}`.trim(),
img: props.row.profileImageUrl
@ -1439,7 +1441,7 @@ watch(
DELEGATE: 'red',
AGENCY: 'magenta',
}[props.row.userType as string] || 'pink',
value: $t(props.row.userType),
value: $t(`personnel.${props.row.userType}`),
},
]"
:disabled="props.row.status === 'INACTIVE'"
@ -1503,15 +1505,15 @@ watch(
>
<div class="flex justify-end">
<TooltipComponent
title="personnelTooltipTitle"
caption="personnelTooltipCaption"
title="personnel.tooltipTitle"
caption="personnel.tooltipCaption"
imgSrc="personnel-table-"
/>
</div>
<div class="col items-center flex justify-center">
<AddButton
:label="'personnelAdd'"
:label="'personnel.addTitle'"
:cyanOn="true"
@trigger="openDialog('FORM')"
/>
@ -1533,12 +1535,8 @@ watch(
>
<div class="col-4">
<div class="row items-center no-wrap">
<div
class="app-text-muted"
style="width: 80px"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
<div class="app-text-muted q-mr-sm" v-if="$q.screen.gt.sm">
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -1572,7 +1570,7 @@ watch(
<div class="col-4 row justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: userData?.result.length,
total: userData?.total,
})
@ -1591,12 +1589,12 @@ watch(
<DrawerInfo
v-if="currentUser"
:category="$t('personnelTitle')"
:category="$t('personnel.personnel')"
bg-on
hide-action
:isEdit="infoDrawerEdit"
:title="
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${currentUser.firstNameEN} ${currentUser.lastNameEN}`
: `${currentUser.firstName} ${currentUser.lastName}`
"
@ -1620,8 +1618,8 @@ watch(
hideFade
:menu="formMenuIcon"
:readonly="!infoDrawerEdit"
:toggleTitle="$t('formDialogTitleUserStatus')"
:title="`${$i18n.locale === 'en-US' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`"
:toggleTitle="$t('status.title')"
:title="`${$i18n.locale === 'eng' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`"
:caption="userCode"
:img="
urlProfile ||
@ -1706,22 +1704,22 @@ watch(
:menu="
[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'info-information',
},
{
name: $t('formDialogTitlePersonal'),
name: $t('personnel.form.personalInformation'),
anchor: 'info-personal',
},
{
name: $t('formDialogTitleAddressPersonnel'),
name: $t('personnel.form.addressInformation'),
anchor: 'info-address',
},
].concat(
!!formData.userType
? [
{
name: $t('formDialogTitleByType'),
name: $t('personnel.form.workInformation'),
anchor: 'info-work',
},
]
@ -1754,7 +1752,7 @@ watch(
dense
outlined
separator
:title="'formDialogTitleInformation'"
:title="'form.field.basicInformation'"
:readonly="!infoDrawerEdit"
:usernameReadonly="isEdit"
class="q-mb-xl"
@ -1774,7 +1772,7 @@ watch(
v-model:email="formData.email"
v-model:gender="formData.gender"
v-model:birth-date="formData.birthDate"
:title="'formDialogTitlePersonal'"
:title="'personnel.form.personalInformation'"
prefix-id="drawer-info-personnel"
dense
outlined
@ -1793,6 +1791,7 @@ watch(
v-model:zipCode="formData.zipCode"
:readonly="!infoDrawerEdit"
prefix-id="drawer-info-personnel"
:title="'personnel.form.addressInformation'"
dense
class="q-mb-xl"
/>
@ -1831,7 +1830,7 @@ watch(
ref="formDialogRef"
:badgeClass="formData.gender === 'male' ? 'app-bg-male' : 'app-bg-female'"
:badgeLabel="userCode"
:title="$t('personnelAdd')"
:title="$t('personnel.addTitle')"
v-model:modal="modal"
:addressSeparator="formData.userType !== ''"
:submit="() => onSubmit()"
@ -1855,8 +1854,8 @@ watch(
female: '/no-img-female.png',
}[formData.gender]
"
:toggleTitle="$t('formDialogTitleUserStatus')"
:title="`${$i18n.locale === 'en-US' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`"
:toggleTitle="$t('status.title')"
:title="`${$i18n.locale === 'eng' ? `${formData.firstNameEN} ${formData.lastNameEN}` : `${formData.firstName} ${formData.lastName}`}`"
:fallbackImg="
{
male: '/no-img-man.png',
@ -1885,28 +1884,28 @@ watch(
>
<SaveButton id="btn-info-basic-save" icon-only type="submit" />
</div>
<div class="col full-height scroll">
<div class="col full-height scroll" v-if="$q.screen.gt.sm">
<div style="position: sticky; top: 0" class="q-pa-sm">
<SideMenu
:menu="
[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'dialog-form-information',
},
{
name: $t('formDialogTitlePersonal'),
name: $t('personnel.form.personalInformation'),
anchor: 'dialog-form-personal',
},
{
name: $t('formDialogTitleAddressPersonnel'),
name: $t('personnel.form.addressInformation'),
anchor: 'dialog-form-address',
},
].concat(
!!formData.userType
? [
{
name: $t('formDialogTitleByType'),
name: $t('personnel.form.workInformation'),
anchor: 'dialog-info-work',
},
]
@ -1922,13 +1921,13 @@ watch(
/>
</div>
</div>
<div class="col-10 q-pa-md full-height scroll">
<div class="col-md-10 col-12 q-pa-md full-height scroll">
<FormInformation
id="dialog-form-information"
dense
outlined
separator
:title="'formDialogTitleInformation'"
:title="'form.field.basicInformation'"
:usernameReadonly="isEdit"
v-model:hqId="hqId"
v-model:brId="brId"
@ -1944,7 +1943,7 @@ watch(
dense
outlined
separator
:title="'formDialogTitlePersonal'"
:title="'personnel.form.personalInformation'"
v-model:first-name="formData.firstName"
v-model:last-name="formData.lastName"
v-model:mid-name="formData.middleName"

View file

@ -275,7 +275,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
outlined
dense
class="col-6"
:label="$t('search')"
:label="$t('general.search')"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearch"
debounce="500"
@ -299,9 +299,9 @@ watch([customerId, inputSearch, currentStatus], async () => {
emit-value
:hide-dropdown-icon="$q.screen.lt.sm"
:options="[
{ label: $t('all'), value: 'All' },
{ label: $t('statusACTIVE'), value: 'ACTIVE' },
{ label: $t('statusINACTIVE'), value: 'INACTIVE' },
{ label: $t('general.all'), value: 'All' },
{ label: $t('status.ACTIVE'), value: 'ACTIVE' },
{ label: $t('status.INACTIVE'), value: 'INACTIVE' },
]"
></q-select>
@ -423,9 +423,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
<div class="col" style="min-width: fit-content">
<div class="col">
{{
$i18n.locale === 'en-US'
? props.row.nameEN
: props.row.name
$i18n.locale === 'eng' ? props.row.nameEN : props.row.name
}}
</div>
<div class="col app-text-muted">
@ -445,7 +443,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
class="text-center"
>
{{
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.addressEN || ''} ${props.row.subDistrict?.nameEN || ''} ${props.row.district?.nameEN || ''} ${props.row.province?.nameEN || ''}`
: `${props.row.address || ''} ${props.row.subDistrict?.name || ''} ${props.row.district?.name || ''} ${props.row.province?.name || ''}`
}}
@ -531,7 +529,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
:field-selected="[
'orderNumber',
'firstName',
'formDialogInputAge',
'general.age',
'formDialogInputNationality',
'formDialogInputPassportNo',
'passportExpiryDate',
@ -562,7 +560,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
customerBranchFormTab: props.row.branchNo,
branchName: props.row.name,
address:
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.addressEN || ''} ${props.row.subDistrict?.nameEN || ''} ${props.row.district?.nameEN || ''} ${props.row.province?.nameEN || ''}`
: `${props.row.address || ''} ${props.row.subDistrict?.name || ''} ${props.row.district?.name || ''} ${props.row.province?.name || ''}`,
telephone: props.row.telephoneNo,
@ -584,7 +582,7 @@ watch([customerId, inputSearch, currentStatus], async () => {
<div class="col"></div>
<div class="app-text-muted col text-center">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: branch?.length,
total: totalBranch,
})

View file

@ -89,10 +89,10 @@ const { state: employeeFormState, currentFromDataEmployee } =
storeToRefs(employeeFormStore);
async function init() {
utilsStore.currentTitle.title = 'customerManagement';
utilsStore.currentTitle.title = 'menu.customer';
utilsStore.currentTitle.path = [
{
text: 'customerManagementCaption',
text: 'menu.customerCaption',
i18n: true,
handler: () => router.push('/customer-management'),
},
@ -111,7 +111,7 @@ async function init() {
if (_data) {
currentCustomer.value = _data;
utilsStore.currentTitle.path.push({
text: `${currentCustomer.value.firstName} ${currentCustomer.value.lastName}`,
text: `${currentCustomer.value.firstName || '-'} ${currentCustomer.value.lastName || ''}`,
i18n: false,
});
} else {
@ -141,7 +141,7 @@ const customerTypeSelected = ref<{
label: string;
value: 'all' | 'customerLegalEntity' | 'customerNaturalPerson';
}>({
label: t('all'),
label: t('general.all'),
value: 'all',
});
@ -602,14 +602,14 @@ const emptyCreateDialog = ref(false);
@click="createCustomerForm('CORP')"
padding="xs"
icon="mdi-office-building-outline"
:label="$t('add') + ' ' + $t('customerLegalEntity')"
:label="$t('general.add') + ' ' + $t('customer.employerLegalEntity')"
external-label
label-position="left"
/>
<q-fab-action
v-if="currentTab === 'employer'"
id="add-customer-natural-person"
:label="$t('add') + ' ' + $t('customerNaturalPerson')"
:label="$t('general.add') + ' ' + $t('customer.employerNaturalPerson')"
external-label
label-position="left"
@click="createCustomerForm('PERS')"
@ -619,7 +619,7 @@ const emptyCreateDialog = ref(false);
/>
<q-fab-action
v-if="currentTab === 'employee'"
:label="$t('add') + ' ' + $t('EMPLOYEE')"
:label="$t('general.add') + ' ' + $t('customer.employee')"
external-label
id="add-employee"
label-position="left"
@ -633,7 +633,7 @@ const emptyCreateDialog = ref(false);
<div class="column full-height no-wrap">
<div v-if="$route.name === 'CustomerManagement'" class="column full-height">
<div class="text-body-2 text-weight-medium q-mb-xs flex items-center">
{{ $t('dataSum') }}
{{ $t('general.dataSum') }}
<q-badge
v-if="listCustomer"
rounded
@ -681,8 +681,8 @@ const emptyCreateDialog = ref(false);
: (statsCustomerType?.PERS ?? 0),
label:
v.name === 'CORP'
? 'customerLegalEntity'
: 'customerNaturalPerson',
? 'customer.employerLegalEntity'
: 'customer.employerNaturalPerson',
icon:
v.name === 'CORP'
? 'mdi-office-building-outline'
@ -691,7 +691,7 @@ const emptyCreateDialog = ref(false);
}))
: [
{
label: 'EMPLOYEE',
label: 'customer.employee',
count: employeeStats,
icon: 'mdi-account-outline',
color: 'pink',
@ -720,7 +720,7 @@ const emptyCreateDialog = ref(false);
for="input-search"
outlined
dense
:label="$t('search')"
:label="$t('general.search')"
class="col-12 col-md-3"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearch"
@ -751,9 +751,9 @@ const emptyCreateDialog = ref(false);
emit-value
:hide-dropdown-icon="$q.screen.lt.sm"
:options="[
{ label: $t('all'), value: 'All' },
{ label: $t('statusACTIVE'), value: 'ACTIVE' },
{ label: $t('statusINACTIVE'), value: 'INACTIVE' },
{ label: $t('general.all'), value: 'All' },
{ label: $t('status.ACTIVE'), value: 'ACTIVE' },
{ label: $t('status.INACTIVE'), value: 'INACTIVE' },
]"
></q-select>
<q-select
@ -767,7 +767,7 @@ const emptyCreateDialog = ref(false);
? fieldDisplayCustomer
: fieldDisplayEmployee
"
:display-value="$t('displayField')"
:display-value="$t('general.displayField')"
:hide-dropdown-icon="$q.screen.lt.sm"
v-model="fieldSelected"
:option-label="(l) => $t(l.label)"
@ -855,7 +855,7 @@ const emptyCreateDialog = ref(false);
currentTab === 'employer' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('EMPLOYER') }}
{{ $t('customer.employer') }}
</div>
</q-tab>
<q-tab
@ -876,7 +876,7 @@ const emptyCreateDialog = ref(false);
currentTab === 'employee' ? 'text-bold' : 'app-text-muted'
"
>
{{ $t('EMPLOYEE') }}
{{ $t('customer.employee') }}
</div>
</q-tab>
</q-tabs>
@ -910,7 +910,16 @@ const emptyCreateDialog = ref(false);
@click="customerTypeSelected = { label: v, value: v }"
>
<span class="q-px-md ellipsis">
{{ $t(v) }}
{{
$t(
{
all: 'general.all',
customerLegalEntity: 'customer.employerLegalEntity',
customerNaturalPerson:
'customer.employerNaturalPerson',
}[v],
)
}}
</span>
</q-item>
</template>
@ -924,7 +933,7 @@ const emptyCreateDialog = ref(false);
clickable
>
<span class="q-px-md ellipsis">
{{ $t('totalEmployee') }}
{{ $t('general.all') }}
</span>
</q-item>
</template>
@ -1192,7 +1201,7 @@ const emptyCreateDialog = ref(false);
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -1218,7 +1227,7 @@ const emptyCreateDialog = ref(false);
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
@ -1245,7 +1254,7 @@ const emptyCreateDialog = ref(false);
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('general.delete') }}
</span>
</q-item>
@ -1272,8 +1281,8 @@ const emptyCreateDialog = ref(false);
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -1321,12 +1330,12 @@ const emptyCreateDialog = ref(false);
separateEnter
history
:prefix-id="
props.row.customerNameEN ?? props.rowIndex
props.row.customerNameEN ?? String(props.rowIndex)
"
:data="{
code: props.row.code,
name:
$i18n.locale === 'en-US'
$i18n.locale === 'eng'
? `${props.row.firstName} ${props.row.lastName} `.trim()
: `${props.row.firstNameEN} ${props.row.lastNameEN} `.trim(),
img:
@ -1356,8 +1365,8 @@ const emptyCreateDialog = ref(false);
}[props.row.customerType as string] || 'CORP',
value: $t(
props.row.customerType === 'CORP'
? 'customerLegalEntity'
: 'customerNaturalPerson',
? 'customer.employerLegalEntity'
: 'customer.employerNaturalPerson',
),
},
]"
@ -1402,7 +1411,7 @@ const emptyCreateDialog = ref(false);
style="width: 80px"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -1436,7 +1445,7 @@ const emptyCreateDialog = ref(false);
<div class="col-4 flex justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: listCustomer.length,
total: statsCustomerType.PERS + statsCustomerType.CORP,
})
@ -1512,7 +1521,7 @@ const emptyCreateDialog = ref(false);
style="width: 80px"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -1546,7 +1555,7 @@ const emptyCreateDialog = ref(false);
<div class="col-4 flex justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: listEmployee.length,
total: employeeStats,
})
@ -1577,16 +1586,8 @@ const emptyCreateDialog = ref(false);
>
<TooltipComponent
class="self-end q-ma-md"
:title="
currentTab === 'employer'
? 'customerEmployerTooltipTitle'
: 'customerEmployeeTooltipTitle'
"
:caption="
currentTab === 'employer'
? 'customerEmployerTooltipCaption'
: 'customerEmployeeTooltipCaption'
"
:title="'general.noData'"
:caption="'general.clickToCreate'"
imgSrc="personnel-table-"
/>
@ -1595,11 +1596,10 @@ const emptyCreateDialog = ref(false);
style="flex-grow: 1"
>
<EmptyAddButton
:label="
currentTab === 'employer'
? 'customerEmployerAdd'
: 'customerEmployeeAdd'
"
:label="'general.add'"
:i18n-args="{
text: $t(`customer.${currentTab}`),
}"
@trigger="
() => {
if (currentTab === 'employer') {
@ -1638,7 +1638,7 @@ const emptyCreateDialog = ref(false);
<DialogForm
v-model:modal="emptyCreateDialog"
:title="$t('customerCardUserType')"
:title="$t('customer.employerType')"
hide-footer
no-app-box
width="60vw"
@ -1725,7 +1725,7 @@ const emptyCreateDialog = ref(false);
<SideMenu
:menu="[
{
name: $t('customer.form.group.basicInfo'),
name: $t('form.field.basicInformation'),
anchor: 'form-basic-info-customer',
},
{
@ -1995,10 +1995,19 @@ const emptyCreateDialog = ref(false);
:img="employeeFormState.profileUrl || `/images/employee-avatar.png`"
:tabs-list="
[
{ name: 'personalInfo', label: 'personalInfo' },
{ name: 'healthCheck', label: 'healthCheck' },
{ name: 'workHistory', label: 'workHistory' },
{ name: 'other', label: 'other' },
{
name: 'personalInfo',
label: 'customerEmployee.form.group.personalInfo',
},
{
name: 'healthCheck',
label: 'customerEmployee.form.group.healthCheck',
},
{
name: 'workHistory',
label: 'customerEmployee.form.group.workHistory',
},
{ name: 'other', label: 'customerEmployee.form.group.other' },
].filter((v) => {
if (!employeeFormState.statusSavePersonal) {
return v.name === 'personalInfo';
@ -2008,7 +2017,7 @@ const emptyCreateDialog = ref(false);
})
"
:menu="formMenuIconEmployee"
:toggleTitle="$t('formDialogTitleUserStatus')"
:toggleTitle="$t('status.title')"
:hideFade="
employeeFormState.profileUrl === '' ||
employeeFormState.profileUrl === undefined
@ -2042,44 +2051,44 @@ const emptyCreateDialog = ref(false);
:menu="
[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'form-information',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePersonal'),
name: $t('customerEmployee.form.group.personalInfo'),
anchor: 'form-personal',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePersonnelAddress'),
name: $t('general.address'),
anchor: 'form-personal-address',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePassport'),
name: $t('customerEmployee.form.group.passport'),
anchor: 'form-passport',
tab: 'personalInfo',
},
{
name: $t('formDialogTitleVisa'),
name: $t('customerEmployee.form.group.visa'),
anchor: 'form-visa',
tab: 'personalInfo',
},
...(currentFromDataEmployee.employeeCheckup?.map((v, i) => ({
name: $t('customer.form.instance', { index: i + 1 }),
name: $t('general.times', { number: i + 1 }),
anchor: `form-employee-checkup-${i}`,
tab: 'healthCheck',
})) || []),
...(currentFromDataEmployee.employeeWork?.map((v, i) => ({
name: $t('customer.form.instance', { index: i + 1 }),
name: $t('general.times', { number: i + 1 }),
anchor: `form-employee-work-history-${i}`,
tab: 'workHistory',
})) || []),
{
name: $t('formDialogTitleFamilyHistory'),
name: $t('customerEmployee.form.group.family'),
anchor: 'form-employee-other',
tab: 'other',
},
@ -2159,7 +2168,7 @@ const emptyCreateDialog = ref(false);
dense
outlined
separator
:title="$t('formDialogTitleInformation')"
title="form.field.basicInformation"
:readonly="!employeeFormState.isEmployeeEdit"
:employee-owner-option="employeeStore.ownerOption"
v-model:customer-branch="employeeFormState.formDataEmployeeOwner"
@ -2176,7 +2185,7 @@ const emptyCreateDialog = ref(false);
outlined
employee
separator
:title="$t('personalInfo')"
title="customerEmployee.form.group.personalInfo"
v-model:open="employeeFormState.dialogModal"
v-model:firstName="currentFromDataEmployee.firstName"
v-model:lastName="currentFromDataEmployee.lastName"
@ -2210,7 +2219,7 @@ const emptyCreateDialog = ref(false);
dense
outlined
separator
:title="$t('formDialogTitlePassport')"
:title="$t('customerEmployee.form.group.passport')"
v-model:passport-type="currentFromDataEmployee.passportType"
v-model:passport-number="currentFromDataEmployee.passportNumber"
v-model:passport-issue-date="
@ -2236,7 +2245,7 @@ const emptyCreateDialog = ref(false);
id="form-visa"
dense
outlined
:title="$t(`formDialogTitleVisa`)"
title="customerEmployee.form.group.visa"
v-model:visa-type="currentFromDataEmployee.visaType"
v-model:visa-number="currentFromDataEmployee.visaNumber"
v-model:visa-issue-date="currentFromDataEmployee.visaIssueDate"
@ -2520,7 +2529,7 @@ const emptyCreateDialog = ref(false);
<SideMenu
:menu="[
{
name: $t('customer.form.group.basicInfo'),
name: $t('form.field.basicInformation'),
anchor: 'form-basic-info-customer',
},
{
@ -2727,7 +2736,7 @@ const emptyCreateDialog = ref(false);
v-model:drawer-open="employeeFormState.drawerModal"
:title="
employeeFormState.currentEmployee
? $i18n.locale === 'en-US'
? $i18n.locale === 'eng'
? `${employeeFormState.currentEmployee.firstNameEN} ${employeeFormState.currentEmployee.lastNameEN}`
: `${employeeFormState.currentEmployee.firstName} ${employeeFormState.currentEmployee.lastName}`
: '-'
@ -2802,7 +2811,7 @@ const emptyCreateDialog = ref(false);
fallback-cover="/images/employee-banner.png"
:title="
employeeFormState.currentEmployee
? $i18n.locale === 'en-US'
? $i18n.locale === 'eng'
? `${employeeFormState.currentEmployee.firstNameEN} ${employeeFormState.currentEmployee.lastNameEN}`
: `${employeeFormState.currentEmployee.firstName} ${employeeFormState.currentEmployee.lastName}`
: '-'
@ -2810,13 +2819,22 @@ const emptyCreateDialog = ref(false);
:caption="currentFromDataEmployee.code"
:img="employeeFormState.profileUrl || '/images/employee-avatar.png'"
:tabs-list="[
{ name: 'personalInfo', label: 'personalInfo' },
{ name: 'healthCheck', label: 'healthCheck' },
{ name: 'workHistory', label: 'workHistory' },
{ name: 'other', label: 'other' },
{
name: 'personalInfo',
label: 'customerEmployee.form.group.personalInfo',
},
{
name: 'healthCheck',
label: 'customerEmployee.form.group.healthCheck',
},
{
name: 'workHistory',
label: 'customerEmployee.form.group.workHistory',
},
{ name: 'other', label: 'customerEmployee.form.group.other' },
]"
:menu="formMenuIconEmployee"
:toggle-title="$t('formDialogTitleUserStatus')"
:toggle-title="$t('status.title')"
:hide-fade="
employeeFormState.profileUrl === '' ||
employeeFormState.profileUrl === undefined
@ -2835,44 +2853,44 @@ const emptyCreateDialog = ref(false);
:menu="
[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'drawer-form-information',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePersonal'),
name: $t('customerEmployee.form.group.personalInfo'),
anchor: 'drawer-form-personal',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePersonnelAddress'),
name: $t('form.address'),
anchor: 'drawer-form-personal-address',
tab: 'personalInfo',
},
{
name: $t('formDialogTitlePassport'),
name: $t('customerEmployee.form.group.passport'),
anchor: 'drawer-form-passport',
tab: 'personalInfo',
},
{
name: $t('formDialogTitleVisa'),
name: $t('customerEmployee.form.group.visa'),
anchor: 'drawer-form-visa',
tab: 'personalInfo',
},
...(currentFromDataEmployee.employeeCheckup?.map(
(v, i) => ({
name: $t('customer.form.instance', { index: i + 1 }),
name: $t('general.times', { number: i + 1 }),
anchor: `drawer-employee-checkup-${i}`,
tab: 'healthCheck',
}),
) || []),
...(currentFromDataEmployee.employeeWork?.map((v, i) => ({
name: $t('customer.form.instance', { index: i + 1 }),
name: $t('general.times', { number: i + 1 }),
anchor: `drawer-employee-work-history-${i}`,
tab: 'workHistory',
})) || []),
{
name: $t('formDialogTitleFamilyHistory'),
name: $t('customerEmployee.form.group.family'),
anchor: 'drawer-other',
tab: 'other',
},
@ -2944,7 +2962,7 @@ const emptyCreateDialog = ref(false);
prefix-id="drawer-info-employee"
dense
outlined
:title="'formDialogTitleInformation'"
title="form.field.basicInformation"
:readonly="!employeeFormState.isEmployeeEdit"
:employee-owner-option="employeeStore.ownerOption"
v-model:customer-branch="
@ -2965,7 +2983,7 @@ const emptyCreateDialog = ref(false);
outlined
employee
separator
:title="'personalInfo'"
title="customerEmployee.form.group.personalInfo"
:readonly="!employeeFormState.isEmployeeEdit"
v-model:firstName="currentFromDataEmployee.firstName"
v-model:lastName="currentFromDataEmployee.lastName"
@ -2996,7 +3014,7 @@ const emptyCreateDialog = ref(false);
dense
outlined
separator
:title="'formDialogTitlePassport'"
:title="'customerEmployee.form.group.passport'"
:readonly="!employeeFormState.isEmployeeEdit"
v-model:passport-type="currentFromDataEmployee.passportType"
v-model:passport-number="currentFromDataEmployee.passportNumber"
@ -3022,7 +3040,7 @@ const emptyCreateDialog = ref(false);
id="drawer-form-visa"
dense
outlined
:title="`formDialogTitleVisa`"
title="customerEmployee.form.group.visa"
:readonly="!employeeFormState.isEmployeeEdit"
v-model:visa-type="currentFromDataEmployee.visaType"
v-model:visa-number="currentFromDataEmployee.visaNumber"

View file

@ -145,7 +145,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
name="mdi-office-building-outline"
style="background-color: var(--surface-3)"
/>
<span>{{ $t('customer.form.group.basicInfo') }}</span>
<span>{{ $t('form.field.basicInformation') }}</span>
<EditButton
icon-only
v-if="readonly && !create"
@ -199,7 +199,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:readonly="readonly"
:options="filteredBranchOptions"
:hide-dropdown-icon="readonly"
:label="$t('registeredBranch')"
:label="$t('customer.form.registeredBranch')"
:for="`${prefixId}-input-source-nationality`"
:rules="[
(val) => {
@ -218,7 +218,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -244,7 +244,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:readonly="readonly"
:options="prefixNameOptions"
:for="`${prefixId}-select-prefix-name`"
:label="$t('formDialogInputPrefixName')"
:label="$t('form.prefixName')"
@filter="prefixNameFilter"
:model-value="readonly ? namePrefix || '-' : namePrefix"
@update:model-value="
@ -263,7 +263,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -364,7 +364,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:options="genderOptions"
:hide-dropdown-icon="readonly"
:for="`${prefixId}-select-gender`"
:label="$t('formDialogInputGender')"
:label="$t('form.gender')"
@filter="genderFilter"
:model-value="readonly ? gender || '-' : gender"
@update:model-value="(v) => (typeof v === 'string' ? (gender = v) : '')"
@ -379,7 +379,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -394,16 +394,16 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:disabled-dates="disabledAfterToday"
:teleport="true"
:dark="$q.dark.isActive"
:locale="$i18n.locale === 'th-th' ? 'th' : 'en'"
:locale="$i18n.locale === 'tha' ? 'th' : 'en'"
:enableTimePicker="false"
:disabled="readonly"
class="col-12 col-md-3"
>
<template #year="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
{{ $i18n.locale === 'tha' ? value + 543 : value }}
</template>
<template #year-overlay-value="{ value }">
{{ $i18n.locale === 'th-th' ? value + 543 : value }}
{{ $i18n.locale === 'tha' ? value + 543 : value }}
</template>
<template #trigger>
<q-input
@ -411,13 +411,13 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
:for="`${prefixId}-input-birth-date`"
hide-bottom-space
placeholder="DD/MM/YYYY"
:label="$t('formDialogInputBirthDate')"
:label="$t('form.birthDate')"
dense
outlined
:readonly="readonly"
:rules="[
(val: string) =>
!!val || $t('selectValidate') + $t('formDialogInputBirthDate'),
!!val || $t('selectValidate') + $t('form.birthDate'),
]"
:mask="readonly ? '' : '##/##/####'"
:model-value="
@ -454,7 +454,7 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
dense
outlined
:readonly="readonly"
:label="$t('formDialogInputAge')"
:label="$t('general.age')"
class="col-12 col-md-2"
:model-value="
birthDate?.toString() === 'Invalid Date' ||

View file

@ -39,11 +39,11 @@ onMounted(async () => {
const resultOption = await fetch('/option/option.json');
rawOption.value = await resultOption.json();
if (locale.value === 'en-US') {
if (locale.value === 'eng') {
typeBusinessOption.value = rawOption.value.eng.businessType;
jobPositionOption.value = rawOption.value.eng.position;
}
if (locale.value === 'th-th') {
if (locale.value === 'tha') {
typeBusinessOption.value = rawOption.value.tha.businessType;
jobPositionOption.value = rawOption.value.tha.position;
}
@ -118,7 +118,7 @@ let jobPositionFilter = selectFilterOptionRefMod(
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>
@ -162,7 +162,7 @@ let jobPositionFilter = selectFilterOptionRefMod(
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
{{ $t('noResults') }}
{{ $t('general.noData') }}
</q-item-section>
</q-item>
</template>

View file

@ -17,56 +17,56 @@ export const columnsEmployee = [
{
name: 'orderNumber',
align: 'center',
label: 'orderNumber',
label: 'general.orderNumber',
field: 'branchNo',
},
{
name: 'firstName',
align: 'left',
label: 'nameEmployee',
label: 'general.name',
field: 'firstName',
},
{
name: 'formDialogInputAge',
name: 'general.age',
align: 'left',
label: 'formDialogInputAge',
label: 'general.age',
field: 'dateOfBirth',
},
{
name: 'formDialogInputNationality',
align: 'left',
label: 'formDialogInputNationality',
label: 'general.nationality',
field: 'nationality',
},
{
name: 'formDialogInputPassportNo',
align: 'left',
label: 'formDialogInputPassportNo',
label: 'customerEmployee.form.passportNo',
field: 'passportNumber',
},
{
name: 'passportExpiryDate',
align: 'left',
label: 'passportExpire',
label: 'customerEmployee.form.passportExpireDate',
field: 'passportExpiryDate',
},
{
name: 'formDialogEmployeeNRCNo',
align: 'left',
label: 'formDialogEmployeeNRCNo',
label: 'customerEmployee.form.nrcNo',
field: 'nrcNo',
},
{
name: 'branchLabel',
align: 'left',
label: 'branchLabel',
label: 'customerEmployee.branch',
field: 'customerBranch',
},

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch, reactive, handleError } from 'vue';
import { ref, watch, reactive } from 'vue';
import { useI18n } from 'vue-i18n';
import { onMounted } from 'vue';
import { getUserId, getRole } from 'src/services/keycloak';
@ -114,14 +114,14 @@ const stat = ref<
{
icon: 'mdi-folder-outline',
count: 0,
label: 'productAndService',
label: 'productService.group.title',
mode: 'group',
color: 'pink',
},
{
icon: 'mdi-folder-table-outline',
count: 0,
label: 'productAndServiceType',
label: 'productService.type.title',
mode: 'type',
color: 'purple',
},
@ -135,7 +135,7 @@ const stat = ref<
{
icon: 'mdi-shopping-outline',
count: 0,
label: 'product',
label: 'productService.product.title',
mode: 'product',
color: 'green',
},
@ -284,31 +284,31 @@ const tbColumn = {
{
name: 'branchLabelNo',
align: 'center',
label: 'orderNumber',
label: 'general.order',
field: 'branchNo',
},
{
name: 'name',
align: 'left',
label: 'name',
label: 'general.name',
field: 'name',
},
{
name: 'detail',
align: 'left',
label: 'detail',
label: 'general.detail',
field: 'detail',
},
{
name: 'formDialogInputRemark',
align: 'left',
label: 'formDialogInputRemark',
label: 'general.remark',
field: 'remark',
},
{
name: 'createdAt',
align: 'left',
label: 'createdAt',
label: 'general.createdAt',
field: 'createdAt',
},
],
@ -317,26 +317,31 @@ const tbColumn = {
{
name: 'branchLabelNo',
align: 'center',
label: 'orderNumber',
label: 'general.order',
field: 'branchNo',
},
{ name: 'productName', align: 'left', label: 'productName', field: 'name' },
{
name: 'productName',
align: 'left',
label: 'general.name',
field: 'name',
},
{
name: 'productDetail',
align: 'left',
label: 'productDetail',
label: 'general.detail',
field: 'detail',
},
{
name: 'productProcessingTime',
align: 'left',
label: 'productProcessingTime',
label: 'productService.product.processingTimeDay',
field: 'process',
},
{
name: 'priceInformation',
align: 'center',
label: 'priceInformation',
label: 'productService.product.priceInformation',
field: 'name',
},
],
@ -344,26 +349,31 @@ const tbColumn = {
{
name: 'branchLabelNo',
align: 'center',
label: 'orderNumber',
label: 'general.order',
field: 'branchNo',
},
{ name: 'serviceName', align: 'left', label: 'serviceName', field: 'name' },
{
name: 'serviceName',
align: 'left',
label: 'general.name',
field: 'name',
},
{
name: 'serviceDetail',
align: 'left',
label: 'serviceDetail',
label: 'general.detail',
field: 'detail',
},
{
name: 'serviceWorkTotal',
align: 'left',
label: 'serviceWorkTotal',
label: 'productService.service.totalWork',
field: (v) => v.work.length,
},
{
name: 'createdAt',
align: 'left',
label: 'createdAt',
label: 'general.createdAt',
field: 'createdAt',
},
],
@ -376,11 +386,11 @@ const tbColumn = {
const tbControl = reactive({
groupAndType: {
fieldDisplay: [
{ value: 'branchLabelNo', label: 'orderNumber' },
{ value: 'name', label: 'name' },
{ value: 'detail', label: 'detail' },
{ value: 'formDialogInputRemark', label: 'formDialogInputRemark' },
{ value: 'createdAt', label: 'createdAt' },
{ value: 'branchLabelNo', label: 'general.order' },
{ value: 'name', label: 'general.name' },
{ value: 'detail', label: 'general.detail' },
{ value: 'formDialogInputRemark', label: 'general.remark' },
{ value: 'createdAt', label: 'general.createdAt' },
],
fieldSelected: [
'branchLabelNo',
@ -392,11 +402,17 @@ const tbControl = reactive({
},
product: {
fieldDisplay: [
{ value: 'branchLabelNo', label: 'orderNumber' },
{ value: 'productName', label: 'productName' },
{ value: 'productDetail', label: 'productDetail' },
{ value: 'productProcessingTime', label: 'productProcessingTime' },
{ value: 'priceInformation', label: 'priceInformation' },
{ value: 'branchLabelNo', label: 'general.order' },
{ value: 'productName', label: 'general.name' },
{ value: 'productDetail', label: 'general.detail' },
{
value: 'productProcessingTime',
label: 'productService.product.processingTimeDay',
},
{
value: 'priceInformation',
label: 'productService.product.priceInformation',
},
],
fieldSelected: [
'branchLabelNo',
@ -408,11 +424,11 @@ const tbControl = reactive({
},
service: {
fieldDisplay: [
{ value: 'branchLabelNo', label: 'orderNumber' },
{ value: 'serviceName', label: 'serviceName' },
{ value: 'serviceDetail', label: 'serviceDetail' },
{ value: 'serviceWorkTotal', label: 'serviceWorkTotal' },
{ value: 'createdAt', label: 'createdAt' },
{ value: 'branchLabelNo', label: 'general.order' },
{ value: 'serviceName', label: 'general.name' },
{ value: 'serviceDetail', label: 'general.detail' },
{ value: 'serviceWorkTotal', label: 'productService.service.totalWork' },
{ value: 'createdAt', label: 'general.createdAt' },
],
fieldSelected: [
'branchLabelNo',
@ -726,13 +742,13 @@ async function triggerChangeStatus(
color: status !== 'INACTIVE' ? 'warning' : 'info',
icon:
status !== 'INACTIVE' ? 'mdi-alert' : 'mdi-message-processing-outline',
title: t('confirmChangeStatusTitle'),
title: t('dialog.title.confirmChangeStatus'),
actionText:
status !== 'INACTIVE' ? t('switchOffLabel') : t('switchOnLabel'),
status !== 'INACTIVE' ? t('general.close') : t('general.open'),
message:
status !== 'INACTIVE'
? t('confirmChangeStatusOffMessage')
: t('confirmChangeStatusOnMessage'),
? t('dialog.message.confirmChangeStatusOff')
: t('dialog.message.confirmChangeStatusOn'),
action: async () => {
if (type === 'group' || productMode.value === 'group') {
const res = await toggleStatusGroup(id, status as Status)
@ -763,10 +779,10 @@ async function deleteServiceConfirm(serviceId?: string) {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('ok'),
title: t('dialog.title.confirmDelete'),
actionText: t('general.delete'),
persistent: true,
message: t('deleteConfirmMessage'),
message: t('dialog.message.confirmDelete'),
action: async () => {
const res = await deleteService(serviceId ?? currentIdService.value);
@ -790,10 +806,10 @@ async function deleteProductConfirm(id?: string) {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('ok'),
title: t('dialog.title.confirmDelete'),
actionText: t('general.delete'),
persistent: true,
message: t('deleteConfirmMessage'),
message: t('dialog.message.confirmDelete'),
action: async () => {
const res = await deleteProduct(id ?? currentIdProduct.value);
@ -823,10 +839,10 @@ async function deleteProductById(productId?: string) {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('ok'),
title: t('dialog.title.confirmDelete'),
actionText: t('general.delete'),
persistent: true,
message: t('deleteConfirmMessage'),
message: t('dialog.message.confirmDelete'),
action: async () => {
if (editByTree.value !== undefined) {
if (editByTree.value === 'type') {
@ -1180,9 +1196,9 @@ function confirmDeleteWork(id: string) {
dialog({
color: 'negative',
icon: 'mdi-alert',
title: t('deleteConfirmTitle'),
actionText: t('delete'),
message: t('deleteConfirmMessage'),
title: t('dialog.title.confirmDelete'),
actionText: t('general.delete'),
message: t('dialog.message.confirmDelete'),
action: async () => {
deleteWork(id);
flowStore.rotate();
@ -1329,19 +1345,20 @@ function handleStatus() {
return tempValue;
}
// function handleHold(node: ProductGroup & { type: string}) {
// if ($q.screen.gt.xs) return;
// return function (props: unknown) {
// holdDialog.value = true;
// currentNode.value = node;
// };
// }
function handleHold(node: ProductGroup & { type: string }) {
if ($q.screen.gt.xs) return;
console.log('asd');
holdDialog.value = true;
currentNode.value = node;
// return function (props: unknown) {
// };
}
onMounted(async () => {
utilsStore.currentTitle.title = 'mainProductTitle';
utilsStore.currentTitle.title = 'productService.title';
utilsStore.currentTitle.path = [
{
text: 'manage',
text: 'productService.caption',
i18n: true,
handler: () => {
expandedTree.value = [];
@ -1366,7 +1383,7 @@ watch(
let tmp: typeof utilsStore.currentTitle.path = [
{
text: 'manage',
text: 'productService.caption',
i18n: true,
handler: () => {
productMode.value = 'group';
@ -1385,7 +1402,7 @@ watch(
productMode.value === 'service'
) {
tmp.push({
text: 'productGroup',
text: 'productService.group.withName',
i18n: true,
argsi18n: { name: pathGroupName.value },
handler: () => {
@ -1404,13 +1421,15 @@ watch(
},
});
if (expandedTree.value.length === 0) {
utilsStore.currentTitle.path = [{ text: 'manage', i18n: true }];
utilsStore.currentTitle.path = [
{ text: 'productService.caption', i18n: true },
];
return;
}
}
if (productMode.value === 'service') {
tmp.push({
text: 'productType',
text: 'productService.type.withName',
i18n: true,
argsi18n: { name: pathTypeName.value },
});
@ -1469,7 +1488,7 @@ watch([currentStatusList, productMode], () => {
style="color: white; background-color: hsla(var(--pink-6-hsl))"
padding="xs"
icon="mdi-folder-multiple-plus-outline"
:label="$t('productAndService')"
:label="$t('productService.group.addTitle')"
external-label
label-position="left"
@click="
@ -1482,7 +1501,7 @@ watch([currentStatusList, productMode], () => {
<q-fab-action
v-if="productMode === 'type'"
id="btn-add-product-type"
:label="$t('productAndServiceType')"
:label="$t('productService.type.addTitle')"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--purple-11-hsl))"
@ -1497,7 +1516,7 @@ watch([currentStatusList, productMode], () => {
></q-fab-action>
<q-fab-action
v-if="productMode === 'service'"
:label="$t('buttonAddProduct')"
:label="$t('productService.product.addTitle')"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--green-11-hsl))"
@ -1514,7 +1533,7 @@ watch([currentStatusList, productMode], () => {
></q-fab-action>
<q-fab-action
v-if="productMode === 'service'"
:label="$t('addService')"
:label="$t('productService.service.addTitle')"
external-label
label-position="left"
style="color: white; background-color: hsla(var(--orange-6-hsl))"
@ -1535,7 +1554,7 @@ watch([currentStatusList, productMode], () => {
<div class="full-height column no-wrap">
<div class="text-body-2 q-mb-xs flex items-center">
{{ $t('dataSum') }}
{{ $t('general.dataSum') }}
<q-btn
class="q-ml-xs"
icon="mdi-pin-outline"
@ -1580,7 +1599,9 @@ watch([currentStatusList, productMode], () => {
class="row no-wrap full-width bordered-b text-weight-bold surface-3 items-center q-px-md q-py-sm"
:style="`min-height: ${$q.screen.gt.sm ? '57px' : '100.8px'}`"
>
<div class="col ellipsis-2-lines">จัดการสาขาทั้งหมด</div>
<div class="col ellipsis-2-lines">
{{ $t('productService.caption') }}
</div>
</div>
<div class="col full-width scroll">
@ -1712,6 +1733,7 @@ watch([currentStatusList, productMode], () => {
}
}
"
@handle-hold="handleHold"
/>
</div>
</div>
@ -1735,7 +1757,7 @@ watch([currentStatusList, productMode], () => {
outlined
:class="{ 'col-12': $q.screen.lt.md }"
dense
:label="$t('search')"
:label="$t('general.search')"
class=""
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearch"
@ -1765,10 +1787,10 @@ watch([currentStatusList, productMode], () => {
emit-value
:hide-dropdown-icon="$q.screen.lt.sm"
:options="[
{ label: $t('all'), value: 'All' },
{ label: $t('statusACTIVE'), value: 'ACTIVE' },
{ label: $t('general.all'), value: 'All' },
{ label: $t('general.active'), value: 'ACTIVE' },
{
label: $t('statusINACTIVE'),
label: $t('general.inactive'),
value: 'INACTIVE',
},
]"
@ -1786,7 +1808,7 @@ watch([currentStatusList, productMode], () => {
}))
"
:hide-dropdown-icon="$q.screen.lt.sm"
:display-value="$t('displayField')"
:display-value="$t('general.displayField')"
v-model="tbControl.groupAndType.fieldSelected"
class="col q-ml-sm"
option-label="label"
@ -2105,7 +2127,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -2149,7 +2171,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
@ -2191,7 +2213,7 @@ watch([currentStatusList, productMode], () => {
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('general.delete') }}
</span>
</q-item>
@ -2218,8 +2240,8 @@ watch([currentStatusList, productMode], () => {
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -2344,11 +2366,10 @@ watch([currentStatusList, productMode], () => {
<div class="col-4">
<div class="row items-center">
<div
class="app-text-muted"
style="width: 80px"
class="app-text-muted q-mr-sm"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -2382,7 +2403,7 @@ watch([currentStatusList, productMode], () => {
<div class="col-4 row justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: productGroup?.length,
total: totalGroup,
})
@ -2410,11 +2431,10 @@ watch([currentStatusList, productMode], () => {
<div class="col-4">
<div class="row items-center">
<div
class="app-text-muted"
style="width: 80px"
class="app-text-muted q-mr-sm"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -2448,7 +2468,7 @@ watch([currentStatusList, productMode], () => {
<div class="col-4 row justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage: productType?.length,
total: totalType,
})
@ -2485,7 +2505,7 @@ watch([currentStatusList, productMode], () => {
outlined
dense
unelavated
:label="$t('search')"
:label="$t('general.search')"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearchProductAndService"
debounce="250"
@ -2514,10 +2534,10 @@ watch([currentStatusList, productMode], () => {
map-options
emit-value
:options="[
{ label: $t('all'), value: 'All' },
{ label: $t('statusACTIVE'), value: 'ACTIVE' },
{ label: $t('general.all'), value: 'All' },
{ label: $t('general.active'), value: 'ACTIVE' },
{
label: $t('statusINACTIVE'),
label: $t('general.inactive'),
value: 'INACTIVE',
},
]"
@ -2540,7 +2560,7 @@ watch([currentStatusList, productMode], () => {
value: x.value,
}))
"
:display-value="$t('displayField')"
:display-value="$t('general.displayField')"
:model-value="
{
product: tbControl.product.fieldSelected,
@ -2618,6 +2638,7 @@ watch([currentStatusList, productMode], () => {
<q-tab
id="tab-service"
name="service"
class="text-capitalize"
@click="
async () => {
currentPageServiceAndProduct = 1;
@ -2642,6 +2663,7 @@ watch([currentStatusList, productMode], () => {
<q-tab
id="tab-product"
name="product"
class="text-capitalize"
@click="
async () => {
currentPageServiceAndProduct = 1;
@ -2660,7 +2682,7 @@ watch([currentStatusList, productMode], () => {
: 'app-text-muted'
"
>
{{ $t('product') }}
{{ $t('productService.product.title') }}
</div>
</q-tab>
</q-tabs>
@ -2889,7 +2911,7 @@ watch([currentStatusList, productMode], () => {
v-if="priceDisplay.price"
>
<div class="col app-text-muted-2 text-caption">
{{ $t('salePrice') }}
{{ $t('productService.product.salePrice') }}
</div>
<div class="col text-weight-bold">
฿{{
@ -2906,7 +2928,7 @@ watch([currentStatusList, productMode], () => {
v-if="priceDisplay.agentPrice"
>
<div class="col app-text-muted-2 text-caption">
{{ $t('agentPrice') }}
{{ $t('productService.product.agentPrice') }}
</div>
<div class="col text-weight-bold">
฿{{
@ -2926,7 +2948,9 @@ watch([currentStatusList, productMode], () => {
v-if="priceDisplay.serviceCharge"
>
<div class="col app-text-muted-2 text-caption">
{{ $t('processingPrice') }}
{{
$t('productService.product.processingPrice')
}}
</div>
<div class="col">
฿{{
@ -3021,7 +3045,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--green-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('viewDetail') }}
{{ $t('general.viewDetail') }}
</span>
</q-item>
@ -3059,7 +3083,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--cyan-6-hsl))"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('edit') }}
{{ $t('general.edit') }}
</span>
</q-item>
<q-item
@ -3095,7 +3119,7 @@ watch([currentStatusList, productMode], () => {
}"
/>
<span class="col-9 q-px-md flex items-center">
{{ $t('delete') }}
{{ $t('general.delete') }}
</span>
</q-item>
@ -3124,8 +3148,8 @@ watch([currentStatusList, productMode], () => {
<span class="q-pl-md">
{{
props.row.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</span>
</div>
@ -3197,12 +3221,8 @@ watch([currentStatusList, productMode], () => {
>
<div class="col-4">
<div class="row items-center">
<div
class="app-text-muted"
style="width: 80px"
v-if="$q.screen.gt.sm"
>
{{ $t('showing') }}
<div class="app-text-muted q-mr-sm" v-if="$q.screen.gt.sm">
{{ $t('general.recordPerPage') }}
</div>
<div>
<q-btn-dropdown
@ -3242,7 +3262,7 @@ watch([currentStatusList, productMode], () => {
<div class="col-4 row justify-center app-text-muted">
{{
$t('recordsPage', {
$t('general.recordsPage', {
resultcurrentPage:
productAndServiceTab === 'product'
? product?.length
@ -3288,7 +3308,7 @@ watch([currentStatusList, productMode], () => {
hideActive
useToggle
:img="`/images/product-service-${productMode}-avatar-add${productMode === 'type' ? ($q.dark.isActive ? '-d' : '-l') : ''}.png`"
:toggleTitle="$t('formDialogTitleUseStatus')"
:toggleTitle="$t('status.title')"
:icon="
productMode === 'group'
? 'mdi-folder-plus-outline'
@ -3340,7 +3360,7 @@ watch([currentStatusList, productMode], () => {
<SideMenu
:menu="[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'form-group',
},
]"
@ -3377,12 +3397,12 @@ watch([currentStatusList, productMode], () => {
:title="
$t(
editByTree === 'group'
? 'productGroup'
? 'productService.group.withName'
: editByTree === 'type'
? 'productType'
? 'productService.type.withName'
: productMode === 'group'
? 'productGroup'
: 'productType',
? 'productService.group.withName'
: 'productService.type.withName',
{
name: formDataGroup.code,
},
@ -3448,7 +3468,7 @@ watch([currentStatusList, productMode], () => {
}-hsl)/0.1)`"
:title="formDataGroup.name"
:caption="formDataGroup.code"
:toggleTitle="$t('formDialogTitleUserStatus')"
:toggleTitle="$t('status.title')"
:menu="[
{
icon: 'mdi-office-building-outline',
@ -3507,12 +3527,13 @@ watch([currentStatusList, productMode], () => {
</div>
</div>
<div
v-if="$q.screen.gt.sm"
class="col full-height rounded scroll row q-py-md q-pl-md q-pr-sm"
>
<SideMenu
:menu="[
{
name: $t('formDialogTitleInformation'),
name: $t('form.field.basicInformation'),
anchor: 'info-group',
},
]"
@ -3548,6 +3569,7 @@ watch([currentStatusList, productMode], () => {
<!-- work product, product work -->
<DialogForm
v-model:modal="dialogTotalProduct"
:submitLabel="$t('general.select')"
noAddress
noAppBox
:title="$t('productService.product.allProduct')"
@ -3596,7 +3618,7 @@ watch([currentStatusList, productMode], () => {
v-if="productIsAdd?.length !== 0"
>
<q-checkbox
:label="$t('selectAll')"
:label="$t('general.selectAll')"
:model-value="
!!inputSearchProductAndService
? selectProduct.length ===
@ -3646,9 +3668,8 @@ watch([currentStatusList, productMode], () => {
lazy-rules="ondemand"
id="input-search-add-product"
outlined
style="width: 250px"
dense
:label="$t('search')"
:label="$t('general.search')"
:bg-color="$q.dark.isActive ? 'dark' : 'white'"
v-model="inputSearchProductAndService"
debounce="500"
@ -3673,7 +3694,7 @@ watch([currentStatusList, productMode], () => {
"
/>
</div>
<div v-else class="row q-col-gutter-md">
<div v-else class="row q-col-gutter-md full-width">
<div
class="col-md-3 col-sm-6 col-12"
v-for="i in (!!inputSearchProductAndService
@ -3739,7 +3760,7 @@ watch([currentStatusList, productMode], () => {
<!-- Add Product -->
<DialogForm
v-model:modal="dialogProduct"
:title="$t('buttonAddProduct')"
:title="$t('productService.product.addTitle')"
:submit="
() => {
submitProduct();
@ -3757,7 +3778,7 @@ watch([currentStatusList, productMode], () => {
hideFade
useToggle
hideActive
:toggleTitle="$t('formDialogTitleUseStatus')"
:toggleTitle="$t('status.title')"
:img="profileUrl || '/images/product-avatar-add.png'"
fallbackCover="/images/product-banner.png"
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
@ -3777,12 +3798,27 @@ watch([currentStatusList, productMode], () => {
formDataProduct.status === 'CREATED' ? 'INACTIVE' : 'CREATED';
}
"
:tabsList="
$q.screen.gt.sm
? []
: [
{
name: 1,
label: $t(`form.field.basicInformation`),
},
{
name: 2,
label: $t('productService.product.priceInformation'),
},
]
"
v-model:currentTab="productTab"
/>
</div>
<div
class="col surface-1 q-ma-lg rounded bordered scroll row relative-position"
id="group-form"
id="product-form"
>
<div
class="col"
@ -3804,8 +3840,8 @@ watch([currentStatusList, productMode], () => {
<span class="full-width q-py-sm" style="padding-inline: 20px">
{{
v === 1
? $t('formDialogTitleInformation')
: $t('priceInformation')
? $t('form.field.basicInformation')
: $t('productService.product.priceInformation')
}}
</span>
</q-item>
@ -3844,7 +3880,7 @@ watch([currentStatusList, productMode], () => {
<DialogForm
v-model:modal="dialogProductEdit"
noAddress
:title="$t('editProduct')"
:title="$t('productService.product.title')"
:editData="() => (infoProductEdit = true)"
:undo="
() => {
@ -3875,7 +3911,7 @@ watch([currentStatusList, productMode], () => {
fallbackImg="/images/product-avatar.png"
color="var(--teal-10)"
:readonly="!infoProductEdit"
:toggleTitle="$t('formDialogTitleUseStatus')"
:toggleTitle="$t('status.title')"
:img="profileUrl || '/images/product-avatar.png'"
fallbackCover="/images/product-banner.png"
:bgColor="`hsla(var(--teal-${$q.dark.isActive ? '8' : '10'}-hsl)/0.15)`"
@ -3899,6 +3935,21 @@ watch([currentStatusList, productMode], () => {
);
}
"
:tabsList="
$q.screen.gt.sm
? []
: [
{
name: 1,
label: $t(`form.field.basicInformation`),
},
{
name: 2,
label: $t('productService.product.priceInformation'),
},
]
"
v-model:currentTab="productTab"
/>
</div>
@ -3964,8 +4015,8 @@ watch([currentStatusList, productMode], () => {
<span class="full-width q-py-sm" style="padding-inline: 20px">
{{
v === 1
? $t('formDialogTitleInformation')
: $t('priceInformation')
? $t('form.field.basicInformation')
: $t('productService.product.priceInformation')
}}
</span>
</q-item>
@ -4008,7 +4059,7 @@ watch([currentStatusList, productMode], () => {
no-address
no-app-box
height="95vh"
:title="$t('addService')"
:title="$t('productService.service.addTitle')"
v-model:modal="dialogService"
:submit="
() => {
@ -4028,7 +4079,7 @@ watch([currentStatusList, productMode], () => {
hideFade
useToggle
hideActive
:toggleTitle="$t('formDialogTitleUseStatus')"
:toggleTitle="$t('status.title')"
:img="profileUrl || '/images/service-avatar-add.png'"
fallbackCover="/images/service-banner.png"
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
@ -4055,12 +4106,27 @@ watch([currentStatusList, productMode], () => {
: 'CREATED';
}
"
:tabsList="
$q.screen.gt.sm
? []
: [
{
name: 1,
label: $t('productService.service.information'),
},
{
name: 2,
label: $t('productService.service.workInformation'),
},
]
"
v-model:currentTab="serviceTab"
/>
</div>
<div
class="col surface-1 q-mx-lg q-mt-lg q-mb-md rounded bordered scroll row relative-position"
id="group-form"
id="service-form"
>
<div
class="col"
@ -4080,7 +4146,11 @@ watch([currentStatusList, productMode], () => {
@click="serviceTab = v"
>
<span class="full-width q-py-sm" style="padding-inline: 20px">
{{ v === 1 ? $t('serviceInformation') : $t('workInformation') }}
{{
v === 1
? $t('productService.service.information')
: $t('productService.service.workInformation')
}}
</span>
</q-item>
</div>
@ -4155,7 +4225,7 @@ watch([currentStatusList, productMode], () => {
no-app-box
height="75vh"
width="75%"
:title="$t('properties')"
:title="$t('productService.service.properties')"
v-model:modal="propertiesDialog"
:submit="
() => {
@ -4175,7 +4245,7 @@ watch([currentStatusList, productMode], () => {
}
"
>
<div class="q-pa-lg full-height">
<div class="q-pa-lg full-width full-height">
<ServiceProperties
v-model:properties-option="propertiesOption"
v-model:form-service-properties="tempValueProperties"
@ -4189,7 +4259,7 @@ watch([currentStatusList, productMode], () => {
height="65vh"
width="65%"
v-model:modal="manageWorkNameDialog"
:title="$t('manage')"
:title="$t('general.manage')"
:close="triggerConfirmCloseWork"
>
<div class="q-pa-lg full-height">
@ -4246,7 +4316,7 @@ watch([currentStatusList, productMode], () => {
:caption="formDataProductService.code"
:active="formDataProductService.status !== 'INACTIVE'"
:readonly="!infoServiceEdit"
:toggleTitle="$t('formDialogTitleUseStatus')"
:toggleTitle="$t('status.title')"
:img="profileUrl || '/images/service-avatar.png'"
fallbackCover="/images/service-banner.png"
:bgColor="`hsla(var(--orange-${$q.dark.isActive ? '6' : '5'}-hsl)/0.15)`"
@ -4275,6 +4345,21 @@ watch([currentStatusList, productMode], () => {
);
}
"
:tabsList="
$q.screen.gt.sm
? []
: [
{
name: 1,
label: $t('productService.service.information'),
},
{
name: 2,
label: $t('productService.service.workInformation'),
},
]
"
v-model:currentTab="serviceTab"
/>
</div>
@ -4340,7 +4425,11 @@ watch([currentStatusList, productMode], () => {
@click="serviceTab = v"
>
<span class="full-width q-py-sm" style="padding-inline: 20px">
{{ v === 1 ? $t('serviceInformation') : $t('workInformation') }}
{{
v === 1
? $t('productService.service.information')
: $t('productService.service.workInformation')
}}
</span>
</q-item>
</div>
@ -4464,7 +4553,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--green-6-hsl))"
/>
</q-item-section>
<q-item-section>{{ $t('viewDetail') }}</q-item-section>
<q-item-section>{{ $t('general.viewDetail') }}</q-item-section>
</q-item>
<q-item
@ -4499,7 +4588,7 @@ watch([currentStatusList, productMode], () => {
style="color: hsl(var(--cyan-6-hsl))"
/>
</q-item-section>
<q-item-section>{{ $t('edit') }}</q-item-section>
<q-item-section>{{ $t('general.edit') }}</q-item-section>
</q-item>
<q-item
@ -4523,7 +4612,7 @@ watch([currentStatusList, productMode], () => {
<q-item-section avatar>
<q-icon name="mdi-trash-can-outline" class="app-text-negative" />
</q-item-section>
<q-item-section>{{ $t('delete') }}</q-item-section>
<q-item-section>{{ $t('general.delete') }}</q-item-section>
</q-item>
<q-item clickable v-ripple>
@ -4562,8 +4651,8 @@ watch([currentStatusList, productMode], () => {
<q-item-section>
{{
currentNode.status !== 'INACTIVE'
? $t('switchOnLabel')
: $t('switchOffLabel')
? $t('general.open')
: $t('general.close')
}}
</q-item-section>
</q-item>

View file

@ -10,7 +10,7 @@ const at = ref(kc.token);
const rt = ref(kc.refreshToken);
onMounted(() => {
utilsStore.currentTitle.title = 'Document Management';
utilsStore.currentTitle.title = 'menu.dms';
utilsStore.currentTitle.path = [
{
text: '',

View file

@ -18,8 +18,8 @@ onMounted(() => {
value: 'branch-management',
icon: 'mdi-chart-donut',
color: 'green',
title: 'mainBranchTitle',
caption: 'mainBranchCaption',
title: 'menu.branch',
caption: 'menu.branchCaption',
hidden:
role.value.includes('admin') ||
role.value.includes('branch_admin') ||
@ -33,8 +33,8 @@ onMounted(() => {
value: 'personnel-management',
icon: 'fa6-solid:building-user',
color: 'cyan',
title: 'mainPersonnelTitle',
caption: 'mainPersonnelCaption',
title: 'menu.user',
caption: 'menu.userCaption',
hidden:
role.value.includes('admin') ||
role.value.includes('branch_admin') ||
@ -48,31 +48,31 @@ onMounted(() => {
value: 'customer-management',
icon: 'isax-frame5',
color: 'cyan',
title: 'mainCustomerTitle',
caption: 'mainCustomerCaption',
title: 'menu.customer',
caption: 'menu.customerCaption',
isax: true,
},
{
value: 'product-service',
icon: 'heroicons-truck-solid',
color: 'orange',
title: 'mainProductTitle',
caption: 'mainProductCaption',
title: 'menu.product',
caption: 'menu.productCaption',
},
{
value: '',
icon: 'mdi-file-document',
color: 'violet',
title: 'mainQuotationTitle',
caption: 'mainQuotationCaption',
title: 'menu.quotation',
caption: 'menu.quotationCaption',
disabled: true,
},
{
value: '',
icon: 'isax-device-message5',
color: 'purple',
title: 'mainRequestTitle',
caption: 'mainRequestCaption',
title: 'menu.requestList',
caption: 'menu.requestListCaption',
isax: true,
disabled: true,
},
@ -80,8 +80,8 @@ onMounted(() => {
value: '',
icon: 'isax-receipt-2-15',
color: 'red',
title: 'mainOrderTitle',
caption: 'mainOrderCaption',
title: 'menu.workOrder',
caption: 'menu.workOrderCaption',
isax: true,
disabled: true,
},
@ -89,16 +89,16 @@ onMounted(() => {
value: '',
icon: 'material-symbols:box',
color: 'camo',
title: 'mainReceiptTitle',
caption: 'mainReceiptCaption',
title: 'menu.invoice',
caption: 'menu.invoiceCaption',
disabled: true,
},
{
value: '',
icon: 'isax-dollar-circle4',
color: 'lime',
title: 'mainFinanceTitle',
caption: 'mainFinanceCaption',
title: 'menu.accountingLedger',
caption: 'menu.accountingLedgerCaption',
isax: true,
disabled: true,
},
@ -106,8 +106,8 @@ onMounted(() => {
value: '',
icon: 'isax-element-35',
color: 'cyan',
title: 'mainDashboardTitle',
caption: 'mainDashboardCaption',
title: 'menu.dashboard',
caption: 'menu.dashboardCaption',
isax: true,
disabled: true,
},
@ -115,8 +115,8 @@ onMounted(() => {
value: '',
icon: 'mdi-file-document',
color: 'indigo',
title: 'mainReportTitle',
caption: 'mainReportCaption',
title: 'menu.report',
caption: 'menu.reportCaption',
disabled: true,
},
];