ปรับ เครื่องราชฯ
This commit is contained in:
parent
388893395b
commit
981bab8061
4 changed files with 416 additions and 139 deletions
|
|
@ -101,20 +101,20 @@ const fetchData = async () => {
|
|||
.get(config.API.listRoundInsignia())
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
rows.value = data.map((e: FormProprsalsRound2) =>({
|
||||
period_id: e.period_id,
|
||||
period_name: e.period_name,
|
||||
period_year: e.period_year + 543,
|
||||
period_amount: e.period_amount,
|
||||
period_start: e.period_start == null ? null : date2Thai(new Date(e.period_start)),
|
||||
period_end: e.period_end == null ? null : date2Thai(new Date(e.period_end)),
|
||||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result
|
||||
})
|
||||
|
||||
);
|
||||
console.log(rows.value)
|
||||
rows.value = data.map((e: FormProprsalsRound2) => ({
|
||||
period_id: e.period_id,
|
||||
period_name: e.period_name,
|
||||
period_year: e.period_year + 543,
|
||||
period_amount: e.period_amount,
|
||||
period_start:
|
||||
e.period_start == null ? null : date2Thai(new Date(e.period_start)),
|
||||
period_end:
|
||||
e.period_end == null ? null : date2Thai(new Date(e.period_end)),
|
||||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result,
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -179,6 +179,16 @@ const getRequest = async (id: string) => {
|
|||
await fetchData();
|
||||
});
|
||||
};
|
||||
// filename: string
|
||||
const downloadFile = (response: any) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = "filename";
|
||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
||||
link.setAttribute("download", fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -288,10 +298,18 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="period_name" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_name"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_name }}
|
||||
</q-td>
|
||||
<q-td key="period_year" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_year"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_year }}
|
||||
</q-td>
|
||||
<q-td
|
||||
|
|
@ -301,10 +319,18 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
>
|
||||
{{ props.row.period_start }}
|
||||
</q-td>
|
||||
<q-td key="period_end" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_end"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
{{ props.row.period_end }}
|
||||
</q-td>
|
||||
<q-td key="period_isActive" :props="props" @click="clickEdit(props.row)">
|
||||
<q-td
|
||||
key="period_isActive"
|
||||
:props="props"
|
||||
@click="clickEdit(props.row)"
|
||||
>
|
||||
<q-icon
|
||||
v-if="props.row.period_isActive == true"
|
||||
name="mdi-close"
|
||||
|
|
@ -358,9 +384,10 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
target="_blank"
|
||||
round
|
||||
color="light-blue-8"
|
||||
:href="props.row.period_doc"
|
||||
icon="mdi-file-download"
|
||||
@click="downloadFile(props.row.period_doc)"
|
||||
>
|
||||
<!-- :href="props.row.period_doc" -->
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const { messageError, dialogConfirm, showLoader, hideLoader, success } = mixin;
|
|||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
|
||||
const loading = ref<boolean>(false);
|
||||
const loadview = ref<boolean>(false);
|
||||
const round = ref<string>("");
|
||||
const roundName = ref<string>("");
|
||||
const optionRound = ref<any>([]);
|
||||
|
|
@ -39,7 +40,6 @@ const stat = ref<any>({
|
|||
onMounted(async () => {
|
||||
await checkRole();
|
||||
await fecthlistRound();
|
||||
await fecthAgency();
|
||||
});
|
||||
|
||||
const checkRole = async () => {
|
||||
|
|
@ -60,16 +60,19 @@ const checkRole = async () => {
|
|||
const fecthlistRound = async () => {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia())
|
||||
.then((res: any) => {
|
||||
.then(async (res: any) => {
|
||||
optionRound.value = res.data.result.map((e: any) => ({
|
||||
id: e.period_id,
|
||||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
}));
|
||||
const lastValue = optionRound.value[0];
|
||||
round.value = lastValue.id.toString();
|
||||
roundName.value = lastValue.name;
|
||||
fecthStat(round.value);
|
||||
if (optionRound.value.length !== 0) {
|
||||
const lastValue = optionRound.value[0];
|
||||
round.value = lastValue.id.toString();
|
||||
roundName.value = lastValue.name;
|
||||
await fecthStat(round.value);
|
||||
await fecthAgency();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
|
|
@ -120,6 +123,7 @@ const fecthType = async () => {
|
|||
name: e.organizationName,
|
||||
}));
|
||||
DataStore.fetchOption(optiontypeOc.value);
|
||||
loadview.value = true;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -294,7 +298,7 @@ const requestSendNote = async () => {
|
|||
<div class="toptitle text-dark col-12 row items-center">
|
||||
รายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</div>
|
||||
<q-card bordered class="row col-12 q-mt-sm">
|
||||
<q-card bordered class="row col-12 q-mt-sm" v-if="loadview">
|
||||
<div class="row col-12 items-center bg-grey-1">
|
||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||
<q-select
|
||||
|
|
@ -351,6 +355,13 @@ const requestSendNote = async () => {
|
|||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-card v-else>
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
</q-banner>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<q-card flat bordered class="col-12 q-mt-sm" v-if="loading">
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue