diff --git a/src/modules/05_placement/components/probation/FormAssign.vue b/src/modules/05_placement/components/probation/FormAssign.vue index 6e899e2af..f1a0062d8 100644 --- a/src/modules/05_placement/components/probation/FormAssign.vue +++ b/src/modules/05_placement/components/probation/FormAssign.vue @@ -96,7 +96,7 @@ hide-bottom-space class="full-width datepicker q-mb-md" :model-value=" - dateExam != null ? date2Thai(dateExam) : null + date_start != null ? date2Thai(date_start) : null " :label="`${'ตั้งเเต่วันที่'}`" clearable @@ -129,7 +129,7 @@ readonly class="full-width datepicker q-mb-md" :model-value=" - dateExam2 != null ? date2Thai(dateExam2) : null + date_finish != null ? date2Thai(date_finish) : null " :label="`${'ถึงวันที่'}`" clearable @@ -1253,8 +1253,7 @@ const val1 = ref([ const router = useRouter(); const mixin = useCounterMixin(); const { date2Thai, notifyError } = mixin; -const dateExam = ref(null); -const dateExam2 = ref(null); + const checkValidate = ref(false); const myForm = ref(null); @@ -1263,8 +1262,8 @@ const personal_id = ref(); const fullname = ref(); const knowledge_skill_map_no = ref([]); const round_no = ref(); -const date_start = ref(); -const date_finish = ref(); +const date_start = ref(null); +const date_finish = ref(null); const behavior_desc = ref(); const other_desc = ref({}); const other4_desc = ref(); @@ -1275,13 +1274,13 @@ const createdAt = ref(); const updatedAt = ref(); const clearDateExam = () => { - dateExam.value = null; + date_start.value = null; }; const clearDateExam2 = () => { - dateExam2.value = null; + date_finish.value = null; }; const isDatePicker2Readonly = computed(() => { - return dateExam.value === null; + return date_start.value === null; }); const routeName = router.currentRoute.value.name; const name = ref(""); @@ -1303,7 +1302,7 @@ const monthOp = [{ value: "6", label: "6 เดือน" }]; const activityCount = ref(2); const activity_desc = ref(Array(activityCount.value).fill("")); const goal_desc = ref(Array(activityCount.value).fill("")); - + const activityDataArray = ref([]); const addActivity = () => { activityCount.value++; }; @@ -1331,6 +1330,7 @@ const addKnowledge = () => { knowledgeCount.value++; } }; + const knowledgeArray = computed(() => { return Array(knowledgeCount.value).fill(""); }); @@ -1551,7 +1551,6 @@ const saveData = async () => { // workInfopRef.value.validate(); myForm.value.validate().then(async (result: boolean) => { if (result) { - // showLoader(); // แสดงข้อมูลใน Console @@ -1576,6 +1575,16 @@ const saveData = async () => { .onCancel(() => {}) .onDismiss(() => {}); } else { + // ลองดูlog + activityDataArray.value = activity_desc.value.map((activity, index) => ({ + id: index + 1, + activity_desc: activity, + goal_desc: goal_desc.value[index], + })); + // showLoader(); + console.log("activity_desc:", activity_desc.value); + console.log("goal_desc:", goal_desc.value); + console.log(activityDataArray.value); // Validation ไม่ผ่าน notifyError($q, "กรุณากรอกข้อมูลให้ครบ"); } @@ -1600,7 +1609,7 @@ const OPmain = [""]; const group = ref(""); const group2 = ref(""); const group3 = ref(""); -const OPgroup = [""]; +const OPgroup = ["test"]; const Other = ref("");