修改文件路径:src\views\customer\list\index.vue 第1038行的importExcelData导入方法修改成下面这个样子
importExcelData(arrRes) {
// 提取表头
const [thead, ...rows] = arrRes;
const data = [];
// 过滤掉全为空字符串的行,并转换为对象格式
rows.forEach((row) => {
const isAllEmpty = row.every((cell) => cell.trim() === '');
if (!isAllEmpty) {
const rowData = {};
row.forEach((cell, index) => {
rowData[thead[index]] = cell;
});
data.push(rowData);
}
});
// 调用导入 API 并更新表格数据
customerImport(this.types, data).then(() => {
this.getTableData('');
});
}
},