uploadFile invoice,receice
This commit is contained in:
parent
48cbe7510c
commit
5bfd87c97b
3 changed files with 81 additions and 20 deletions
|
|
@ -26,7 +26,7 @@ export default {
|
||||||
insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
|
insigniaDashboard: (insigniaPeriodId: string) => `${insignia}/request/dashboard/${insigniaPeriodId}`,
|
||||||
// record
|
// record
|
||||||
noteround: () => `${insignia}/request/note`,
|
noteround: () => `${insignia}/request/note`,
|
||||||
requestDocNote: (id:string) => `${insignia}/request/note/doc/${id}`,
|
requestDocNote: (id: string) => `${insignia}/request/note/doc/${id}`,
|
||||||
noteSearch: () => `${insignia}/request/note/search`,
|
noteSearch: () => `${insignia}/request/note/search`,
|
||||||
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
noteAdd: (insigniaId: string) => `${insignia}/request/note/${insigniaId}`,
|
||||||
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
noteByid: (id: string) => `${insignia}/request/note/${id}`,
|
||||||
|
|
@ -35,4 +35,9 @@ export default {
|
||||||
insigniaSendToDirector: (roundId: string, ocId: string) => `${insignia}/request/officer/approve/${roundId}/${ocId}`,
|
insigniaSendToDirector: (roundId: string, ocId: string) => `${insignia}/request/officer/approve/${roundId}/${ocId}`,
|
||||||
insigniaDirectorBackToEdit: (roundId: string, ocId: string) => `${insignia}/request/director/reject/${roundId}/${ocId}`,
|
insigniaDirectorBackToEdit: (roundId: string, ocId: string) => `${insignia}/request/director/reject/${roundId}/${ocId}`,
|
||||||
insigniaDirectorApproved: (roundId: string, ocId: string) => `${insignia}/request/director/approve/${roundId}/${ocId}`,
|
insigniaDirectorApproved: (roundId: string, ocId: string) => `${insignia}/request/director/approve/${roundId}/${ocId}`,
|
||||||
|
|
||||||
|
// uploadfile
|
||||||
|
uploadfilereceice: (noteId: string) => `${insignia}/request/import/receice/${noteId}`,
|
||||||
|
uploadfileinvoice: (noteId: string) => `${insignia}/request/import/invoice/${noteId}`,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ const fectDataByid = async (id: string) => {
|
||||||
Advertise.value = data.number;
|
Advertise.value = data.number;
|
||||||
brand.value = data.requestInsigniaId;
|
brand.value = data.requestInsigniaId;
|
||||||
receivedate.value = data.dateReceive;
|
receivedate.value = data.dateReceive;
|
||||||
issue.value = "";
|
issue.value = data.issue;
|
||||||
affiliationRequest.value = data.organizationOrganizationSend;
|
affiliationRequest.value = data.organizationOrganizationSend;
|
||||||
affiliationReceived.value = data.organizationOrganizationReceive;
|
affiliationReceived.value = data.organizationOrganizationReceive;
|
||||||
announceDate.value = data.date;
|
announceDate.value = data.date;
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,14 @@ import { useQuasar } from "quasar";
|
||||||
// const router = useRouter();
|
// const router = useRouter();
|
||||||
const DataStore = useResultDataStore();
|
const DataStore = useResultDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { date2Thai, dialogConfirm, showLoader, hideLoader, messageError } =
|
const {
|
||||||
mixin;
|
date2Thai,
|
||||||
|
dialogConfirm,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
} = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const tab = ref<string>("");
|
const tab = ref<string>("");
|
||||||
|
|
||||||
|
|
@ -205,18 +211,6 @@ const rows = ref<any>([
|
||||||
// typepay: null,
|
// typepay: null,
|
||||||
// address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
|
// address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
|
||||||
// },
|
// },
|
||||||
// {
|
|
||||||
// no: "2",
|
|
||||||
// status: "บันทึกลง ก.พ. 7 แล้ว",
|
|
||||||
// name: "นางสาวภาพรรณ ลออ",
|
|
||||||
// type: "ทั้งหมด",
|
|
||||||
// page: "12",
|
|
||||||
// number: "11",
|
|
||||||
// vatnumber: "1122345",
|
|
||||||
// datepay: null,
|
|
||||||
// typepay: null,
|
|
||||||
// address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
|
|
||||||
// },
|
|
||||||
]);
|
]);
|
||||||
watch(tab, () => {
|
watch(tab, () => {
|
||||||
if (tab.value !== "doc") {
|
if (tab.value !== "doc") {
|
||||||
|
|
@ -272,6 +266,43 @@ const fecthlistInsignia = async () => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const uploadFile = async (event: any, action: string) => {
|
||||||
|
console.log(selectRound.value);
|
||||||
|
if (selectRound.value !== undefined) {
|
||||||
|
let id = selectRound.value.toString();
|
||||||
|
if (action === "result") {
|
||||||
|
const formdata = new FormData();
|
||||||
|
formdata.append("file", event);
|
||||||
|
await http
|
||||||
|
.put(config.API.uploadfilereceice(id), formdata)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fecthlistInsignia();
|
||||||
|
fileResult.value = null;
|
||||||
|
});
|
||||||
|
} else if (action === "invoice") {
|
||||||
|
const formdata = new FormData();
|
||||||
|
formdata.append("file", event);
|
||||||
|
await http
|
||||||
|
.put(config.API.uploadfileinvoice(id), formdata)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "อัพโหลดไฟล์สำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
await fecthlistInsignia();
|
||||||
|
fileinvoice.value = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const filterRef = ref<QInput>();
|
const filterRef = ref<QInput>();
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
|
|
@ -285,9 +316,7 @@ const addData = () => {
|
||||||
action.value = "addData";
|
action.value = "addData";
|
||||||
};
|
};
|
||||||
|
|
||||||
const editData = (data) => {
|
const editData = (data: any) => {
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
personId.value = data.id;
|
personId.value = data.id;
|
||||||
profileType.value = data.profileType;
|
profileType.value = data.profileType;
|
||||||
action.value = "editData";
|
action.value = "editData";
|
||||||
|
|
@ -398,6 +427,7 @@ const resetFilter = () => {
|
||||||
v-model="fileResult"
|
v-model="fileResult"
|
||||||
label="บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์"
|
label="บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์"
|
||||||
style="min-width: auto"
|
style="min-width: auto"
|
||||||
|
accept=".xlsx"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
|
|
@ -428,6 +458,20 @@ const resetFilter = () => {
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn> -->
|
</q-btn> -->
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="fileResult !== null">
|
||||||
|
<q-btn
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="add"
|
||||||
|
icon="mdi-upload"
|
||||||
|
@click="uploadFile(fileResult, 'result')"
|
||||||
|
>
|
||||||
|
<q-tooltip
|
||||||
|
>อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์</q-tooltip
|
||||||
|
>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<q-file
|
<q-file
|
||||||
dense
|
dense
|
||||||
|
|
@ -436,7 +480,7 @@ const resetFilter = () => {
|
||||||
v-model="fileinvoice"
|
v-model="fileinvoice"
|
||||||
label="บันทึกผลการจ่ายใบกำกับ"
|
label="บันทึกผลการจ่ายใบกำกับ"
|
||||||
style="min-width: auto"
|
style="min-width: auto"
|
||||||
accept=".pdf"
|
accept=".xlsx"
|
||||||
>
|
>
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
|
|
@ -444,6 +488,18 @@ const resetFilter = () => {
|
||||||
<q-tooltip>อัพโหลดไฟล์บันทึกผลการจ่ายใบกำกับ</q-tooltip>
|
<q-tooltip>อัพโหลดไฟล์บันทึกผลการจ่ายใบกำกับ</q-tooltip>
|
||||||
</q-file>
|
</q-file>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="fileinvoice !== null">
|
||||||
|
<q-btn
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="add"
|
||||||
|
icon="mdi-upload"
|
||||||
|
@click="uploadFile(fileinvoice, 'invoice')"
|
||||||
|
>
|
||||||
|
<q-tooltip>อัพโหลดไฟล์บันทึกผลการจ่ายใบกำกับ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue