Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
21c4dabdf0
4 changed files with 22 additions and 21 deletions
|
|
@ -101,6 +101,7 @@ export default {
|
||||||
`${appeal}/admin?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
`${appeal}/admin?status=${status}&type=${type}&year=${year}&page=${page}&pageSize=${pageSize}&keyword=${keyword}`,
|
||||||
appealAdd: () => `${appeal}`,
|
appealAdd: () => `${appeal}`,
|
||||||
appealByID: (id: string) => `${appeal}/${id}`,
|
appealByID: (id: string) => `${appeal}/${id}`,
|
||||||
|
appealByIDGet: (id: string) => `${appeal}/admin/${id}`,
|
||||||
appealUpLoadFile: (id: string) => `${appeal}/file/${id}`,
|
appealUpLoadFile: (id: string) => `${appeal}/file/${id}`,
|
||||||
appealDeleteFile: (id: string, docId: string) =>
|
appealDeleteFile: (id: string, docId: string) =>
|
||||||
`${appeal}/file/${id}/${docId}`,
|
`${appeal}/file/${id}/${docId}`,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,9 @@ import { useQuasar } from "quasar";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||||
|
|
||||||
|
import genReport from "@/plugins/genreport";
|
||||||
|
|
||||||
const probationStore = useProbationDataStore();
|
const probationStore = useProbationDataStore();
|
||||||
const { fecthdataAssign } = probationStore;
|
const { fecthdataAssign } = probationStore;
|
||||||
|
|
||||||
|
|
@ -59,35 +62,26 @@ const fecthAssign = async (id: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const downloadFile = (response: any, filename: string) => {
|
|
||||||
const link = document.createElement("a");
|
|
||||||
var fileName = filename;
|
|
||||||
link.href = window.URL.createObjectURL(new Blob([response.data]));
|
|
||||||
link.setAttribute("download", fileName);
|
|
||||||
document.body.appendChild(link);
|
|
||||||
link.click();
|
|
||||||
document.body.removeChild(link);
|
|
||||||
};
|
|
||||||
|
|
||||||
const FileDownload = async (type: string) => {
|
const FileDownload = async (type: string) => {
|
||||||
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
|
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.reportEvaluateChairman(type, numTab.id), {
|
.get(config.API.reportEvaluateChairman(type, numTab.id))
|
||||||
responseType: "blob",
|
|
||||||
})
|
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
downloadFile(
|
const data = res.data.result;
|
||||||
res,
|
await genReport(
|
||||||
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
|
data,
|
||||||
|
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
|
||||||
|
type
|
||||||
);
|
);
|
||||||
|
hideLoader();
|
||||||
})
|
})
|
||||||
.catch(async (e) => {
|
.catch(async (e) => {
|
||||||
messageError($q, JSON.parse(await e.response.data.text()));
|
messageError($q, JSON.parse(await e.response.data.text()));
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
})
|
||||||
|
.finally(() => {});
|
||||||
};
|
};
|
||||||
const addData = () => {
|
const addData = () => {
|
||||||
router.push(
|
router.push(
|
||||||
|
|
@ -134,7 +128,13 @@ const changeTab = (tabVal: string) => {
|
||||||
|
|
||||||
<div class="q-gutter-md" v-if="tabs.length === 0">
|
<div class="q-gutter-md" v-if="tabs.length === 0">
|
||||||
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
<div class="flex justify-center items-center q-my-md q-gutter-md">
|
||||||
<q-btn v-if="!checkRoutePermisson" outline color="primary" label="สร้างแบบประเมิน" @click="addData" />
|
<q-btn
|
||||||
|
v-if="!checkRoutePermisson"
|
||||||
|
outline
|
||||||
|
color="primary"
|
||||||
|
label="สร้างแบบประเมิน"
|
||||||
|
@click="addData"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ async function onSubmit(data: any) {
|
||||||
function getData() {
|
function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
.get(config.API.appealByID(id.value))
|
.get(config.API.appealByIDGet(id.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const dataList = res.data.result;
|
const dataList = res.data.result;
|
||||||
data.id = dataList.id;
|
data.id = dataList.id;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ async function fetchEvaluteList() {
|
||||||
status: selectedStatus.value,
|
status: selectedStatus.value,
|
||||||
};
|
};
|
||||||
await http
|
await http
|
||||||
.put(config.API.evaluationMain(), body)
|
.post(config.API.evaluationMain(), body)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result.data;
|
const data = res.data.result.data;
|
||||||
total.value = res.data.result.total;
|
total.value = res.data.result.total;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue