excel name missing issue fix
This commit is contained in:
parent
babbc9d132
commit
1c307c6f60
Binary file not shown.
@ -250,9 +250,22 @@ if(order.length>0){
|
|||||||
}
|
}
|
||||||
download(){
|
download(){
|
||||||
var element = document.getElementById('table');
|
var element = document.getElementById('table');
|
||||||
|
|
||||||
|
// Create a new date object using the selectDate value
|
||||||
|
const selectedDate = new Date(this.selectDate[0]);
|
||||||
|
|
||||||
|
// Get the year, month, and day components
|
||||||
|
const year = selectedDate.getFullYear();
|
||||||
|
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
|
||||||
|
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
|
||||||
|
|
||||||
|
// Format the components as "yyyy-mm-dd"
|
||||||
|
const formattedDate = `${day}-${month}-${year}`;
|
||||||
|
console.log(formattedDate);
|
||||||
|
|
||||||
var opt = {
|
var opt = {
|
||||||
margin: 1,
|
margin: 1,
|
||||||
filename: 'sheet.pdf',
|
filename: 'Delivery_Sheet_'+formattedDate+'_'+this.driverName,
|
||||||
image: { type: 'jpg', quality: 0.98 },
|
image: { type: 'jpg', quality: 0.98 },
|
||||||
html2canvas: { scale: 2 },
|
html2canvas: { scale: 2 },
|
||||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||||
|
|||||||
@ -308,14 +308,26 @@ if(order.length>0){
|
|||||||
|
|
||||||
}
|
}
|
||||||
download(){
|
download(){
|
||||||
|
console.log(this.driverName,this.selectDate[0])
|
||||||
|
// Create a new date object using the selectDate value
|
||||||
|
const selectedDate = new Date(this.selectDate[0]);
|
||||||
|
|
||||||
|
// Get the year, month, and day components
|
||||||
|
const year = selectedDate.getFullYear();
|
||||||
|
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
|
||||||
|
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
|
||||||
|
|
||||||
|
// Format the components as "yyyy-mm-dd"
|
||||||
|
const formattedDate = `${day}-${month}-${year}`;
|
||||||
|
console.log(formattedDate);
|
||||||
var element = document.getElementById('table');
|
var element = document.getElementById('table');
|
||||||
var opt = {
|
var opt = {
|
||||||
margin: 1,
|
margin: 1,
|
||||||
filename: 'sheet.pdf',
|
filename: 'Return_Sheet_'+formattedDate+'_'+this.driverName,
|
||||||
image: { type: 'jpg', quality: 0.98 },
|
image: { type: 'jpg', quality: 0.98 },
|
||||||
html2canvas: { scale: 2 },
|
html2canvas: { scale: 2 },
|
||||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||||
};
|
};
|
||||||
|
|
||||||
// New Promise-based usage:
|
// New Promise-based usage:
|
||||||
html2pdf().from(element).set(opt).save();
|
html2pdf().from(element).set(opt).save();
|
||||||
|
|||||||
@ -282,14 +282,26 @@ console.log(result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
download(){
|
download(){
|
||||||
var element = document.getElementById('table');
|
console.log(this.driverName,this.selectDate[0])
|
||||||
var opt = {
|
// Create a new date object using the selectDate value
|
||||||
margin: 1,
|
const selectedDate = new Date(this.selectDate[0]);
|
||||||
filename: 'sheet.pdf',
|
|
||||||
image: { type: 'jpg', quality: 0.98 },
|
// Get the year, month, and day components
|
||||||
html2canvas: { scale: 2 },
|
const year = selectedDate.getFullYear();
|
||||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
const month = String(selectedDate.getMonth() + 1).padStart(2, '0'); // Add leading zero if needed
|
||||||
};
|
const day = String(selectedDate.getDate()).padStart(2, '0'); // Add leading zero if needed
|
||||||
|
|
||||||
|
// Format the components as "yyyy-mm-dd"
|
||||||
|
const formattedDate = `${day}-${month}-${year}`;
|
||||||
|
console.log(formattedDate);
|
||||||
|
var element = document.getElementById('table');
|
||||||
|
var opt = {
|
||||||
|
margin: 1,
|
||||||
|
filename: 'Delivery_Summary_'+formattedDate+'_'+this.driverName,
|
||||||
|
image: { type: 'jpg', quality: 0.98 },
|
||||||
|
html2canvas: { scale: 2 },
|
||||||
|
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||||
|
};
|
||||||
|
|
||||||
// New Promise-based usage:
|
// New Promise-based usage:
|
||||||
html2pdf().from(element).set(opt).save();
|
html2pdf().from(element).set(opt).save();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user