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