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}`,
|
||||
appealAdd: () => `${appeal}`,
|
||||
appealByID: (id: string) => `${appeal}/${id}`,
|
||||
appealByIDGet: (id: string) => `${appeal}/admin/${id}`,
|
||||
appealUpLoadFile: (id: string) => `${appeal}/file/${id}`,
|
||||
appealDeleteFile: (id: string, docId: string) =>
|
||||
`${appeal}/file/${id}/${docId}`,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import { useQuasar } from "quasar";
|
|||
import { useRoute, useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useProbationDataStore } from "@/modules/05_placement/storeProbation";
|
||||
|
||||
import genReport from "@/plugins/genreport";
|
||||
|
||||
const probationStore = useProbationDataStore();
|
||||
const { fecthdataAssign } = probationStore;
|
||||
|
||||
|
|
@ -59,35 +62,26 @@ const fecthAssign = async (id: string) => {
|
|||
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) => {
|
||||
let numTab = evaluate.value.find((e: any) => e.no === dataArrayNumber.value);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportEvaluateChairman(type, numTab.id), {
|
||||
responseType: "blob",
|
||||
})
|
||||
.get(config.API.reportEvaluateChairman(type, numTab.id))
|
||||
.then(async (res) => {
|
||||
downloadFile(
|
||||
res,
|
||||
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}.${type}`
|
||||
const data = res.data.result;
|
||||
await genReport(
|
||||
data,
|
||||
`แบบประเมินผล(คณะกรรมการ)_${probationStore.person.name}_ครั้งที่${numTab.no}`,
|
||||
type
|
||||
);
|
||||
hideLoader();
|
||||
})
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
})
|
||||
.finally(() => {});
|
||||
};
|
||||
const addData = () => {
|
||||
router.push(
|
||||
|
|
@ -134,7 +128,13 @@ const changeTab = (tabVal: string) => {
|
|||
|
||||
<div class="q-gutter-md" v-if="tabs.length === 0">
|
||||
<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>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ async function onSubmit(data: any) {
|
|||
function getData() {
|
||||
showLoader();
|
||||
http
|
||||
.get(config.API.appealByID(id.value))
|
||||
.get(config.API.appealByIDGet(id.value))
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
data.id = dataList.id;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ async function fetchEvaluteList() {
|
|||
status: selectedStatus.value,
|
||||
};
|
||||
await http
|
||||
.put(config.API.evaluationMain(), body)
|
||||
.post(config.API.evaluationMain(), body)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
total.value = res.data.result.total;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue