|
|
@@ -62,7 +62,8 @@ const importBills = (function () {
|
|
|
//分析文件,1、工程量清单 2、清单示例表
|
|
|
function getFileType(sheetData) {
|
|
|
let dataTable = sheetData.data.dataTable,
|
|
|
- rowCount = sheetData.rowCount;
|
|
|
+ // rowCount = sheetData.rowCount;
|
|
|
+ rowCount = sheetData.rows.length;
|
|
|
for (let row = 0; row < rowCount; row++) {
|
|
|
if (isGCLHead(dataTable[row], dataTable[row + 1])) {
|
|
|
return fileType.gcl;
|
|
|
@@ -77,7 +78,8 @@ const importBills = (function () {
|
|
|
//层级由depth确定,表格里最顶层depth为0(表头里一清单),表格内容里数据的depth为空格数+1
|
|
|
function extractGCLDatas(sheetData, colMapping) {
|
|
|
let dataTable = sheetData.data.dataTable,
|
|
|
- rowCount = sheetData.rowCount;
|
|
|
+ // rowCount = sheetData.rowCount;
|
|
|
+ rowCount = sheetData.rows.length;
|
|
|
let rst = [];
|
|
|
for (let row = 0; row < rowCount; row++) {
|
|
|
//表格中顶层节点
|
|
|
@@ -219,7 +221,7 @@ const importBills = (function () {
|
|
|
rowCount: 0,
|
|
|
};
|
|
|
const dataTable = sheetData.data.dataTable;
|
|
|
- const rowCount = sheetData.rowCount;
|
|
|
+ const rowCount = sheetData.rows.length;
|
|
|
let preRootName;
|
|
|
for (let row = 0; row < rowCount; row++) {
|
|
|
const rowData = dataTable[row];
|
|
|
@@ -256,7 +258,7 @@ const importBills = (function () {
|
|
|
//提取清单示例数据
|
|
|
function extractSLDatas(sheetData) {
|
|
|
let dataTable = sheetData.data.dataTable,
|
|
|
- rowCount = sheetData.rowCount;
|
|
|
+ rowCount = sheetData.rows.length;
|
|
|
let rst = [];
|
|
|
let curRoot = null;
|
|
|
for (let row = 0; row < rowCount; row++) {
|
|
|
@@ -338,7 +340,7 @@ const importBills = (function () {
|
|
|
let curSheetType = null;
|
|
|
for (let sheetName in sheets) {
|
|
|
let sheetData = sheets[sheetName];
|
|
|
- if (!sheetData.data.dataTable) {
|
|
|
+ if (!sheetData.data.dataTable || sheetData.index !== 0) {
|
|
|
continue;
|
|
|
}
|
|
|
let sheetType = getFileType(sheetData);
|