|
|
@@ -100,6 +100,12 @@ const importBills = (function () {
|
|
|
if (!code && !name || /合计/.test(code)) { //过滤掉同时没有编号和名称的、过滤合计行
|
|
|
continue;
|
|
|
}
|
|
|
+ // “子目号”、“单位”、“数量”都为空,“子目名称”不为空时,应将此行清单名称合并到上一行
|
|
|
+ let lastData = rst[rst.length - 1];
|
|
|
+ if (!code && !unit && !quantity && name) {
|
|
|
+ lastData.name += name;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
//表格内的数据
|
|
|
code = String(code);
|
|
|
let depth = getDepth(code);
|
|
|
@@ -114,7 +120,6 @@ const importBills = (function () {
|
|
|
depth: depth,
|
|
|
unitPriceAnalysis: 1,
|
|
|
};
|
|
|
- let lastData = rst[rst.length - 1];
|
|
|
//获取data的父节点链,成为兄弟节点,只能在父链里找前兄弟(不能跨父链)
|
|
|
let parents = getParents(lastData);
|
|
|
let preData = findLast(parents, x => x.depth === depth);
|