chore: format code

This commit is contained in:
Methapon2001 2024-07-08 11:21:00 +07:00
parent 37d19e8600
commit 4fa1188063
6 changed files with 98 additions and 122 deletions

View file

@ -1,6 +1,6 @@
import { boot } from 'quasar/wrappers'; import { boot } from 'quasar/wrappers';
import VueDatePicker from '@vuepic/vue-datepicker'; import VueDatePicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css' import '@vuepic/vue-datepicker/dist/main.css';
import GlobalDialog from 'components/GlobalDialog.vue'; import GlobalDialog from 'components/GlobalDialog.vue';
import GlobalLoading from 'components/GlobalLoading.vue'; import GlobalLoading from 'components/GlobalLoading.vue';

View file

@ -154,7 +154,6 @@ defineEmits<{
</q-btn> </q-btn>
</div> </div>
<!-- profile --> <!-- profile -->
<AppCircle <AppCircle
@ -163,8 +162,6 @@ defineEmits<{
style="border: 2px solid var(--border-color); overflow: visible" style="border: 2px solid var(--border-color); overflow: visible"
@click="$emit('editProfile')" @click="$emit('editProfile')"
> >
<q-img <q-img
:src="data.img ?? '/no-profile.png'" :src="data.img ?? '/no-profile.png'"
style=" style="
@ -182,7 +179,6 @@ defineEmits<{
<q-img src="/no-profile.png" width="5rem" /> <q-img src="/no-profile.png" width="5rem" />
</div> </div>
</template> </template>
</q-img> </q-img>
<div class="avatar__status"></div> <div class="avatar__status"></div>
</AppCircle> </AppCircle>

View file

@ -7,5 +7,5 @@ export default {
companyOwnerName: 'Company Owner Name', companyOwnerName: 'Company Owner Name',
corporation:'Corporation' corporation: 'Corporation',
}; };

View file

@ -7,6 +7,5 @@ export default {
companyOwnerName: 'ชื่อเจ้าของบริษัท', companyOwnerName: 'ชื่อเจ้าของบริษัท',
corporation:'ชื่อ บริษัท/นิติบุคคล' corporation: 'ชื่อ บริษัท/นิติบุคคล',
}; };

View file

@ -68,7 +68,6 @@ const useMyBranch = useMyBranchStore();
const { fetchListOptionBranch } = useMyBranch; const { fetchListOptionBranch } = useMyBranch;
const columns = [ const columns = [
{ {
name: 'customerName', name: 'customerName',
@ -91,7 +90,6 @@ const columns = [
field: 'personName', field: 'personName',
}, },
{ {
name: 'telephoneNo', name: 'telephoneNo',
align: 'left', align: 'left',
@ -107,7 +105,6 @@ const columns = [
}, },
] satisfies QTableProps['columns']; ] satisfies QTableProps['columns'];
const { const {
create, create,
getStatsCustomer, getStatsCustomer,
@ -171,17 +168,12 @@ const fieldSelectedCustomer = ref<{ label: string; value: string }>({
value: 'all', value: 'all',
}); });
const fieldDisplay = ref< const fieldDisplay = ref<
{ {
label: string; label: string;
value: string; value: string;
}[] }[]
>([ >([
{ {
label: t('corporation'), label: t('corporation'),
value: 'customerName', value: 'customerName',
@ -206,8 +198,6 @@ const fieldDisplay = ref<
label: t('formDialogInputEmail'), label: t('formDialogInputEmail'),
value: 'branchEmail', value: 'branchEmail',
}, },
]); ]);
const fieldSelected = ref< const fieldSelected = ref<
( (
@ -217,11 +207,7 @@ const fieldSelected = ref<
| 'telephoneNo' | 'telephoneNo'
| 'branchEmail' | 'branchEmail'
)[] )[]
>([ 'customerName', >(['customerName', 'customerType', 'personName', 'telephoneNo', 'branchEmail']);
'customerType',
'personName',
'telephoneNo',
'branchEmail']);
const splitterModel = ref(15); const splitterModel = ref(15);
const modeView = ref(true); const modeView = ref(true);
@ -865,8 +851,6 @@ async function toggleStatusEmployee(id: string, status: boolean) {
} }
async function toggleStatusCustomer(id: string, status: boolean) { async function toggleStatusCustomer(id: string, status: boolean) {
await editById(id, { status: !status ? 'ACTIVE' : 'INACTIVE' }); await editById(id, { status: !status ? 'ACTIVE' : 'INACTIVE' });
await fetchListCustomer(); await fetchListCustomer();
@ -1779,9 +1763,7 @@ watch([inputSearch, currentStatus], async () => {
} }
" "
> >
<q-td <q-td v-if="fieldSelected.includes('customerName')">
v-if="fieldSelected.includes('customerName')"
>
<div class="row items-center"> <div class="row items-center">
<div <div
:class="{ :class="{
@ -1800,16 +1782,17 @@ watch([inputSearch, currentStatus], async () => {
> >
<div class="branch-card__icon"> <div class="branch-card__icon">
<q-avatar size="md"> <q-avatar size="md">
<q-img :src="props.row.imageUrl ?? '/no-profile.png'"> <q-img
:src="
props.row.imageUrl ?? '/no-profile.png'
"
>
<template #error> <template #error>
<q-img src="/no-profile.png" /> <q-img src="/no-profile.png" />
</template> </template>
</q-img> </q-img>
</q-avatar> </q-avatar>
<!-- <q-icon <!-- <q-icon
size="md" size="md"
style="scale: 0.8" style="scale: 0.8"
@ -1818,26 +1801,28 @@ watch([inputSearch, currentStatus], async () => {
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="col">{{ props.row.customerName || '-' }}</div> <div class="col">
{{ props.row.customerName || '-' }}
</div>
<div class="col app-text-muted"> <div class="col app-text-muted">
{{ props.row.customerNameEN || '-' }} {{ props.row.customerNameEN || '-' }}
</div> </div>
</div> </div>
</div> </div>
</q-td> </q-td>
<q-td <q-td v-if="fieldSelected.includes('customerType')">
v-if="fieldSelected.includes('customerType')"
>
<span <span
class="tags" class="tags"
:class="{
:class="{ [`tags__${props.row.customerType === 'CORP'? 'purple' : 'green'}`]: true }" [`tags__${props.row.customerType === 'CORP' ? 'purple' : 'green'}`]: true,
}"
> >
{{props.row.customerType === 'CORP' ? $t('customerLegalEntity') : $t('customerNaturalPerson')}} {{
props.row.customerType === 'CORP'
? $t('customerLegalEntity')
: $t('customerNaturalPerson')
}}
</span> </span>
</q-td> </q-td>
<q-td v-if="fieldSelected.includes('personName')"> <q-td v-if="fieldSelected.includes('personName')">
{{ props.row.personName }} {{ props.row.personName }}
@ -1845,10 +1830,7 @@ watch([inputSearch, currentStatus], async () => {
<q-td v-if="fieldSelected.includes('telephoneNo')"> <q-td v-if="fieldSelected.includes('telephoneNo')">
{{ props.row.branch[0].telephoneNo || '-' }} {{ props.row.branch[0].telephoneNo || '-' }}
</q-td> </q-td>
<q-td <q-td v-if="fieldSelected.includes('branchEmail')">
v-if="fieldSelected.includes('branchEmail')"
>
{{ props.row.branch[0].email || '-' }} {{ props.row.branch[0].email || '-' }}
</q-td> </q-td>
<q-td> <q-td>
@ -2009,7 +1991,6 @@ watch([inputSearch, currentStatus], async () => {
} }
" "
:model-value=" :model-value="
props.row.status !== 'INACTIVE' props.row.status !== 'INACTIVE'
" "
/> />
@ -2053,21 +2034,20 @@ watch([inputSearch, currentStatus], async () => {
() => { () => {
if (!listCustomer) return; if (!listCustomer) return;
customerType = props.row.customerType customerType = props.row.customerType;
const { branch, ...payload } = props.row const { branch, ...payload } = props.row;
currentCustomer = payload currentCustomer = payload;
currentCustomerId = props.row.id currentCustomerId = props.row.id;
assignFormData(props.row.id) assignFormData(props.row.id);
infoDrawerEdit = true
openDialogInputForm('INFO', props.row.id)
infoDrawerEdit = true;
openDialogInputForm('INFO', props.row.id);
} }
" "
@enter-card="()=>{ @enter-card="
() => {
currentCustomerName = props.row.customerName; currentCustomerName = props.row.customerName;
customerType = props.row.customerType; customerType = props.row.customerType;
currentCustomerUrlImage = props.row.imageUrl; currentCustomerUrlImage = props.row.imageUrl;
@ -2076,13 +2056,14 @@ watch([inputSearch, currentStatus], async () => {
const { branch, ...payload } = props.row; const { branch, ...payload } = props.row;
currentCustomer = payload; currentCustomer = payload;
isMainPage = false; isMainPage = false;
}" }
"
@delete-card="deleteCustomerById(props.row.id)" @delete-card="deleteCustomerById(props.row.id)"
@toggle-status=" @toggle-status="
toggleStatusCustomer( toggleStatusCustomer(
props.row.id, props.row.id,
props.row.status === 'ACTIVE' ? true : false, props.row.status === 'ACTIVE' ? true : false,
); )
" "
/> />
</div> </div>