Browse Source

bug#1870智能填表时无法按字段对应到相应的列

feture-12345
mk 6 months ago
parent
commit
67aabe1ef7
  1. 27
      src/views/modules/base/smartExcel/cpts/excel-upload-data.vue

27
src/views/modules/base/smartExcel/cpts/excel-upload-data.vue

@ -236,11 +236,28 @@ export default {
} }
}, },
async checkExtractExcelHead() { async checkExtractExcelHead() {
const columnMateStr = this.currentTable[0].data[0] let columnMateStr = '';
.filter(item => item && item.v != null) let foundFirstValue = false; //
.map(item => item.v) for (let item of this.currentTable[0].data[0]) {
.join(';'); if (!foundFirstValue) {
//
if (!item || item.v === '') {
columnMateStr += '空;'; // ""
} else {
columnMateStr += item.v + ';'; //
foundFirstValue = true; //
}
} else {
//
if (!item || item.v === '') {
break; //
} else {
columnMateStr += item.v + ';'; //
}
}
}
//
columnMateStr = columnMateStr.slice(0, -1);
const url = "/actual/base/intelligentImportData/extractImportHead"; const url = "/actual/base/intelligentImportData/extractImportHead";
let params = { let params = {
importCategory: this.formData1.importCategory, importCategory: this.formData1.importCategory,

Loading…
Cancel
Save