ทะเบียนประวัติ(ใหม่): แก้ไข req body, สี icon ข้อมูลอื่นๆ

This commit is contained in:
puriphatt 2024-03-21 16:11:45 +07:00
parent 9332691144
commit 982969c68f
2 changed files with 18 additions and 19 deletions

View file

@ -55,7 +55,6 @@ const modal = ref<boolean>(false);
const edit = ref<boolean>(false);
const modalHistory = ref<boolean>(false);
const isActive = ref<boolean>(true);
const date = ref<Date | null>(null);
const detail = ref<string>();
@ -159,7 +158,6 @@ async function saveData() {
await http
.post(config.API.profileNewOther, {
profileId: profileId.value,
isActive: isActive.value,
date: date.value,
detail: detail.value,
})
@ -183,7 +181,6 @@ async function editData() {
showLoader();
await http
.patch(config.API.profileNewOtherById(id.value), {
isActive: isActive.value,
date: date.value,
detail: detail.value,
})
@ -215,21 +212,21 @@ async function getData() {
});
}
async function deleteData(id: string) {
showLoader();
await http
.delete(config.API.profileNewOtherById(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
getData();
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
// async function deleteData(id: string) {
// showLoader();
// await http
// .delete(config.API.profileNewOtherById(id))
// .then((res) => {
// success($q, "");
// getData();
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
// }
const infoRows = [
{ title: "รายละเอียด", value: "" },
@ -402,7 +399,7 @@ onMounted(() => {
><q-tooltip>แกไข</q-tooltip></q-btn
>
<q-btn
color="edit"
color="info"
icon="mdi-history"
flat
round

View file

@ -54,6 +54,7 @@ const columns = ref<QTableProps["columns"]>([
field: "date",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width: 50px;",
format: (v) => date2Thai(v),
},
{
name: "detail",
@ -85,6 +86,7 @@ const columns = ref<QTableProps["columns"]>([
field: "createdAt",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},