fix currency
This commit is contained in:
parent
0a445447e8
commit
512f9840de
3 changed files with 86 additions and 43 deletions
|
|
@ -8,6 +8,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||
import { useCommandDetail } from "@/modules/18_command/store/DetailStore";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import CurruncyInput from "@/components/CurruncyInput.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { showLoader, hideLoader, dialogConfirm, messageError, success } =
|
||||
|
|
@ -140,25 +141,30 @@ watch(
|
|||
v-if="store.isShowSalary(type)"
|
||||
class="col-xs-6 col-sm-6 col-md-6"
|
||||
>
|
||||
<q-input
|
||||
<CurruncyInput
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
v-model="formData.amount"
|
||||
:class="getClass(storeDetail.isSalary)"
|
||||
mask="###,###,###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:readonly="!storeDetail.isSalary"
|
||||
:label="`${'เงินเดือน'}`"
|
||||
:rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||
:rules="[
|
||||
(val:any) => !!val || 'กรุณากรอกเงินเดือน',
|
||||
(val:any) => {
|
||||
if (!val) return true;
|
||||
const numVal = typeof val === 'number' ? val : Number(String(val).replace(/,/g, ''));
|
||||
return numVal <= 10000000 || 'เงินเดือนต้องไม่เกิน 10,000,000 บาท';
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="store.isShowSalary(type)"
|
||||
class="col-xs-6 col-sm-6 col-md-6"
|
||||
>
|
||||
<q-input
|
||||
<CurruncyInput
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
|
|
@ -166,16 +172,21 @@ watch(
|
|||
v-model="formData.amountSpecial"
|
||||
:class="getClass(storeDetail.isSalary)"
|
||||
:readonly="!storeDetail.isSalary"
|
||||
mask="###,###,###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:label="`${'เงินค่าตอบแทนพิเศษ'}`"
|
||||
:rules="[
|
||||
(val:any) => {
|
||||
if (!val) return true;
|
||||
const numVal = typeof val === 'number' ? val : Number(String(val).replace(/,/g, ''));
|
||||
return numVal <= 10000000 || 'เงินค่าตอบแทนพิเศษต้องไม่เกิน 10,000,000 บาท';
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
v-if="store.isShowSalary(type)"
|
||||
class="col-xs-6 col-sm-6 col-md-6"
|
||||
>
|
||||
<q-input
|
||||
<CurruncyInput
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
|
|
@ -183,9 +194,14 @@ watch(
|
|||
v-model="formData.positionSalaryAmount"
|
||||
:class="getClass(storeDetail.isSalary)"
|
||||
:readonly="!storeDetail.isSalary"
|
||||
mask="###,###,###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:label="`${'เงินประจำตำแหน่ง'}`"
|
||||
:rules="[
|
||||
(val:any) => {
|
||||
if (!val) return true;
|
||||
const numVal = typeof val === 'number' ? val : Number(String(val).replace(/,/g, ''));
|
||||
return numVal <= 10000000 || 'เงินประจำตำแหน่งต้องไม่เกิน 10,000,000 บาท';
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
@ -193,7 +209,7 @@ watch(
|
|||
v-if="store.isShowSalary(type)"
|
||||
class="col-xs-6 col-sm-6 col-md-6"
|
||||
>
|
||||
<q-input
|
||||
<CurruncyInput
|
||||
dense
|
||||
outlined
|
||||
lazy-rules
|
||||
|
|
@ -201,9 +217,14 @@ watch(
|
|||
v-model="formData.monthSalaryAmount"
|
||||
:class="getClass(storeDetail.isSalary)"
|
||||
:readonly="!storeDetail.isSalary"
|
||||
mask="###,###,###,###,###,###"
|
||||
reverse-fill-mask
|
||||
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
|
||||
:rules="[
|
||||
(val:any) => {
|
||||
if (!val) return true;
|
||||
const numVal = typeof val === 'number' ? val : Number(String(val).replace(/,/g, ''));
|
||||
return numVal <= 10000000 || 'เงินค่าตอบแทนรายเดือนต้องไม่เกิน 10,000,000 บาท';
|
||||
}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue