เเก้ไข api insignia (file)

This commit is contained in:
AnandaTon 2023-08-11 11:13:14 +07:00
parent 5304e98617
commit bf80274f86
4 changed files with 20 additions and 12 deletions

View file

@ -295,6 +295,7 @@ const checkSave = async () => {
await editData(id.value); await editData(id.value);
} else { } else {
await addData(); await addData();
clickBack();
} }
} }
}); });

View file

@ -102,7 +102,7 @@
</q-td> </q-td>
<q-td key="status" :props="props" @click="clickEdit(props.row)"> <q-td key="status" :props="props" @click="clickEdit(props.row)">
<q-icon <q-icon
v-if="props.row.status == 'ยังไม่ได้เสนอ'" v-if="props.row.status == true"
name="mdi-close" name="mdi-close"
color="grey-5" color="grey-5"
class="text-h5" class="text-h5"
@ -139,7 +139,7 @@
flat flat
round round
color="light-blue-8" color="light-blue-8"
@click.stop.prevent="clickProposals(props.row.id)" @click.stop.prevent="clickProposals(props.row.file)"
icon="mdi-file-download" icon="mdi-file-download"
> >
<q-tooltip>ดาวนโหลดเอกสารประกอบ </q-tooltip> <q-tooltip>ดาวนโหลดเอกสารประกอบ </q-tooltip>
@ -297,7 +297,7 @@ const rows = ref<FormProprsalsRound[]>([
year: "2566", year: "2566",
startDate: "2566", startDate: "2566",
endDate: "31 พ.ค. 2566", endDate: "31 พ.ค. 2566",
status: "เสนอเเล้ว", status: true,
statusRoyal: "เสนอเเล้ว", statusRoyal: "เสนอเเล้ว",
}, },
{ {
@ -305,7 +305,7 @@ const rows = ref<FormProprsalsRound[]>([
year: "2566", year: "2566",
startDate: "2566", startDate: "2566",
endDate: "31 พ.ค. 2566", endDate: "31 พ.ค. 2566",
status: "เสนอเเล้ว", status: true,
statusRoyal: "เสนอเเล้ว", statusRoyal: "เสนอเเล้ว",
}, },
{ {
@ -313,7 +313,7 @@ const rows = ref<FormProprsalsRound[]>([
year: "2566", year: "2566",
startDate: "2566", startDate: "2566",
endDate: "31 พ.ค. 2566", endDate: "31 พ.ค. 2566",
status: "เสนอเเล้ว", status: true,
statusRoyal: "เสนอเเล้ว", statusRoyal: "เสนอเเล้ว",
}, },
{ {
@ -329,7 +329,7 @@ const rows = ref<FormProprsalsRound[]>([
year: "2566", year: "2566",
startDate: "2566", startDate: "2566",
endDate: "31 พ.ค. 2566", endDate: "31 พ.ค. 2566",
status: "เสนอเเล้ว", status: true,
statusRoyal: "ยังไม่ได้เสนอ", statusRoyal: "ยังไม่ได้เสนอ",
}, },
]); ]);
@ -356,7 +356,8 @@ const fetchData = async () => {
e.period_start == null ? null : date2Thai(new Date(e.period_start)), e.period_start == null ? null : date2Thai(new Date(e.period_start)),
endDate: endDate:
e.period_end == null ? null : date2Thai(new Date(e.period_end)), e.period_end == null ? null : date2Thai(new Date(e.period_end)),
status: e.period_status, status: e.period_isActive,
file: e.period_doc,
}); });
}); });
}) })
@ -406,8 +407,10 @@ const clickAdd = () => {
router.push({ name: "roundAdd" }); router.push({ name: "roundAdd" });
}; };
const clickProposals = (id: string) => { const clickProposals = (file: string) => {
// window.open(config.API.exportInsigniaDoc(id)); if (file !== null) {
window.open(file);
}
}; };
// //

View file

@ -319,6 +319,7 @@ const checkSave = async () => {
await editData(id.value); await editData(id.value);
} else { } else {
await addData(); await addData();
clickBack();
} }
} }
}); });

View file

@ -139,7 +139,7 @@
flat flat
round round
color="light-blue-8" color="light-blue-8"
@click.stop.prevent="clickProposals(props.row.id)" @click.stop.prevent="clickProposals(props.row.file)"
icon="mdi-file-download" icon="mdi-file-download"
> >
<q-tooltip>ดาวนโหลดเอกสารประกอบ </q-tooltip> <q-tooltip>ดาวนโหลดเอกสารประกอบ </q-tooltip>
@ -341,6 +341,7 @@ const fetchData = async () => {
endDate: endDate:
e.period_end == null ? null : date2Thai(new Date(e.period_end)), e.period_end == null ? null : date2Thai(new Date(e.period_end)),
status: e.period_status, status: e.period_status,
file: e.period_doc,
}); });
}); });
}) })
@ -356,8 +357,10 @@ const clickEdit = (col: any) => {
router.push(`/coin/round-add/${col.id}`); router.push(`/coin/round-add/${col.id}`);
}; };
const clickProposals = (id: string) => { const clickProposals = (file: string) => {
// window.open(config.API.exportDisablePassExamList(id)); if (file !== null) {
window.open(file);
}
}; };
// 2 // 2