refactor: header Format numbers

This commit is contained in:
Net 2024-08-22 11:14:36 +07:00
parent 6a5ab0ffc1
commit 408b7b3441

View file

@ -1,5 +1,6 @@
<script setup lang="ts">
import DatePicker from 'src/components/shared/DatePicker.vue';
import { formatNumberDecimal } from 'stores/utils';
const citizenId = defineModel<string | undefined>('citizenId', {
required: true,
@ -20,7 +21,9 @@ const registerName = defineModel<string | undefined>('registerName', {
const registerNameEN = defineModel<string>('registerNameEN');
const registerDate = defineModel<Date | null>('registerDate');
const authorizedCapital = defineModel<string>('authorizedCapital');
const authorizedCapital = defineModel<string>('authorizedCapital', {
default: '0',
});
defineProps<{
index: string;
@ -57,7 +60,7 @@ defineProps<{
for="input-branch-code"
:label="$t('customer.form.branchCode')"
:readonly="readonly"
:model-value="`${branchCode}${index}`"
:model-value="branchCode"
/>
<q-input
@ -113,12 +116,22 @@ defineProps<{
lazy-rules="ondemand"
dense
outlined
type="text"
:readonly="readonly"
hide-bottom-space
class="col-12 col-md-2"
class="col-12 col-md-3"
:label="$t('customer.form.authorizedCapital')"
for="input-authorized-capital"
v-model="authorizedCapital"
:model-value="
!readonly
? authorizedCapital
: formatNumberDecimal(+authorizedCapital, 2)
"
@update:model-value="
(v) => {
authorizedCapital = `${v}`;
}
"
/>
<DatePicker