Merge branch 'develop' into dev
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s
This commit is contained in:
commit
d022ae189c
1 changed files with 135 additions and 12 deletions
|
|
@ -6,7 +6,7 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useLeaveStore } from "@/modules/05_leave/store";
|
||||
import { useDataStore } from "@/stores/data";
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
/** import type*/
|
||||
import type {
|
||||
|
|
@ -16,8 +16,6 @@ import type {
|
|||
FromCancelDetail,
|
||||
} from "@/modules/05_leave/interface/response/leave";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import Workflow from "@/components/Workflow/Main.vue";
|
||||
import FormLeave from "@/modules/05_leave/components/formDetail/01_SickForm.vue";
|
||||
import FormChildbirth from "@/modules/05_leave/components/formDetail/04_HelpWifeBirthForm.vue";
|
||||
import FormHoliday from "@/modules/05_leave/components/formDetail/05_VacationForm.vue";
|
||||
|
|
@ -33,7 +31,6 @@ import FormCancel from "@/modules/05_leave/components/formDetail/formCancel.vue"
|
|||
|
||||
const $q = useQuasar();
|
||||
const dataStore = useLeaveStore();
|
||||
const mainStore = useDataStore();
|
||||
const { convertStatud } = dataStore;
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
|
|
@ -411,6 +408,28 @@ async function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันดาวน์โหลดไฟล์
|
||||
* @param id รหัสการลา
|
||||
* @param fileName ชื่อไฟล์
|
||||
* @param type ประเภทไฟล์
|
||||
*/
|
||||
async function onClickDownloadFile(id: string, fileName: string, type: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.leaveReport(id))
|
||||
.then(async (res) => {
|
||||
const data = res.data.result;
|
||||
await genReport(data, fileName, type);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**** ตรวจสอบว่ามีการส่งข้อมูลเข้ามาแล้วเปิด modal */
|
||||
watch(
|
||||
() => props.modal,
|
||||
|
|
@ -434,10 +453,62 @@ watch(
|
|||
v-if="props.leaveStatus != 'DELETE'"
|
||||
style="width: 900px; max-width: 80vw"
|
||||
>
|
||||
<DialogHeader
|
||||
:tittle="`${titleMain} ${titleName}`"
|
||||
:close="props.onClickClose"
|
||||
/>
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">
|
||||
{{ ` ${titleMain} ${titleName}` }}
|
||||
<q-btn class="q-mr-sm" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveSubTypeName
|
||||
? formData.leaveSubTypeName
|
||||
: formData.leaveTypeName,
|
||||
'docx',
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="mdi-file-word" />
|
||||
</q-item-section>
|
||||
<q-item-section>ไฟล์ .DOCX</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveSubTypeName
|
||||
? formData.leaveSubTypeName
|
||||
: formData.leaveTypeName,
|
||||
'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-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="props.onClickClose?.()"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
<q-card-section v-if="isLoading">
|
||||
|
|
@ -580,10 +651,62 @@ watch(
|
|||
</q-card>
|
||||
|
||||
<q-card v-if="props.leaveStatus === 'DELETE'" style="min-width: 40vw">
|
||||
<DialogHeader
|
||||
:tittle="`${titleMainCancle} ${titleName}`"
|
||||
:close="props.onClickClose"
|
||||
/>
|
||||
<q-toolbar>
|
||||
<q-toolbar-title class="text-subtitle2 text-bold">
|
||||
{{ ` ${titleMainCancle} ${titleName}` }}
|
||||
<q-btn class="q-mr-sm" icon="mdi-download" round color="primary" flat>
|
||||
<q-tooltip>ดาวน์โหลดไฟล์</q-tooltip>
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveSubTypeName
|
||||
? formData.leaveSubTypeName
|
||||
: formData.leaveTypeName,
|
||||
'docx',
|
||||
)
|
||||
"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="blue" name="mdi-file-word" />
|
||||
</q-item-section>
|
||||
<q-item-section>ไฟล์ .DOCX</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="
|
||||
onClickDownloadFile(
|
||||
formData.id,
|
||||
formData.leaveSubTypeName
|
||||
? formData.leaveSubTypeName
|
||||
: formData.leaveTypeName,
|
||||
'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-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-toolbar-title>
|
||||
<q-btn
|
||||
icon="close"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
@click="props.onClickClose?.()"
|
||||
style="color: #ff8080; background-color: #ffdede"
|
||||
/>
|
||||
</q-toolbar>
|
||||
|
||||
<q-separator />
|
||||
<q-card-section v-if="isLoading">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue