This commit is contained in:
setthawutttty 2024-03-07 16:18:28 +07:00
parent 24e0fc57fa
commit 1d4a73fc17
4 changed files with 28 additions and 27 deletions

View file

@ -179,14 +179,15 @@ function dialogClose(id: string) {
dialogConfirm(
$q,
() => {
// http
// .put(config.API)
// .then((res) => {})
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// });
http
.get(config.API.salaryPeriod() + `/close/${id}`)
.then((res) => {
getData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {});
},
"ยืนยันการปิดรอบ",
"หากปิดรอบแล้วจะไม่สามารถแก้ไขรายการเงินเดือนของรอบนี้ได้ ต้องการยืนยันการปิดรอบนี้ใช่หรือไม่?"
@ -408,32 +409,31 @@ onMounted(async () => {
}}</q-tooltip>
</q-btn>
<q-btn
v-if="props.row.isClose == false ? dateToISO(new Date()) >= dateToISO(props.row.effectiveDate) ? true : false:false"
color="red"
flat
dense
round
size="12px"
:icon="
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
? 'mdi-close-box'
: 'mdi-delete'
"
icon="mdi-close-box"
clickable
@click.stop="
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
? dialogClose(props.row.id)
: dialogRemove(
$q,
async () => await deleteData(props.row.id)
)
"
@click.stop="dialogClose(props.row.id)"
>
<q-tooltip>ดรอบ</q-tooltip>
</q-btn>
<q-btn
v-if="dateToISO(new Date()) >= dateToISO(props.row.effectiveDate) ? false : true"
color="red"
flat
dense
round
size="12px"
icon="mdi-delete"
clickable
@click.stop="dialogRemove( $q, async () => await deleteData(props.row.id))"
v-close-popup
>
<q-tooltip>{{
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
? "ปิดรอบ"
: "ลบข้อมูล"
}}</q-tooltip>
<q-tooltip>ลบขอม</q-tooltip>
</q-btn>
</q-td>
</q-tr>