html:
导出
js:
function to2(num) {
return num > 9 ? num : '0' + num;
}
a.download = '进货信息导出' + now.getFullYear() + to2((now.getMonth() + 1)) + to2(now.getDate()) + to2(now.getHours()) + to2(now.getMinutes()) + to2(now.getSeconds()) + '.csv';
a.href = csvUrl;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}
return num > 9 ? num : '0' + num;
}
a.download = '进货信息导出' + now.getFullYear() + to2((now.getMonth() + 1)) + to2(now.getDate()) + to2(now.getHours()) + to2(now.getMinutes()) + to2(now.getSeconds()) + '.csv';
a.href = csvUrl;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
}