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

View file

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