Merge branch 'develop' into devTee
This commit is contained in:
commit
b05065ba67
4 changed files with 86 additions and 50 deletions
|
|
@ -11,6 +11,8 @@ export default {
|
||||||
questionnaireByid: (id: string) =>
|
questionnaireByid: (id: string) =>
|
||||||
`${retirementResign}/resign/questionnaire/${id}`,
|
`${retirementResign}/resign/questionnaire/${id}`,
|
||||||
listquestionnaire: () => `${retirementResign}/resign/questionnaire`,
|
listquestionnaire: () => `${retirementResign}/resign/questionnaire`,
|
||||||
|
cancelResign: (id: string) => `${retirementResign}/resign/cancel/${id}`,
|
||||||
|
|
||||||
// คำถาม
|
// คำถาม
|
||||||
questionList: () => `${retirementResign}/resign/questionnaire/question`,
|
questionList: () => `${retirementResign}/resign/questionnaire/question`,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ export const useRestDataStore = defineStore("Rest", () => {
|
||||||
return "ส่งรายชื่อไปออกคำสั่ง";
|
return "ส่งรายชื่อไปออกคำสั่ง";
|
||||||
case "DONE":
|
case "DONE":
|
||||||
return "ออกคำสั่งเสร็จแล้ว";
|
return "ออกคำสั่งเสร็จแล้ว";
|
||||||
|
case "CANCEL":
|
||||||
|
return "ยกเลิกการลาออก";
|
||||||
default:
|
default:
|
||||||
return "-";
|
return "-";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,29 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, defineModel } from "vue";
|
import { ref, defineModel } from "vue";
|
||||||
import Header from "@/components/DialogHeader.vue";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
|
/** importCompouents*/
|
||||||
|
import Header from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
/** importStore*/
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
/** use*/
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const route = useRoute();
|
||||||
|
|
||||||
const modal = defineModel<boolean>("modal", { required: true });
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
const type = ref<string>("");
|
const props = defineProps({
|
||||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
fectData: { type: Function, require: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
const id = ref<string>(route.params.id.toString());
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm, date2Thai, messageError } = mixin;
|
const { dialogConfirm, messageError, showLoader, hideLoader, success } = mixin;
|
||||||
const reason = ref<string>("");
|
const reason = ref<string>("");
|
||||||
|
|
||||||
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
|
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
|
||||||
|
|
@ -29,6 +40,21 @@ function onSubmit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
() => {
|
() => {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.put(config.API.cancelResign(id.value), {
|
||||||
|
reason: reason.value,
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.fectData?.(id.value);
|
||||||
|
success($q, "ยกเลิกการลาออกสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
reason.value = "";
|
reason.value = "";
|
||||||
},
|
},
|
||||||
|
|
@ -41,6 +67,7 @@ function onSubmit() {
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card class="col-12" style="width: 30%">
|
<q-card class="col-12" style="width: 30%">
|
||||||
|
<q-form @submit.prevent @validation-success="validateForm">
|
||||||
<Header :tittle="`ยื่นขอยกเลิกการลาออก`" :close="close" />
|
<Header :tittle="`ยื่นขอยกเลิกการลาออก`" :close="close" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
|
|
@ -51,12 +78,16 @@ function onSubmit() {
|
||||||
v-model="reason"
|
v-model="reason"
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
hide-bottom-space
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
:rules="[
|
||||||
|
(val) => !!val || `${'กรุณากรอกเหตุผลที่ขอยกเลิกการลาออก'}`,
|
||||||
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<form @submit.prevent="validateForm">
|
|
||||||
<q-card-actions align="right" class="bg-white text-teal">
|
<q-card-actions align="right" class="bg-white text-teal">
|
||||||
<!-- <q-btn flat label="OK" v-close-popup /> -->
|
<!-- <q-btn flat label="OK" v-close-popup /> -->
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
@ -69,7 +100,7 @@ function onSubmit() {
|
||||||
label="ยืนยัน"
|
label="ยืนยัน"
|
||||||
/>
|
/>
|
||||||
</q-card-actions>
|
</q-card-actions>
|
||||||
</form>
|
</q-form>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -511,7 +511,9 @@ function downloadFile(data: string) {
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="
|
v-if="
|
||||||
dataDetail.status !== 'DELETE' && dataDetail.status !== 'DONE'
|
dataDetail.status !== 'DELETE' &&
|
||||||
|
dataDetail.status !== 'DONE' &&
|
||||||
|
dataDetail.status !== 'CANCEL'
|
||||||
"
|
"
|
||||||
unelevated
|
unelevated
|
||||||
dense
|
dense
|
||||||
|
|
@ -540,5 +542,5 @@ function downloadFile(data: string) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Dialog v-model:modal="modal" />
|
<Dialog v-model:modal="modal" :fectData="fectDataresign" />
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue