ออกคำสั่ง => fix bug

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-10 15:00:16 +07:00
parent a18581abbe
commit 3b5d9ff4fb
2 changed files with 13 additions and 48 deletions

View file

@ -249,7 +249,7 @@ const saveModal = () => {
if (myForm.value !== null) {
myForm.value.validate().then(async (result: boolean) => {
if (result) {
putSalary(modalData.value);
putSalary();
}
});
}
@ -309,7 +309,7 @@ const fetchSalary = async (personalId: string) => {
});
};
//
const putSalary = async (salary: any) => {
const putSalary = async () => {
dialogConfirm($q, async () => {
showLoader();
if (modalData.value.salaryAmount === null) {
@ -323,15 +323,15 @@ const putSalary = async (salary: any) => {
}
await http
.put(config.API.salaryOrder(personalId.value), modalData.value)
.then(() => {
.then(async () => {
await conditionData();
modal.value = false;
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await conditionData();
modal.value = false;
hideLoader();
});
});
@ -446,19 +446,6 @@ const resetFilter = () => {
filter.value = "";
filterRef.value!.focus();
};
const getClass = (val: boolean) => {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
const pagination = ref({
// sortBy: "OrderDate,OrderType",
descending: true,
page: 1,
rowsPerPage: 10,
});
</script>
<template>
@ -641,17 +628,9 @@ const pagination = ref({
:rules="[(val:number) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
mask="###,###,###,###,###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.salaryAmount"
:label="`${'เงินเดือน'}`"
:rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
hide-bottom-space
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
@ -661,19 +640,11 @@ const pagination = ref({
dense
hide-bottom-space
:label="`${'เงินประจำตำแหน่ง'}`"
:rules="modalData.positionSalaryAmount !== 0 ?[(val:number) => !!val || `${'กรุณากรอกเงินประจำตำแหน่ง'}`] : []"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
mask="###,###,###,###,###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.positionSalaryAmount"
:label="`${'เงินประจำตำแหน่ง'}`"
hide-bottom-space
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-6">
@ -683,19 +654,11 @@ const pagination = ref({
dense
hide-bottom-space
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
:rules="modalData.monthSalaryAmount !== 0 ?[(val:number) => !!val || `${'กรุณากรอกเงินค่าตอบแทนรายเดือน'}`]:[]"
lazy-rules
class="inputgreen"
mask="###,###,###,###"
mask="###,###,###,###,###,###,###,###"
reverse-fill-mask
/>
<!-- <CurruncyInput
:edit="true"
:dense="true"
v-model="modalData.monthSalaryAmount"
:label="`${'เงินค่าตอบแทนรายเดือน'}`"
hide-bottom-space
/> -->
</div>
<div class="col-xs-6 col-sm-6 col-md-12" v-if="checkNote">
<q-input
@ -705,6 +668,7 @@ const pagination = ref({
label="หมายเหตุแนวตั้ง"
type="textarea"
rows="2"
class="inputgreen"
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-12" v-if="checkNote">
@ -715,6 +679,7 @@ const pagination = ref({
type="textarea"
label="หมายเหตุแนวนอน"
rows="2"
class="inputgreen"
/>
</div>
</div>

View file

@ -319,15 +319,15 @@ const putSalary = async (salary: any) => {
}
await http
.put(config.API.salaryOrder(personalId.value), modalData.value)
.then(() => {
.then(async () => {
await conditionData();
modal.value = false;
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
await conditionData();
modal.value = false;
hideLoader();
});
});