diff --git a/src/modules/11_discipline/components/1_Complaint/Form.vue b/src/modules/11_discipline/components/1_Complaint/Form.vue
index e1a2e6915..d12fdcb90 100644
--- a/src/modules/11_discipline/components/1_Complaint/Form.vue
+++ b/src/modules/11_discipline/components/1_Complaint/Form.vue
@@ -211,7 +211,11 @@ function onSubmit() {
);
}
-/** เช็คข้อมูลจาก props*/
+/**
+ * เช็คข้อมูลจาก props
+ * เมื่อมีข้อมูล
+ * เก็บข้อมูลลง formData
+ */
watch(props.data, async () => {
formData.complainantType = props.data.complainantType;
formData.complainant = props.data.complainant;
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue b/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue
index 293549aac..00a3f1378 100644
--- a/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue
+++ b/src/modules/11_discipline/components/2_InvestigateFacts/AddPage.vue
@@ -1,11 +1,11 @@
diff --git a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue
index d91b7190d..54a049566 100644
--- a/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue
+++ b/src/modules/11_discipline/components/2_InvestigateFacts/Form.vue
@@ -12,26 +12,16 @@ import { diffDates } from "@fullcalendar/core/internal";
const $q = useQuasar();
-const investigateFactStore = useInvestigateFactStore(); // เรียกใช้ store
-const { filterFnOptionsType } = investigateFactStore; // เรียกใช้ filterFnOptionsType จาก store
-
-const mixin = useCounterMixin(); // เรียกใช้ mixin
-const { date2Thai, dialogConfirm } = mixin; // เรียกใช้ date2Thai, dialogConfirm จาก mixin
-
-const props = defineProps({
- data: {
- type: Object,
- default: null,
- },
- onSubmit: {
- type: Function,
- default: () => "",
- },
-});
+/**เรียกใช้ store */
+const investigateFactStore = useInvestigateFactStore();
+const mixin = useCounterMixin();
+const { filterFnOptionsType } = investigateFactStore;
+const { date2Thai, dialogConfirm } = mixin;
const complaintsOptions = ref([]);
const isUpdate = ref(false);
+/** ตัวแปร ref สำหรับแสดง validate */
const complaintRef = ref
+
{
+
{
+
{
]"
/>
+
{
keep-color
/>
+
+
+
{
type="textarea"
/>
+
{
+
{
type="textarea"
/>
+
{
+
("");
const filterRef = ref(null);
const resetFilter = () => {
@@ -34,6 +34,8 @@ const resetFilter = () => {
};
const attrs = ref(useAttrs());
+
+/** แสดงจำนวนในตาราง */
const pagination = ref({
// sortBy: "desc",
descending: false,
@@ -41,9 +43,22 @@ const pagination = ref({
rowsPerPage: 10,
});
+/**ไปยังหน้าเพิ่มข้อมูล */
const clickAdd = () => {
router.push(`/discipline/investigatefacts/add`);
};
+
+/**
+ * ไปหน้าแก้ไข
+ * @param id ไอดีเฉพาะ รายบุคคล
+ */
+function editPage(id: string) {
+ router.push(`/discipline/investigatefacts/${id}`);
+}
+
+/**เมื่อเริ่มโหลดหน้า
+ * ส่งข้อมูลจำลองไปยัง store
+ */
onMounted(async () => {
await fecthList([
{
@@ -80,9 +95,6 @@ onMounted(async () => {
},
]);
});
-function editPage(id: string) {
- router.push(`/discipline/investigatefacts/${id}`);
-}
@@ -144,6 +156,7 @@ function editPage(id: string) {
class="col-xs-12 col-sm-3 col-md-2"
/>
+