API แก้ไขปฏิทินวันทำงาน

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-09 13:24:57 +07:00
parent 01b70ab7a0
commit c134530d5c
2 changed files with 38 additions and 7 deletions

View file

@ -13,6 +13,8 @@ export default {
leaveSearch: () => `${leave}/search`,
leaveRound: () => `${leave}/round`,
leaveRoundById: (id: string) => `${leave}/round/${id}`,
leaveWorkByid: (id: string) => `${leave}/admin/work/${id}`,
/**ลงเวลาพิเศษ */
specialTime: () => `${leave}/admin/edit`,
specialTimeApprove: (id: string) => `${leave}/admin/edit/approve/${id}`,

View file

@ -1,6 +1,8 @@
<script setup lang="ts">
import { ref, onMounted, reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
/** importType */
import type { dataPost } from "@/modules/09_leave/interface/request/changeRound";
@ -14,14 +16,21 @@ import { useChangeRoundDataStore } from "@/modules/09_leave/stores/ChangeRoundSt
/** useStore */
const mixin = useCounterMixin();
const { dialogMessageNotify } = mixin;
const {
showLoader,
hideLoader,
success,
messageError,
dialogMessageNotify,
dialogConfirm,
} = mixin;
const dataStore = useChangeRoundDataStore();
/** use */
const $q = useQuasar();
const modal = ref<boolean>(false);
const dateWork = ref<string>("5");
const dateWork = ref<string>("NORMAL");
const modalFix = ref<boolean>(false);
const editCheck = ref<string>("");
const DataRow = ref<any>();
@ -47,7 +56,10 @@ function Openmodal(check: string, detail: any) {
}
}
const detailByid = ref();
function OpenmodalFix(detail: any) {
dateWork.value = "NORMAL";
detailByid.value = detail;
modalFix.value = true;
}
@ -58,8 +70,23 @@ function closeDialog() {
}
function save() {
console.log("dateWork===>", dateWork.value);
closeDialog();
dialogConfirm($q, async () => {
showLoader();
await http
.post(config.API.leaveWorkByid(detailByid.value.profileId), {
work: dateWork.value,
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
closeDialog();
});
});
}
/** Function ค้นหาข้อมูล */
@ -212,7 +239,7 @@ function searchData() {
</div>
</q-card>
<!-- popup แกไขปฏนวนทำงาน -->
<!-- popup เปลยนรอบการปฏงาน ,ประวการเปลยนรอบการปฏงาน -->
<Dialogform
:modal="modal"
:closeDialog="closeDialog"
@ -221,6 +248,8 @@ function searchData() {
:personId="DataRow == null ? '' : DataRow.profileId"
@update:change-page="dataStore.changePage"
/>
<!-- แกไขปฏนวนทำงาน -->
<q-dialog v-model="modalFix" persistent>
<q-card style="min-width: 800px"
><q-toolbar>
@ -242,13 +271,13 @@ function searchData() {
<q-radio
name="dateWork"
v-model="dateWork"
val="5"
val="NORMAL"
label="ทำงาน 5 วัน"
/>
<q-radio
name="dateWork"
v-model="dateWork"
val="6"
val="6DAY"
label="ทำงาน 6 วัน"
/>
</div>