Validate เพิ่ม id /for เทส
This commit is contained in:
parent
c602ca401b
commit
4b5b2530d2
5 changed files with 221 additions and 188 deletions
|
|
@ -22,139 +22,22 @@ const myForm = ref<QForm | null>(null); //form data input
|
|||
const edit = ref<boolean>(false);
|
||||
const channel = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
// if (route.params.id) {
|
||||
// // มี params id ให้ เรียกข้อมูลของรอบการเสนอขอ
|
||||
// await fetchData();
|
||||
// }
|
||||
});
|
||||
onMounted(async () => {});
|
||||
// เรียกข้อมูลของรอบการเสนอขอ
|
||||
const fetchData = async () => {
|
||||
// edit.value = true;
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.getRoundInsignia(id.value))
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// id.value = data.period_id;
|
||||
// roundInsig.value =
|
||||
// options.value.filter((r: any) => r.value == data.period_round).length >
|
||||
// 0
|
||||
// ? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
// : null;
|
||||
// yearly.value = data.period_year;
|
||||
// datelast.value = data.period_amount;
|
||||
// dateStart.value = new Date(data.period_start);
|
||||
// dateEnd.value = new Date(data.period_end);
|
||||
// files.value = data.period_doc;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
const fetchData = async () => {};
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .delete(config.API.periodExamId(id))
|
||||
// .then((res) => {
|
||||
// success($q, "ลบข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
const deleteData = async (id: string) => {};
|
||||
|
||||
// แก้ไขข้อมูล
|
||||
|
||||
// คลิกบันทึก
|
||||
const checkSave = () => {
|
||||
// if (myForm.value !== null) {
|
||||
// myForm.value.validate().then(async (success) => {
|
||||
// if (success) {
|
||||
// dialogConfirm($q, () => SaveData());
|
||||
// } else if (Number(datelast.value) !== 0) {
|
||||
// dialogMessageNotify($q, "กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
};
|
||||
const checkSave = () => {};
|
||||
// บันทึกข้อมูล
|
||||
const SaveData = async () => {
|
||||
// if (edit.value) {
|
||||
// await editData(id.value);
|
||||
// } else {
|
||||
// await addData();
|
||||
// clickBack();
|
||||
// }
|
||||
};
|
||||
const SaveData = async () => {};
|
||||
// เพิ่มข้อมูลรอบการเสนอขอพระราชทานเครื่องราชฯ
|
||||
const addData = async () => {
|
||||
// const formData = new FormData();
|
||||
// const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||
// roundInsig.value.value
|
||||
// } ปี ${yearly.value + 543} `;
|
||||
// formData.append("name", name);
|
||||
// formData.append("year", yearly.value.toString());
|
||||
// formData.append("amount", datelast.value.toString());
|
||||
// formData.append("round", roundInsig.value.value);
|
||||
// if (dateStart.value !== null) {
|
||||
// formData.append("startDate", dateToISO(dateStart.value));
|
||||
// }
|
||||
// if (dateEnd.value !== null) {
|
||||
// formData.append("endDate", dateToISO(dateEnd.value));
|
||||
// }
|
||||
// formData.append("file", files.value);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .post(config.API.listRoundInsignia(), formData)
|
||||
// .then(() => {
|
||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// });
|
||||
};
|
||||
const addData = async () => {};
|
||||
// แก้ไขข้อมูล
|
||||
const editData = async (id: string) => {
|
||||
// const formData = new FormData();
|
||||
// const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||
// roundInsig.value.value
|
||||
// } ปี ${yearly.value + 543}`;
|
||||
// formData.append("name", name);
|
||||
// formData.append("year", yearly.value.toString());
|
||||
// formData.append("amount", datelast.value.toString());
|
||||
// formData.append("round", roundInsig.value.value);
|
||||
// if (dateStart.value !== null) {
|
||||
// formData.append("startDate", dateToISO(dateStart.value));
|
||||
// }
|
||||
// if (dateEnd.value !== null) {
|
||||
// formData.append("endDate", dateToISO(dateEnd.value));
|
||||
// }
|
||||
// formData.append("file", files.value);
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.editRoundInsignia(id), formData)
|
||||
// .then(() => {
|
||||
// success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// hideLoader();
|
||||
// clickBack();
|
||||
// });
|
||||
};
|
||||
const editData = async (id: string) => {};
|
||||
|
||||
const clickBack = () => {
|
||||
router.push(`/discipline/channel`);
|
||||
|
|
@ -187,6 +70,7 @@ const clickBack = () => {
|
|||
dense
|
||||
outlined
|
||||
v-model="channel"
|
||||
for="channel"
|
||||
label="กรอกชื่อช่องทาง"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อช่องทาง'}`]"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ onMounted(() => {});
|
|||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
for="filterKeyword"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
|
|
@ -150,6 +151,7 @@ onMounted(() => {});
|
|||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
for="visibleColumns"
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
|
|
@ -204,18 +206,6 @@ onMounted(() => {});
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="scope.pagesNumber"
|
||||
:max-pages="5"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue