api เครื่องราช ส่วนจัดการ
This commit is contained in:
parent
5a0bf37501
commit
b15dd6205f
6 changed files with 94 additions and 46 deletions
|
|
@ -242,4 +242,6 @@ const uploadData = async () => {
|
|||
const downloadData = async (path: string) => {
|
||||
window.open(path);
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { useQuasar } from "quasar";
|
|||
import type { FormProprsalsRound2 } from "@/modules/07_insignia/interface/request/Main";
|
||||
import config from "@/app.config";
|
||||
import http from "@/plugins/http";
|
||||
import { useInsigniaDataStore } from "@/modules/07_insignia/store";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -19,6 +20,7 @@ const {
|
|||
dialogRemove,
|
||||
} = mixin;
|
||||
const $q = useQuasar(); //ใช้ noti quasar
|
||||
const storeInsignia = useInsigniaDataStore();
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"period_name",
|
||||
|
|
@ -108,7 +110,7 @@ const fetchData = async () => {
|
|||
period_isActive: e.period_isActive,
|
||||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result,
|
||||
statusRoyal: 'กำลังดำเนินการ'
|
||||
statusRoyal: storeInsignia.convertStatus(e.period_status),
|
||||
}));
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
|||
|
|
@ -816,7 +816,6 @@ const clickShowWarn = () => {
|
|||
/>
|
||||
<q-th v-else></q-th>
|
||||
</q-tr>
|
||||
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr
|
||||
|
|
@ -859,16 +858,14 @@ const clickShowWarn = () => {
|
|||
</q-td>
|
||||
<q-td key="note" class="text-center">
|
||||
<q-btn
|
||||
v-if="props.rowIndex == 2"
|
||||
v-if="props.row.reason"
|
||||
icon="mdi-information-outline"
|
||||
size="12px"
|
||||
color="blue"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
@click.stop="
|
||||
clickShowreson(props.row.name, 'จะได้เลื่อนเงินเดือน')
|
||||
"
|
||||
@click.stop="clickShowreson(props.row.name, props.row.reason)"
|
||||
>
|
||||
<q-tooltip>หมายเหตุ</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ const changround = async () => {
|
|||
};
|
||||
const requestNote = ref<string>("");
|
||||
const requestStatus = ref<string>("");
|
||||
const requestId = ref<string>("");
|
||||
const document = ref<string>("");
|
||||
|
||||
//เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์ ตามรอบการเสนอขอ
|
||||
const fecthInsigniaByOc = async (
|
||||
|
|
@ -156,6 +158,8 @@ const fecthInsigniaByOc = async (
|
|||
.then(async (res) => {
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
requestId.value = res.data.result.requestId;
|
||||
document.value = res.data.result.document;
|
||||
await DataStore.fetchData(res.data.result.items); // ส่งรายชื่อข้าราชการสามัญฯ
|
||||
await DataStore.fetchDataInsignia(res.data.result); // ส่งข้อมูลรอบบการแสดง
|
||||
loading.value = true;
|
||||
|
|
@ -279,11 +283,27 @@ const directorApproved = async () => {
|
|||
);
|
||||
};
|
||||
// ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st5 และ adminRole
|
||||
const backToEditinsignia2Role = async () => {
|
||||
const backToEditinsignia2Role = async (reason: string) => {
|
||||
dialogConfirm($q, async () => {
|
||||
console.log("รอ API");
|
||||
closepopupBackToInsignia2Role();
|
||||
success($q, " ตีกลับรอบการเสนอขอ รอ API");
|
||||
await http
|
||||
.put(config.API.rejectRequest(round.value, DataStore.typeOc), {
|
||||
reason: reason,
|
||||
})
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.typeOc,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
success($q, "การตีกลับสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
closepopupBackToInsignia2Role();
|
||||
});
|
||||
});
|
||||
};
|
||||
// ล็อกข้อมูลรอบการเสนอขอ
|
||||
|
|
@ -315,23 +335,32 @@ const requestSendNote = async () => {
|
|||
});
|
||||
});
|
||||
};
|
||||
// อัปโหลดไฟล์
|
||||
// อัปโหลดไฟล์เจ้าหน้าที่
|
||||
const fileUpload = ref<any>(null);
|
||||
const uploadFile = async (event: any) => {
|
||||
dialogConfirm($q, () => {
|
||||
dialogConfirm($q, async () => {
|
||||
const selectedFile = event;
|
||||
const formdata = new FormData();
|
||||
formdata.append("file", selectedFile);
|
||||
console.log("uploadFile :รอ API"),
|
||||
formdata.append("Document", selectedFile);
|
||||
await http
|
||||
.put(config.API.uploadfileOnlyInsignia(requestId.value), formdata)
|
||||
.then(async () => {
|
||||
await fecthInsigniaByOc(
|
||||
round.value,
|
||||
DataStore.agency,
|
||||
"officer",
|
||||
tab.value
|
||||
);
|
||||
success($q, "อัปโหลดไฟล์สำเร็จ");
|
||||
fileUpload.value = null;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
}),
|
||||
"ยืนยันการอัปโหลดไฟล์",
|
||||
"ต้องการยืนยันการอัปโหลดไฟล์นี้หรือไม่ ?";
|
||||
});
|
||||
};
|
||||
// ดาวน์โหลดไฟล์
|
||||
const downloadFile = async () => {
|
||||
console.log("downloadFile : รอ API");
|
||||
success($q, "downloadFile : รอ API");
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
@ -500,27 +529,31 @@ const downloadFile = async () => {
|
|||
@click="uploadFile(fileUpload)"
|
||||
v-if="fileUpload !== null"
|
||||
/>
|
||||
<q-btn
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
@click="downloadFile"
|
||||
v-if="roleDataStore.insignia1Role"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="primary"
|
||||
icon-right="mdi-download"
|
||||
label="ดาวน์โหลดไฟล์"
|
||||
@click="downloadFile"
|
||||
outline
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip></q-btn
|
||||
>
|
||||
<div v-if="document">
|
||||
<q-btn
|
||||
size="md"
|
||||
icon="mdi-download"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
v-if="roleDataStore.insignia1Role"
|
||||
:href="document"
|
||||
target="_blank"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-else
|
||||
color="primary"
|
||||
icon-right="mdi-download"
|
||||
label="ดาวน์โหลดไฟล์"
|
||||
outline
|
||||
:href="document"
|
||||
target="_blank"
|
||||
>
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
<q-space />
|
||||
<q-btn
|
||||
v-if="
|
||||
|
|
@ -553,7 +586,7 @@ const downloadFile = async () => {
|
|||
@click="directorApproved"
|
||||
/>
|
||||
<q-btn
|
||||
v-if="requestStatus == 'st5' && roleDataStore.adminRole"
|
||||
v-if="requestStatus == 'st6' && roleDataStore.adminRole"
|
||||
dense
|
||||
unelevated
|
||||
label="ตีกลับ"
|
||||
|
|
|
|||
|
|
@ -36,12 +36,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
{ id: '43', title: 'บัญชีระดับผลการประเมินผลการปฏิบัติราชการในรอบ 5 ปี' },
|
||||
{ id: '44', title: 'บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ' }
|
||||
])
|
||||
|
||||
|
||||
|
||||
const mainTab = ref<string | undefined>("pending");
|
||||
|
||||
|
||||
// เรียกราชชื่อการเสนอขอ
|
||||
const fetchData = async (data: any) => {
|
||||
if (data !== null) {
|
||||
|
|
@ -60,6 +55,8 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
dateSend: date2Thai(e.requestDate),
|
||||
requestNote: e.requestNote,
|
||||
employeeType: profileType(e.profileType),
|
||||
reason: e.reason
|
||||
|
||||
}));
|
||||
rows.value = await datalist;
|
||||
listinsignia.value = await datalist;
|
||||
|
|
@ -137,6 +134,17 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
return "ลูกจ้างประจำ";
|
||||
}
|
||||
};
|
||||
//แปลงสถานะ
|
||||
function convertStatus(val: string) {
|
||||
switch (val) {
|
||||
case "WAITTING":
|
||||
return "สร้างรอบ"
|
||||
case "PENDING":
|
||||
return "กำลังดำเนินการ"
|
||||
case "DONE":
|
||||
return "เสร็จสิ้น"
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
roundId,
|
||||
|
|
@ -159,5 +167,6 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
roleUser,
|
||||
requestStatus,
|
||||
optionReport,
|
||||
convertStatus
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue