fix report
This commit is contained in:
parent
b194cb2a25
commit
b925026c2f
4 changed files with 61 additions and 57 deletions
|
|
@ -45,6 +45,8 @@ const detailReport = ref<any>();
|
|||
* @param endDate วันสิ้นสุด
|
||||
*/
|
||||
async function getReportRecruit() {
|
||||
pdfSrc.value = undefined;
|
||||
page.value = 1;
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
|
|
@ -70,8 +72,6 @@ async function getReportRecruit() {
|
|||
* @param data ข้อมูลบัญชีวันลา
|
||||
*/
|
||||
async function genReport(data: any) {
|
||||
pdfSrc.value = undefined;
|
||||
page.value = 1;
|
||||
await axios
|
||||
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
||||
headers: {
|
||||
|
|
@ -202,14 +202,15 @@ function filterFnOptions(val: any, update: Function) {
|
|||
</div>
|
||||
<q-space />
|
||||
<div class="q-py-xs">
|
||||
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
:disable="
|
||||
!checkPermission($route)?.attrIsGet &&
|
||||
isReport &&
|
||||
!checkPermission($route)?.attrIsGet ||
|
||||
isReport ||
|
||||
reportSelect.id == ''
|
||||
"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ async function onUpdateFilter() {
|
|||
.post(config.API.disciplineReportByType(employeeClass.value), body)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
detailReport.value = data;
|
||||
// detailReport.value = data;
|
||||
data && (await genReportPreview(data));
|
||||
})
|
||||
.catch(async (e) => {
|
||||
|
|
@ -299,6 +299,7 @@ onMounted(async () => {
|
|||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
:loading="isLoadPDF"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
|
|
|
|||
|
|
@ -239,56 +239,58 @@ onMounted(async () => {
|
|||
</div>
|
||||
|
||||
<q-space />
|
||||
<q-btn
|
||||
:disable="
|
||||
!typeReport ||
|
||||
((typeReport == 'main' || typeReport == 'report3') &&
|
||||
!organization)
|
||||
"
|
||||
:loading="loadingBtn"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<div>
|
||||
<q-btn
|
||||
:disable="
|
||||
!typeReport ||
|
||||
((typeReport == 'main' || typeReport == 'report3') &&
|
||||
!organization)
|
||||
"
|
||||
:loading="loadingBtn"
|
||||
flat
|
||||
round
|
||||
color="primary"
|
||||
icon="download"
|
||||
v-if="checkPermission($route)?.attrIsGet"
|
||||
>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'pdf'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .pdf</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
genReportXLSX(
|
||||
detailReport,
|
||||
`รายการโครงการ/หลักสูตรการฝึกอบรมที่หน่วยงานของกรุงเทพมหานครเป็นผู้จัด`,
|
||||
'xlsx'
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="typeReport" class="row col-12">
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ async function genReportXLSX(
|
|||
URL.revokeObjectURL(url);
|
||||
}
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue