เหตุผลที่ขอยกเลิกการลาออก

This commit is contained in:
setthawutttty 2024-02-27 14:52:25 +07:00
parent 759a7c556d
commit 2f8d318a38
2 changed files with 86 additions and 18 deletions

View file

@ -0,0 +1,79 @@
<script setup lang="ts">
import { ref, defineModel } from "vue";
import Header from "@/components/DialogHeader.vue";
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
const $q = useQuasar();
const modal = defineModel<boolean>("modal", { required: true });
const type = ref<string>("");
const isReadonly = ref<boolean>(false); //
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, messageError } = mixin;
const reason = ref<string>('')
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
function validateForm() {
onSubmit();
}
function close() {
modal.value = false;
reason.value = "";
}
function onSubmit() {
dialogConfirm($q,()=>{
modal.value = false
reason.value = "";
})
}
function inputEdit(val: boolean) {
return {
"full-width cursor-pointer inputgreen ": val,
"full-width cursor-pointer inputgreen": !val,
};
}
</script>
<template>
<q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 30%">
<Header :tittle="`ขอยื่นขอยกเลิกการลาออก`" :close="close" />
<q-separator />
<q-card-section class="scroll" style="max-height: 70vh">
<div class="q-gutter-y-sm">
<q-input
label="เหตุผลที่ขอยกเลิกการลาออก"
v-model="reason"
outlined
dense
type="textarea"
/>
</div>
</q-card-section>
<q-separator />
<form @submit.prevent="validateForm">
<q-card-actions align="right" class="bg-white text-teal">
<!-- <q-btn flat label="OK" v-close-popup /> -->
<q-btn
type="submit"
for="#submitForm"
unelevated
dense
class="q-px-md items-center"
color="light-blue-10"
label="บันทึก"
/>
</q-card-actions>
</form>
</q-card>
</q-dialog>
</template>
<style lang="scss" scoped></style>

View file

@ -6,6 +6,7 @@ import { useCounterMixin } from "@/stores/mixin"
import http from "@/plugins/http"
import config from "@/app.config"
import type { QForm } from "quasar"
import Dialog from '@/modules/03_retire/views/DialogRetire.vue'
const mixin = useCounterMixin()
const { date2Thai, dateToISO, success, messageError, showLoader, hideLoader, fails } = mixin
@ -23,7 +24,7 @@ const tranferOrg = ref("")
const dateCommand = ref<Date>(new Date())
const dateLeave = ref<Date>(new Date())
const noteReason = ref("")
const modal = ref<boolean>(false)
/** ข้อมูล v-model ของฟอร์ม */
const dataDetail = ref<any>({
datetext: "",
@ -129,23 +130,7 @@ const saveResing = () => {
//
const cancelResing = () => {
$q.dialog({
title: "ยืนยันการยกเลิกการลาออก",
message: "ต้องการยื่นข้อมูลยกเลิกการลาออกนี้ใช่หรือไม่?",
cancel: {
flat: true,
color: "negative",
},
persistent: true,
})
.onOk(async () => {
if (route.params.id !== undefined) {
id.value = route.params.id.toString()
deleteResting(id.value)
}
})
.onCancel(() => {})
.onDismiss(() => {})
modal.value = true
}
/**
@ -433,4 +418,8 @@ const fectDataresign = async (id: string) => {
</q-form>
</div>
</div>
<Dialog
v-model:modal="modal"
/>
</template>