diff --git a/src/components/Dialogs/AddPersonal.vue b/src/components/Dialogs/AddPersonal.vue index 0a253e943..2581a16c7 100644 --- a/src/components/Dialogs/AddPersonal.vue +++ b/src/components/Dialogs/AddPersonal.vue @@ -21,7 +21,7 @@ interface typeOp { } interface tableType { - id: string; + personId: string; idcard: string; prefix: string; firstName: string; @@ -46,10 +46,6 @@ const typeOps = ref([ /** รับค่ามาจาก หน้าหลัก */ const props = defineProps({ - checkId: { - type: Array, - default: [], - }, modal: { type: Boolean, default: false, @@ -67,6 +63,10 @@ const props = defineProps({ type: String, default: "", }, + selectedData: { + type: Array, + default: [], + }, close: { type: Function, default: () => console.log("not function"), @@ -145,10 +145,16 @@ async function searchInput() { } } + /** update เมื่อเปลี่ยน option */ function updateSelect() { search.value = ""; } +watch(()=>props.selectedData,()=>{ + if(props.selectedData){ + selected.value = props.selectedData + } +}) diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue index 9db6e52f7..819e7b350 100644 --- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue +++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue @@ -1302,7 +1302,7 @@ onMounted(async () => { -import { ref, computed, watchEffect, onMounted } from "vue"; +import { ref, computed, watchEffect, onMounted, watch } from "vue"; import { useQuasar } from "quasar"; import { useCounterMixin } from "@/stores/mixin"; import type { QTableProps } from "quasar"; @@ -119,6 +119,7 @@ const columns2 = ref([ ]); const props = defineProps({ + data:Array, Modal: Boolean, closeModal: Function, getData: Function, @@ -209,8 +210,15 @@ watchEffect(() => { } }); +watch(()=>props.data,()=>{ + if(props.data){ + const data = props.data.persons + console.log(data) + } +}) onMounted(async () => { await fecthTypeOption(); + });