exp2() {
let that = this;
const tHeader = ["卡名称", "卡号", "卡类型", "Id", "手机号", "用户姓名", "余额", "开卡时间"]; //表头
const filterVal = ["CardName", "CardNo", "CardType", "Id", "Phone", "RealName", "Balance", "UploadTime"]; //对应的值
const list = that.dc; //要导出的数据
tHeader.map((v) => { str += v + ',' })
str += '\n';
list.map((v) => {
filterVal.map((j) => {
if (j == "Balance") {
str += v[j] / 100 + '元'+ + '\t,';
} else if (j == "UploadTime") {
str += v[j].substring(0, 10) + '/' + v[j].substring(11, 18)+ + '\t,';
} else {
str += v[j]+ + '\t,';
}
})
str += '\n';
})
var blob = new Blob([str], {
type: "text/plain;charset=utf-8"
});
//解决中文乱码问题
blob = new Blob([String.fromCharCode(0xFEFF), blob], {
type: blob.type
});
var object_url = window.URL.createObjectURL(blob);
var link = document.createElement("a");
link.href = object_url;
link.download = "明细表.csv";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
},