fix PDF = undefined
This commit is contained in:
parent
4d4a95c2b9
commit
4f0eecfffe
15 changed files with 24 additions and 2 deletions
|
|
@ -70,6 +70,8 @@ async function getReportRecruit() {
|
||||||
* @param data ข้อมูลบัญชีวันลา
|
* @param data ข้อมูลบัญชีวันลา
|
||||||
*/
|
*/
|
||||||
async function genReport(data: any) {
|
async function genReport(data: any) {
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await axios
|
await axios
|
||||||
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ function fetchDataReport() {
|
||||||
}
|
}
|
||||||
isLoadPDF.value = true;
|
isLoadPDF.value = true;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
nodeId:
|
nodeId:
|
||||||
reportType.value.type === "probation" && reportType.value.id === "2"
|
reportType.value.type === "probation" && reportType.value.id === "2"
|
||||||
|
|
|
||||||
|
|
@ -142,6 +142,8 @@ function fetchDataReport() {
|
||||||
* @param data ข้อมูลบัญชีวันลา
|
* @param data ข้อมูลบัญชีวันลา
|
||||||
*/
|
*/
|
||||||
async function fetchDocumentTemplate(data: any) {
|
async function fetchDocumentTemplate(data: any) {
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await axios
|
await axios
|
||||||
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,8 @@ async function onUpdateFilter() {
|
||||||
* @param data ข้อมูลบัญชีวันลา
|
* @param data ข้อมูลบัญชีวันลา
|
||||||
*/
|
*/
|
||||||
async function fetchDocumentTemplate(data: any, type: string = "docx") {
|
async function fetchDocumentTemplate(data: any, type: string = "docx") {
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await axios
|
await axios
|
||||||
.post(`${config.API.reportTemplate}/${type}`, data, {
|
.post(`${config.API.reportTemplate}/${type}`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,7 @@ async function updateLeaveday() {
|
||||||
isReport.value = false;
|
isReport.value = false;
|
||||||
isLoadPDF.value = true;
|
isLoadPDF.value = true;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
|
|
||||||
//เรียกฟังก์ชัน fetchLeaveday
|
//เรียกฟังก์ชัน fetchLeaveday
|
||||||
fetchLeaveday(
|
fetchLeaveday(
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ async function updateFilterType(type: string) {
|
||||||
isReport.value = false;
|
isReport.value = false;
|
||||||
isLoadPDF.value = true;
|
isLoadPDF.value = true;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "DAY":
|
case "DAY":
|
||||||
body = {
|
body = {
|
||||||
|
|
|
||||||
|
|
@ -121,6 +121,7 @@ function onSelectedNode(id: string, level: number) {
|
||||||
async function onUpdateFilter() {
|
async function onUpdateFilter() {
|
||||||
isLoadPDF.value = true;
|
isLoadPDF.value = true;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
if (nodeId) {
|
if (nodeId) {
|
||||||
const body = {
|
const body = {
|
||||||
nodeId: nodeId.value,
|
nodeId: nodeId.value,
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,8 @@ function fetchReport() {
|
||||||
* @param data ข้อมูลบัญชีวันลา
|
* @param data ข้อมูลบัญชีวันลา
|
||||||
*/
|
*/
|
||||||
function genPDf(data: ResReport) {
|
function genPDf(data: ResReport) {
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
showLoader();
|
showLoader();
|
||||||
axios
|
axios
|
||||||
.post(config.API.reportTemplate + `/docx`, data, {
|
.post(config.API.reportTemplate + `/docx`, data, {
|
||||||
|
|
@ -429,7 +431,7 @@ function onCloseModal() {
|
||||||
* function fetch รายชื่อข้อมูลทะเบียนประวัติ
|
* function fetch รายชื่อข้อมูลทะเบียนประวัติ
|
||||||
*/
|
*/
|
||||||
function fetchListPerson() {
|
function fetchListPerson() {
|
||||||
rowsPerson.value = []
|
rowsPerson.value = [];
|
||||||
showLoader();
|
showLoader();
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
page: formFilter.page,
|
page: formFilter.page,
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,8 @@ async function fetchDataCommand(type: string) {
|
||||||
/** ฟังชั่นกำหนดค่าของ PDF*/
|
/** ฟังชั่นกำหนดค่าของ PDF*/
|
||||||
async function fetchPDF(data: any, type: string = "docx?folder=command") {
|
async function fetchPDF(data: any, type: string = "docx?folder=command") {
|
||||||
isLoadView.value = false;
|
isLoadView.value = false;
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
axios
|
axios
|
||||||
.get(data.downloadUrl, {
|
.get(data.downloadUrl, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
|
|
@ -155,6 +157,7 @@ watch(
|
||||||
} else {
|
} else {
|
||||||
tab.value = "main";
|
tab.value = "main";
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ async function fetchDataCommand(type: string) {
|
||||||
/** ฟังชั่นกำหนดค่าของ PDF*/
|
/** ฟังชั่นกำหนดค่าของ PDF*/
|
||||||
async function fetchPDF(data: any, type: string = "docx?folder=command") {
|
async function fetchPDF(data: any, type: string = "docx?folder=command") {
|
||||||
isLoadView.value = false;
|
isLoadView.value = false;
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await axios
|
await axios
|
||||||
.post(config.API.reportTemplate + `/${type}`, data, {
|
.post(config.API.reportTemplate + `/${type}`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,7 @@ async function fetchPDF(type: string = "docx") {
|
||||||
function onClose() {
|
function onClose() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(modal, () => {
|
watch(modal, () => {
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ watch(modal, (val) => {
|
||||||
fetchPDF(dataFile.value.downloadUrl, dataFile.value.fileType);
|
fetchPDF(dataFile.value.downloadUrl, dataFile.value.fileType);
|
||||||
} else {
|
} else {
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
numOfPages.value = 0;
|
numOfPages.value = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ async function getReport(list: string) {
|
||||||
)?.val;
|
)?.val;
|
||||||
const newReport = listFind === "report2" ? "report2-history" : listFind;
|
const newReport = listFind === "report2" ? "report2-history" : listFind;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
numOfPages.value = 1;
|
page.value = 1;
|
||||||
isLoadPDF.value = true;
|
isLoadPDF.value = true;
|
||||||
if (newReport) {
|
if (newReport) {
|
||||||
await http
|
await http
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ async function getReport() {
|
||||||
) {
|
) {
|
||||||
loadingBtn.value = true;
|
loadingBtn.value = true;
|
||||||
pdfSrc.value = undefined;
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await http
|
await http
|
||||||
.get(
|
.get(
|
||||||
config.API.developmentReport() +
|
config.API.developmentReport() +
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,8 @@ async function fetchReport() {
|
||||||
* @param data ข้อมูลบัญชีวันลา
|
* @param data ข้อมูลบัญชีวันลา
|
||||||
*/
|
*/
|
||||||
async function fetchDocumentTemplate(data: any) {
|
async function fetchDocumentTemplate(data: any) {
|
||||||
|
pdfSrc.value = undefined;
|
||||||
|
page.value = 1;
|
||||||
await axios
|
await axios
|
||||||
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
.post(`${config.API.reportTemplate}/xlsx`, data, {
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue