แก้ไขหน้าที่ประธานสืบสวน สอบสวน

This commit is contained in:
Warunee Tamkoo 2023-12-23 00:14:27 +07:00
parent 9b83d6bfd0
commit a07cc6d2a2
4 changed files with 99 additions and 49 deletions

View file

@ -1,5 +1,12 @@
<script setup lang="ts">
import { ref, computed, watchEffect, watch, type PropType } from "vue";
import {
ref,
computed,
watchEffect,
watch,
type PropType,
onMounted,
} from "vue";
import { QForm, useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
@ -11,10 +18,15 @@ const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const props = defineProps({
modal: Boolean,
id: String,
closePopup: Function,
duty: {
type: String,
default: "",
},
save: {
type: Function,
default: ""
default: () => console.log("not function"),
},
});
@ -24,22 +36,27 @@ const myForm = ref<QForm | null>(null);
/**
* งก Save
*/
const submit = async () => {
const submit = async () => {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
dialogConfirm(
$q,
async () => {
await props.save();
await props.save(props.id, duty.value);
duty.value = "";
},
"ยืนยันการแก้ไขข้อมูล",
"ต้องการยืนยันการแก้ไขข้อมูลเพื่อลงบัญชีแนบท้ายหรือไม่?"
"ยืนยันการบันทึกข้อมูล",
"ต้องการยืนยันการบันทึกข้อมูลหรือไม่?"
);
}
});
}
};
watch(props, () => {
duty.value = props?.duty;
});
</script>
<template>