แจ้งเตือน กรณีมีแก้ไข
This commit is contained in:
parent
e85d90afbd
commit
a211c3dabb
1 changed files with 23 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, reactive, watch } from "vue";
|
import { ref, onMounted, reactive, watch, watchEffect } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { is, useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
/** import Type */
|
/** import Type */
|
||||||
|
|
@ -55,6 +55,8 @@ const complaintFromRef = ref<Object | null>(null);
|
||||||
const appellantRef = ref<Object | null>(null);
|
const appellantRef = ref<Object | null>(null);
|
||||||
const resultRef = ref<Object | null>(null);
|
const resultRef = ref<Object | null>(null);
|
||||||
|
|
||||||
|
const isSave = ref<boolean>(false); // มีการแก้ไขรอบันทึก
|
||||||
|
|
||||||
const fileList = ref<ArrayFileList[]>([]);
|
const fileList = ref<ArrayFileList[]>([]);
|
||||||
/** รับ props มาจากหน้าหลัก */
|
/** รับ props มาจากหน้าหลัก */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
|
@ -305,6 +307,7 @@ function onSubmit() {
|
||||||
props.onSubmit(formData);
|
props.onSubmit(formData);
|
||||||
} else props.onSubmit(formData);
|
} else props.onSubmit(formData);
|
||||||
// props.onSubmit(formData);
|
// props.onSubmit(formData);
|
||||||
|
isSave.value = false;
|
||||||
},
|
},
|
||||||
"ยืนยันการบันทึกข้อมูล",
|
"ยืนยันการบันทึกข้อมูล",
|
||||||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||||
|
|
@ -393,7 +396,6 @@ function upLoadFileDoc() {
|
||||||
http
|
http
|
||||||
.put(config.API.complaintFileUpload(formData.id), Data)
|
.put(config.API.complaintFileUpload(formData.id), Data)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
props.getData();
|
props.getData();
|
||||||
})
|
})
|
||||||
|
|
@ -404,12 +406,10 @@ function upLoadFileDoc() {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
formData.documentFile = null;
|
formData.documentFile = null;
|
||||||
});
|
});
|
||||||
console.log("file", formData.documentFile, formData.id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function addPerson(data: any) {
|
async function addPerson(data: any) {
|
||||||
toggleModal();
|
toggleModal();
|
||||||
console.log(data);
|
|
||||||
await complainstStore.fetchComplainstAdd(data);
|
await complainstStore.fetchComplainstAdd(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -425,6 +425,7 @@ function deletePerson(id: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePerson(id: string) {
|
function removePerson(id: string) {
|
||||||
|
isSave.value = true;
|
||||||
const dataRow = complainstStore.rowsAdd;
|
const dataRow = complainstStore.rowsAdd;
|
||||||
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
const updatedRows = dataRow.filter((item: any) => item.personId !== id);
|
||||||
complainstStore.rowsAdd = updatedRows;
|
complainstStore.rowsAdd = updatedRows;
|
||||||
|
|
@ -443,9 +444,21 @@ onMounted(() => {
|
||||||
complainstStore.visibleColumns = visibleColumns.value;
|
complainstStore.visibleColumns = visibleColumns.value;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="row col-12 bg-white">
|
<div class="row col-12 bg-white">
|
||||||
<div class="col-sm-12 col-md-9">
|
<div class="col-sm-12 col-md-9">
|
||||||
|
<div v-if="isSave === true" class="q-pa-sm q-gutter-sm">
|
||||||
|
<q-banner
|
||||||
|
inline-actions
|
||||||
|
bordered
|
||||||
|
class="bg-red-1 text-red border-orange"
|
||||||
|
>
|
||||||
|
<q-icon name="mdi-information-outline" size="20px" /> แจ้งเตือน
|
||||||
|
ยังไม่ได้บันทึกข้อมูล
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
|
||||||
<form @submit.prevent="validateForm">
|
<form @submit.prevent="validateForm">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered>
|
<q-card bordered>
|
||||||
|
|
@ -1108,4 +1121,8 @@ onMounted(() => {
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.q-banner {
|
||||||
|
min-height: 25px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue