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(){
|
||||
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 = {
|
||||
margin: 1,
|
||||
filename: 'sheet.pdf',
|
||||
filename: 'Delivery_Sheet_'+formattedDate+'_'+this.driverName,
|
||||
image: { type: 'jpg', quality: 0.98 },
|
||||
html2canvas: { scale: 2 },
|
||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||
|
||||
@ -308,14 +308,26 @@ if(order.length>0){
|
||||
|
||||
}
|
||||
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 opt = {
|
||||
var opt = {
|
||||
margin: 1,
|
||||
filename: 'sheet.pdf',
|
||||
filename: 'Return_Sheet_'+formattedDate+'_'+this.driverName,
|
||||
image: { type: 'jpg', quality: 0.98 },
|
||||
html2canvas: { scale: 2 },
|
||||
jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }
|
||||
};
|
||||
};
|
||||
|
||||
// New Promise-based usage:
|
||||
html2pdf().from(element).set(opt).save();
|
||||
|
||||
@ -282,14 +282,26 @@ console.log(result)
|
||||
}
|
||||
|
||||
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 opt = {
|
||||
var opt = {
|
||||
margin: 1,
|
||||
filename: 'sheet.pdf',
|
||||
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:
|
||||
html2pdf().from(element).set(opt).save();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user