fix(03): view customer card

This commit is contained in:
puriphatt 2024-07-30 11:05:39 +00:00
parent 75a8e43a22
commit c9f23397e3
3 changed files with 23 additions and 3 deletions

View file

@ -136,10 +136,10 @@ watch([inputSearch, currentStatus], async () => {
<template> <template>
<div <div
class="row justify-between bordered-b surface-3 full-width no-wrap" class="row justify-between bordered-b surface-3 full-width"
style="z-index: 1" style="z-index: 1"
> >
<div class="row items-center col-12 col-sm"> <div class="row items-center col-12 col-md">
<q-btn <q-btn
round round
icon="mdi-arrow-left" icon="mdi-arrow-left"

View file

@ -20,6 +20,7 @@ defineProps<{
noBg?: boolean; noBg?: boolean;
history?: boolean; history?: boolean;
prefixId: string; prefixId: string;
separateEnter?: boolean;
}>(); }>();
defineEmits<{ defineEmits<{
@ -28,6 +29,7 @@ defineEmits<{
(e: 'deleteCard'): void; (e: 'deleteCard'): void;
(e: 'updateCard', action: 'FORM' | 'INFO', isEdit?: boolean): void; (e: 'updateCard', action: 'FORM' | 'INFO', isEdit?: boolean): void;
(e: 'enterCard', action: 'FORM' | 'INFO'): void; (e: 'enterCard', action: 'FORM' | 'INFO'): void;
(e: 'viewCard', action: 'FORM' | 'INFO'): void;
(e: 'toggleStatus', status: boolean): void; (e: 'toggleStatus', status: boolean): void;
}>(); }>();
</script> </script>
@ -89,7 +91,12 @@ defineEmits<{
dense dense
class="row q-py-sm" class="row q-py-sm"
style="white-space: nowrap" style="white-space: nowrap"
@click.stop="$emit('enterCard', 'INFO')" v-close-popup
@click.stop="
separateEnter
? $emit('viewCard', 'INFO')
: $emit('enterCard', 'INFO')
"
> >
<q-icon <q-icon
name="mdi-eye-outline" name="mdi-eye-outline"

View file

@ -2290,6 +2290,7 @@ watch(isMainPage, () => {
<PersonCard <PersonCard
:id="`card-${props.row.customerName}`" :id="`card-${props.row.customerName}`"
:field-selected="fieldSelected" :field-selected="fieldSelected"
separateEnter
history history
:prefix-id=" :prefix-id="
props.row.customerNameEN ?? props.rowIndex props.row.customerNameEN ?? props.rowIndex
@ -2360,6 +2361,18 @@ watch(isMainPage, () => {
isMainPage = false; isMainPage = false;
} }
" "
@view-card="
() => {
if (!listCustomer) return;
customerType = props.row.customerType;
const { branch, ...payload } = props.row;
currentCustomer = payload;
currentCustomerId = props.row.id;
assignFormData(props.row.id);
infoDrawerEdit = true;
openDialogInputForm('INFO', props.row.id);
}
"
@delete-card="deleteCustomerById(props.row.id)" @delete-card="deleteCustomerById(props.row.id)"
@toggle-status=" @toggle-status="
triggerChangeStatus(props.row.id, props.row.status) triggerChangeStatus(props.row.id, props.row.status)