This commit is contained in:
setthawutttty 2023-11-15 11:30:13 +07:00
parent 13b5589083
commit c76af202de
2 changed files with 19 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import type { QTableProps } from "quasar";
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogConfirm } = mixin;
const { dialogConfirm, dialogMessageNotify } = mixin;
interface typeOp {
id: string;
@ -127,6 +127,9 @@ const props = defineProps({
},
});
/**ส่งค่ากลับหน้าหลัก */
const emit = defineEmits(["returnData"]);
/** ปิด dialog */
async function close() {
console.log("close");
@ -135,13 +138,17 @@ async function close() {
/** เปิด dialog ยืนยัน */
function savePost() {
dialogConfirm($q, () => saveData());
if (selected.value.length != 0) {
dialogConfirm($q, () => saveData());
} else {
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 รายการ");
}
}
/** save data หลังจาก ยืนยัน */
function saveData() {
console.log("save #in component", selected.value);
props.save();
emit("returnData", selected.value);
}
/** input ค้นหา */

View file

@ -357,6 +357,14 @@ watch(props.data, async () => {
formData.files = props.data.files;
});
/**
* งช บคาจาก คอมโพเเนน
* @param returnData าทไดนมา
*/
function handleSave(returnData:any) {
console.log('returnData:', returnData);
}
onMounted(() => {
complainstStore.columns = columns.value;
complainstStore.visibleColumns = visibleColumns.value;
@ -464,6 +472,7 @@ onMounted(() => {
btn-title="เพิ่มรายชื่อผู้ถูกสอบสวน"
:close="toggleModal"
:save="addPerson"
@returnData="handleSave"
/>
</div>
<div class="col-12">