เพิ่ม comment หน้า edit
This commit is contained in:
parent
35c63aa361
commit
47327cff40
1 changed files with 13 additions and 1 deletions
|
|
@ -26,6 +26,9 @@ import { useLeaveStore } from "@/modules/05_leave/store";
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ตัวแปรที่ใช้
|
||||||
|
*/
|
||||||
const personalId = ref<string>(route.params.id as string);
|
const personalId = ref<string>(route.params.id as string);
|
||||||
const leaveId = ref<string>("");
|
const leaveId = ref<string>("");
|
||||||
const dataStore = useLeaveStore();
|
const dataStore = useLeaveStore();
|
||||||
|
|
@ -202,12 +205,12 @@ async function fetchDataDetail(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**modal */
|
||||||
const model = computed(() => {
|
const model = computed(() => {
|
||||||
return (
|
return (
|
||||||
dataStore.options.find((x) => x.id == formData.leaveTypeId)?.code ?? ""
|
dataStore.options.find((x) => x.id == formData.leaveTypeId)?.code ?? ""
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const modelSpecific = computed(() => {
|
const modelSpecific = computed(() => {
|
||||||
const code = dataStore.options.find(
|
const code = dataStore.options.find(
|
||||||
(x) => x.id == formData.leaveTypeId
|
(x) => x.id == formData.leaveTypeId
|
||||||
|
|
@ -226,6 +229,11 @@ const modelSpecific = computed(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function บันทึกข้อมูล
|
||||||
|
* @param formData ข้อมูลใน formdata
|
||||||
|
* @param isLeave ตัวแปรเช็คว่าใช้หน้า edit หรือไม่
|
||||||
|
*/
|
||||||
function onSubmit(formData: FormData, isLeave: boolean = true) {
|
function onSubmit(formData: FormData, isLeave: boolean = true) {
|
||||||
if (isLeave) {
|
if (isLeave) {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
|
@ -248,6 +256,10 @@ function onSubmit(formData: FormData, isLeave: boolean = true) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* funciotn ยื่นใบลา
|
||||||
|
* @param id id ของใบลา
|
||||||
|
*/
|
||||||
function onConfirm(id: string) {
|
function onConfirm(id: string) {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue