Merge branch 'develop' into devTee
This commit is contained in:
commit
24a93f0024
8 changed files with 447 additions and 18 deletions
|
|
@ -12,7 +12,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, success } = mixin;
|
||||
const { dialogConfirm, success, showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
|
|
@ -27,6 +27,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
fetchData: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
});
|
||||
|
||||
const morningStatus = ref<string>("");
|
||||
|
|
@ -48,15 +52,26 @@ async function onClickSave() {
|
|||
afternoonStatusRef.value?.validate();
|
||||
if (!morningStatusRef.value.hasError && !afternoonStatusRef.value.hasError) {
|
||||
const body = {
|
||||
morningStatus: morningStatus.value,
|
||||
afternoonStatus: afternoonStatus.value,
|
||||
checkInStatus: morningStatus.value,
|
||||
checkOutStatus: afternoonStatus.value,
|
||||
reason: reason.value,
|
||||
};
|
||||
dialogConfirm($q, async () => {
|
||||
console.log(body);
|
||||
|
||||
success($q, "บันทึกข้อมูสำเร็จ");
|
||||
props.close?.();
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.leaveEditCheckin(props.detail?.id), body)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
props.fetchData?.();
|
||||
props.close?.();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -81,7 +96,7 @@ watch(
|
|||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
<q-card class="column" style="width: 300px">
|
||||
<q-card class="column" style="width: 320px">
|
||||
<HeaderDialog :tittle="'แก้ไขสถานะการเข้า-ออกงาน'" :close="props.close" />
|
||||
|
||||
<q-separator />
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ onMounted(async () => {
|
|||
:maxPage="maxPage"
|
||||
@update:pagination="updatePaging"
|
||||
:tab="'time-record'"
|
||||
:fetchData="fetchListTimeRecord"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ const props = defineProps({
|
|||
type: String,
|
||||
require: true,
|
||||
},
|
||||
fetchData: {
|
||||
type: Function,
|
||||
require: true,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:pagination"]);
|
||||
|
|
@ -203,6 +207,11 @@ onMounted(() => {
|
|||
:close="closeDetail"
|
||||
/>
|
||||
|
||||
<DialogEdit :modal="modalEdit" :detail="dataDetail" :close="onClickEdit" />
|
||||
<DialogEdit
|
||||
:modal="modalEdit"
|
||||
:detail="dataDetail"
|
||||
:close="onClickEdit"
|
||||
:fetchData="props.fetchData"
|
||||
/>
|
||||
</template>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ function save() {
|
|||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.leaveWorkByid(detailByid.value.profileId), {
|
||||
.put(config.API.leaveWorkByid(detailByid.value.profileId), {
|
||||
work: dateWork.value,
|
||||
})
|
||||
.then(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue