fix: comma & customer form
This commit is contained in:
parent
613d233e8d
commit
133ede6a60
2 changed files with 48 additions and 41 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { QSelect } from 'quasar';
|
import { QSelect } from 'quasar';
|
||||||
import { onMounted, ref, watch, capitalize } from 'vue';
|
import { onMounted, ref, watch, capitalize } from 'vue';
|
||||||
import { formatNumberDecimal, selectFilterOptionRefMod } from 'stores/utils';
|
import { selectFilterOptionRefMod, commaInput } from 'stores/utils';
|
||||||
import { calculateAge, disabledAfterToday } from 'src/utils/datetime';
|
import { calculateAge, disabledAfterToday } from 'src/utils/datetime';
|
||||||
|
|
||||||
import useOptionStore from 'src/stores/options';
|
import useOptionStore from 'src/stores/options';
|
||||||
|
|
@ -108,6 +108,36 @@ watch(
|
||||||
<template>
|
<template>
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<template v-if="customerType === 'CORP'">
|
<template v-if="customerType === 'CORP'">
|
||||||
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-12 col-md-6"
|
||||||
|
:label="$t('customer.form.registerName')"
|
||||||
|
for="input-register-name"
|
||||||
|
v-model="registerName"
|
||||||
|
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
:readonly="readonly"
|
||||||
|
hide-bottom-space
|
||||||
|
class="col-12 col-md-6"
|
||||||
|
label="Company name"
|
||||||
|
for="input-register-name-en"
|
||||||
|
v-model="registerNameEN"
|
||||||
|
:rules="[
|
||||||
|
(val: string) => !!val || $t('form.error.required'),
|
||||||
|
(val: string) =>
|
||||||
|
/^[0-9A-Za-z\s.,]+$/.test(val) || $t('form.error.letterOnly'),
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row q-col-gutter-sm">
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
|
|
@ -166,36 +196,6 @@ watch(
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-12 row q-col-gutter-sm">
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-12 col-md-6"
|
|
||||||
:label="$t('customer.form.registerName')"
|
|
||||||
for="input-register-name"
|
|
||||||
v-model="registerName"
|
|
||||||
:rules="[(val: string) => !!val || $t('form.error.required')]"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<q-input
|
|
||||||
dense
|
|
||||||
outlined
|
|
||||||
:readonly="readonly"
|
|
||||||
hide-bottom-space
|
|
||||||
class="col-12 col-md-6"
|
|
||||||
label="Company name"
|
|
||||||
for="input-register-name-en"
|
|
||||||
v-model="registerNameEN"
|
|
||||||
:rules="[
|
|
||||||
(val: string) => !!val || $t('form.error.required'),
|
|
||||||
(val: string) =>
|
|
||||||
/^[0-9A-Za-z\s.,]+$/.test(val) || $t('form.error.letterOnly'),
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 row q-col-gutter-sm">
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
<DatePicker
|
<DatePicker
|
||||||
v-model="registerDate"
|
v-model="registerDate"
|
||||||
|
|
@ -214,14 +214,10 @@ watch(
|
||||||
class="col-12 col-md-2"
|
class="col-12 col-md-2"
|
||||||
:label="$t('customer.form.authorizedCapital')"
|
:label="$t('customer.form.authorizedCapital')"
|
||||||
for="input-authorized-capital"
|
for="input-authorized-capital"
|
||||||
:model-value="
|
:model-value="authorizedCapital"
|
||||||
!readonly
|
|
||||||
? authorizedCapital
|
|
||||||
: formatNumberDecimal(+authorizedCapital, 2)
|
|
||||||
"
|
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(v) => {
|
(v) => {
|
||||||
authorizedCapital = `${v}`;
|
if (typeof v === 'string') authorizedCapital = commaInput(v);
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { selectFilterOptionRefMod } from 'stores/utils';
|
import { selectFilterOptionRefMod, commaInput } from 'stores/utils';
|
||||||
import { onMounted, watch } from 'vue';
|
import { onMounted, watch } from 'vue';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
|
|
@ -13,9 +13,10 @@ const jobPosition = defineModel<string>('jobPosition');
|
||||||
const jobDescription = defineModel<string>('jobDescription');
|
const jobDescription = defineModel<string>('jobDescription');
|
||||||
const payDate = defineModel<string>('payDate');
|
const payDate = defineModel<string>('payDate');
|
||||||
const payDateEN = defineModel<string>('payDateEN');
|
const payDateEN = defineModel<string>('payDateEN');
|
||||||
const wageRate = defineModel<number>('wageRate');
|
const wageRate = defineModel<number | string>('wageRate');
|
||||||
const wageRateText = defineModel<string>('wageRateText');
|
const wageRateText = defineModel<string>('wageRateText');
|
||||||
|
|
||||||
|
const wageRate4Show = ref('');
|
||||||
const typeBusinessOption = ref([]);
|
const typeBusinessOption = ref([]);
|
||||||
const typeBusinessENOption = ref([]);
|
const typeBusinessENOption = ref([]);
|
||||||
const jobPositionOption = ref([]);
|
const jobPositionOption = ref([]);
|
||||||
|
|
@ -272,7 +273,6 @@ let jobPositionENFilter = selectFilterOptionRefMod(
|
||||||
(v) => (typeof v === 'string' ? (payDateEN = v) : '')
|
(v) => (typeof v === 'string' ? (payDateEN = v) : '')
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
:for="`${prefixId}-input-pay-rate`"
|
:for="`${prefixId}-input-pay-rate`"
|
||||||
:id="`${prefixId}-input-pay-rate`"
|
:id="`${prefixId}-input-pay-rate`"
|
||||||
|
|
@ -282,7 +282,18 @@ let jobPositionENFilter = selectFilterOptionRefMod(
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
class="col-md-3 col-6"
|
class="col-md-3 col-6"
|
||||||
:label="$t('customer.form.payRate')"
|
:label="$t('customer.form.payRate')"
|
||||||
v-model="wageRate"
|
:model-value="commaInput(wageRate?.toString() || '-')"
|
||||||
|
@update:model-value="
|
||||||
|
(v) => {
|
||||||
|
if (typeof v === 'string') wageRate4Show = commaInput(v);
|
||||||
|
const x = parseInt(
|
||||||
|
wageRate4Show && typeof wageRate4Show === 'string'
|
||||||
|
? wageRate4Show.replace(/,/g, '')
|
||||||
|
: '',
|
||||||
|
);
|
||||||
|
wageRate = x;
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue