download file ประเมินผล step2
This commit is contained in:
parent
6f5a408f9e
commit
b1397c3a3b
3 changed files with 64 additions and 17 deletions
7
src/api/assess/api.assess.ts
Normal file
7
src/api/assess/api.assess.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import env from "../index";
|
||||
|
||||
const assess = `${env.API_URI}`;
|
||||
|
||||
export default {
|
||||
reportTemplate: () => `${assess}/report-template/docx`,
|
||||
};
|
||||
|
|
@ -1,19 +1,20 @@
|
|||
/**ใช้รวมไฟล์ย่อยๆ ของ api แต่ละไฟล์ */
|
||||
|
||||
/** API Metadata */
|
||||
import testtest from "./api/test/api.test"
|
||||
import retirementResign from "./api/leave/api.leave"
|
||||
import placementTransfer from "./api/transfer/api.transfer"
|
||||
import message from "./api/api.message"
|
||||
|
||||
import testtest from "./api/test/api.test";
|
||||
import retirementResign from "./api/leave/api.leave";
|
||||
import placementTransfer from "./api/transfer/api.transfer";
|
||||
import message from "./api/api.message";
|
||||
import assess from "./api/assess/api.assess";
|
||||
|
||||
const API = {
|
||||
...testtest,
|
||||
...retirementResign,
|
||||
...placementTransfer,
|
||||
...message
|
||||
}
|
||||
...testtest,
|
||||
...retirementResign,
|
||||
...placementTransfer,
|
||||
...message,
|
||||
...assess,
|
||||
};
|
||||
|
||||
export default {
|
||||
API: API,
|
||||
}
|
||||
API: API,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { ref, onMounted } from "vue";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const $q = useQuasar();
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError } = mixin;
|
||||
|
||||
const fullName = ref<string>(
|
||||
keycloak.tokenParsed ? keycloak.tokenParsed.name!.toString() : ""
|
||||
);
|
||||
|
||||
const fileEvaluation1 = ref<any>();
|
||||
const fileEvaluation2 = ref<any>();
|
||||
|
|
@ -33,13 +48,30 @@ function backPage() {
|
|||
}
|
||||
|
||||
async function onClickDowloadFile(tp: string, templateName: string) {
|
||||
showLoader();
|
||||
const data = Object.assign(
|
||||
{ fullName: fullName.value },
|
||||
tp === "EV1_005" || tp === "EV1_007" ? { organizationName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionName: "-" } : null,
|
||||
tp === "EV1_007" ? { positionLeaveName: "-" } : null
|
||||
);
|
||||
const body = {
|
||||
template: tp,
|
||||
reportName: templateName,
|
||||
data: {
|
||||
fullName: "ใจดี จังนะ",
|
||||
},
|
||||
data: data,
|
||||
};
|
||||
console.log(body);
|
||||
await http
|
||||
.post(config.API.reportTemplate(), body)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q,err)
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
@ -62,6 +94,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_005', 'template-1')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -94,6 +127,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
</template>
|
||||
</q-file>
|
||||
</div>
|
||||
|
||||
<div class="col-1 self-center text-center">
|
||||
<q-btn flat round dense color="primary" icon="mdi-upload"
|
||||
><q-tooltip>อัปโหลดไฟล์</q-tooltip></q-btn
|
||||
|
|
@ -122,7 +156,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_005', 'template-2')"
|
||||
@click="onClickDowloadFile('EV1_006', 'template-2')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -182,6 +216,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_007', 'template-3')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -241,6 +276,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_008', 'template-4')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -300,6 +336,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_009', 'template-5')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -312,6 +349,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="visibility"
|
||||
label="ดูไฟล์เอกสาร"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_009', 'template-5')"
|
||||
>
|
||||
<q-tooltip> ดูไฟล์เอกสาร </q-tooltip></q-btn
|
||||
>
|
||||
|
|
@ -359,6 +397,7 @@ async function onClickDowloadFile(tp: string, templateName: string) {
|
|||
icon="download"
|
||||
label="ดาวน์โหลดต้นแบบ"
|
||||
color="primary"
|
||||
@click="onClickDowloadFile('EV1_010', 'template-6')"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลดต้นแบบ </q-tooltip></q-btn
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue