fix bug
This commit is contained in:
parent
46ea808c84
commit
f6ea889258
5 changed files with 45 additions and 16 deletions
|
|
@ -81,11 +81,11 @@ function onSubmit(type: string, id: string) {
|
||||||
if (props.dateCheckReceive === null) {
|
if (props.dateCheckReceive === null) {
|
||||||
formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii));
|
formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii));
|
||||||
formData.append("File", files.value);
|
formData.append("File", files.value);
|
||||||
formData.append("OrgId", OrganazationId.value);
|
// formData.append("OrgId", OrganazationId.value);
|
||||||
} else {
|
} else {
|
||||||
formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii));
|
formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii));
|
||||||
formData.append("File", filesReturn.value);
|
formData.append("File", filesReturn.value);
|
||||||
formData.append("OrgId", OrganazationId2.value);
|
// formData.append("OrgId", OrganazationId2.value);
|
||||||
}
|
}
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,7 @@ watch(props, () => {
|
||||||
if (props.modal == true && props.roundId != "all") {
|
if (props.modal == true && props.roundId != "all") {
|
||||||
roundNo.value = props.roundId;
|
roundNo.value = props.roundId;
|
||||||
if (props.action === "editData") {
|
if (props.action === "editData") {
|
||||||
fetchOrgList();
|
// fetchOrgList();
|
||||||
} else {
|
} else {
|
||||||
fecthlistInsignia();
|
fecthlistInsignia();
|
||||||
}
|
}
|
||||||
|
|
@ -489,7 +489,7 @@ watch(props, () => {
|
||||||
</datepicker>
|
</datepicker>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-sm-6">
|
<!-- <div class="col-xs-12 col-sm-6">
|
||||||
<q-select
|
<q-select
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:options="filterOrgList"
|
:options="filterOrgList"
|
||||||
|
|
@ -509,7 +509,7 @@ watch(props, () => {
|
||||||
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
|
doneFn:Function) => filterSelector(inputValue, doneFn,'filterOrgList'
|
||||||
) "
|
) "
|
||||||
/>
|
/>
|
||||||
</div>
|
</div> -->
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-input
|
<q-input
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,15 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
|
||||||
position: e.position,
|
position: e.position,
|
||||||
status: status(e.status),
|
status: status(e.status),
|
||||||
dateReceive: date2Thai(e.dateReceive),
|
dateReceive: date2Thai(e.dateReceive),
|
||||||
name: e.prefix + e.fullName,
|
name: e.fullName,
|
||||||
type: `${e.requestInsignia} (${
|
type: `${e.requestInsignia} (${
|
||||||
type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
|
type.value.find((item) => item.name === e.requestInsignia)?.shortName ||
|
||||||
""
|
""
|
||||||
})`,
|
})`,
|
||||||
employeeType: profileType(e.profileType),
|
employeeType: profileType(
|
||||||
profileType: e.profileType,
|
e.profileType === "" ? "officer" : e.profileType
|
||||||
|
),
|
||||||
|
profileType: e.profileType === "" ? "officer" : e.profileType,
|
||||||
date: date2Thai(e.date),
|
date: date2Thai(e.date),
|
||||||
volumeNo: e.volumeNo,
|
volumeNo: e.volumeNo,
|
||||||
section: e.section,
|
section: e.section,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import genReport from "@/plugins/genreport";
|
import genReport from "@/plugins/genreport";
|
||||||
|
import genReportXLSX from "@/plugins/genreportxlsx";
|
||||||
|
|
||||||
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
|
import { useOrderPlacementDataStore } from "@/modules/10_order/store";
|
||||||
|
|
||||||
|
|
@ -127,11 +128,19 @@ const downloadCover = async (type: string) => {
|
||||||
|
|
||||||
// โหลด เอกสารแนบท้าย
|
// โหลด เอกสารแนบท้าย
|
||||||
const downloadAttachment = async (type: string) => {
|
const downloadAttachment = async (type: string) => {
|
||||||
genReport(
|
if (type === "xlsx") {
|
||||||
dataAttachment.value,
|
genReportXLSX(
|
||||||
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
|
dataAttachmentxlxs.value,
|
||||||
type
|
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
|
||||||
);
|
type
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
genReport(
|
||||||
|
dataAttachment.value,
|
||||||
|
`เอกสารแนบท้าย คำสั่ง ${orderName.value}`,
|
||||||
|
type
|
||||||
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const dataCover = ref<any>();
|
const dataCover = ref<any>();
|
||||||
|
|
@ -151,6 +160,7 @@ const fetchReportCover = async (type: string, orderId: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const dataAttachment = ref<any>();
|
const dataAttachment = ref<any>();
|
||||||
|
const dataAttachmentxlxs = ref<any>();
|
||||||
// เรียกไฟล์ เอกสารแนบท้าย
|
// เรียกไฟล์ เอกสารแนบท้าย
|
||||||
const fetchReportAttachment = async (type: string, orderId: string) => {
|
const fetchReportAttachment = async (type: string, orderId: string) => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -164,6 +174,17 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.reportOrderAttachment("xlsx", orderId, code.value))
|
||||||
|
.then(async (res) => {
|
||||||
|
dataAttachmentxlxs.value = res.data.result;
|
||||||
|
})
|
||||||
|
.catch(async (e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
function genPDf(data: any) {
|
function genPDf(data: any) {
|
||||||
|
|
@ -520,6 +541,9 @@ const viewFileUpload = async (url: string) => {
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="downloadAttachment('pdf')"
|
@click="downloadAttachment('pdf')"
|
||||||
>
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderAttachmentPdf"
|
||||||
|
target="_blank" -->
|
||||||
<q-item-section avatar
|
<q-item-section avatar
|
||||||
><q-icon color="red" name="mdi-file-pdf"
|
><q-icon color="red" name="mdi-file-pdf"
|
||||||
/></q-item-section>
|
/></q-item-section>
|
||||||
|
|
@ -528,10 +552,13 @@ const viewFileUpload = async (url: string) => {
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="downloadAttachment('docx')"
|
@click="downloadAttachment('xlsx')"
|
||||||
>
|
>
|
||||||
|
<!-- type="a"
|
||||||
|
:href="orderAttachmentXlsx"
|
||||||
|
target="_blank" -->
|
||||||
<q-item-section avatar
|
<q-item-section avatar
|
||||||
><q-icon color="blue" name="mdi-file-word"
|
><q-icon color="green-7" name="mdi-file-excel"
|
||||||
/></q-item-section>
|
/></q-item-section>
|
||||||
<q-item-section>ไฟล์ .xls</q-item-section>
|
<q-item-section>ไฟล์ .xls</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
|
||||||
|
|
@ -276,7 +276,7 @@ async function onChangeRound() {
|
||||||
|
|
||||||
/** function เปลี่ยนรอบ*/
|
/** function เปลี่ยนรอบ*/
|
||||||
async function onChangeSnap() {
|
async function onChangeSnap() {
|
||||||
agencyFilter.value = "";
|
// agencyFilter.value = "";
|
||||||
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
|
if (agencyFilter.value && roundFilter.value.id && snapFilter.value) {
|
||||||
await fetchSalalyPeriod(
|
await fetchSalalyPeriod(
|
||||||
agencyFilter.value,
|
agencyFilter.value,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue