Merge branch 'anandadev' into develop
This commit is contained in:
commit
da8ef556b8
2 changed files with 52 additions and 13 deletions
|
|
@ -3,8 +3,13 @@
|
|||
*/
|
||||
import env from "../index";
|
||||
const reportOrder = `${env.API_REPORT2_URI}/report/order`;
|
||||
const reportRetire = `${env.API_REPORT2_URI}/report/retire`;
|
||||
|
||||
export default {
|
||||
reportOrderCover: (fileType: string, id: string) => `${reportOrder}/cover/${fileType}/${id}`,
|
||||
reportOrderAttachment: (fileType: string, id: string) => `${reportOrder}/attachment/${fileType}/${id}`,
|
||||
reportOrderCover: (fileType: string, id: string) =>
|
||||
`${reportOrder}/cover/${fileType}/${id}`,
|
||||
reportOrderAttachment: (fileType: string, id: string) =>
|
||||
`${reportOrder}/attachment/${fileType}/${id}`,
|
||||
reportRetireList: (fileType: string, id: string) =>
|
||||
`${reportRetire}/${fileType}/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ const { showLoader, hideLoader, messageError, success } = mixin;
|
|||
// const type_params = route.params.type;
|
||||
// const year_params = route.params.year;
|
||||
const retireld_params = route.params.retirementId;
|
||||
|
||||
const orderCoverDocs = ref<string>("");
|
||||
const orderCoverPdf = ref<string>("");
|
||||
const modalNote = ref<boolean>(false);
|
||||
const note = ref<string>("");
|
||||
const retireProfileId = ref<string>("");
|
||||
|
|
@ -153,6 +154,8 @@ const fileUpload = ref<any>(null);
|
|||
onMounted(() => {
|
||||
retireld.value = retireld_params.toString();
|
||||
fecthlistprofile(retireld.value);
|
||||
fetchReportCover("pdf", retireld.value);
|
||||
fetchReportCover("docx", retireld.value);
|
||||
});
|
||||
const round = ref<number>();
|
||||
const typeReport = ref<string>("");
|
||||
|
|
@ -320,6 +323,25 @@ const uploadFile = async (event: any) => {
|
|||
});
|
||||
};
|
||||
|
||||
const fetchReportCover = async (type: string, orderId: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportRetireList(type, orderId))
|
||||
.then(async (res) => {
|
||||
if (type == "pdf") {
|
||||
orderCoverPdf.value = res.data.result;
|
||||
} else {
|
||||
orderCoverDocs.value = res.data.result;
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
// messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// const classrow = (prop: any) => {
|
||||
// if (profileId.value !== "" && prop.profileId === profileId.value) {
|
||||
// return "color: #26a69a;";
|
||||
|
|
@ -374,17 +396,29 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<q-btn color="primary" flat round icon="download">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item clickable>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="red" name="mdi-file-pdf" />
|
||||
</q-item-section>
|
||||
<q-item-section>ไฟล .PDF</q-item-section>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
:href="orderCoverPdf"
|
||||
target="_blank"
|
||||
>
|
||||
<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-item clickable>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="green" name="mdi-file-excel" />
|
||||
</q-item-section>
|
||||
<q-item-section>ไฟล .xls</q-item-section>
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
:href="orderCoverDocs"
|
||||
target="_blank"
|
||||
>
|
||||
<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-list>
|
||||
</q-menu>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue